chore: misc cleanup

This commit is contained in:
Cory Dransfeldt 2024-08-12 14:01:39 -07:00
parent cab8b34832
commit 31b69ae565
No known key found for this signature in database
7 changed files with 32 additions and 17 deletions

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "coryd.dev",
"version": "22.1.9",
"version": "22.2.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
"version": "22.1.9",
"version": "22.2.0",
"license": "MIT",
"dependencies": {
"@cdransf/api-text": "^1.5.0",

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "22.1.9",
"version": "22.2.0",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"scripts": {

View file

@ -22,14 +22,13 @@
srcset="
https://cdn.coryd.dev{{ item.image }}?class=squaresm 200w,
https://cdn.coryd.dev{{ item.image }}?class=squaremd 400w,
https://cdn.coryd.dev{{ item.image }}?class=squarebase 800w,
https://cdn.coryd.dev{{ item.image }}?class=squarelg 1200w
https://cdn.coryd.dev{{ item.image }}?class=squarebase 800w
"
sizes="(max-width: 450px) 200px,
(max-width: 850px) 400px,
(max-width: 100px) 800px,
1200px"
src="https://cdn.coryd.dev{{ item.image }}?class=squarelg"
(max-width: 1000px) 800px,
800px"
src="https://cdn.coryd.dev{{ item.image }}?class=squarebase"
alt="{{ alt }}"
loading="{{ loadingStrategy }}"
decoding="async"
@ -41,14 +40,13 @@
srcset="
https://cdn.coryd.dev{{ item.image }}?class=verticalsm 200w,
https://cdn.coryd.dev{{ item.image }}?class=verticalmd 400w,
https://cdn.coryd.dev{{ item.image }}?class=verticalbase 800w,
https://cdn.coryd.dev{{ item.image }}?class=verticallg 1200w
https://cdn.coryd.dev{{ item.image }}?class=verticalbase 800w
"
sizes="(max-width: 450px) 200px,
(max-width: 850px) 400px,
(max-width: 1000px) 800px,
1200px"
src="https://cdn.coryd.dev{{ item.image }}?class=verticallg"
800px"
src="https://cdn.coryd.dev{{ item.image }}?class=verticalbase"
alt="{{ alt }}"
loading="{{ loadingStrategy }}"
decoding="async"

View file

@ -24,14 +24,13 @@
srcset="
https://cdn.coryd.dev{{ item.backdrop }}?class=bannersm 256w,
https://cdn.coryd.dev{{ item.backdrop }}?class=bannermd 512w,
https://cdn.coryd.dev{{ item.backdrop }}?class=bannerbase 1024w,
https://cdn.coryd.dev{{ item.backdrop }}?class=bannerlg 2048w
https://cdn.coryd.dev{{ item.backdrop }}?class=bannerbase 1024w
"
sizes="(max-width: 450px) 256px,
(max-width: 850px) 512px,
(max-width: 1000px) 1024px,
2048px"
src="https://cdn.coryd.dev{{ item.backdrop }}?class=bannerlg"
1024px"
src="https://cdn.coryd.dev{{ item.backdrop }}?class=bannerbase"
alt="{{ alt }}"
loading="{{ loadingStrategy }}"
decoding="async"

View file

@ -32,6 +32,7 @@ permalink: /search.html
const query = $input.value
const results = (query.length > 1) ? getSearchResults(query) : []
if (query === '') renderSearchResults([])
if (query.length > 1 && window?.umami) umami.trackEvent('Search', { query: query })
renderSearchResults(results)
})

View file

@ -20,5 +20,21 @@ async function handleRequest(request) {
headers: newHeaders
})
}
if (url.pathname === '/js/api/send') {
const targetUrl = 'https://dashboard.coryd.dev/api/send'
const response = await fetch(targetUrl, {
method: request.method,
headers: request.headers,
body: request.body
})
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers: response.headers
})
}
return fetch(request)
}

View file

@ -8,5 +8,6 @@ workers_dev = true
[env.production]
name = "analytics-worker-production"
routes = [
{ pattern = "coryd.dev/js/script.js", zone_id = "${CF_ZONE_ID}" }
{ pattern = "coryd.dev/js/script.js", zone_id = "${CF_ZONE_ID}" },
{ pattern = "coryd.dev/js/api/send", zone_id = "${CF_ZONE_ID}" }
]