refactor: renamed "pageName" to "pageTags"

dev
Antonio De Lucreziis 4 months ago
parent 1509984afb
commit 27317b38b1

@ -7,10 +7,18 @@ import '@fontsource/source-code-pro/latin.css'
import '@fontsource/space-mono/latin.css'
import '@fontsource/iosevka/latin.css'
import '../styles/main.scss'
const { title, description, thumbnail, pageName } = Astro.props
type Props = {
title: string
description: string
thumbnail: string
/** Tags for the page, used for styling */
pageTags: string | string[]
}
const { title, description, thumbnail, pageTags } = Astro.props
---
<!doctype html>
@ -47,7 +55,7 @@ const { title, description, thumbnail, pageName } = Astro.props
<title>{title}</title>
</head>
<body class:list={Array.isArray(pageName) ? pageName : [pageName]}>
<body class:list={typeof pageTags === 'string' ? [pageTags] : pageTags}>
<slot />
</body>
</html>

@ -4,7 +4,7 @@ import PageLayout from '@layouts/PageLayout.astro'
import { AppuntiList, AppuntiCard } from '@client/Appunti'
---
<PageLayout pageName="appunti">
<PageLayout pageTags="appunti">
<h1>Appunti & Dispense</h1>
<div class="search">

@ -18,7 +18,7 @@ const { entry } = Astro.props
const { Content } = await entry.render()
---
<ArticleLayout {...entry.data} pageName={['guida', entry.data.id, entry.data.series && 'series']}>
<ArticleLayout {...entry.data} pageTags={['guida', entry.data.id, entry.data.series && 'series']}>
<h1>{entry.data.title}</h1>
{entry.data.series && <div class="series">Serie: {entry.data.series}</div>}
<Content />

@ -6,7 +6,7 @@ import PageLayout from '@layouts/PageLayout.astro'
const guides = await getCollection('guides')
---
<PageLayout pageName="guide">
<PageLayout pageTags="guide">
<h1>Guide</h1>
<div class="card-list">
{

@ -33,7 +33,7 @@ interface Props {
const { tag, guides } = Astro.props
---
<PageLayout pageName="guide tag">
<PageLayout pageTags="guide tag">
<h1>Guide > #{tag}</h1>
<div class="card-list">
{

@ -12,7 +12,7 @@ const news = await getCollection('news')
import { Content as WhatPhcContent, frontmatter as whatsPhcFrontmatter } from '../content/meta/whats-phc.md'
---
<PageLayout pageName="homepage">
<PageLayout pageTags="homepage">
<section class="principal">
<div class="circuit-layer">
<canvas id="circuits-art"></canvas>

@ -2,7 +2,7 @@
import PageLayout from '../layouts/PageLayout.astro'
---
<PageLayout pageName="login">
<PageLayout pageTags="login">
<h1>Login</h1>
<!-- form with username and password, and a button for oauth login -->

@ -11,7 +11,7 @@ import { Content, getHeadings } from '../../content/meta/design.mdx'
const headings = getHeadings()
---
<BaseLayout {...Astro.props} pageName="design">
<BaseLayout {...Astro.props} pageTags="design">
<Header />
<aside>
<nav>

@ -15,6 +15,6 @@ const { entry } = Astro.props
const { Content } = await entry.render()
---
<ArticleLayout {...entry.data} pageName={['notizia']}>
<ArticleLayout {...entry.data} pageTags={['notizia']}>
<Content />
</ArticleLayout>

@ -6,7 +6,7 @@ import PageLayout from '@layouts/PageLayout.astro'
const news = await getCollection('news')
---
<PageLayout pageName="notizie">
<PageLayout pageTags="notizie">
<h1>Notizie</h1>
<div class="card-list">
{

@ -5,7 +5,7 @@ import Header from '../components/Header.astro'
import Footer from '../components/Footer.astro'
---
<BaseLayout {...Astro.props} pageName={'storia'}>
<BaseLayout {...Astro.props} pageTags={'storia'}>
<Header />
<main>
<h1>Storia</h1>

@ -2,7 +2,7 @@
import PageLayout from '../layouts/PageLayout.astro'
---
<PageLayout pageName="utenti">
<PageLayout pageTags="utenti">
<h1>Utenti</h1>
<div class="search">

Loading…
Cancel
Save