Compare commits
6 Commits
c1714e9654
...
ddbb5bc09b
Author | SHA1 | Date | |
---|---|---|---|
ddbb5bc09b
|
|||
53a0881051
|
|||
68b752e15f
|
|||
b524091d38
|
|||
29887ab25c
|
|||
1e0ab6b0c8
|
2
.env
2
.env
@ -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"
|
@ -4,9 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
pull_request:
|
- develop
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -15,5 +13,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Check out repository code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Run docker-compose
|
- name: Build production
|
||||||
run: docker compose up -d --build
|
run: docker compose up -d --build prod
|
||||||
|
if: gitea.ref == 'refs/heads/master'
|
||||||
|
- name: Build develop
|
||||||
|
run: docker compose up -d --build dev
|
||||||
|
if: gitea.ref == 'refs/heads/develop'
|
@ -1,9 +1,20 @@
|
|||||||
services:
|
services:
|
||||||
web:
|
prod:
|
||||||
container_name: martials.no
|
hostname: martials.no
|
||||||
|
container_name: "martials.no"
|
||||||
restart: always
|
restart: always
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "4321:4321"
|
- "4321:4321"
|
||||||
|
|
||||||
|
dev:
|
||||||
|
hostname: dev.martials.no
|
||||||
|
container_name: "dev.martials.no"
|
||||||
|
restart: always
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "4322:4321"
|
19
package.json
19
package.json
@ -36,25 +36,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"daisyui": "^5.0.43",
|
"daisyui": "^5.0.43",
|
||||||
"prettier": "^3.6.2",
|
|
||||||
"prettier-plugin-astro": "^0.14.1",
|
|
||||||
"prettier-plugin-svelte": "^3.4.0",
|
|
||||||
"vite": "^7.0.0"
|
"vite": "^7.0.0"
|
||||||
},
|
|
||||||
"prettier": {
|
|
||||||
"semi": false,
|
|
||||||
"singleQuote": false,
|
|
||||||
"plugins": [
|
|
||||||
"prettier-plugin-astro",
|
|
||||||
"prettier-plugin-svelte"
|
|
||||||
],
|
|
||||||
"overrides": [
|
|
||||||
{
|
|
||||||
"files": "**/*.astro",
|
|
||||||
"options": {
|
|
||||||
"parser": "astro"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
29
pnpm-lock.yaml
generated
29
pnpm-lock.yaml
generated
@ -63,15 +63,6 @@ importers:
|
|||||||
daisyui:
|
daisyui:
|
||||||
specifier: ^5.0.43
|
specifier: ^5.0.43
|
||||||
version: 5.0.43
|
version: 5.0.43
|
||||||
prettier:
|
|
||||||
specifier: ^3.6.2
|
|
||||||
version: 3.6.2
|
|
||||||
prettier-plugin-astro:
|
|
||||||
specifier: ^0.14.1
|
|
||||||
version: 0.14.1
|
|
||||||
prettier-plugin-svelte:
|
|
||||||
specifier: ^3.4.0
|
|
||||||
version: 3.4.0(prettier@3.6.2)(svelte@5.34.9)
|
|
||||||
vite:
|
vite:
|
||||||
specifier: ^7.0.0
|
specifier: ^7.0.0
|
||||||
version: 7.0.0(jiti@2.4.2)(lightningcss@1.30.1)(yaml@2.5.1)
|
version: 7.0.0(jiti@2.4.2)(lightningcss@1.30.1)(yaml@2.5.1)
|
||||||
@ -2527,12 +2518,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-RiBETaaP9veVstE4vUwSIcdATj6dKmXljouXc/DDNwBSPTp8FRkLGDSGFClKsAFeeg+13SB0Z1JZvbD76bigJw==}
|
resolution: {integrity: sha512-RiBETaaP9veVstE4vUwSIcdATj6dKmXljouXc/DDNwBSPTp8FRkLGDSGFClKsAFeeg+13SB0Z1JZvbD76bigJw==}
|
||||||
engines: {node: ^14.15.0 || >=16.0.0}
|
engines: {node: ^14.15.0 || >=16.0.0}
|
||||||
|
|
||||||
prettier-plugin-svelte@3.4.0:
|
|
||||||
resolution: {integrity: sha512-pn1ra/0mPObzqoIQn/vUTR3ZZI6UuZ0sHqMK5x2jMLGrs53h0sXhkVuDcrlssHwIMk7FYrMjHBPoUSyyEEDlBQ==}
|
|
||||||
peerDependencies:
|
|
||||||
prettier: ^3.0.0
|
|
||||||
svelte: ^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0
|
|
||||||
|
|
||||||
prettier@2.8.7:
|
prettier@2.8.7:
|
||||||
resolution: {integrity: sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==}
|
resolution: {integrity: sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==}
|
||||||
engines: {node: '>=10.13.0'}
|
engines: {node: '>=10.13.0'}
|
||||||
@ -6383,16 +6368,13 @@ snapshots:
|
|||||||
'@astrojs/compiler': 2.10.3
|
'@astrojs/compiler': 2.10.3
|
||||||
prettier: 3.6.2
|
prettier: 3.6.2
|
||||||
sass-formatter: 0.7.9
|
sass-formatter: 0.7.9
|
||||||
|
optional: true
|
||||||
prettier-plugin-svelte@3.4.0(prettier@3.6.2)(svelte@5.34.9):
|
|
||||||
dependencies:
|
|
||||||
prettier: 3.6.2
|
|
||||||
svelte: 5.34.9
|
|
||||||
|
|
||||||
prettier@2.8.7:
|
prettier@2.8.7:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
prettier@3.6.2: {}
|
prettier@3.6.2:
|
||||||
|
optional: true
|
||||||
|
|
||||||
prismjs@1.30.0: {}
|
prismjs@1.30.0: {}
|
||||||
|
|
||||||
@ -6618,7 +6600,8 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
queue-microtask: 1.2.3
|
queue-microtask: 1.2.3
|
||||||
|
|
||||||
s.color@0.0.15: {}
|
s.color@0.0.15:
|
||||||
|
optional: true
|
||||||
|
|
||||||
safe-buffer@5.2.1: {}
|
safe-buffer@5.2.1: {}
|
||||||
|
|
||||||
@ -6627,6 +6610,7 @@ snapshots:
|
|||||||
sass-formatter@0.7.9:
|
sass-formatter@0.7.9:
|
||||||
dependencies:
|
dependencies:
|
||||||
suf-log: 2.5.3
|
suf-log: 2.5.3
|
||||||
|
optional: true
|
||||||
|
|
||||||
sax@1.4.1: {}
|
sax@1.4.1: {}
|
||||||
|
|
||||||
@ -6795,6 +6779,7 @@ snapshots:
|
|||||||
suf-log@2.5.3:
|
suf-log@2.5.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
s.color: 0.0.15
|
s.color: 0.0.15
|
||||||
|
optional: true
|
||||||
|
|
||||||
svelte2tsx@0.7.40(svelte@5.34.9)(typescript@5.8.3):
|
svelte2tsx@0.7.40(svelte@5.34.9)(typescript@5.8.3):
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -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"
|
||||||
|
@ -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" &&
|
||||||
|
Reference in New Issue
Block a user