1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-06-28 16:48:00 +02:00

link css file when defined in post frontmatter

This commit is contained in:
Matthias Kretschmann 2023-09-04 20:55:30 +01:00
parent 7b7260e2f8
commit c0bb9d6bb9
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 11 additions and 22 deletions

View File

@ -4,6 +4,7 @@ import remarkToc from './src/lib/remark-toc.mjs'
import react from '@astrojs/react'
// https://astro.build/config
/** @type {import('astro').AstroUserConfig} */
export default defineConfig({
site: 'https://kremalicious.com',
markdown: {

View File

@ -12,9 +12,10 @@ type Props = {
title?: string
pageTitle?: string
description?: string
style?: string
}
const { title, pageTitle, description } = Astro.props
const { title, pageTitle, description, style } = Astro.props
const titleFinal = title
? `${title} ¦ ${config.siteTitle}`
@ -41,6 +42,7 @@ const canonicalURL = Astro.site + Astro.url.pathname.replace('/', '')
<meta name="twitter:creator" content={config.author.twitter} />
<link rel="canonical" href={canonicalURL} />
{style && <link rel="stylesheet" href={style} />}
</head>
<body>
<Typekit />

View File

@ -14,10 +14,10 @@ type Props = CollectionEntry<'articles' | 'links' | 'photos'> & {
}
const { data, collection, lead, tableOfContents } = Astro.props
const { title, date, updated, image, linkurl, toc } = data
const { title, date, updated, image, linkurl, toc, style } = data
---
<LayoutBase title={title}>
<LayoutBase title={title} style={style}>
<article class={styles.entry}>
<header>
<Title linkurl={linkurl} title={title} date={date} updated={updated} />

View File

@ -45,3 +45,7 @@
font-size: var(--font-size-large);
margin-bottom: calc(var(--spacer) * var(--line-height));
}
.lead code {
font-size: calc(var(--font-size-large) * 0.9);
}

View File

@ -1,18 +0,0 @@
Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
##########
This directory contains the fonts for the platform. They are licensed
under the Apache 2 license.

View File

@ -12,7 +12,7 @@ tags:
- development
---
There's this HTML element meant for marking up keyboard keys named `<kbd>`. Obviously it can be styled with CSS so why not use it to make those elements look a bit more like hardware or the iOS and Android software keys.
There's this HTML element meant for marking up keyboard keys named `kbd`. Obviously it can be styled with CSS so why not use it to make those elements look a bit more like hardware or the iOS and Android software keys.
The above picture might be blurry depending on the device you're using so here's a live rendered demo: