fix: ensure that the slug is a string
Ensure that the last part of the permalink is used as the slug.
This commit is contained in:
parent
991c333c8a
commit
4161ecbe7c
|
@ -11,13 +11,13 @@ export async function getStaticPaths() {
|
|||
const slug = email.frontmatter.permalink
|
||||
.replace('archive/', '')
|
||||
.replace('\n', '')
|
||||
.split('/')[3] as string
|
||||
const slugParts = slug.split('/')
|
||||
|
||||
return {
|
||||
params: {
|
||||
day: pubDate[2],
|
||||
month: pubDate[1],
|
||||
slug,
|
||||
slug: slugParts.reverse()[0],
|
||||
year: pubDate[0],
|
||||
},
|
||||
props: {
|
||||
|
|
Loading…
Reference in a new issue