on master help sign in
pages/slug: fallback when extra exists without index field
452e531Matilde Park
content/coinmarketcap.md+1−1
@@ -1,8 +1,8 @@
1+++
1+++
2title = "CoinMarketCap"
2title = "CoinMarketCap"
3−template = "page_indiced.html"
4[extra]
3[extra]
5hidetitle = "true"
4hidetitle = "true"
5+index = "true"
6+++
6+++
7
7
8The ticket number for CoinMarketCap verification is 429809.
8The ticket number for CoinMarketCap verification is 429809.
pages/[slug].js+5−1
@@ -16,7 +16,11 @@ export async function getStaticProps({ params }) {
16 "/"
16 "/"
17 );
17 );
18
18
19− const { index } = post?.extra || { index: null };
19+ let { index } = post?.extra || { index: null };
20+
21+ if (index === undefined) {
22+ index = null;
23+ }
20
24
21 const markdown = JSON.stringify(MarkdownParse({ post }));
25 const markdown = JSON.stringify(MarkdownParse({ post }));
22 return {
26 return {