diff options
| -rw-r--r-- | src/layouts/Default.astro | 17 | ||||
| -rw-r--r-- | src/pages/blog/[...slug].astro | 3 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro index 9653392..0878e5a 100644 --- a/src/layouts/Default.astro +++ b/src/layouts/Default.astro @@ -41,6 +41,8 @@ const date = new Date(); <meta name="darkreader-lock"> + <!-- Discord Component Embed --> + {Astro.url.pathname == "/" && <Fragment set:html={toComponentEmbedScript(HomeEmbed())} /> } @@ -56,15 +58,21 @@ const date = new Date(); plausible.init() </script> + <!-- Show notice div only for alee14.me --> + <script> + const notice = document.getElementById("notice"); + if (location.hostname == "alee14.me") { + notice.style.display = "block"; + } + </script> + <ClientRouter fallback="animate" /> <title>{title}</title> </head> <body> - {(Astro.url.hostname == "alee14.me") && - <div class="notice"> + <div id="notice"> <span>NOTICE: alee14.me will be switching to alee14.ca. Links will soon start redirecting to the new domain.</span> </div> - } <Navbar client:load /> <div transition:name="main" transition:animate="fade"> <slot /> @@ -172,7 +180,8 @@ const date = new Date(); monospace; } - .notice { + #notice { + display: none; background-color: #660F0F; padding: 1.2em; border-radius: 20px; diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index 8c8aea9..bd9ac7f 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -1,6 +1,6 @@ --- import Page from '../../layouts/BlogPost.astro'; -import { getEntry, getCollection, render } from 'astro:content'; +import { getCollection, CollectionEntry, getEntry, render } from 'astro:content'; import { formatDate } from "../../util"; export async function getStaticPaths() { @@ -10,6 +10,7 @@ export async function getStaticPaths() { props: { post }, })) } +type Props = CollectionEntry<'blog'>; const { slug } = Astro.params; |
