aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--astro.config.mjs7
-rw-r--r--src/layouts/Default.astro27
-rw-r--r--src/pages/404.astro2
-rw-r--r--src/pages/blog/[...slug].astro12
-rw-r--r--vercel.json12
5 files changed, 31 insertions, 29 deletions
diff --git a/astro.config.mjs b/astro.config.mjs
index 24d101a..9f04f39 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -1,19 +1,12 @@
import { defineConfig, passthroughImageService } from 'astro/config';
import icon from "astro-icon";
import react from "@astrojs/react";
-import vercel from "@astrojs/vercel";
import svelte from "@astrojs/svelte";
// https://astro.build/config
export default defineConfig({
site: 'https://alee14.me',
integrations: [icon(), react(), svelte()],
- output: "server",
- adapter: vercel({
- webAnalytics: {
- enabled: false
- }
- }),
image: {
service: passthroughImageService()
},
diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro
index 5f5208a..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())} />
}
@@ -49,20 +51,28 @@ const date = new Date();
<Fragment set:html={toComponentEmbedScript(PageEmbed())} />
}
- <!-- Plausible Analytics -->
-
- <script defer data-domain="alee14.me" data-api="/plausible/api/event" src="/plausible/js/script.js"/>
- <script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
+ <!-- Privacy-friendly analytics by Plausible -->
+ <script async src="https://stats.alee14.me/js/pa-JtfmJJUJHGy9kLPhK4-dv.js"></script>
+ <script>
+ window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};
+ 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 />
@@ -170,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/404.astro b/src/pages/404.astro
index 38ecfb8..16e8b27 100644
--- a/src/pages/404.astro
+++ b/src/pages/404.astro
@@ -7,7 +7,7 @@ import Layout from '../layouts/Default.astro'
<h2>Page not found</h2>
<h2>Whoops! You blew up the website!</h2>
</div>
- <script>document.addEventListener('DOMContentLoaded', function () { plausible('404', { props: { path: document.location.pathname } }); });</script>
+ <script>document.addEventListener('DOMContentLoaded', function () { plausible('404'); });</script>
</Layout>
<style>
.error {
diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro
index 6dc78ba..bd9ac7f 100644
--- a/src/pages/blog/[...slug].astro
+++ b/src/pages/blog/[...slug].astro
@@ -1,7 +1,17 @@
---
import Page from '../../layouts/BlogPost.astro';
-import { getEntry, render } from 'astro:content';
+import { getCollection, CollectionEntry, getEntry, render } from 'astro:content';
import { formatDate } from "../../util";
+
+export async function getStaticPaths() {
+ const posts = await getCollection('blog')
+ return posts.map((post) => ({
+ params: { slug: post.id },
+ props: { post },
+ }))
+}
+type Props = CollectionEntry<'blog'>;
+
const { slug } = Astro.params;
if (slug === undefined) {
diff --git a/vercel.json b/vercel.json
deleted file mode 100644
index 3d9f9bd..0000000
--- a/vercel.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "rewrites": [
- {
- "source": "/plausible/js/script.js",
- "destination": "https://stats.alee14.me/js/script.file-downloads.outbound-links.js"
- },
- {
- "source": "/plausible/api/event",
- "destination": "https://stats.alee14.me/api/event"
- }
- ]
-}