[READ-ONLY] Mirror of https://github.com/flo-bit/blog-template. minimalistic astro blog template flo-bit.dev/blog-template/
astro blog template
0

Configure Feed

Select the types of activity you want to include in your feed.

fix warnings

Florian (Oct 27, 2024, 1:49 AM +0200) b16e0a5f 5ca025cc

+43 -60
+12
README.md
··· 60 60 61 61 - `description.md` is used for the homepage description 62 62 - `about.md` is used for the about page 63 + 64 + ## Notes 65 + 66 + Search currently only works in production mode (i.e. when running `npm run build`) not in dev mode (`npm run dev`). 67 + 68 + ## Credits 69 + 70 + Adopted from the default astro blog template when running `npm create astro@latest`. 71 + 72 + ## License 73 + 74 + MIT.
+20 -43
package-lock.json
··· 1 1 { 2 - "name": "astro-scaffold", 2 + "name": "blog-template", 3 3 "version": "0.0.1", 4 4 "lockfileVersion": 3, 5 5 "requires": true, 6 6 "packages": { 7 7 "": { 8 - "name": "astro-scaffold", 8 + "name": "blog-template", 9 9 "version": "0.0.1", 10 + "license": "MIT", 10 11 "dependencies": { 11 12 "@astrojs/check": "^0.9.4", 12 13 "@astrojs/mdx": "^3.1.8", ··· 22 23 "typescript": "^5.6.3" 23 24 }, 24 25 "devDependencies": { 26 + "@sveltejs/vite-plugin-svelte": "^4.0.0-next.6", 25 27 "@tailwindcss/typography": "^0.5.15", 26 28 "pagefind": "^1.1.1", 27 29 "vite-plugin-pagefind": "^0.2.10" ··· 1809 1811 "integrity": "sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==" 1810 1812 }, 1811 1813 "node_modules/@sveltejs/vite-plugin-svelte": { 1812 - "version": "3.1.2", 1813 - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-3.1.2.tgz", 1814 - "integrity": "sha512-Txsm1tJvtiYeLUVRNqxZGKR/mI+CzuIQuc2gn+YCs9rMTowpNZ2Nqt53JdL8KF9bLhAf2ruR/dr9eZCwdTriRA==", 1814 + "version": "4.0.0", 1815 + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-4.0.0.tgz", 1816 + "integrity": "sha512-kpVJwF+gNiMEsoHaw+FJL76IYiwBikkxYU83+BpqQLdVMff19KeRKLd2wisS8niNBMJ2omv5gG+iGDDwd8jzag==", 1815 1817 "dependencies": { 1816 - "@sveltejs/vite-plugin-svelte-inspector": "^2.1.0", 1817 - "debug": "^4.3.4", 1818 + "@sveltejs/vite-plugin-svelte-inspector": "^3.0.0-next.0||^3.0.0", 1819 + "debug": "^4.3.7", 1818 1820 "deepmerge": "^4.3.1", 1819 1821 "kleur": "^4.1.5", 1820 - "magic-string": "^0.30.10", 1821 - "svelte-hmr": "^0.16.0", 1822 - "vitefu": "^0.2.5" 1822 + "magic-string": "^0.30.12", 1823 + "vitefu": "^1.0.3" 1823 1824 }, 1824 1825 "engines": { 1825 - "node": "^18.0.0 || >=20" 1826 + "node": "^18.0.0 || ^20.0.0 || >=22" 1826 1827 }, 1827 1828 "peerDependencies": { 1828 - "svelte": "^4.0.0 || ^5.0.0-next.0", 1829 + "svelte": "^5.0.0-next.96 || ^5.0.0", 1829 1830 "vite": "^5.0.0" 1830 1831 } 1831 1832 }, 1832 1833 "node_modules/@sveltejs/vite-plugin-svelte-inspector": { 1833 - "version": "2.1.0", 1834 - "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-2.1.0.tgz", 1835 - "integrity": "sha512-9QX28IymvBlSCqsCll5t0kQVxipsfhFFL+L2t3nTWfXnddYwxBuAEtTtlaVQpRz9c37BhJjltSeY4AJSC03SSg==", 1834 + "version": "3.0.1", 1835 + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-3.0.1.tgz", 1836 + "integrity": "sha512-2CKypmj1sM4GE7HjllT7UKmo4Q6L5xFRd7VMGEWhYnZ+wc6AUVU01IBd7yUi6WnFndEwWoMNOd6e8UjoN0nbvQ==", 1836 1837 "dependencies": { 1837 - "debug": "^4.3.4" 1838 + "debug": "^4.3.7" 1838 1839 }, 1839 1840 "engines": { 1840 - "node": "^18.0.0 || >=20" 1841 + "node": "^18.0.0 || ^20.0.0 || >=22" 1841 1842 }, 1842 1843 "peerDependencies": { 1843 - "@sveltejs/vite-plugin-svelte": "^3.0.0", 1844 - "svelte": "^4.0.0 || ^5.0.0-next.0", 1844 + "@sveltejs/vite-plugin-svelte": "^4.0.0-next.0||^4.0.0", 1845 + "svelte": "^5.0.0-next.96 || ^5.0.0", 1845 1846 "vite": "^5.0.0" 1846 - } 1847 - }, 1848 - "node_modules/@sveltejs/vite-plugin-svelte/node_modules/svelte-hmr": { 1849 - "version": "0.16.0", 1850 - "resolved": "https://registry.npmjs.org/svelte-hmr/-/svelte-hmr-0.16.0.tgz", 1851 - "integrity": "sha512-Gyc7cOS3VJzLlfj7wKS0ZnzDVdv3Pn2IuVeJPk9m2skfhcu5bq3wtIZyQGggr7/Iim5rH5cncyQft/kRLupcnA==", 1852 - "engines": { 1853 - "node": "^12.20 || ^14.13.1 || >= 16" 1854 - }, 1855 - "peerDependencies": { 1856 - "svelte": "^3.19.0 || ^4.0.0" 1857 - } 1858 - }, 1859 - "node_modules/@sveltejs/vite-plugin-svelte/node_modules/vitefu": { 1860 - "version": "0.2.5", 1861 - "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-0.2.5.tgz", 1862 - "integrity": "sha512-SgHtMLoqaeeGnd2evZ849ZbACbnwQCIwRH57t18FxcXoZop0uQu0uzlIhJBlF/eWVzuce0sHeqPcDo+evVcg8Q==", 1863 - "peerDependencies": { 1864 - "vite": "^3.0.0 || ^4.0.0 || ^5.0.0" 1865 - }, 1866 - "peerDependenciesMeta": { 1867 - "vite": { 1868 - "optional": true 1869 - } 1870 1847 } 1871 1848 }, 1872 1849 "node_modules/@tailwindcss/forms": {
+4
package.json
··· 25 25 "typescript": "^5.6.3" 26 26 }, 27 27 "devDependencies": { 28 + "@sveltejs/vite-plugin-svelte": "^4.0.0-next.6", 28 29 "@tailwindcss/typography": "^0.5.15", 29 30 "pagefind": "^1.1.1", 30 31 "vite-plugin-pagefind": "^0.2.10" 32 + }, 33 + "overrides": { 34 + "@sveltejs/vite-plugin-svelte": "^4.0.0-next.6" 31 35 }, 32 36 "license": "MIT" 33 37 }
+1 -3
src/components/search/CommandPalette.svelte
··· 35 35 for (let i = 0; i < search.results.length && i < 5; i++) { 36 36 let result = await search.results[i].data(); 37 37 38 - console.log(result); 39 - 40 38 let excerpt = result.excerpt; 41 39 // replace <mark> tags with <span class="bg-pink-600/10"> 42 40 excerpt = excerpt.replaceAll( ··· 145 143 $showSearch = false; 146 144 } 147 145 } 148 - console.log(event, event.key); 146 + 149 147 // on arrow down 150 148 if (event.key == "ArrowDown") { 151 149 currentSelection++;
-2
src/components/search/Search.svelte
··· 4 4 5 5 <button 6 6 onclick={() => { 7 - console.log("clicked"); 8 7 $showSearch = true; 9 - console.log($showSearch); 10 8 }} 11 9 > 12 10 <div class="sr-only">search</div>
+2 -3
src/pages/open-graph/[...route].ts
··· 1 1 import { OGImageRoute } from "astro-og-canvas"; 2 - import { getCollection } from "astro:content"; 3 2 import { SITE_DESCRIPTION, SITE_TITLE } from "../../config.json"; 3 + import { getBlogPosts } from "src/utils"; 4 4 5 - const posts = await getCollection("blog"); 5 + const posts = await getBlogPosts(); 6 6 7 7 // turn posts into an object with slugs as keys, and title and description as values 8 8 // { slug: { title, description } } ··· 25 25 >, 26 26 ); 27 27 28 - console.log(pages); 29 28 export const { getStaticPaths, GET } = OGImageRoute({ 30 29 // Tell us the name of your dynamic route segment. 31 30 // In this case it’s `route`, because the file is named `[...route].ts`.
-4
src/pages/pages/[...index].astro
··· 3 3 SITE_TITLE, 4 4 SITE_DESCRIPTION, 5 5 POSTS_PER_PAGE, 6 - ACCENT_COLOR, 7 - BASE_COLOR, 8 6 } from "../../config.json"; 9 7 10 8 import Header from "$components/Header.astro"; ··· 12 10 import BaseLayout from "$layouts/BaseLayout.astro"; 13 11 import BlogEntry from "$components/BlogEntry.astro"; 14 12 import Pagination from "$components/Pagination.astro"; 15 - import { colorBaseClasses, colorAccentClasses } from "src/colors"; 16 13 import { getBlogPosts } from "src/utils"; 17 14 18 - import { Content } from "$content/info/description.md"; 19 15 import BlogPost from "$layouts/BlogPost.astro"; 20 16 21 17 export async function getStaticPaths() {
+2 -2
src/pages/rss.xml.js
··· 1 1 import rss from "@astrojs/rss"; 2 - import { getCollection } from "astro:content"; 3 2 import { SITE_TITLE, SITE_DESCRIPTION } from "../config.json"; 3 + import { getBlogPosts } from "src/utils"; 4 4 5 5 export async function GET(context) { 6 - const posts = await getCollection("blog"); 6 + const posts = await getBlogPosts(); 7 7 return rss({ 8 8 title: SITE_TITLE, 9 9 description: SITE_DESCRIPTION,
-2
src/pages/tags/[...tag]/[...index].astro
··· 7 7 BASE_COLOR, 8 8 } from "../../../config.json"; 9 9 10 - import { getCollection } from "astro:content"; 11 - 12 10 import Header from "$components/Header.astro"; 13 11 import Footer from "$components/Footer.astro"; 14 12 import BaseLayout from "$layouts/BaseLayout.astro";
+2 -1
tsconfig.json
··· 12 12 "$assets/*": ["src/assets/*"], 13 13 "$examples/*": ["src/examples/*"] 14 14 } 15 - } 15 + }, 16 + "exclude": ["public/pagefind", "dist"] 16 17 }