Updated
This commit is contained in:
parent
6fb5145b16
commit
bb58c17286
24 changed files with 129 additions and 57 deletions
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
import Layout from '../../layouts/Layout.astro'
|
||||
import Article from '../../components/Article.astro'
|
||||
// import Article from '../../components/Article.astro'
|
||||
|
||||
import { Picture } from 'astro:assets'
|
||||
|
||||
|
|
@ -8,39 +8,40 @@ import * as fiveTech from '../../content/articles/5-tech-icons.md'
|
|||
import * as letsMake from '../../content/articles/lets-make-this.md'
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const articles = await Astro.glob('../../content/articles/*.md')
|
||||
const paths = articles.map((article: any) => ({ params: { story: article.frontmatter.slug } }))
|
||||
return paths
|
||||
// const articles: any = await Astro.glob('../../content/articles/*.md')
|
||||
// const paths = articles.map((article: any) => ({ params: { story: article.frontmatter.slug } }))
|
||||
// return paths
|
||||
return [{ params: { article: '5-tech-icons' } }, { params: { article: 'lets-make-this' } }]
|
||||
}
|
||||
const { story } = Astro.params
|
||||
const { article } = Astro.params
|
||||
|
||||
let title = ''
|
||||
let content = ''
|
||||
|
||||
if (story === fiveTech.frontmatter.slug) {
|
||||
if (article === fiveTech.frontmatter.slug) {
|
||||
title = fiveTech.frontmatter.title
|
||||
content = await fiveTech.compiledContent()
|
||||
} else if (story === letsMake.frontmatter.slug) {
|
||||
} else if (article === letsMake.frontmatter.slug) {
|
||||
title = letsMake.frontmatter.title
|
||||
content = await letsMake.compiledContent()
|
||||
}
|
||||
---
|
||||
|
||||
<Layout title="Read" description="Story Page - <story>">
|
||||
<Layout title={title}>
|
||||
<main class="page">
|
||||
<section class="toolbar">
|
||||
<!-- <section class="toolbar">
|
||||
<a href="/" style="text-decoration: none; color: inherit;" aria-label="Go to index page">
|
||||
<div class="toolbar--title" style="text-decoration: none; color: inherit;">Snuffverse</div>
|
||||
</a>
|
||||
</section>
|
||||
</section> -->
|
||||
|
||||
<Article title={title} />
|
||||
<p set:html={content} />
|
||||
<!-- <Article title={title} /> -->
|
||||
<!-- <p set:html={content} /> -->
|
||||
</main>
|
||||
|
||||
<style lang="sass">
|
||||
@media only screen and (max-width: 767px)
|
||||
.title
|
||||
font-size: 3rem
|
||||
</style>
|
||||
</Layout>
|
||||
|
||||
<style lang="sass">
|
||||
@media only screen and (max-width: 767px)
|
||||
.title
|
||||
font-size: 3rem
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue