-
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
Showing
15 changed files
with
75 additions
and
90 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 was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { brand } from "@/common/texts"; | ||
import { markdownNames } from "@/docs"; | ||
import { MetadataRoute } from "next"; | ||
export default function sitemap(): MetadataRoute.Sitemap { | ||
return markdownNames.map((markdownName) => ({ | ||
url: `${brand.origin}/${markdownName}`, | ||
changeFrequency: "daily", | ||
priority: 0.7, | ||
})); | ||
} |
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,42 @@ | ||
import { brand } from "@/common/texts"; | ||
import { markdownNames } from "@/docs"; | ||
import { getStories } from "@/server/services/story"; | ||
import { MetadataRoute } from "next"; | ||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> { | ||
const stories = await getStories({ | ||
count: 300, | ||
}); | ||
return [ | ||
{ | ||
url: `${brand.origin}/`, | ||
changeFrequency: "daily", | ||
priority: 0.7, | ||
}, | ||
{ | ||
url: `${brand.origin}/stories`, | ||
changeFrequency: "daily", | ||
priority: 0.7, | ||
}, | ||
{ | ||
url: `${brand.origin}/stories/rank`, | ||
changeFrequency: "daily", | ||
priority: 0.7, | ||
}, | ||
...markdownNames.map( | ||
(markdownName) => | ||
({ | ||
url: `${brand.origin}/${markdownName}`, | ||
changeFrequency: "daily", | ||
priority: 0.7, | ||
}) as const, | ||
), | ||
...stories.map( | ||
(story) => | ||
({ | ||
url: `${brand.origin}/stories/${story.id}`, | ||
changeFrequency: "daily", | ||
priority: 0.7, | ||
}) as const, | ||
), | ||
]; | ||
} |
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
File renamed without changes.
File renamed without changes.
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,20 @@ | ||
import { resolve } from "path"; | ||
import { readFile } from "fs/promises"; | ||
|
||
export const markdownNames = [ | ||
"privacy", | ||
"terms", | ||
"about", | ||
"howToWriteStory", | ||
"situationPuzzle", | ||
"sponsor", | ||
] as const; | ||
|
||
export const readMarkdownDoc = ( | ||
markdownName: (typeof markdownNames)[number], | ||
) => { | ||
return readFile( | ||
resolve(process.cwd(), "src", "docs", `${markdownName}.md`), | ||
"utf-8", | ||
); | ||
}; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.