Skip to content

Commit

Permalink
support no home md entry
Browse files Browse the repository at this point in the history
  • Loading branch information
wassfila committed May 4, 2024
1 parent d2ed26b commit 4bbbe2b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import {getEntry} from 'content-structure'
console.log(`index> home page`)
const entry = await getEntry({path:"home/readme.md"})
const not_empty = !(Object.keys(entry.tree).length == 0)
const headings = (Object.hasOwn(entry.data,"toc")&&entry.data.toc == false)?[]:entry.data.headings
---
<Layout title={entry.title} headings={headings} >
<AstroMarkdown node={entry.tree} data={entry.data} />
{not_empty&&
<AstroMarkdown node={entry.tree} data={entry.data} />
}
</Layout>

0 comments on commit 4bbbe2b

Please sign in to comment.