File tree Expand file tree Collapse file tree 3 files changed +13
-24
lines changed
Expand file tree Collapse file tree 3 files changed +13
-24
lines changed Original file line number Diff line number Diff line change 11---
22layout : default
33title : Paperless NHS
4+ slug : paperless.html
45---
56
67The NHS has committed to replacing paper medical records with digital records several times, but this has not happened.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,11 +6,18 @@ const posts = defineCollection({
66 base : 'posts' ,
77 pattern : '**/*.md' ,
88 generateId : ( { entry, data} ) => {
9- const id = entry . slice ( 11 , - 3 )
10- const pubDate = data . pubDate ?? entry . slice ( 0 , 10 )
11- // Note: mutating the data obj. serves them right for passing it in unfrozen.
12- data . pubDate = pubDate
13- return id
9+ // Note: jekyll pulls the pubDate and the slug from filename,
10+ // so we recreate that here by adding the pubDate where unset
11+ if ( ! data . pubDate ) {
12+ // first 10 chars should be a hyphenated ISO8601 date.
13+ data . pubDate = entry . slice ( 0 , 10 )
14+ }
15+ if ( data . slug && typeof data . slug === 'string' ) {
16+ // use the `slug` prop from the frontmatter if specified.
17+ return data . slug
18+ }
19+ // chars after the iso date are teh slug, minus the `.md` suffix
20+ return entry . slice ( 11 , - 3 )
1421 }
1522 } ) ,
1623 schema : z . object ( {
You can’t perform that action at this time.
0 commit comments