feat: 404 tracking
This commit is contained in:
parent
9e72e0436f
commit
f3aef3df2c
8 changed files with 65 additions and 57 deletions
12
package-lock.json
generated
12
package-lock.json
generated
|
@ -6430,9 +6430,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/regex-recursion": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-4.2.1.tgz",
|
||||
"integrity": "sha512-QHNZyZAeKdndD1G3bKAbBEKOSSK4KOHQrAJ01N1LJeb0SoH4DJIeFhp0uUpETgONifS4+P3sOgoA1dhzgrQvhA==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-4.3.0.tgz",
|
||||
"integrity": "sha512-5LcLnizwjcQ2ALfOj95MjcatxyqF5RPySx9yT+PaXu3Gox2vyAtLDjHB8NTJLtMGkvyau6nI3CfpwFCjPUIs/A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"regex-utilities": "^2.3.0"
|
||||
|
@ -7470,9 +7470,9 @@
|
|||
"license": "0BSD"
|
||||
},
|
||||
"node_modules/type-fest": {
|
||||
"version": "4.28.1",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.28.1.tgz",
|
||||
"integrity": "sha512-LO/+yb3mf46YqfUC7QkkoAlpa7CTYh//V1Xy9+NQ+pKqDqXIq0NTfPfQRwFfCt+if4Qkwb9gzZfsl6E5TkXZGw==",
|
||||
"version": "4.29.0",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.29.0.tgz",
|
||||
"integrity": "sha512-RPYt6dKyemXJe7I6oNstcH24myUGSReicxcHTvCLgzm4e0n8y05dGvcGB15/SoPRBmhlMthWQ9pvKyL81ko8nQ==",
|
||||
"license": "(MIT OR CC0-1.0)",
|
||||
"engines": {
|
||||
"node": ">=16"
|
||||
|
|
|
@ -81,4 +81,5 @@
|
|||
/posts/2014/sublime-text-ctrl-tab-key-bindings/ /posts/2014/sublime-text-3-ctrl-tab-key-bindings/ 301
|
||||
/posts/2022/simple-api-fetch-hooks-with-swr/ /posts/2022/simple-data-fetching-with-custom-react-hooks-and-swr/ 301
|
||||
/posts/2023/drying-up-now-page-templates-eleventy/ /posts/2023/drying-up-now-page-templates-and-normalizing-data-in-eleventy/ 301
|
||||
/posts/2023/hacking-together-a-tweeklyfm-replacement.html /posts/2023/hacking-together-a-tweeklyfm-replacement/ 301
|
||||
/posts/2023/hacking-together-a-tweeklyfm-replacement.html /posts/2023/hacking-together-a-tweeklyfm-replacement/ 301
|
||||
/posts/2024/setting-up-image-transforms-in-eleventy.html /posts/2024/setting-up-image-transforms-in-eleventy 301
|
|
@ -96,7 +96,14 @@ const pageDescription = md(description);
|
|||
<script defer src="/scripts/index.js" is:inline></script>
|
||||
{
|
||||
isProduction && (
|
||||
<script defer data-domain="coryd.dev" src="/js/script.js" />
|
||||
<>
|
||||
<script is:inline defer data-domain="coryd.dev" src="/js/script.js" />
|
||||
<script is:inline defer>
|
||||
window.plausible = window.plausible || function(...args) {
|
||||
(window.plausible.q = window.plausible.q || []).push(args);
|
||||
};
|
||||
</script>
|
||||
</>
|
||||
)
|
||||
}
|
||||
<noscript>
|
||||
|
|
|
@ -58,3 +58,8 @@ const description = "What kind of idiots do you have working here?";
|
|||
<hr />
|
||||
<AddonLinks popularPosts={popularPosts} links={links} />
|
||||
</Layout>
|
||||
<script is:inline defer>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
plausible("404", { props: { path: document.location.pathname } });
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -37,17 +37,9 @@ const description =
|
|||
<h2 class="page-title">{title}</h2>
|
||||
<p>
|
||||
I've listened to{" "}
|
||||
<strong class="highlight-text">
|
||||
{music.week.artists.length} artists
|
||||
</strong>
|
||||
,{" "}
|
||||
<strong class="highlight-text">
|
||||
{music.week.albums.length} albums
|
||||
</strong>
|
||||
, and{" "}
|
||||
<strong class="highlight-text">
|
||||
{music.week.totalTracks} tracks
|
||||
</strong>{" "}
|
||||
<strong class="highlight-text">{music.week.artists.length} artists</strong>,{" "}
|
||||
<strong class="highlight-text">{music.week.albums.length} albums</strong>, and{" "}
|
||||
<strong class="highlight-text">{music.week.totalTracks} tracks</strong>{" "}
|
||||
this week. Most of that has been{" "}
|
||||
<span set:html={mediaLinks(music.week.genres, "genre", 5)}></span>.
|
||||
</p>
|
||||
|
|
|
@ -31,9 +31,7 @@ const topGenres = mediaLinks(music.month.genres, "genre", 5);
|
|||
>
|
||||
<h2 class="page-title">{title}</h2>
|
||||
<p>
|
||||
I've listened to <strong class="highlight-text"
|
||||
>{artistCount} artists</strong
|
||||
>,
|
||||
I've listened to <strong class="highlight-text">{artistCount} artists</strong>,
|
||||
<strong class="highlight-text">{albumCount} albums</strong> and
|
||||
<strong class="highlight-text">{totalTracks} tracks</strong> this month. Most
|
||||
of that has been <span set:html={topGenres} />.
|
||||
|
|
|
@ -8625,7 +8625,7 @@
|
|||
"loc": "https://coryd.dev/music/genres/alternative-metal"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/30991"
|
||||
"loc": "https://coryd.dev/watching/shows/126254"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/71994"
|
||||
|
@ -8648,12 +8648,6 @@
|
|||
{
|
||||
"loc": "https://coryd.dev/watching/shows/104157"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/126254"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/157065"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/61222"
|
||||
},
|
||||
|
@ -8663,6 +8657,9 @@
|
|||
{
|
||||
"loc": "https://coryd.dev/watching/shows/62822"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/1621"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/1640"
|
||||
},
|
||||
|
@ -8703,7 +8700,7 @@
|
|||
"loc": "https://coryd.dev/watching/shows/81241"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/1621"
|
||||
"loc": "https://coryd.dev/watching/shows/109939"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/80707"
|
||||
|
@ -8712,10 +8709,10 @@
|
|||
"loc": "https://coryd.dev/watching/shows/76887"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/109939"
|
||||
"loc": "https://coryd.dev/watching/shows/137437"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/137437"
|
||||
"loc": "https://coryd.dev/watching/shows/1414"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/202557"
|
||||
|
@ -8724,7 +8721,10 @@
|
|||
"loc": "https://coryd.dev/watching/shows/93784"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/92553"
|
||||
"loc": "https://coryd.dev/watching/shows/30991"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/1398"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/81239"
|
||||
|
@ -8738,30 +8738,30 @@
|
|||
{
|
||||
"loc": "https://coryd.dev/watching/shows/80558"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/1414"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/1398"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/15621"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/233629"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/76231"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/136308"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/157239"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/233629"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/76231"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/47665"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/1436"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/111894"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/17968"
|
||||
},
|
||||
|
@ -8781,31 +8781,34 @@
|
|||
"loc": "https://coryd.dev/watching/shows/65708"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/1436"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/111894"
|
||||
"loc": "https://coryd.dev/watching/shows/92553"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/157061"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/94028"
|
||||
"loc": "https://coryd.dev/watching/shows/202879"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/202879"
|
||||
"loc": "https://coryd.dev/watching/shows/94028"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/1107"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/157065"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/185"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/90228"
|
||||
"loc": "https://coryd.dev/watching/shows/688"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/688"
|
||||
"loc": "https://coryd.dev/watching/shows/125988"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/90228"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/124364"
|
||||
|
@ -8816,9 +8819,6 @@
|
|||
{
|
||||
"loc": "https://coryd.dev/watching/shows/113962"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/125988"
|
||||
},
|
||||
{
|
||||
"loc": "https://coryd.dev/watching/shows/60694"
|
||||
},
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { isBefore } from "date-fns";
|
||||
import { createClient } from "@supabase/supabase-js";
|
||||
import { CACHE_DURATION } from "@utils/constants/index.js";
|
||||
|
||||
|
@ -26,7 +27,11 @@ export async function fetchSyndication() {
|
|||
|
||||
const [{ syndication } = {}] = data;
|
||||
const result =
|
||||
syndication?.filter((item) => item.syndication !== null) || [];
|
||||
syndication?.filter(
|
||||
(item) =>
|
||||
item.syndication !== null &&
|
||||
isBefore(new Date(item.syndication.date), now)
|
||||
) || [];
|
||||
|
||||
cachedSyndication = result;
|
||||
lastFetchTime = now;
|
||||
|
|
Reference in a new issue