diff --git a/package-lock.json b/package-lock.json index 7561714..3f75eae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "coryd.dev", - "version": "5.1.5", + "version": "5.1.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "coryd.dev", - "version": "5.1.5", + "version": "5.1.6", "license": "MIT", "dependencies": { "html-minifier-terser": "7.2.0", diff --git a/package.json b/package.json index 0c9d794..580dae9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "5.1.5", + "version": "5.1.6", "description": "The source for my personal site. Built using 11ty (and other tools).", "type": "module", "engines": { diff --git a/src/data/topTags.js b/src/data/topTags.js index d457f77..2348c3b 100644 --- a/src/data/topTags.js +++ b/src/data/topTags.js @@ -22,6 +22,5 @@ const fetchTopTags = async () => { }; export default async function () { - console.log(await fetchTopTags()) return await fetchTopTags(); } diff --git a/src/includes/blocks/top-tags.liquid b/src/includes/blocks/top-tags.liquid index a0ef8ab..aef2881 100644 --- a/src/includes/blocks/top-tags.liquid +++ b/src/includes/blocks/top-tags.liquid @@ -1 +1 @@ -

{{ label }}{%- for tag in tags %} #{{ tag.tag }}{%- endfor -%}

+

{{ label }}{%- for tag in tags %} #{{ tag.tag }}{%- endfor -%}

diff --git a/src/includes/fetchers/book.php.liquid b/src/includes/fetchers/book.php.liquid index e72c94e..93995f2 100644 --- a/src/includes/fetchers/book.php.liquid +++ b/src/includes/fetchers/book.php.liquid @@ -14,22 +14,34 @@ $filePath = __DIR__ . "/years/{$year}.html"; if (file_exists($filePath)) { - echo file_get_contents($filePath); - exit(); + readfile($filePath); } else { - echo file_get_contents(__DIR__ . "/../404/index.html"); + http_response_code(404); + header("Content-Type: text/html; charset=utf-8"); + readfile(__DIR__ . "/../404/index.html"); exit(); } + exit(); } - if ($url === "books/years" || $url === "books") { - $indexPath = $url === "books" ? "index.html" : __DIR__ . "/../404/index.html"; - readfile($indexPath); + if ($url === "books") { + http_response_code(200); + header("Content-Type: text/html; charset=utf-8"); + readfile(__DIR__ . "/index.html"); + exit(); + } + + if ($url === "books/years") { + http_response_code(404); + header("Content-Type: text/html; charset=utf-8"); + readfile(__DIR__ . "/../404/index.html"); exit(); } if (!preg_match('/^books\/[\w-]+$/', $url)) { - echo file_get_contents(__DIR__ . "/../404/index.html"); + http_response_code(404); + header("Content-Type: text/html; charset=utf-8"); + readfile(__DIR__ . "/../404/index.html"); exit(); } @@ -37,7 +49,9 @@ $book = $fetcher->fetch($url); if (!$book) { - echo file_get_contents(__DIR__ . "/../404/index.html"); + http_response_code(404); + header("Content-Type: text/html; charset=utf-8"); + readfile(__DIR__ . "/../404/index.html"); exit(); } diff --git a/src/includes/media/music/charts/recent.liquid b/src/includes/media/music/charts/recent.liquid index b40c6e3..3217642 100644 --- a/src/includes/media/music/charts/recent.liquid +++ b/src/includes/media/music/charts/recent.liquid @@ -22,7 +22,7 @@ {{ item.chart.subtext }} -