Files
git.taskfile.build/image/entrypoint.sh
T
Janik von Rotz 323f81a45f refactor: migrate documentation from 11ty to Zensical and restructure project layout
- Replace 11ty static site generator with Zensical (Material for MkDocs)
- Remove Node.js dependencies, `package.json`, `pnpm-lock.yaml`, and `node_modules`
- Refactor directory structure: move docs to `docs/`, assets to `docs/{img, stylesheets, javascripts}`, and build output to `site/`
- Create modular bin scripts for Zensical, 11ty, and Vuepress workflows (init, dev, build, serve)
- Update `.gitignore` to track `.venv` and `site` instead of `node_modules` and `_site`
- Rewrite `README.md` and `AGENTS.md` to reflect new tooling and structure
- Update `task` and `task.template` with new documentation commands and help rows
- Implement `install` and `uninstall` scripts to fetch scripts from remote repository
- Add `zensical.toml` configuration with Material theme, dark mode toggle, and navigation
- Fix shellcheck issues in `task.template` and `save-pass-to-keepass`
- Update `prompt.md` with completion status and worklog
2026-10-05 16:53:23 +02:00

71 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
echo "pnpm version: $(pnpm --version)"
echo "hugo version: $(hugo version)"
echo "git version: $(git -v)"
echo "curl version: $(curl -V)"
GIT_PATH="/app/repo"
if [[ -n "$GIT_URL" ]]; then
if [[ ! -d "$GIT_PATH" ]]; then
echo "Cloning git repo: $GIT_URL (shallow clone)"
git clone --depth 1 "$GIT_URL" "$GIT_PATH"
else
echo "Pull git repo: $GIT_URL"
git -C "$GIT_PATH" reset --hard
git -C "$GIT_PATH" pull
fi
if [[ -f "$GIT_PATH/.gitmodules" ]]; then
echo 'Found .gitmodules, initializing submodules (shallow).'
git -C "$GIT_PATH" submodule init
git -C "$GIT_PATH" submodule update --recursive --depth 1
fi
else
echo 'GIT_URL not set, skipping git clone/pull.'
fi
if [[ -f "${GIT_PATH}/task" ]]; then
if [[ -z "$TASK_COMMANDS" ]]; then
echo 'Error: TASK_COMMANDS environment variable is required.' >&2
exit 1
fi
echo 'Ensure Taskfile is executable.'
chmod +x "${GIT_PATH}/task"
cd "$GIT_PATH"
COMMANDS=$(echo "$TASK_COMMANDS" | tr "," "\n")
for COMMAND in $COMMANDS; do
echo "Run task command: $COMMAND"
./task "$COMMAND"
done
fi
echo 'Template Caddyfile.'
cat > /etc/caddy/Caddyfile <<EOF
:80 {
root * ${GIT_PATH}/${CADDY_ROOT}
file_server
try_files {path} {path}/ /index.html
encode gzip
header {
X-Content-Type-Options nosniff
X-Frame-Options DENY
X-XSS-Protection "1; mode=block"
Referrer-Policy strict-origin-when-cross-origin
}
@static {
file
path *.css *.js *.png *.jpg *.jpeg *.gif *.ico *.svg *.woff *.woff2 *.ttf *.eot
}
header @static Cache-Control "public, max-age=31536000, immutable"
}
EOF
case "$1" in
caddy)
echo "Start Caddy with root $GIT_PATH/$CADDY_ROOT"
exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
;;
*)
exec "$@"
;;
esac