126 lines
3.6 KiB
Plaintext
126 lines
3.6 KiB
Plaintext
---
|
|
import '@fontsource/open-sans/400-italic.css';
|
|
import '@fontsource/open-sans/400.css';
|
|
import '@fontsource/open-sans/700-italic.css';
|
|
import '@fontsource/open-sans/700.css';
|
|
import '@fontsource/quicksand/400.css';
|
|
import '@fontsource/quicksand/700.css';
|
|
|
|
import Footer from '../components/Footer.astro'
|
|
import Header from '../components/Header.astro'
|
|
|
|
interface Props {
|
|
title: string;
|
|
type?: 'text' | 'website';
|
|
image?: string;
|
|
description?: string;
|
|
}
|
|
|
|
const {title, type, description, image} = Astro.props
|
|
|
|
const imageUrl = image
|
|
? image
|
|
: new URL('/images/vikunja.jpg', Astro.url)
|
|
|
|
const base = (new URL(Astro.url.pathname, Astro.site)).toString()
|
|
const canonical = base.endsWith('/')
|
|
? base.substring(0, Astro.url.toString().length - 1)
|
|
: base
|
|
---
|
|
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>{title}</title>
|
|
|
|
<meta charset="UTF-8"/>
|
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
|
|
<meta name="generator" content={Astro.generator}/>
|
|
|
|
<link rel="me" href="https://social.linux.pizza/@vikunja"/>
|
|
<link rel="sitemap" href="/sitemap-index.xml" />
|
|
|
|
<meta property="og:title" content={title}/>
|
|
<meta name="twitter:title" content={title}/>
|
|
<meta itemprop="name" content={title}/>
|
|
<meta name="application-name" content={title}/>
|
|
|
|
<!-- Description -->
|
|
{description &&
|
|
<meta name="description" content={description}/>
|
|
<meta itemprop="description" content={description}/>
|
|
<meta property="og:description" content={description}/>
|
|
<meta name="twitter:description" content={description}/>
|
|
}
|
|
|
|
<!-- Links -->
|
|
<link rel="canonical" href={canonical} itemprop="url"/>
|
|
<meta name="url" content={canonical}/>
|
|
<meta name="twitter:url" content={canonical}/>
|
|
<meta property="og:url" content={canonical}/>
|
|
|
|
<!-- Images -->
|
|
<meta itemprop="image" content={imageUrl}/>
|
|
<meta property="og:image" content={imageUrl}/>
|
|
<meta name="twitter:image" content={imageUrl}/>
|
|
<meta name="twitter:image:src" content={imageUrl}/>
|
|
|
|
<meta property="og:type" content={type || 'website'}/>
|
|
|
|
<script is:inline defer data-domain="vikunja.io" src="https://plausible.io/js/script.js"></script>
|
|
</head>
|
|
<body class="bg-gray-50 dark:bg-gray-900 font-sans text-gray-900 dark:text-gray-100 antialiased">
|
|
|
|
<Header/>
|
|
|
|
<slot/>
|
|
|
|
<Footer/>
|
|
|
|
<style is:global>
|
|
ul.list-checkmark {
|
|
list-style-type: '✓';
|
|
|
|
li::marker {
|
|
@apply text-blue-700 pr-2;
|
|
}
|
|
}
|
|
|
|
html.dark .astro-code,
|
|
html.dark .astro-code span {
|
|
color: var(--shiki-dark) !important;
|
|
background-color: var(--shiki-dark-bg) !important;
|
|
/* Optional, if you also want font styles */
|
|
font-style: var(--shiki-dark-font-style) !important;
|
|
font-weight: var(--shiki-dark-font-weight) !important;
|
|
text-decoration: var(--shiki-dark-text-decoration) !important;
|
|
}
|
|
|
|
</style>
|
|
|
|
<script>
|
|
const buttons = document.querySelectorAll('[data-toggle-dark-mode]')
|
|
|
|
buttons.forEach(button => {
|
|
button.addEventListener('click', () => {
|
|
const isDark = document.documentElement.classList.contains('dark')
|
|
localStorage.theme = isDark ? 'light' : 'dark'
|
|
setThemeClass()
|
|
})
|
|
})
|
|
|
|
function setThemeClass() {
|
|
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
document.documentElement.classList.add('dark')
|
|
} else {
|
|
document.documentElement.classList.remove('dark')
|
|
}
|
|
}
|
|
|
|
setThemeClass()
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|