This commit is contained in:
thiloho
2023-05-18 22:17:46 +02:00
parent 40411fd328
commit a1c12866ae
14 changed files with 109 additions and 87 deletions

View File

@@ -7,19 +7,25 @@ import svelte from "@astrojs/svelte";
export default defineConfig({
experimental: {
assets: true,
inlineStylesheets: "auto"
inlineStylesheets: "auto",
},
scopedStyleStrategy: "class",
markdown: {
rehypePlugins: [rehypeHeadingIds, [rehypeAutolinkHeadings, {
rehypePlugins: [
rehypeHeadingIds,
[
rehypeAutolinkHeadings,
{
behavior: "wrap",
properties: {
class: "heading-linker"
}
}]]
class: "heading-linker",
},
},
],
],
},
image: {
service: sharpImageService()
service: sharpImageService(),
},
integrations: [svelte()]
integrations: [svelte()],
});

View File

@@ -16,7 +16,7 @@
</script>
<Dropdown shortcut="S">
<svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon">
<title>Search for an article (Shift + s)</title>
<path fill-rule="evenodd" d="M10.5 3.75a6.75 6.75 0 100 13.5 6.75 6.75 0 000-13.5zM2.25 10.5a8.25 8.25 0 1114.59 5.28l4.69 4.69a.75.75 0 11-1.06 1.06l-4.69-4.69A8.25 8.25 0 012.25 10.5z" clip-rule="evenodd" />
</svg>

View File

@@ -32,10 +32,10 @@
}
</script>
<svelte:window on:keydown={handleKeydown} on:click={handleClick} />
<svelte:window on:keydown="{handleKeydown}" on:click="{handleClick}" />
<details bind:this={detailsElement}>
<summary bind:this={summaryElement}>
<details bind:this="{detailsElement}">
<summary bind:this="{summaryElement}">
<slot name="icon" />
</summary>
<slot />

View File

@@ -25,7 +25,11 @@ const currentDateYear = new Date().getFullYear();
footer {
margin-block-start: 4rem;
padding-block: 1rem;
background: linear-gradient(0deg, var(--tertiary-background-color) 0%, var(--background-color) 100%);
background: linear-gradient(
0deg,
var(--tertiary-background-color) 0%,
var(--background-color) 100%
);
}
.container {

View File

@@ -7,7 +7,7 @@ const { title, description } = Astro.props;
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<meta name="color-scheme" content="light">
<meta name="color-scheme" content="light" />
<title>{title}</title>
<meta name="author" content="Your Name" />
<meta name="description" content={description} />

View File

@@ -5,9 +5,7 @@ import ThemeToggle from "../components/ThemeToggle.svelte";
<nav>
<div class="container">
<a href="/">
Logo
</a>
<a href="/"> Logo</a>
<slot />
<ArticleSearchWrapper />
<ThemeToggle client:only="svelte" />
@@ -29,7 +27,7 @@ import ThemeToggle from "../components/ThemeToggle.svelte";
position: relative;
}
a {
.container > *:first-child {
margin-inline-end: auto;
}
</style>

View File

@@ -7,7 +7,7 @@
</script>
<Dropdown shortcut="C">
<svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
<svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon">
<title>Table of contents (Shift + c)</title>
<path fill-rule="evenodd" d="M2.625 6.75a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875 0A.75.75 0 018.25 6h12a.75.75 0 010 1.5h-12a.75.75 0 01-.75-.75zM2.625 12a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zM7.5 12a.75.75 0 01.75-.75h12a.75.75 0 010 1.5h-12A.75.75 0 017.5 12zm-4.875 5.25a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0zm4.875 0a.75.75 0 01.75-.75h12a.75.75 0 010 1.5h-12a.75.75 0 01-.75-.75z" clip-rule="evenodd" />
</svg>

View File

@@ -19,7 +19,7 @@
</script>
<Dropdown shortcut="T">
<svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-6 h-6">
<svg slot="icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="icon">
<title>Toggle theme (Shift + t)</title>
<path fill-rule="evenodd" d="M2.25 5.25a3 3 0 013-3h13.5a3 3 0 013 3V15a3 3 0 01-3 3h-3v.257c0 .597.237 1.17.659 1.591l.621.622a.75.75 0 01-.53 1.28h-9a.75.75 0 01-.53-1.28l.621-.622a2.25 2.25 0 00.659-1.59V18h-3a3 3 0 01-3-3V5.25zm1.5 0v7.5a1.5 1.5 0 001.5 1.5h13.5a1.5 1.5 0 001.5-1.5v-7.5a1.5 1.5 0 00-1.5-1.5H5.25a1.5 1.5 0 00-1.5 1.5z" clip-rule="evenodd" />
</svg>

View File

@@ -39,7 +39,7 @@ hello **bold** the brown fox jumps _italicized text_ over the `code` high fence
## Image
![Minke Whale breaching in Antarctica](../../assets/blog/markdown-style-guide/example-image.jpg)
![A deer with its head resting on its back. The animal has a brown fur coat and long ears, and it appears to be standing in an outdoor setting. Its snout is visible, as well as the white markings around its eyes.](../../assets/blog/markdown-style-guide/example-image.jpg)
## Table

View File

@@ -1,5 +1,5 @@
---
const { title, description, publicationDate, headings } = Astro.props;
const { id, title, description, publicationDate, headings } = Astro.props;
import PageLayout from "./PageLayout.astro";
import TableOfContents from "../components/TableOfContents.svelte";
@@ -15,7 +15,10 @@ import PublicationDate from "../components/PublicationDate.astro";
<PublicationDate {publicationDate} />
</strong>
</p>
<a href="#">Edit this page</a>
<a
href={`https://github.com/thiloho/aurora/edit/main/src/content/blog/${id}`}
>Edit this page</a
>
</Fragment>
<slot />
</PageLayout>

View File

@@ -14,6 +14,6 @@ const { entry } = Astro.props;
const { Content, headings } = await entry.render();
---
<ArticleLayout {...entry.data} {headings}>
<ArticleLayout id={entry.id} {...entry.data} {headings}>
<Content />
</ArticleLayout>

View File

@@ -54,7 +54,10 @@ body {
color: var(--text-color);
}
nav, header, main, footer {
nav,
header,
main,
footer {
padding-inline: 1rem;
}
@@ -63,7 +66,12 @@ nav, header, main, footer {
margin-inline: auto;
}
h1, h2, h3, h4, h5, h6 {
h1,
h2,
h3,
h4,
h5,
h6 {
scroll-margin-block-start: var(--nav-height);
}
@@ -73,7 +81,7 @@ img {
block-size: auto;
}
svg {
.icon {
inline-size: 1.5rem;
block-size: 1.5rem;
vertical-align: middle;
@@ -85,7 +93,8 @@ table {
overflow-x: auto;
}
td, th {
td,
th {
border: var(--standard-border);
padding-inline: 0.5rem;
padding-block: 0.25rem;
@@ -116,7 +125,8 @@ input {
padding-inline: 0.5rem;
}
summary, button {
summary,
button {
cursor: pointer;
}
@@ -124,7 +134,8 @@ button {
color: inherit;
}
ul, ol {
ul,
ol {
line-height: 2;
}