diff options
| -rw-r--r-- | astro.config.mjs | 7 | ||||
| -rw-r--r-- | src/layouts/Default.astro | 10 | ||||
| -rw-r--r-- | src/pages/404.astro | 2 | ||||
| -rw-r--r-- | src/pages/blog/[...slug].astro | 11 | ||||
| -rw-r--r-- | vercel.json | 12 |
5 files changed, 17 insertions, 25 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..9653392 100644 --- a/src/layouts/Default.astro +++ b/src/layouts/Default.astro @@ -49,10 +49,12 @@ 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> <ClientRouter fallback="animate" /> <title>{title}</title> 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..8c8aea9 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -1,7 +1,16 @@ --- import Page from '../../layouts/BlogPost.astro'; -import { getEntry, render } from 'astro:content'; +import { getEntry, getCollection, 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 }, + })) +} + 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" - } - ] -} |
