Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"prettier-plugin-svelte": "^3.5.1",
"svelte-preprocess": "^6.0.3",
"typescript-eslint": "^8.57.2",
"wrangler": "^4.78.0"
"wrangler": "^4.79.0"
},
"packageManager": "pnpm@10.32.1",
"devEngines": {
Expand Down
95 changes: 55 additions & 40 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion scripts/collect-licenses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const ALLOWED_LICENSES: string[] = [
"ISC",
"LGPL-3.0-or-later",
"MIT",
"MIT OR Apache-2.0",
"MIT OR CC0-1.0",
"OFL-1.1",
"Python-2.0",
Expand All @@ -39,7 +40,17 @@ for (const dependency of dependencies) {
);
process.exit(1);
}
const { licenseText } = await getLicenseText(dependency);

let licenseText: string | undefined;
try {
const result = await getLicenseText(dependency);
licenseText = result.licenseText;
} catch {
console.warn(
`License text not found for ${dependency.name}@${dependency.version}. Skipping license text.`,
);
}

if (dependency.homepage && !isSafeHomepageURL(dependency.homepage)) {
console.error(
`Unsafe homepage URL found: "${dependency.homepage}" (${dependency.name}@${dependency.version})`,
Expand Down
7 changes: 6 additions & 1 deletion src/components/works/WorkModal.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import type { Work } from '../../types';
import { getWorkSlug } from '../../utils';
import WorkAsset from './WorkAsset.svelte';

interface Props {
Expand Down Expand Up @@ -45,8 +46,12 @@
}

async function handleCopyLink() {
if (!work) return;

const origin = window.location.origin;
try {
await navigator.clipboard.writeText(window.location.href);
const slug = getWorkSlug(work);
await navigator.clipboard.writeText(`${origin}/works/${slug}`);
} catch {
return;
}
Expand Down
27 changes: 18 additions & 9 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ import "@fontsource/special-gothic-expanded-one";

interface Props {
title: string;
meta?: {
title?: string;
description?: string;
thumbnail?: string;
canonicalUrl?: string;
};
}

const { title } = Astro.props;
const { title, meta } = Astro.props;

const absThumbnailPath = WEBSITE_URL + studioHeaderImage.src;
const absThumbnailPath = meta?.thumbnail ?? WEBSITE_URL + studioHeaderImage.src;
const fullTitle = `${WEBSITE_TITLE} | ${title}`;
const DESCRIPTION = "あらゆるクリエイティブをワンストップで。";
const canonicalUrl = WEBSITE_URL + Astro.url.pathname;
const canonicalUrl = meta?.canonicalUrl ?? WEBSITE_URL + Astro.url.pathname;
---

<!--
Expand Down Expand Up @@ -73,21 +79,24 @@ Web 開発だけでなく、Discord ボットやソフトウェア開発など
/>
<meta name="copyright" content={COPYRIGHT} />

<slot name="head" />

<title>{fullTitle}</title>
<meta name="title" content={fullTitle} />
<meta name="description" content={DESCRIPTION} />
<meta name="title" content={meta?.title ?? fullTitle} />
<meta name="description" content={meta?.description ?? DESCRIPTION} />

<meta property="og:title" content={title} />
<meta property="og:description" content={DESCRIPTION} />
<meta property="og:title" content={meta?.title ?? fullTitle} />
<meta
property="og:description"
content={meta?.description ?? DESCRIPTION}
/>
Comment thread
tutinoko2048 marked this conversation as resolved.
<meta property="og:url" content={canonicalUrl} />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary_large_image" />
<meta property="og:image" content={absThumbnailPath} />

<link rel="canonical" href={canonicalUrl} />

<slot name="head" />

<ClientRouter />
</head>

Expand Down
Loading
Loading