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
import { defineConfig, envField } from "astro/config"
import paraglide from "@inlang/paraglide-astro"
import tailwindcss from "@tailwindcss/vite"
import tailwind from "@astrojs/tailwind"
import sitemap from "@astrojs/sitemap"
import svelte from "@astrojs/svelte"
import node from "@astrojs/node"
@ -20,9 +20,10 @@ export default defineConfig({
output: "server",
i18n: {
defaultLocale: "nb",
locales: ["nb", "en"],
locales: ["nb", "en"]
},
integrations: [
tailwind(),
sitemap(),
mdx(),
svelte(),
@ -30,21 +31,18 @@ export default defineConfig({
paraglide({
// recommended settings
project: "./project.inlang",
outdir: "./src/paraglide", //where your files should be
}),
outdir: "./src/paraglide" //where your files should be
})
],
adapter: node({
mode: "standalone",
mode: "standalone"
}),
vite: {
plugins: [tailwindcss()],
},
env: {
schema: {
DOMAIN: envField.string({ context: "client", access: "public" }),
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",
"myLinks": "My links",
"myProjects": "My projects",
"uses": "Uses",
"hardware": "Hardware",
"accessories": "Accessories",
"sourceCode": "Source code",

View File

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

View File

@ -8,35 +8,34 @@
"build": "paraglide-js compile --project ./project.inlang --outdir ./src/paraglide && astro check && astro build",
"preview": "astro preview",
"astro": "astro",
"type-check": "astro check",
"postinstall": "paraglide-js compile --project ./project.inlang --outdir ./src/paraglide",
"format": "prettier --write \"./src/**/*.{js,mjs,ts,astro,svelte,css,md,json}\"",
"watch-messages": "paraglide-js compile --watch --project ./project.inlang --outdir ./src/paraglide"
},
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/mdx": "^4.0.8",
"@astrojs/node": "9.1.0",
"@astrojs/mdx": "^4.0.6",
"@astrojs/node": "9.0.1",
"@astrojs/sitemap": "^3.2.1",
"@astrojs/svelte": "^7.0.4",
"@iconify-json/pajamas": "^1.2.5",
"@astrojs/svelte": "^7.0.3",
"@astrojs/tailwind": "^5.1.4",
"@iconify-json/pajamas": "^1.2.4",
"@inlang/paraglide-astro": "^0.3.5",
"@inlang/paraglide-js": "1.11.8",
"@tailwindcss/typography": "^0.5.16",
"@tailwindcss/vite": "^4.0.6",
"astro": "5.3.0",
"astro": "5.1.7",
"astro-icon": "^1.1.5",
"sharp": "^0.33.5",
"svelte": "^5.20.1",
"tailwindcss": "^4.0.6",
"svelte": "^5.19.0",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.3"
},
"devDependencies": {
"daisyui": "^5.0.0-beta.8",
"prettier": "^3.5.1",
"daisyui": "^4.12.23",
"prettier": "^3.4.2",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-svelte": "^3.3.3",
"vite": "^6.1.0"
"vite": "^6.0.7"
},
"prettier": {
"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 * as m from "@/paraglide/messages"
import CollapseList from "@/components/collapse/CollapseList.svelte"
import type { CollectionEntry } from "astro:content"
interface Props {
uses: CollectionEntry<'uses'>[]
}
export let hardware: any[] = []
const { uses }: Props = $props()
const hardwareOptions = uses.map((item) => ({
const hardwareOptions = hardware.map((item) => ({
key: item.id,
value: item.data.title
}))
let selectedHardwareKey = $state(uses[0].id)
let selectedHardware = $derived(uses.find((item) => item.id === selectedHardwareKey)!)
let selectedHardwareKey: string = hardware[0].id
$: selectedHardware = hardware.find((item) => item.id === selectedHardwareKey)!
// TODO bind to component
function onChange({ detail }: CustomEvent<string>) {
selectedHardwareKey = detail
}
</script>
<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>
<Select options={hardwareOptions} bind:selected={selectedHardwareKey} class="mx-auto w-max" />
<Select options={hardwareOptions} on:change={onChange} class="mx-auto w-max" />
</div>
<br />

View File

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

View File

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

View File

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

View File

@ -16,8 +16,8 @@ const projectCollection = defineCollection({
})
})
const usesCollection = defineCollection({
loader: glob({ pattern: "**\/*.yaml", base: "./src/content/uses" }),
const hardwareCollection = defineCollection({
loader: glob({ pattern: "**\/*.yaml", base: "./src/content/hardware" }),
schema: z.object({
title: z.string(),
accessories: z.optional(z.array(z.string())),
@ -27,5 +27,5 @@ const usesCollection = defineCollection({
export const collections = {
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
- 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
- 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
- Mouse | Logitech G502 HERO Gaming Mouse
- 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:
- b # Graphics cards, CPUs, etc.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
@import "tailwindcss";
@plugin "@tailwindcss/typography";
@plugin "daisyui";
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer utilities {
.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")]
}