Major rewrite for 0.1.6 - Dynamic database entry generation based on json files, dynamic run page generation and more
This commit is contained in:
parent
e75a575417
commit
7fe9e8c25f
28 changed files with 2954 additions and 45 deletions
src/pages/database
23
src/pages/database/[slug].astro
Normal file
23
src/pages/database/[slug].astro
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
import TaShowcaseLayout from '../../layouts/taShowcaseLayout.astro'
|
||||
import {findSlug} from '../../utils/slugTools'
|
||||
|
||||
export function getStaticPaths() {
|
||||
const fulldata = import.meta.glob<{ default: any }>(
|
||||
`../../content/data/*.json`
|
||||
)
|
||||
const keylist = Object.keys(fulldata).map(
|
||||
(item) => findSlug(item)
|
||||
)
|
||||
|
||||
const paths: { params: { slug: string } }[] = []
|
||||
for (const key of keylist) {
|
||||
paths.push({ params: { slug: key! } })
|
||||
}
|
||||
return paths
|
||||
}
|
||||
|
||||
const { slug } = Astro.params
|
||||
---
|
||||
|
||||
<TaShowcaseLayout datafile={slug} />
|
Loading…
Add table
Add a link
Reference in a new issue