diff --git a/package-lock.json b/package-lock.json index 082ebc0..e9e01ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -62,6 +62,7 @@ "svelte": "^4.2.12", "svelte-check": "^3.6.2", "svelte-preprocess": "^5.1.1", + "sveltekit-search-params": "^2.1.2", "tailwindcss": "^3.4.1", "tslib": "^2.6.2", "typescript": "^5.3.2", @@ -1243,7 +1244,6 @@ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.0.2.tgz", "integrity": "sha512-MpmF/cju2HqUls50WyTHQBZUV3ovV/Uk8k66AN2gwHogNAG8wnW8xtZDhzNBsFJJuvmq1qnzA5kE7YfMJNFv2Q==", "dev": true, - "peer": true, "dependencies": { "@sveltejs/vite-plugin-svelte-inspector": "^2.0.0", "debug": "^4.3.4", @@ -1266,7 +1266,6 @@ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-2.0.0.tgz", "integrity": "sha512-gjr9ZFg1BSlIpfZ4PRewigrvYmHWbDrq2uvvPB1AmTWKuM+dI1JXQSUu2pIrYLb/QncyiIGkFDFKTwJ0XqQZZg==", "dev": true, - "peer": true, "dependencies": { "debug": "^4.3.4" }, @@ -2270,7 +2269,6 @@ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -7258,7 +7256,6 @@ "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.3.tgz", "integrity": "sha512-41snaPswvSf8TJUhlkoJBekRrABDXDMdpNpT2tfHIv4JuhgvHqLMhEPGtaQn0BmbNSTkuz2Ed20DF2eHw0SmBQ==", "dev": true, - "peer": true, "engines": { "node": "^12.20 || ^14.13.1 || >= 16" }, @@ -7329,6 +7326,19 @@ } } }, + "node_modules/sveltekit-search-params": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/sveltekit-search-params/-/sveltekit-search-params-2.1.2.tgz", + "integrity": "sha512-wh5WSo46wz48MdWvpchVGrOjoDmbmsNJ7dUToSZ4L1SQ2LOasmTjAAlFhfG/EFvEhR34phRzLF7BjE0ZHzx1Uw==", + "dev": true, + "dependencies": { + "@sveltejs/vite-plugin-svelte": "^3.0.2" + }, + "peerDependencies": { + "@sveltejs/kit": "^1.0.0 || ^2.0.0", + "svelte": "^3.55.0 || ^4.0.0 || ^5.0.0" + } + }, "node_modules/tailwindcss": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.1.tgz", @@ -8148,7 +8158,6 @@ "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", "dev": true, - "peer": true, "peerDependencies": { "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" }, @@ -9031,7 +9040,6 @@ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.0.2.tgz", "integrity": "sha512-MpmF/cju2HqUls50WyTHQBZUV3ovV/Uk8k66AN2gwHogNAG8wnW8xtZDhzNBsFJJuvmq1qnzA5kE7YfMJNFv2Q==", "dev": true, - "peer": true, "requires": { "@sveltejs/vite-plugin-svelte-inspector": "^2.0.0", "debug": "^4.3.4", @@ -9047,7 +9055,6 @@ "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-2.0.0.tgz", "integrity": "sha512-gjr9ZFg1BSlIpfZ4PRewigrvYmHWbDrq2uvvPB1AmTWKuM+dI1JXQSUu2pIrYLb/QncyiIGkFDFKTwJ0XqQZZg==", "dev": true, - "peer": true, "requires": { "debug": "^4.3.4" } @@ -9724,8 +9731,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", - "dev": true, - "peer": true + "dev": true }, "dequal": { "version": "2.0.3", @@ -13375,7 +13381,6 @@ "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.15.3.tgz", "integrity": "sha512-41snaPswvSf8TJUhlkoJBekRrABDXDMdpNpT2tfHIv4JuhgvHqLMhEPGtaQn0BmbNSTkuz2Ed20DF2eHw0SmBQ==", "dev": true, - "peer": true, "requires": {} }, "svelte-preprocess": { @@ -13391,6 +13396,15 @@ "strip-indent": "^3.0.0" } }, + "sveltekit-search-params": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/sveltekit-search-params/-/sveltekit-search-params-2.1.2.tgz", + "integrity": "sha512-wh5WSo46wz48MdWvpchVGrOjoDmbmsNJ7dUToSZ4L1SQ2LOasmTjAAlFhfG/EFvEhR34phRzLF7BjE0ZHzx1Uw==", + "dev": true, + "requires": { + "@sveltejs/vite-plugin-svelte": "^3.0.2" + } + }, "tailwindcss": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.1.tgz", @@ -13964,7 +13978,6 @@ "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", "dev": true, - "peer": true, "requires": {} }, "vscode-oniguruma": { diff --git a/package.json b/package.json index 08f0ae4..97e2d73 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "svelte": "^4.2.12", "svelte-check": "^3.6.2", "svelte-preprocess": "^5.1.1", + "sveltekit-search-params": "^2.1.2", "tailwindcss": "^3.4.1", "tslib": "^2.6.2", "typescript": "^5.3.2", diff --git a/src/lib/siteConfig.js b/src/lib/siteConfig.js index a8ca302..40ec4a1 100644 --- a/src/lib/siteConfig.js +++ b/src/lib/siteConfig.js @@ -14,6 +14,8 @@ export const STEAM_ID = '76561197965804852' // need process.env.STEAM_API_KEY export const APPROVED_POSTERS_GH_USERNAME = ['tjheffner'] export const GH_PUBLISHED_TAGS = ['Published'] +export const POST_CATEGORIES = ['Note', 'Recipe', 'Technical', 'DIY'] + // auto generated variables export const REPO_URL = 'https://github.com/' + GH_USER_REPO export const REPO_OWNER = GH_USER_REPO.split('/')[0] diff --git a/src/routes/(main)/+page.svelte b/src/routes/(main)/+page.svelte index 4ba3a9a..992ff7e 100644 --- a/src/routes/(main)/+page.svelte +++ b/src/routes/(main)/+page.svelte @@ -49,7 +49,7 @@

This site is perpetually under construction but coming along. 😎

- It's mostly a place for me to post recipes I like and diff --git a/src/routes/(main)/blog/+page.svelte b/src/routes/(main)/blog/+page.svelte index dbf6401..b41ab95 100644 --- a/src/routes/(main)/blog/+page.svelte +++ b/src/routes/(main)/blog/+page.svelte @@ -1,107 +1,44 @@ @@ -125,13 +62,13 @@ to filter.

+
Filter: - - - - - + {#each POST_CATEGORIES as availableCategory} +
+ + +
+ {/each}

- {#if list.length} + {#if list?.length} - {#if !showAll} + {#if isTruncated}
{/if} - {:else if filterStr} + {:else if $search && $selectedCategories.length === 0}
No posts found for - {filterStr}. + {$search}.
{:else} -
Search something else!
+
No posts found with this combination of filters. Search something else!
+ {/if}