on master help sign in
pages/slug: fallback when extra exists without index field
commit452e5314ec56593e596be252eed48de5c4f8c99d authorMatilde Park <matilde.park@urbit.org> dateMon 13 Jun 2022, 14:31 (4 years ago) parent7f3643c
2 files changed+6−2
content/coinmarketcap.md+1−1 pages/[slug].js+5−1
content/coinmarketcap.md+1−1
@@ -1,8 +1,8 @@
11+++
22title = "CoinMarketCap"
3−template = "page_indiced.html"
43[extra]
54hidetitle = "true"
5+index = "true"
66+++
77
88The ticket number for CoinMarketCap verification is 429809.
pages/[slug].js+5−1
@@ -16,7 +16,11 @@ export async function getStaticProps({ params }) {
1616 "/"
1717 );
1818
19− const { index } = post?.extra || { index: null };
19+ let { index } = post?.extra || { index: null };
20+
21+ if (index === undefined) {
22+ index = null;
23+ }
2024
2125 const markdown = JSON.stringify(MarkdownParse({ post }));
2226 return {