Skip to content

Commit 81064d6

Browse files
committed
Initial commit
Open source release
1 parent 5fe5829 commit 81064d6

220 files changed

Lines changed: 11655 additions & 5 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "KaiOS.dev Hugo Development",
3+
"image": "mcr.microsoft.com/devcontainers/base:trixie",
4+
5+
// Add Hugo feature with extended support
6+
"features": {
7+
"ghcr.io/devcontainers/features/git:1": {},
8+
"ghcr.io/devcontainers/features/hugo:latest": {
9+
"extended": true
10+
}
11+
},
12+
13+
// Configure tool-specific properties
14+
"customizations": {
15+
"vscode": {
16+
"settings": {
17+
"git.alwaysSignOff": true
18+
},
19+
"extensions": [
20+
"budparr.language-hugo-vscode",
21+
"eliostruyf.vscode-hugo-themer",
22+
"tamasfe.even-better-toml"
23+
]
24+
}
25+
},
26+
27+
"forwardPorts": [1313],
28+
29+
// Port attributes
30+
"portsAttributes": {
31+
"1313": {
32+
"label": "Hugo Server",
33+
"onAutoForward": "notify"
34+
}
35+
},
36+
37+
// After the container is created
38+
"postCreateCommand": "git submodule update --init --recursive && bash .devcontainer/install-typos.sh"
39+
}

.devcontainer/install-typos.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# Install typos-cli for spell checking
3+
4+
set -e
5+
6+
echo "Installing typos-cli..."
7+
8+
# Check if cargo is installed
9+
if ! command -v cargo >/dev/null 2>&1; then
10+
echo "Cargo not found. Installing Rust..."
11+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
12+
source "$HOME/.cargo/env"
13+
fi
14+
15+
# Install typos-cli
16+
if ! command -v typos >/dev/null 2>&1; then
17+
cargo install typos-cli
18+
echo "✓ typos-cli installed successfully"
19+
else
20+
echo "✓ typos-cli is already installed"
21+
fi
22+
23+
# Verify installation
24+
typos --version

.github/workflows/deploy.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy to Cloudflare Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
deployments: write
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: recursive # Fetch Hugo themes (if any)
23+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
24+
25+
- name: Check for typos
26+
uses: crate-ci/typos@master
27+
28+
- name: Setup Hugo
29+
uses: peaceiris/actions-hugo@v3
30+
with:
31+
hugo-version: 'latest'
32+
extended: true
33+
34+
- name: Build Hugo site
35+
env:
36+
HUGO_ENV_GIT_COMMIT_HASH: ${{ github.sha }}
37+
run: hugo --minify --gc --cleanDestinationDir --environment production
38+
39+
- name: Deploy to Cloudflare Pages
40+
uses: cloudflare/wrangler-action@v3
41+
with:
42+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
43+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
44+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
45+
command: |
46+
pages deploy public --project-name=${{ secrets.CLOUDFLARE_PROJECT_NAME }} --branch=${{ github.head_ref || github.ref_name }} --commit-dirty=true

.gitignore

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ go.work.sum
2727
# env file
2828
.env
2929

30-
# Editor/IDE
31-
# .idea/
32-
# .vscode/
30+
# Editor/IDE/macOS
31+
.idea/
32+
.DS_Store
33+
34+
# Hugo
35+
.hugo_build.lock
36+
_gen/
37+
.scss_*
38+
public/
39+
40+
# Claude/ OpenCode
41+
CLAUDE.md
42+
.opencode/
43+
.claude/
44+
45+
# NPM
46+
node_modules/

.vscode/tasks.json

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Start Hugo Server",
6+
"type": "shell",
7+
"command": "export HUGO_ENV_GIT_COMMIT_HASH=$(git rev-parse --verify HEAD) && hugo server --bind 0.0.0.0 --disableFastRender --noHTTPCache",
8+
"isBackground": true,
9+
"group": {
10+
"kind": "build",
11+
"isDefault": true
12+
},
13+
"runOptions": {
14+
"runOn": "folderOpen"
15+
},
16+
"problemMatcher": {
17+
"pattern": [
18+
{
19+
"regexp": ".",
20+
"file": 1,
21+
"location": 2,
22+
"message": 3
23+
}
24+
],
25+
"background": {
26+
"activeOnStart": true,
27+
"beginsPattern": "Web Server is available at",
28+
"endsPattern": "Press Ctrl+C to stop"
29+
}
30+
},
31+
"presentation": {
32+
"reveal": "always",
33+
"panel": "new"
34+
}
35+
},
36+
{
37+
"label": "Typos: Check",
38+
"type": "shell",
39+
"command": "typos",
40+
"problemMatcher": {
41+
"owner": "typos",
42+
"fileLocation": ["relative", "${workspaceFolder}"],
43+
"pattern": [
44+
{
45+
"regexp": "^(.*):(\\d+):(\\d+):\\s+(.*)$",
46+
"file": 1,
47+
"line": 2,
48+
"column": 3,
49+
"message": 4
50+
}
51+
]
52+
},
53+
"presentation": {
54+
"reveal": "always",
55+
"panel": "shared"
56+
}
57+
},
58+
{
59+
"label": "Typos: Watch",
60+
"type": "shell",
61+
"command": "typos --watch",
62+
"isBackground": true,
63+
"problemMatcher": {
64+
"owner": "typos",
65+
"fileLocation": ["relative", "${workspaceFolder}"],
66+
"pattern": [
67+
{
68+
"regexp": "^(.*):(\\d+):(\\d+):\\s+(.*)$",
69+
"file": 1,
70+
"line": 2,
71+
"column": 3,
72+
"message": 4
73+
}
74+
],
75+
"background": {
76+
"activeOnStart": true,
77+
"beginsPattern": "^Watching",
78+
"endsPattern": "^$"
79+
}
80+
},
81+
"presentation": {
82+
"reveal": "always",
83+
"panel": "shared"
84+
}
85+
}
86+
]
87+
}

0 commit comments

Comments
 (0)