mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
feat: website (#45)
This commit is contained in:
@@ -26,10 +26,10 @@ type GlobWithParserOptions = Parameters<typeof glob>[0] & {
|
||||
* ```ts
|
||||
* loader: globWithParser({
|
||||
* base: './src/content/blog',
|
||||
* pattern: '**\/*.md',
|
||||
* pattern: '**\/*.mdx',
|
||||
* generateId: ({ entry }) => entry.replace(/^\d{4}-\d{2}-\d{2}-/, ''),
|
||||
* parser: async (entry, originalEntry) => {
|
||||
* // entry.id = "my-post", originalEntry = "2024-01-01-my-post.md"
|
||||
* // entry.id = "my-post", originalEntry = "2024-01-01-my-post.mdx"
|
||||
* const date = extractDateFromFilename(originalEntry);
|
||||
* entry.data.pubDate = date;
|
||||
* return entry;
|
||||
|
||||
Reference in New Issue
Block a user