Compare commits

..

12 Commits

Author SHA1 Message Date
ddbb5bc09b 👷 Merge into single docker compose file
All checks were successful
Build and deploy website / build (push) Successful in 1m8s
2025-07-03 19:05:43 +02:00
53a0881051 👷 Update ref keys and master to develop on develop step 2025-07-03 19:05:42 +02:00
68b752e15f 👷 Staging from develop branch 2025-07-03 19:05:42 +02:00
b524091d38 🔥 Remove prettier 2025-07-03 19:05:42 +02:00
29887ab25c Update git domain 2025-07-03 19:05:42 +02:00
1e0ab6b0c8 🎨 Fix lint errors using Biome 2025-07-03 19:05:42 +02:00
45226136f3 🎨 Format using Biome 2025-07-01 19:45:02 +02:00
a859439353 Adde Biome formatter and linter 2025-07-01 19:43:59 +02:00
969660abc8 ❄️ Add Nix shell 2025-07-01 19:20:26 +02:00
99aced7367 📦 Update dependencies 2025-07-01 19:09:53 +02:00
78b333e9f7 ✍️ Update TODO.md 2025-07-01 19:09:24 +02:00
1d04befff1 🐛 Fix trailing slash 2025-07-01 19:08:34 +02:00
16 changed files with 1585 additions and 942 deletions

2
.env
View File

@ -1,3 +1,3 @@
DOMAIN="martials.no" DOMAIN="martials.no"
GIT_URL=https://git.$DOMAIN GIT_URL=https://code.$DOMAIN
STATUS_URL="https://status.$DOMAIN/status/home" STATUS_URL="https://status.$DOMAIN/status/home"

View File

@ -3,11 +3,16 @@
- [ ] License - [ ] License
## Code ## Code
- [ ] Nix Shell - [x] Nix Shell
- [ ] Analytics - [ ] Analytics
- [ ] Organize code better - [ ] Organize code better
- [ ] Type slug of project - [ ] Type slug of project
## CI/CD
- [ ] Staging environment
- [ ] Deploy to staging environment on push to master
- [ ] Deploy to production environment on push tag to master
## SEO ## SEO
- [ ] Meta tags on each page - [ ] Meta tags on each page

57
biome.jsonc Normal file
View File

@ -0,0 +1,57 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": ["./src/paraglide"],
"include": ["./src/**"]
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"semicolons": "asNeeded",
"arrowParentheses": "asNeeded"
}
},
"overrides": [
{
"include": ["*.astro"],
"linter": {
"rules": {
"style": {
"useConst": "off",
"useImportType": "off"
}
}
}
},
{
"include": ["*.svelte"],
"linter": {
"rules": {
"style": {
"useConst": "off",
"useImportType": "off"
}
}
}
}
]
}

27
flake.lock generated Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1751211869,
"narHash": "sha256-1Cu92i1KSPbhPCKxoiVG5qnoRiKTgR5CcGSRyLpOd7Y=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b43c397f6c213918d6cfe6e3550abfe79b5d1c51",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

37
flake.nix Normal file
View File

@ -0,0 +1,37 @@
{
description = "martials.no Development environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
};
outputs = { nixpkgs, ... }:
let
system = "x86_64-linux";
in
{
devShells.${system}.default =
let
pkgs = import nixpkgs {
inherit system;
};
in
pkgs.mkShell {
packages = with pkgs; [
git
] ++ [
# Node
nodejs_22
pnpm
] ++ [
nodePackages.prettier
biome
];
shellHook = ''
pnpm install
fish
'';
};
};
}

View File

@ -10,49 +10,32 @@
"astro": "astro", "astro": "astro",
"type-check": "astro check", "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": "biome format --write .",
"lint": "biome lint --write .",
"lint:fix": "biome check --write .",
"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.3.0",
"@astrojs/node": "9.1.1", "@astrojs/node": "9.2.2",
"@astrojs/sitemap": "^3.2.1", "@astrojs/sitemap": "^3.4.1",
"@astrojs/svelte": "^7.0.4", "@astrojs/svelte": "^7.1.0",
"@iconify-json/pajamas": "^1.2.5", "@iconify-json/pajamas": "^1.2.11",
"@inlang/paraglide-astro": "^0.3.5", "@inlang/paraglide-astro": "^0.4.1",
"@inlang/paraglide-js": "1.11.8", "@inlang/paraglide-js": "2.1.0",
"@tailwindcss/typography": "^0.5.16", "@tailwindcss/typography": "^0.5.16",
"@tailwindcss/vite": "^4.0.9", "@tailwindcss/vite": "^4.1.11",
"astro": "^5.4.1 ", "astro": "^5.10.2",
"astro-icon": "^1.1.5", "astro-icon": "^1.1.5",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"sharp": "^0.33.5", "sharp": "^0.34.2",
"svelte": "^5.20.4", "svelte": "^5.34.9",
"tailwindcss": "^4.0.9", "tailwindcss": "^4.1.11",
"typescript": "^5.7.3" "typescript": "^5.8.3"
}, },
"devDependencies": { "devDependencies": {
"daisyui": "^5.0.0", "daisyui": "^5.0.43",
"prettier": "^3.5.2", "vite": "^7.0.0"
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-svelte": "^3.3.3",
"vite": "^6.2.0"
},
"prettier": {
"semi": false,
"singleQuote": false,
"plugins": [
"prettier-plugin-astro",
"prettier-plugin-svelte"
],
"overrides": [
{
"files": "**/*.astro",
"options": {
"parser": "astro"
}
}
]
} }
} }

2127
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@ let paths: string[]
if (pathname === "/") { if (pathname === "/") {
paths = ["~"] paths = ["~"]
} else { } else {
paths = ["~", ...pathname.split("/").slice(1)] paths = ["~", ...pathname.split("/").filter(x => x)]
} }
function getLink(path: string): NavLink { function getLink(path: string): NavLink {

View File

@ -53,11 +53,7 @@ LinkedIn: linkedin.com/in/johndoe`,
if (input === "clear") { if (input === "clear") {
history = [] history = []
} else { } else {
history = [ history = [...history, `${currentDir} $ ${input}`, executeCommand(input)]
...history,
`${currentDir} $ ${input}`,
executeCommand(input),
]
} }
input = "" input = ""
} }

View File

@ -16,7 +16,10 @@ interface Props {
const { project } = Astro.props const { project } = Astro.props
const entry = await getEntry("projects", project) const entry = await getEntry("projects", project)
const { Content } = await render(entry!) if (!entry) {
throw new Error("Project not found")
}
const { Content } = await render(entry)
const { const {
lang, lang,
title, title,
@ -28,7 +31,7 @@ const {
source, source,
createdAt, createdAt,
updatedAt, updatedAt,
} = entry!.data } = entry.data
function localeDateString(isoString: string): string { function localeDateString(isoString: string): string {
let template = "DD-MM-YYYY" let template = "DD-MM-YYYY"

View File

@ -2,7 +2,7 @@ import { defineCollection, z } from "astro:content"
import { glob } from "astro/loaders" import { glob } from "astro/loaders"
const projectCollection = defineCollection({ const projectCollection = defineCollection({
loader: glob({ pattern: "**\/*.mdx", base: "./src/content/projects" }), loader: glob({ pattern: "**/*.mdx", base: "./src/content/projects" }),
schema: ({ image }) => schema: ({ image }) =>
z.object({ z.object({
lang: z.union([z.literal("en"), z.literal("nb")]), lang: z.union([z.literal("en"), z.literal("nb")]),
@ -19,7 +19,7 @@ const projectCollection = defineCollection({
}) })
const usesCollection = defineCollection({ const usesCollection = defineCollection({
loader: glob({ pattern: "**\/*.yaml", base: "./src/content/uses" }), loader: glob({ pattern: "**/*.yaml", base: "./src/content/uses" }),
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())),

View File

@ -52,9 +52,8 @@ export function localizePathname(
const rest = pathnameParts.slice(2) const rest = pathnameParts.slice(2)
if (rest.length > 0) { if (rest.length > 0) {
return `${localizedPathname}/${rest.join("/")}` return `${localizedPathname}/${rest.join("/")}`
} else {
return localizedPathname
} }
return localizedPathname
} }
return pathname return pathname
} }
@ -71,13 +70,14 @@ export function isAbsolutePathname(path: string): path is AbsolutePathname {
} }
export function isNavLink(path: string): path is NavLink { export function isNavLink(path: string): path is NavLink {
let basePath = path
if (path.startsWith("/en")) { if (path.startsWith("/en")) {
path = path.slice(2) basePath = path.slice(2)
} }
if (paths.has(path as NavLink)) { if (paths.has(basePath as NavLink)) {
return true return true
} }
const pathSplit = path.split("/").slice(1) const pathSplit = basePath.split("/").slice(1)
return ( return (
pathSplit.length === 2 && pathSplit.length === 2 &&
pathSplit[0] === "projects" && pathSplit[0] === "projects" &&