feat: bye analytics

This commit is contained in:
Cory Dransfeldt 2024-08-10 18:54:06 -07:00
parent 94d58d0f0c
commit 2bf2fba325
No known key found for this signature in database
20 changed files with 14 additions and 185 deletions

View file

@ -430,6 +430,10 @@ main {
.home-status,
article {
margin-bottom: var(--sizing-base);
}
.home-status,
.posts-wrapper article {
border-bottom: 1px solid var(--gray-light);
}

View file

@ -1,29 +0,0 @@
.addon-links {
display: grid;
gap: var(--sizing-sm);
grid-template-columns: repeat(1, 1fr);
& div {
& > h3 {
margin-top: 0;
}
&:last-of-type h3 {
margin-top: var(--sizing-base);
}
}
& .link-list {
margin-bottom: 0;
}
}
@media screen and (min-width: 768px) {
.addon-links {
grid-template-columns: repeat(2, 1fr);
& div:last-of-type h3 {
margin-top: 0;
}
}
}

View file

@ -25,7 +25,6 @@
@import url('./pages/webrings.css') layer(page);
/* component styles */
@import url('./components/addon-links.css') layer(components);
@import url('./components/badge-grid.css') layer(components);
@import url('./components/banners.css') layer(components);
@import url('./components/buttons.css') layer(components);

View file

@ -1,18 +0,0 @@
import EleventyFetch from '@11ty/eleventy-fetch'
export default async function () {
const API_KEY_PLAUSIBLE = process.env.API_KEY_PLAUSIBLE
const url =
'https://plausible.io/api/v1/stats/breakdown?site_id=coryd.dev&period=6mo&property=event:page&limit=30'
const res = EleventyFetch(url, {
duration: '1h',
type: 'json',
fetchOptions: {
headers: {
Authorization: `Bearer ${API_KEY_PLAUSIBLE}`,
},
},
}).catch()
const pages = await res
return pages['results'].filter((p) => p['page'].includes('posts'))
}

View file

@ -107,8 +107,7 @@
<link rel="alternate" href="https://coryd.dev/feeds/movies" title="Movies / {{ globals.site_name }}'s movies feed" type="application/rss+xml">
<link rel="alternate" href="https://coryd.dev/feeds/books" title="Books / {{ globals.site_name }}" type="application/rss+xml">
<link rel="alternate" href="https://coryd.dev/feeds/all" title="All activity / {{ globals.site_name }}" type="application/rss+xml">
<script defer data-domain="coryd.dev" src="/js/script.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
<script defer src="/assets/scripts/index.js?v={% appVersion %}"></script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
@ -154,6 +153,5 @@
})()
</script>
{{ content }}
<script src="/assets/scripts/index.js?v={% appVersion %}" defer></script>
</body>
</html>

View file

@ -1,8 +0,0 @@
<div class="addon-links">
{%- if popularPosts.size > 0 -%}
<div>{% render "partials/blocks/popular-posts.liquid", popularPosts:popularPosts %}</div>
{%- endif -%}
{%- if links.size > 0 -%}
<div>{% render "partials/blocks/recent-links.liquid", links:links %}</div>
{%- endif -%}
</div>

View file

@ -13,7 +13,5 @@
{{ block.text | markdown }}
{%- elsif block.type == 'divider' -%}
{{ block.markup | markdown }}
{%- elsif block.type == 'addon_links' -%}
{% render "partials/blocks/addon-links.liquid", popularPosts:collections.popularPosts, links:links %}
{%- endif -%}
{%- endfor -%}

View file

@ -1,15 +0,0 @@
{%- if popularPosts.size > 0 -%}
<h3 class="flex-centered">
{% tablericon "flame" "Popular" %}
Popular posts
</h3>
<ul class="link-list">
{%- for post in popularPosts limit: 5 -%}
<li>
<a class="no-underline" href="{{ post.slug }}" title="{{ post.title | escape}}">
{{ post.title }}
</a>
</li>
{%- endfor -%}
</ul>
{%- endif -%}

View file

@ -1,16 +0,0 @@
{%- if links.size > 0 -%}
<h3 id="links" class="flex-centered">
{% tablericon "link" "Links" %}
Recent links
</h3>
<ul class="link-list">
{%- for link in links limit: 5 -%}
<li>
<a href="{{ link.link }}" title="{{ link.title | escape }}">
{{ link.title }}
</a>
{% if link.authors %} via <a href="{{ link.authors.url }}">{{ link.authors.name }}</a>{% endif %}
</li>
{%- endfor -%}
</ul>
{%- endif -%}

View file

@ -5,7 +5,7 @@ permalink: /blogroll.html
description: These are awesome blogs that I enjoy and you may enjoy too.
---
<h2 class="page-header">{{ title }}</h2>
<p>You can <a onclick="if (typeof plausible === 'function') { plausible('OPML download', { props: { action: 'download' } }) }" href="/blogroll.opml">Download OPML</a>
<p>You can <a href="/blogroll.opml">Download OPML</a>
download an OPML file</a> containing all of these feeds and import them into your RSS reader.</p>
<table>
<tr>

View file

@ -7,7 +7,7 @@ pagination:
permalink: "{{ post.slug }}/index.html"
schema: blog
---
<article class="h-entry">
<article class="h-entry standalone">
<div class="time-wrapper flex-centered">
{% tablericon "calendar-month" "Date" %}
<time class="dt-published" datetime="{{ date }}">
@ -41,5 +41,4 @@ schema: blog
{{ post.content | markdown }}
{% render "partials/blocks/index.liquid", blocks:post.blocks %}
</div>
</article>
{% render "partials/blocks/addon-links.liquid", popularPosts:collections.popularPosts, links:links %}
</article>

View file

@ -32,17 +32,4 @@ description: How to contact me.
<button type="submit">Send message</button>
</div>
</form>
</div>
<script>
document.querySelector('[data-form="contact"]').addEventListener('submit', function(event) {
if (typeof plausible === 'function') {
plausible('Contact form submitted', {
props: {
name: this.name.value,
email: this.email.value,
message: this.message.value
}
})
}
})
</script>
</div>

View file

@ -32,7 +32,6 @@ permalink: /search.html
const query = $input.value
const results = (query.length > 1) ? getSearchResults(query) : []
if (query === '') renderSearchResults([])
if (results && typeof plausible === 'function') plausible('Search', { props: { query: query } });
renderSearchResults(results)
})
@ -58,5 +57,4 @@ permalink: /search.html
<input class="search__form--input" placeholder="Search" type="search" name="q" autocomplete="off" autofocus>
<input class="search__form--fallback" type="hidden" placeholder="Search" name="sites" value="coryd.dev">
</form>
<ul class="search__results hidden"></ul>
{% render "partials/blocks/addon-links.liquid", popularPosts:collections.popularPosts, links:links %}
<ul class="search__results hidden"></ul>