mirror of
https://github.com/thiloho/thiloho.github.io.git
synced 2025-11-22 02:11:35 +01:00
Update RSS elements and TOC svg
This commit is contained in:
File diff suppressed because one or more lines are too long
11
src/pages/404.astro
Normal file
11
src/pages/404.astro
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
import PageLayout from "../layouts/PageLayout.astro";
|
||||||
|
---
|
||||||
|
|
||||||
|
<PageLayout title="404: Not found" description="Not found">
|
||||||
|
<p>
|
||||||
|
The file associated with the requested path (<code
|
||||||
|
>{Astro.originPathname}</code
|
||||||
|
>) could not be found.
|
||||||
|
</p>
|
||||||
|
</PageLayout>
|
||||||
@@ -30,18 +30,17 @@ const { Content, headings } = await render(article);
|
|||||||
<details class="toc sticky top-0 z-20">
|
<details class="toc sticky top-0 z-20">
|
||||||
<summary
|
<summary
|
||||||
title="Table of contents"
|
title="Table of contents"
|
||||||
class="flex mx-auto w-fit cursor-pointer list-none p-2 border-b-2 border-transparent hover:bg-neutral-200 hover:border-neutral-400 hover:dark:bg-neutral-700 hover:dark:border-neutral-600"
|
class="flex mx-auto w-fit cursor-pointer list-none px-2 py-2.5 border-b-2 border-transparent hover:bg-neutral-200 hover:border-neutral-400 hover:dark:bg-neutral-700 hover:dark:border-neutral-600"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
viewBox="0 0 24 24"
|
viewBox="0 0 20 20"
|
||||||
fill="currentColor"
|
fill="currentColor"
|
||||||
class="size-6"
|
class="size-5"
|
||||||
>
|
>
|
||||||
<path
|
<path
|
||||||
fill-rule="evenodd"
|
d="M10.75 16.82A7.462 7.462 0 0 1 15 15.5c.71 0 1.396.098 2.046.282A.75.75 0 0 0 18 15.06v-11a.75.75 0 0 0-.546-.721A9.006 9.006 0 0 0 15 3a8.963 8.963 0 0 0-4.25 1.065V16.82ZM9.25 4.065A8.963 8.963 0 0 0 5 3c-.85 0-1.673.118-2.454.339A.75.75 0 0 0 2 4.06v11a.75.75 0 0 0 .954.721A7.506 7.506 0 0 1 5 15.5c1.579 0 3.042.487 4.25 1.32V4.065Z"
|
||||||
d="M2.25 4.5A.75.75 0 0 1 3 3.75h14.25a.75.75 0 0 1 0 1.5H3a.75.75 0 0 1-.75-.75Zm0 4.5A.75.75 0 0 1 3 8.25h9.75a.75.75 0 0 1 0 1.5H3A.75.75 0 0 1 2.25 9Zm15-.75A.75.75 0 0 1 18 9v10.19l2.47-2.47a.75.75 0 1 1 1.06 1.06l-3.75 3.75a.75.75 0 0 1-1.06 0l-3.75-3.75a.75.75 0 1 1 1.06-1.06l2.47 2.47V9a.75.75 0 0 1 .75-.75Zm-15 5.25a.75.75 0 0 1 .75-.75h9.75a.75.75 0 0 1 0 1.5H3a.75.75 0 0 1-.75-.75Z"
|
></path>
|
||||||
clip-rule="evenodd"></path>
|
|
||||||
</svg>
|
</svg>
|
||||||
</summary>
|
</summary>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const sortedArticles = allArticles.sort((a, b) => {
|
|||||||
<ul>
|
<ul>
|
||||||
{
|
{
|
||||||
sortedArticles.map((article) => (
|
sortedArticles.map((article) => (
|
||||||
<li class="flex gap-2">
|
<li>
|
||||||
<Date date={article.data.pubDate} />
|
<Date date={article.data.pubDate} />
|
||||||
<span>»</span>
|
<span>»</span>
|
||||||
<a
|
<a
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
import PageLayout from "../layouts/PageLayout.astro";
|
|
||||||
---
|
|
||||||
|
|
||||||
<PageLayout title="Contact" description="Contact">
|
|
||||||
<p>Example content</p>
|
|
||||||
</PageLayout>
|
|
||||||
@@ -6,12 +6,24 @@ const parser = new MarkdownIt();
|
|||||||
|
|
||||||
export const GET = async (context) => {
|
export const GET = async (context) => {
|
||||||
const blog = await getCollection("blog");
|
const blog = await getCollection("blog");
|
||||||
|
|
||||||
|
const latestModDate = blog.reduce((latest, article) => {
|
||||||
|
const modDate = article.data.modDate || article.data.pubDate;
|
||||||
|
return modDate > latest ? modDate : latest;
|
||||||
|
}, new Date(0));
|
||||||
|
|
||||||
return rss({
|
return rss({
|
||||||
title: "Thilo Hohlt’s Blog",
|
title: "Thilo Hohlt's Blog",
|
||||||
description: "Thilo Hohlt’s Blog",
|
description: "Thilo Hohlt's Blog",
|
||||||
site: context.site,
|
site: context.site,
|
||||||
trailingSlash: false,
|
trailingSlash: false,
|
||||||
stylesheet: "pretty-feed-v3.xsl",
|
xmlns: {
|
||||||
|
atom: "http://www.w3.org/2005/Atom",
|
||||||
|
},
|
||||||
|
customData: `
|
||||||
|
<lastBuildDate>${latestModDate.toUTCString()}</lastBuildDate>
|
||||||
|
<atom:link href="${context.site}rss.xml" rel="self" type="application/rss+xml" />
|
||||||
|
`,
|
||||||
items: blog.map((article) => ({
|
items: blog.map((article) => ({
|
||||||
link: `/blog/${article.id}/`,
|
link: `/blog/${article.id}/`,
|
||||||
content: sanitizeHtml(parser.render(article.body), {
|
content: sanitizeHtml(parser.render(article.body), {
|
||||||
|
|||||||
Reference in New Issue
Block a user