mirror of
https://github.com/thiloho/thiloho.github.io.git
synced 2025-11-22 10:21:36 +01:00
Set site url and remove old logic
This commit is contained in:
@@ -1,29 +1,17 @@
|
||||
---
|
||||
interface Props {
|
||||
date: Date | string;
|
||||
date: Date;
|
||||
}
|
||||
|
||||
const { date } = Astro.props;
|
||||
|
||||
const isStringDate = typeof date === "string";
|
||||
const transformedDate = isStringDate ? new Date(date) : date;
|
||||
|
||||
// Create the base options object
|
||||
const localeOptions = {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
};
|
||||
|
||||
// Conditionally add time options if it's a string date
|
||||
if (isStringDate) {
|
||||
Object.assign(localeOptions, {
|
||||
hour: "2-digit",
|
||||
minute: "2-digit"
|
||||
});
|
||||
}
|
||||
---
|
||||
|
||||
<time datetime={transformedDate.toISOString()}>
|
||||
{transformedDate.toLocaleString("en-us", localeOptions)}
|
||||
</time>
|
||||
<time datetime={date.toISOString()}>
|
||||
{
|
||||
date.toLocaleString("en-us", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
})
|
||||
}
|
||||
</time>
|
||||
|
||||
@@ -22,7 +22,7 @@ const { title, pubDate, modDate } = Astro.props;
|
||||
Published: <Date date={pubDate} />
|
||||
<br />
|
||||
Last modified:{" "}
|
||||
{modDate ? <Date date={modDate} /> : <span>No changes yet</span>}
|
||||
{modDate ? <Date date={modDate} /> : <span>No modifications</span>}
|
||||
</p>
|
||||
</hgroup>
|
||||
) : (
|
||||
|
||||
@@ -3,6 +3,7 @@ id: 2
|
||||
title: "Privacy-focused operating systems"
|
||||
description: "Good choices for privacy-focused operating systems for desktop and mobile phones."
|
||||
pubDate: "2025-01-16"
|
||||
modDate: "2025-04-26"
|
||||
---
|
||||
|
||||
## Introduction
|
||||
|
||||
@@ -17,14 +17,14 @@ if (!article) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
const { Content, headings, remarkPluginFrontmatter } = await render(article);
|
||||
const { Content, headings } = await render(article);
|
||||
---
|
||||
|
||||
<PageLayout
|
||||
title={article.data.title}
|
||||
metaDescription="Blog"
|
||||
pubDate={article.data.pubDate}
|
||||
modDate={remarkPluginFrontmatter.lastModified}
|
||||
modDate={article.data.modDate}
|
||||
>
|
||||
<details class="toc sticky top-0 z-20">
|
||||
<summary
|
||||
|
||||
Reference in New Issue
Block a user