-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b277613
commit dca2007
Showing
13 changed files
with
95 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,41 @@ | ||
import type { MetaTagsProps } from "svelte-meta-tags"; | ||
import type { LayoutLoad } from "./$types"; | ||
import { INFO } from "$lib/assets/info.js"; | ||
|
||
export const load: LayoutLoad = ({ url }) => { | ||
const image = new URL("/images/ogp.png", INFO.url).href; | ||
|
||
const baseMetaTags = Object.freeze({ | ||
title: INFO.about.title, | ||
description: INFO.about.description, | ||
canonical: new URL(url.pathname, url.origin).href, | ||
openGraph: { | ||
type: "website", | ||
url: new URL(url.pathname, url.origin).href, | ||
locale: "ja_JP", | ||
title: INFO.about.title, | ||
description: INFO.about.description, | ||
siteName: INFO.about.title, | ||
images: [ | ||
{ | ||
url: image, | ||
width: 1200, | ||
height: 630, | ||
}, | ||
], | ||
}, | ||
twitter: { | ||
cardType: "summary_large_image", | ||
title: INFO.about.title, | ||
description: INFO.about.description, | ||
image: image, | ||
}, | ||
} as const satisfies MetaTagsProps); | ||
|
||
return { | ||
baseMetaTags, | ||
}; | ||
}; | ||
|
||
export const prerender = true; | ||
export const trailingSlash = "always"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { MetaTagsProps } from "svelte-meta-tags"; | ||
import type { PageServerLoad } from "./$types"; | ||
|
||
export const load: PageServerLoad = async () => { | ||
const pageMetaTags = Object.freeze({ | ||
title: "About", | ||
} as const satisfies MetaTagsProps); | ||
|
||
return { | ||
pageMetaTags, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import type { MetaTagsProps } from "svelte-meta-tags"; | ||
import type { PageServerLoad } from "./$types"; | ||
import { getContentList } from "$lib/utils/services/microcms"; | ||
|
||
export const load: PageServerLoad = async () => { | ||
const res = await getContentList("blogs"); | ||
|
||
const pageMetaTags = Object.freeze({ | ||
title: "Blogs", | ||
} as const satisfies MetaTagsProps); | ||
|
||
return { | ||
blogList: res, | ||
pageMetaTags, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,36 @@ | ||
import type { MetaTagsProps } from "svelte-meta-tags"; | ||
import type { PageServerLoad } from "./$types"; | ||
import { INFO } from "$lib/assets/info"; | ||
import { getContentDetail } from "$lib/utils/services/microcms"; | ||
|
||
export const load: PageServerLoad = async ({ params }) => { | ||
const { slug } = params; | ||
const res = await getContentDetail("blogs", slug); | ||
|
||
const title = `${res.title} | Blogs | ${INFO.about.title}`; | ||
const description = res.description ?? INFO.about.description; | ||
const image = res.ogpImg?.url ?? new URL("/images/ogp.png", INFO.url).href; | ||
const pageMetaTags = Object.freeze({ | ||
title, | ||
openGraph: { | ||
title, | ||
description, | ||
images: [ | ||
{ | ||
url: image, | ||
}, | ||
], | ||
}, | ||
twitter: { | ||
cardType: "summary_large_image", | ||
title, | ||
description, | ||
image, | ||
}, | ||
} as const satisfies MetaTagsProps); | ||
|
||
return { | ||
detail: res, | ||
pageMetaTags, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,8 @@ | ||
<script lang="ts"> | ||
import type { PageData } from "./$types"; | ||
import BlogDetails from "$lib/components/BlogDetails.svelte"; | ||
import HeadTags from "$lib/components/HeadTags.svelte"; | ||
export let data: PageData; | ||
</script> | ||
|
||
<HeadTags | ||
title={data.detail.title} | ||
description={data.detail.description} | ||
ogpImgUrl={data.detail.ogpImg?.url} | ||
/> | ||
|
||
<BlogDetails details={data.detail} /> |