Compare commits

..

No commits in common. "04f279dab313e3f888dcd38c59894c781b7c89ee" and "cfd11a98ec514029e20eb8dd6016fb69b70ad029" have entirely different histories.

27 changed files with 884 additions and 641 deletions

View File

@ -1,7 +1,7 @@
// @ts-check // @ts-check
import { defineConfig, envField } from "astro/config" import { defineConfig, envField } from "astro/config"
import paraglide from "@inlang/paraglide-astro" import paraglide from "@inlang/paraglide-astro"
import tailwindcss from "@tailwindcss/vite" import tailwind from "@astrojs/tailwind"
import sitemap from "@astrojs/sitemap" import sitemap from "@astrojs/sitemap"
import svelte from "@astrojs/svelte" import svelte from "@astrojs/svelte"
import node from "@astrojs/node" import node from "@astrojs/node"
@ -20,9 +20,10 @@ export default defineConfig({
output: "server", output: "server",
i18n: { i18n: {
defaultLocale: "nb", defaultLocale: "nb",
locales: ["nb", "en"], locales: ["nb", "en"]
}, },
integrations: [ integrations: [
tailwind(),
sitemap(), sitemap(),
mdx(), mdx(),
svelte(), svelte(),
@ -30,21 +31,18 @@ export default defineConfig({
paraglide({ paraglide({
// recommended settings // recommended settings
project: "./project.inlang", project: "./project.inlang",
outdir: "./src/paraglide", //where your files should be outdir: "./src/paraglide" //where your files should be
}), })
], ],
adapter: node({ adapter: node({
mode: "standalone", mode: "standalone"
}), }),
vite: {
plugins: [tailwindcss()],
},
env: { env: {
schema: { schema: {
DOMAIN: envField.string({ context: "client", access: "public" }), DOMAIN: envField.string({ context: "client", access: "public" }),
URL: envField.string({ context: "client", access: "public" }), URL: envField.string({ context: "client", access: "public" }),
GIT_URL: envField.string({ context: "client", access: "public" }), GIT_URL: envField.string({ context: "client", access: "public" }),
STATUS_URL: envField.string({ context: "client", access: "public" }), STATUS_URL: envField.string({ context: "client", access: "public" })
}, }
}, }
}) })

View File

@ -7,7 +7,6 @@
"contactMe": "Contact me", "contactMe": "Contact me",
"myLinks": "My links", "myLinks": "My links",
"myProjects": "My projects", "myProjects": "My projects",
"uses": "Uses",
"hardware": "Hardware", "hardware": "Hardware",
"accessories": "Accessories", "accessories": "Accessories",
"sourceCode": "Source code", "sourceCode": "Source code",

View File

@ -7,7 +7,6 @@
"contactMe": "Kontakt meg", "contactMe": "Kontakt meg",
"myLinks": "Mine lenker", "myLinks": "Mine lenker",
"myProjects": "Mine prosjekter", "myProjects": "Mine prosjekter",
"uses": "Uses",
"hardware": "Maskinvare", "hardware": "Maskinvare",
"accessories": "Tilbehør", "accessories": "Tilbehør",
"sourceCode": "Kildekode", "sourceCode": "Kildekode",

View File

@ -8,35 +8,34 @@
"build": "paraglide-js compile --project ./project.inlang --outdir ./src/paraglide && astro check && astro build", "build": "paraglide-js compile --project ./project.inlang --outdir ./src/paraglide && astro check && astro build",
"preview": "astro preview", "preview": "astro preview",
"astro": "astro", "astro": "astro",
"type-check": "astro check",
"postinstall": "paraglide-js compile --project ./project.inlang --outdir ./src/paraglide", "postinstall": "paraglide-js compile --project ./project.inlang --outdir ./src/paraglide",
"format": "prettier --write \"./src/**/*.{js,mjs,ts,astro,svelte,css,md,json}\"", "format": "prettier --write \"./src/**/*.{js,mjs,ts,astro,svelte,css,md,json}\"",
"watch-messages": "paraglide-js compile --watch --project ./project.inlang --outdir ./src/paraglide" "watch-messages": "paraglide-js compile --watch --project ./project.inlang --outdir ./src/paraglide"
}, },
"dependencies": { "dependencies": {
"@astrojs/check": "^0.9.4", "@astrojs/check": "^0.9.4",
"@astrojs/mdx": "^4.0.8", "@astrojs/mdx": "^4.0.6",
"@astrojs/node": "9.1.0", "@astrojs/node": "9.0.1",
"@astrojs/sitemap": "^3.2.1", "@astrojs/sitemap": "^3.2.1",
"@astrojs/svelte": "^7.0.4", "@astrojs/svelte": "^7.0.3",
"@iconify-json/pajamas": "^1.2.5", "@astrojs/tailwind": "^5.1.4",
"@iconify-json/pajamas": "^1.2.4",
"@inlang/paraglide-astro": "^0.3.5", "@inlang/paraglide-astro": "^0.3.5",
"@inlang/paraglide-js": "1.11.8", "@inlang/paraglide-js": "1.11.8",
"@tailwindcss/typography": "^0.5.16", "@tailwindcss/typography": "^0.5.16",
"@tailwindcss/vite": "^4.0.6", "astro": "5.1.7",
"astro": "5.3.0",
"astro-icon": "^1.1.5", "astro-icon": "^1.1.5",
"sharp": "^0.33.5", "sharp": "^0.33.5",
"svelte": "^5.20.1", "svelte": "^5.19.0",
"tailwindcss": "^4.0.6", "tailwindcss": "^3.4.17",
"typescript": "^5.7.3" "typescript": "^5.7.3"
}, },
"devDependencies": { "devDependencies": {
"daisyui": "^5.0.0-beta.8", "daisyui": "^4.12.23",
"prettier": "^3.5.1", "prettier": "^3.4.2",
"prettier-plugin-astro": "^0.14.1", "prettier-plugin-astro": "^0.14.1",
"prettier-plugin-svelte": "^3.3.3", "prettier-plugin-svelte": "^3.3.3",
"vite": "^6.1.0" "vite": "^6.0.7"
}, },
"prettier": { "prettier": {
"semi": false, "semi": false,

1370
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -2,28 +2,27 @@
import Select from "./Select.svelte" import Select from "./Select.svelte"
import * as m from "@/paraglide/messages" import * as m from "@/paraglide/messages"
import CollapseList from "@/components/collapse/CollapseList.svelte" import CollapseList from "@/components/collapse/CollapseList.svelte"
import type { CollectionEntry } from "astro:content"
interface Props { export let hardware: any[] = []
uses: CollectionEntry<'uses'>[]
}
const { uses }: Props = $props() const hardwareOptions = hardware.map((item) => ({
const hardwareOptions = uses.map((item) => ({
key: item.id, key: item.id,
value: item.data.title value: item.data.title
})) }))
let selectedHardwareKey = $state(uses[0].id) let selectedHardwareKey: string = hardware[0].id
let selectedHardware = $derived(uses.find((item) => item.id === selectedHardwareKey)!) $: selectedHardware = hardware.find((item) => item.id === selectedHardwareKey)!
// TODO bind to component
function onChange({ detail }: CustomEvent<string>) {
selectedHardwareKey = detail
}
</script> </script>
<div class="px-2 max-w-[750px] sm:min-w-[750px] w-screen"> <div class="px-2 max-w-[750px] sm:min-w-[750px] w-screen">
<h1 class="text-center">{m.uses()}</h1> <h1 class="text-center">{m.hardware()}</h1>
<div> <div>
<Select options={hardwareOptions} bind:selected={selectedHardwareKey} class="mx-auto w-max" /> <Select options={hardwareOptions} on:change={onChange} class="mx-auto w-max" />
</div> </div>
<br /> <br />

View File

@ -1,23 +1,20 @@
<script lang="ts"> <script lang="ts">
import { createEventDispatcher } from "svelte"
// TODO move to types? // TODO move to types?
interface Option<Key> { interface Option {
key: Key key: string
value: string value: string
} }
interface Props<Key = string> { export let options: Option[] = []
selected: Key // TODO bind data instead of dispatching events
options?: Option<Key>[] const dispatch = createEventDispatcher<{ change: string }>()
class?: string
}
let { selected = $bindable(), options = [], class: clazz }: Props = $props()
</script> </script>
<select <select
bind:value={selected} class="select select-bordered w-full max-w-xs ${$$restProps.class}"
class="select select-bordered w-full max-w-xs ${clazz}" on:change={(value) => dispatch("change", value.currentTarget.value)}
> >
{#each options as { key, value }} {#each options as { key, value }}
<option value={key}>{value}</option> <option value={key}>{value}</option>

View File

@ -1,16 +1,10 @@
<script lang="ts"> <script lang="ts">
export let title: string = ""
interface Props {
title?: string
children: any
}
const { title = "", children }: Props = $props()
</script> </script>
<details class="collapse collapse-arrow bg-base-200"> <details class="collapse collapse-arrow bg-base-200">
<summary class="collapse-title text-xl font-medium">{title}</summary> <summary class="collapse-title text-xl font-medium">{title}</summary>
<div class="collapse-content"> <div class="collapse-content">
{@render children()} <slot />
</div> </div>
</details> </details>

View File

@ -1,12 +1,9 @@
<script lang="ts"> <script lang="ts">
import Collapse from "@/components/collapse/Collapse.svelte" import Collapse from "@/components/collapse/Collapse.svelte"
interface Props { export let items: string[] = []
items?: string[] export let title: string = ""
title?: string
}
const { items = [], title = "" }: Props = $props()
</script> </script>
<Collapse title={title}> <Collapse title={title}>

View File

@ -16,8 +16,8 @@ const projectCollection = defineCollection({
}) })
}) })
const usesCollection = defineCollection({ const hardwareCollection = defineCollection({
loader: glob({ pattern: "**\/*.yaml", base: "./src/content/uses" }), loader: glob({ pattern: "**\/*.yaml", base: "./src/content/hardware" }),
schema: z.object({ schema: z.object({
title: z.string(), title: z.string(),
accessories: z.optional(z.array(z.string())), accessories: z.optional(z.array(z.string())),
@ -27,5 +27,5 @@ const usesCollection = defineCollection({
export const collections = { export const collections = {
projects: projectCollection, projects: projectCollection,
uses: usesCollection hardware: hardwareCollection
} }

View File

@ -3,7 +3,7 @@ accessories:
- Gaming chair | Arozzi Mezzo V2 Gaming chair Fabric Black/Red # https://www.komplett.no/product/1079732?noredirect=true - Gaming chair | Arozzi Mezzo V2 Gaming chair Fabric Black/Red # https://www.komplett.no/product/1079732?noredirect=true
- Headset | Logitech PRO X LIGHTSPEED Wireless Gaming Headset # https://www.komplett.no/product/1162749?noredirect=true - Headset | Logitech PRO X LIGHTSPEED Wireless Gaming Headset # https://www.komplett.no/product/1162749?noredirect=true
- Keyboard | Keychron K8 Pro QMK/VIA RGB Gateron Red # https://www.komplett.no/product/1303473/gaming/gaming-utstyr/gamingtastatur/keychron-k8-pro-qmkvia-rgb-gateron-red-traadloest-gamingtastatur-sort - Keyboard | Keychron K8 Pro QMK/VIA RGB Gateron Red # https://www.komplett.no/product/1303473/gaming/gaming-utstyr/gamingtastatur/keychron-k8-pro-qmkvia-rgb-gateron-red-traadloest-gamingtastatur-sort
- Monitor 1 | Philips 34" 34M2C6500/00 # https://www.komplett.no/product/1307753/gaming/gaming-utstyr/gamingskjermer/philips-34-gamingskjerm-34m2c650000 - Monitor 1 | AOC 27" LED FreeSync G2790PX # https://www.komplett.no/product/975642?noredirect=true
- Monitor 2 | Asus 28" 4K LED PB287Q # https://www.komplett.no/product/815114?noredirect=true - Monitor 2 | Asus 28" 4K LED PB287Q # https://www.komplett.no/product/815114?noredirect=true
- Mouse | Logitech G502 HERO Gaming Mouse - Mouse | Logitech G502 HERO Gaming Mouse
- Mousepad | Svive Styx ESGR Gaming Mousepad XXL # https://www.komplett.no/product/985884?noredirect=true - Mousepad | Svive Styx ESGR Gaming Mousepad XXL # https://www.komplett.no/product/985884?noredirect=true

View File

@ -1,3 +1,3 @@
title: Homelab title: Home Server
hardware: hardware:
- b # Graphics cards, CPUs, etc. - b # Graphics cards, CPUs, etc.

View File

@ -20,7 +20,7 @@ const Links: Link[] = [
to: "/links" to: "/links"
}, },
{ {
label: m.uses, label: m.hardware,
to: "/uses" to: "/uses"
}, },
{ {

View File

@ -1,6 +1,5 @@
--- ---
import Layout from "../layouts/Layout.astro" import Layout from "../layouts/Layout.astro"
import "@/styles/global.css"
--- ---
<Layout title="404"> <Layout title="404">

View File

@ -1,7 +1,6 @@
--- ---
import OnePager from "../../components/Greeting.astro" import OnePager from "../../components/Greeting.astro"
import Layout from "../../layouts/Layout.astro" import Layout from "../../layouts/Layout.astro"
import "@/styles/global.css"
--- ---
<Layout title="Welcome"> <Layout title="Welcome">

View File

@ -1,7 +1,6 @@
--- ---
import Layout from "@/layouts/Layout.astro" import Layout from "@/layouts/Layout.astro"
import LinksPage from "@/components/myLinks/LinksPage.astro" import LinksPage from "@/components/myLinks/LinksPage.astro"
import "@/styles/global.css"
--- ---
<Layout title="My links"> <Layout title="My links">
<LinksPage /> <LinksPage />

View File

@ -1,7 +1,6 @@
--- ---
import ProjectPage from "@/components/projects/ProjectPage.astro" import ProjectPage from "@/components/projects/ProjectPage.astro"
import { type GetStaticPathsResult } from "astro" import { type GetStaticPathsResult } from "astro"
import "@/styles/global.css"
// Prerender the page as static HTML during build // Prerender the page as static HTML during build
export const prerender = true export const prerender = true

View File

@ -2,7 +2,6 @@
import { getCollection } from "astro:content" import { getCollection } from "astro:content"
import Layout from "@/layouts/Layout.astro" import Layout from "@/layouts/Layout.astro"
import MyProjectsPage from "@/components/projects/MyProjectsPage.astro" import MyProjectsPage from "@/components/projects/MyProjectsPage.astro"
import "@/styles/global.css"
const projects = await getCollection("projects") const projects = await getCollection("projects")
--- ---

View File

@ -1,12 +1,12 @@
--- ---
import Layout from "@/layouts/Layout.astro" import Layout from "@/layouts/Layout.astro"
import UsesPage from "@/components/UsesPage.svelte" import HardwarePage from "@/components/HardwarePage.svelte"
import "@/styles/global.css" import "@/styles/global.css"
import { getCollection } from "astro:content" import { getCollection } from "astro:content"
const uses = await getCollection("uses") const hardware = await getCollection("hardware")
--- ---
<Layout title="Hardware" class="mx-auto max-w-[750px]"> <Layout title="Hardware" class="mx-auto max-w-[750px]">
<UsesPage server:defer uses={uses} /> <HardwarePage server:defer hardware={hardware} />
</Layout> </Layout>

View File

@ -1,9 +1,6 @@
--- ---
import Layout from "../layouts/Layout.astro" import Layout from "../layouts/Layout.astro"
import Greeting from "../components/Greeting.astro" import Greeting from "../components/Greeting.astro"
// https://slashpages.net/
--- ---
<Layout title="Velkommen"> <Layout title="Velkommen">

View File

@ -1,7 +1,6 @@
--- ---
import Layout from "@/layouts/Layout.astro" import Layout from "@/layouts/Layout.astro"
import LinksPage from "@/components/myLinks/LinksPage.astro" import LinksPage from "@/components/myLinks/LinksPage.astro"
import "@/styles/global.css"
--- ---
<Layout title="Mine lenker"> <Layout title="Mine lenker">
<LinksPage /> <LinksPage />

View File

@ -1,7 +1,6 @@
--- ---
import ProjectPage from "@/components/projects/ProjectPage.astro" import ProjectPage from "@/components/projects/ProjectPage.astro"
import { type GetStaticPathsResult } from "astro" import { type GetStaticPathsResult } from "astro"
import "@/styles/global.css"
// Prerender the page as static HTML during build // Prerender the page as static HTML during build
export const prerender = true export const prerender = true

View File

@ -2,7 +2,6 @@
import { getCollection } from "astro:content" import { getCollection } from "astro:content"
import Layout from "@/layouts/Layout.astro" import Layout from "@/layouts/Layout.astro"
import MyProjectsPage from "@/components/projects/MyProjectsPage.astro" import MyProjectsPage from "@/components/projects/MyProjectsPage.astro"
import "@/styles/global.css"
const projects = await getCollection("projects") const projects = await getCollection("projects")
--- ---

View File

@ -1,12 +1,12 @@
--- ---
import Layout from "@/layouts/Layout.astro" import Layout from "@/layouts/Layout.astro"
import UsesPage from "@/components/UsesPage.svelte" import HardwarePage from "@/components/HardwarePage.svelte"
import "@/styles/global.css" import "@/styles/global.css"
import { getCollection } from "astro:content" import { getCollection } from "astro:content"
const uses = await getCollection("uses") const hardware = await getCollection("hardware")
--- ---
<Layout title="Hardware" class="mx-auto max-w-[750px]"> <Layout title="Hardware" class="mx-auto max-w-[750px]">
<UsesPage client:load uses={uses} /> <HardwarePage server:defer hardware={hardware} />
</Layout> </Layout>

View File

@ -1,6 +1,6 @@
@import "tailwindcss"; @tailwind base;
@plugin "@tailwindcss/typography"; @tailwind components;
@plugin "daisyui"; @tailwind utilities;
@layer utilities { @layer utilities {
.debug { .debug {

8
tailwind.config.mjs Normal file
View File

@ -0,0 +1,8 @@
/** @type {import("tailwindcss").Config} */
export default {
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
theme: {
extend: {}
},
plugins: [require("@tailwindcss/typography"), require("daisyui")]
}