Skip to content

Commit 337580f

Browse files
committed
feat(remark-git-dates): integrate plugin and remove old implementation
remark-git-datesプラグインをastro.config.mjsに登録し、ビルドプロセスに 統合した。これにより、ブログ記事のpubDate(作成日)とupdatedDate(更新日) がGitの履歴から自動的に設定される。 同時に、機能が重複する旧プラグイン(remark-astro-last-modified-at)を 削除し、コードベースを整理した。 remark-git-datesは以下の機能を提供: - frontmatterにpubDateがない場合 → Git最初のコミット日を設定 - frontmatterにupdatedDateがない場合 → Git最後のコミット日を設定 - 既存の手動設定は上書きしない
1 parent ab94123 commit 337580f

2 files changed

Lines changed: 2 additions & 26 deletions

File tree

astro.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import rehypeLineNumbers from "./tools/rehype-line-numbers";
88
import rehypeCodeCopyButton from "./tools/rehype-code-copy-button";
99
import rehypeToc from "./tools/rehype-toc";
1010
import remarkAside from "./tools/remark-aside";
11+
import remarkGitDates from "./tools/remark-git-dates";
1112

1213
import compressor from "astro-compressor";
1314

@@ -47,7 +48,7 @@ export default defineConfig({
4748
footnoteLabelTagName: "hr",
4849
footnoteLabel: " ",
4950
},
50-
remarkPlugins: [remarkAside, codeBlockPlugin, remarkBreaks],
51+
remarkPlugins: [remarkAside, codeBlockPlugin, remarkBreaks, remarkGitDates],
5152
rehypePlugins: [
5253
rehypeLineNumbers,
5354
rehypeHeadingSpan,

tools/remark-astro-last-modified-at/index.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)