jekyll-theme-zer0 1.8.2 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -3
- data/README.md +98 -7
- data/_data/content_statistics.yml +253 -251
- data/_includes/components/nav-export.html +61 -0
- data/_includes/components/nav-overview.html +54 -0
- data/scripts/bin/install +52 -705
- data/scripts/github-setup.sh +0 -0
- data/scripts/install/README.md +162 -0
- data/scripts/install/ai/client.sh +164 -0
- data/scripts/install/ai/diagnose.sh +81 -0
- data/scripts/install/ai/prompts/diagnose.system.md +42 -0
- data/scripts/install/ai/prompts/spec.schema.json +129 -0
- data/scripts/install/ai/prompts/suggest.system.md +43 -0
- data/scripts/install/ai/prompts/wizard.system.md +142 -0
- data/scripts/install/ai/suggest.sh +57 -0
- data/scripts/install/ai/wizard.sh +150 -0
- data/scripts/install/apply.sh +156 -0
- data/scripts/install/cli.sh +561 -0
- data/scripts/install/diff.sh +128 -0
- data/scripts/install/doctor.sh +168 -0
- data/scripts/install/fs.sh +138 -0
- data/scripts/install/log.sh +119 -0
- data/scripts/install/plan.sh +299 -0
- data/scripts/install/platform.sh +122 -0
- data/scripts/install/prompt.sh +124 -0
- data/scripts/install/repair.sh +45 -0
- data/scripts/install/scrape.sh +535 -0
- data/scripts/install/scrape_html.py +764 -0
- data/scripts/install/spec.sh +486 -0
- data/scripts/install/tasks/_registry.sh +65 -0
- data/scripts/install/tasks/agents.sh +60 -0
- data/scripts/install/tasks/config.sh +37 -0
- data/scripts/install/tasks/data.sh +18 -0
- data/scripts/install/tasks/deploy_azure-swa.sh +17 -0
- data/scripts/install/tasks/deploy_docker-prod.sh +21 -0
- data/scripts/install/tasks/deploy_github-pages.sh +18 -0
- data/scripts/install/tasks/devcontainer.sh +26 -0
- data/scripts/install/tasks/docker.sh +29 -0
- data/scripts/install/tasks/gemfile.sh +42 -0
- data/scripts/install/tasks/gitignore.sh +26 -0
- data/scripts/install/tasks/marker.sh +46 -0
- data/scripts/install/tasks/nav.sh +18 -0
- data/scripts/install/tasks/pages.sh +61 -0
- data/scripts/install/tasks/readme.sh +27 -0
- data/scripts/install/tasks/scrape.sh +348 -0
- data/scripts/install/template.sh +138 -0
- data/scripts/install/tui.sh +110 -0
- data/scripts/install/upgrade.sh +49 -0
- data/scripts/lib/install/template.sh +1 -0
- metadata +49 -6
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# scripts/install/tasks/deploy_azure-swa.sh — Azure Static Web Apps deploy
|
|
4
|
+
# =============================================================================
|
|
5
|
+
[[ -n "${_HAS_TASK_DEPLOY_AZURE_SWA:-}" ]] && return 0
|
|
6
|
+
_HAS_TASK_DEPLOY_AZURE_SWA=1
|
|
7
|
+
|
|
8
|
+
task_deploy_azure-swa_run() {
|
|
9
|
+
local target="$1"
|
|
10
|
+
log_info "Configuring Azure Static Web Apps deploy..."
|
|
11
|
+
fs_ensure_dir "${target}/.github/workflows"
|
|
12
|
+
tmpl_apply "deploy/azure-swa/azure-static-web-apps.yml.template" \
|
|
13
|
+
"${target}/.github/workflows/azure-static-web-apps.yml"
|
|
14
|
+
fs_copy_file "${TEMPLATES_DIR}/deploy/azure-swa/staticwebapp.config.json" \
|
|
15
|
+
"${target}/staticwebapp.config.json"
|
|
16
|
+
log_success "Azure SWA config written"
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# scripts/install/tasks/deploy_docker-prod.sh — Production Docker deploy
|
|
4
|
+
# =============================================================================
|
|
5
|
+
[[ -n "${_HAS_TASK_DEPLOY_DOCKER_PROD:-}" ]] && return 0
|
|
6
|
+
_HAS_TASK_DEPLOY_DOCKER_PROD=1
|
|
7
|
+
|
|
8
|
+
task_deploy_docker-prod_run() {
|
|
9
|
+
local target="$1"
|
|
10
|
+
log_info "Configuring production Docker deploy..."
|
|
11
|
+
fs_ensure_dir "${target}/docker"
|
|
12
|
+
tmpl_apply "deploy/docker-prod/Dockerfile.prod.template" \
|
|
13
|
+
"${target}/docker/Dockerfile.prod"
|
|
14
|
+
tmpl_apply "deploy/docker-prod/docker-compose.prod.yml.template" \
|
|
15
|
+
"${target}/docker-compose.prod.yml"
|
|
16
|
+
fs_copy_file "${TEMPLATES_DIR}/deploy/docker-prod/nginx.conf" \
|
|
17
|
+
"${target}/docker/nginx.conf"
|
|
18
|
+
fs_copy_file "${TEMPLATES_DIR}/deploy/docker-prod/.dockerignore" \
|
|
19
|
+
"${target}/.dockerignore"
|
|
20
|
+
log_success "Production Docker config written"
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# scripts/install/tasks/deploy_github-pages.sh — GitHub Pages deploy plugin
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Writes .github/workflows/jekyll-gh-pages.yml so the repo deploys to
|
|
6
|
+
# GitHub Pages via Actions. Idempotent.
|
|
7
|
+
# =============================================================================
|
|
8
|
+
[[ -n "${_HAS_TASK_DEPLOY_GH_PAGES:-}" ]] && return 0
|
|
9
|
+
_HAS_TASK_DEPLOY_GH_PAGES=1
|
|
10
|
+
|
|
11
|
+
task_deploy_github-pages_run() {
|
|
12
|
+
local target="$1"
|
|
13
|
+
log_info "Configuring GitHub Pages deploy..."
|
|
14
|
+
fs_ensure_dir "${target}/.github/workflows"
|
|
15
|
+
tmpl_apply "deploy/github-pages/jekyll-gh-pages.yml.template" \
|
|
16
|
+
"${target}/.github/workflows/jekyll-gh-pages.yml"
|
|
17
|
+
log_success "GitHub Pages workflow written"
|
|
18
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# scripts/install/tasks/devcontainer.sh — Write .devcontainer config
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Writes: .devcontainer/devcontainer.json
|
|
6
|
+
# Bash 3.2 compatible. No set -euo pipefail here.
|
|
7
|
+
# =============================================================================
|
|
8
|
+
[[ -n "${_HAS_TASK_DEVCONTAINER:-}" ]] && return 0
|
|
9
|
+
_HAS_TASK_DEVCONTAINER=1
|
|
10
|
+
|
|
11
|
+
task_devcontainer_run() {
|
|
12
|
+
local target="$1"
|
|
13
|
+
local profile="${SPEC_PROFILE:-default}"
|
|
14
|
+
|
|
15
|
+
case "$profile" in
|
|
16
|
+
minimal)
|
|
17
|
+
log_info "devcontainer task: skipped for profile 'minimal'"
|
|
18
|
+
return 0
|
|
19
|
+
;;
|
|
20
|
+
esac
|
|
21
|
+
|
|
22
|
+
log_info "Writing devcontainer configuration..."
|
|
23
|
+
fs_ensure_dir "${target}/.devcontainer"
|
|
24
|
+
tmpl_apply "config/devcontainer.json.template" "${target}/.devcontainer/devcontainer.json"
|
|
25
|
+
log_success "devcontainer.json written"
|
|
26
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# scripts/install/tasks/docker.sh — Write Docker files
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Writes: docker-compose.yml, docker/Dockerfile
|
|
6
|
+
# Skipped for: minimal and github-pages profiles.
|
|
7
|
+
# Bash 3.2 compatible. No set -euo pipefail here.
|
|
8
|
+
# =============================================================================
|
|
9
|
+
[[ -n "${_HAS_TASK_DOCKER:-}" ]] && return 0
|
|
10
|
+
_HAS_TASK_DOCKER=1
|
|
11
|
+
|
|
12
|
+
task_docker_run() {
|
|
13
|
+
local target="$1"
|
|
14
|
+
local profile="${SPEC_PROFILE:-default}"
|
|
15
|
+
|
|
16
|
+
case "$profile" in
|
|
17
|
+
minimal|github-pages)
|
|
18
|
+
log_info "Docker task: skipped for profile '$profile'"
|
|
19
|
+
return 0
|
|
20
|
+
;;
|
|
21
|
+
esac
|
|
22
|
+
|
|
23
|
+
log_info "Writing Docker configuration..."
|
|
24
|
+
|
|
25
|
+
tmpl_apply "config/docker-compose.yml.template" "${target}/docker-compose.yml"
|
|
26
|
+
tmpl_apply "config/Dockerfile.consumer.template" "${target}/docker/Dockerfile"
|
|
27
|
+
|
|
28
|
+
log_success "Docker files written"
|
|
29
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# scripts/install/tasks/gemfile.sh — Write Gemfile
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Selects the correct Gemfile template variant based on profile + platform:
|
|
6
|
+
# remote → Gemfile.remote.template (github-pages gem)
|
|
7
|
+
# macos → Gemfile.macos.template (system ruby < 2.7 compat caps)
|
|
8
|
+
# minimal → Gemfile.minimal.template (bare jekyll, no gem-theme)
|
|
9
|
+
# default → Gemfile.full.template (jekyll-theme-zer0 gem)
|
|
10
|
+
# Bash 3.2 compatible. No set -euo pipefail here.
|
|
11
|
+
# =============================================================================
|
|
12
|
+
[[ -n "${_HAS_TASK_GEMFILE:-}" ]] && return 0
|
|
13
|
+
_HAS_TASK_GEMFILE=1
|
|
14
|
+
|
|
15
|
+
task_gemfile_run() {
|
|
16
|
+
local target="$1"
|
|
17
|
+
|
|
18
|
+
log_info "Writing Gemfile..."
|
|
19
|
+
|
|
20
|
+
local tmpl
|
|
21
|
+
local profile="${SPEC_PROFILE:-default}"
|
|
22
|
+
local theme_source="${SPEC_THEME_SOURCE:-${THEME_SOURCE:-gem}}"
|
|
23
|
+
|
|
24
|
+
case "$profile" in
|
|
25
|
+
github-pages)
|
|
26
|
+
tmpl="config/Gemfile.remote.template" ;;
|
|
27
|
+
minimal)
|
|
28
|
+
# macOS compat check
|
|
29
|
+
if [[ "$(type -t platform_needs_macos_gemfile)" == "function" ]] && \
|
|
30
|
+
platform_needs_macos_gemfile; then
|
|
31
|
+
tmpl="config/Gemfile.macos.template"
|
|
32
|
+
else
|
|
33
|
+
tmpl="config/Gemfile.minimal.template"
|
|
34
|
+
fi
|
|
35
|
+
;;
|
|
36
|
+
*)
|
|
37
|
+
tmpl="config/Gemfile.full.template" ;;
|
|
38
|
+
esac
|
|
39
|
+
|
|
40
|
+
tmpl_apply "$tmpl" "${target}/Gemfile"
|
|
41
|
+
log_success "Gemfile written (template: $tmpl)"
|
|
42
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# scripts/install/tasks/gitignore.sh — Write .gitignore
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Writes: .gitignore (profile-aware variant)
|
|
6
|
+
# Bash 3.2 compatible. No set -euo pipefail here.
|
|
7
|
+
# =============================================================================
|
|
8
|
+
[[ -n "${_HAS_TASK_GITIGNORE:-}" ]] && return 0
|
|
9
|
+
_HAS_TASK_GITIGNORE=1
|
|
10
|
+
|
|
11
|
+
task_gitignore_run() {
|
|
12
|
+
local target="$1"
|
|
13
|
+
local profile="${SPEC_PROFILE:-default}"
|
|
14
|
+
|
|
15
|
+
log_info "Writing .gitignore..."
|
|
16
|
+
|
|
17
|
+
local tmpl
|
|
18
|
+
case "$profile" in
|
|
19
|
+
fork) tmpl="config/gitignore.full.template" ;;
|
|
20
|
+
minimal) tmpl="config/gitignore.minimal.template" ;;
|
|
21
|
+
*) tmpl="config/gitignore.full.template" ;;
|
|
22
|
+
esac
|
|
23
|
+
|
|
24
|
+
tmpl_apply "$tmpl" "${target}/.gitignore"
|
|
25
|
+
log_success ".gitignore written"
|
|
26
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# scripts/install/tasks/marker.sh — Write .zer0-installed marker
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Writes: .zer0/install.spec.json (persists final spec)
|
|
6
|
+
# .zer0-installed (simple marker for upgrade detection)
|
|
7
|
+
# Bash 3.2 compatible. No set -euo pipefail here.
|
|
8
|
+
# =============================================================================
|
|
9
|
+
[[ -n "${_HAS_TASK_MARKER:-}" ]] && return 0
|
|
10
|
+
_HAS_TASK_MARKER=1
|
|
11
|
+
|
|
12
|
+
task_marker_run() {
|
|
13
|
+
local target="$1"
|
|
14
|
+
|
|
15
|
+
log_info "Writing installation marker..."
|
|
16
|
+
|
|
17
|
+
# Create .zer0 directory and persist the spec
|
|
18
|
+
fs_ensure_dir "${target}/.zer0"
|
|
19
|
+
spec_write "$(spec_path "$target")"
|
|
20
|
+
|
|
21
|
+
# Write a human-readable marker file
|
|
22
|
+
local marker_content
|
|
23
|
+
marker_content=$(cat <<MARKER
|
|
24
|
+
# zer0-mistakes installation marker
|
|
25
|
+
# Do not delete this file — it is used by the upgrade and repair commands.
|
|
26
|
+
installed_at: $(date -u +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null || date +"%Y-%m-%dT%H:%M:%SZ")
|
|
27
|
+
profile: ${SPEC_PROFILE:-default}
|
|
28
|
+
theme_source: ${SPEC_THEME_SOURCE:-gem}
|
|
29
|
+
installer_version: "2"
|
|
30
|
+
MARKER
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
if [[ -f "${target}/.zer0-installed" ]]; then
|
|
34
|
+
# Append an upgrade entry
|
|
35
|
+
local append_content
|
|
36
|
+
append_content=$(printf '\n# Upgrade: %s\nprofile: %s\n' \
|
|
37
|
+
"$(date -u +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null || date)" \
|
|
38
|
+
"${SPEC_PROFILE:-default}")
|
|
39
|
+
fs_write_file "${target}/.zer0-installed" \
|
|
40
|
+
"$(cat "${target}/.zer0-installed")${append_content}"
|
|
41
|
+
else
|
|
42
|
+
fs_write_file "${target}/.zer0-installed" "$marker_content"
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
log_success "Installation marker written"
|
|
46
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# scripts/install/tasks/nav.sh — Generate navigation data
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Writes: _data/navigation/main.yml
|
|
6
|
+
# Bash 3.2 compatible. No set -euo pipefail here.
|
|
7
|
+
# =============================================================================
|
|
8
|
+
[[ -n "${_HAS_TASK_NAV:-}" ]] && return 0
|
|
9
|
+
_HAS_TASK_NAV=1
|
|
10
|
+
|
|
11
|
+
task_nav_run() {
|
|
12
|
+
local target="$1"
|
|
13
|
+
|
|
14
|
+
log_info "Writing navigation data..."
|
|
15
|
+
fs_ensure_dir "${target}/_data/navigation"
|
|
16
|
+
tmpl_apply "data/navigation-main.yml.template" "${target}/_data/navigation/main.yml"
|
|
17
|
+
log_success "Navigation data written"
|
|
18
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# scripts/install/tasks/pages.sh — Generate starter content pages
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Copies pages listed in templates/pages/manifest.yml to target.
|
|
6
|
+
# Skips individual files that already exist (respects _FS_FORCE).
|
|
7
|
+
# Bash 3.2 compatible. No set -euo pipefail here.
|
|
8
|
+
# =============================================================================
|
|
9
|
+
[[ -n "${_HAS_TASK_PAGES:-}" ]] && return 0
|
|
10
|
+
_HAS_TASK_PAGES=1
|
|
11
|
+
|
|
12
|
+
task_pages_run() {
|
|
13
|
+
local target="$1"
|
|
14
|
+
local profile="${SPEC_PROFILE:-default}"
|
|
15
|
+
|
|
16
|
+
log_info "Generating starter pages..."
|
|
17
|
+
|
|
18
|
+
# Locate pages template directory
|
|
19
|
+
local pages_tmpl_dir="${TEMPLATES_DIR:-}/pages"
|
|
20
|
+
if [[ ! -d "$pages_tmpl_dir" ]]; then
|
|
21
|
+
log_warning "Pages template dir not found: $pages_tmpl_dir (skipping)"
|
|
22
|
+
return 0
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Read manifest if present
|
|
26
|
+
local manifest="${pages_tmpl_dir}/manifest.yml"
|
|
27
|
+
if [[ ! -f "$manifest" ]]; then
|
|
28
|
+
log_warning "pages/manifest.yml not found (skipping)"
|
|
29
|
+
return 0
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# Parse manifest: lines of format "- dest: path src: template"
|
|
33
|
+
local dest src
|
|
34
|
+
while IFS= read -r line; do
|
|
35
|
+
# Skip blank / comment lines
|
|
36
|
+
case "$line" in
|
|
37
|
+
''|\#*) continue ;;
|
|
38
|
+
esac
|
|
39
|
+
|
|
40
|
+
# Extract dest and src fields
|
|
41
|
+
dest=$(echo "$line" | sed 's/.*dest:[[:space:]]*//' | sed 's/[[:space:]].*//')
|
|
42
|
+
src=$(echo "$line" | sed 's/.*src:[[:space:]]*//' | sed 's/[[:space:]].*//')
|
|
43
|
+
|
|
44
|
+
[[ -z "$dest" || -z "$src" ]] && continue
|
|
45
|
+
|
|
46
|
+
# Profile filter — lines can have a "profiles:" key
|
|
47
|
+
local profiles_spec
|
|
48
|
+
profiles_spec=$(echo "$line" | grep -o 'profiles:[^,}]*' | sed 's/profiles://')
|
|
49
|
+
if [[ -n "$profiles_spec" ]]; then
|
|
50
|
+
case "$profiles_spec" in
|
|
51
|
+
*"$profile"*) ;;
|
|
52
|
+
*"all"*) ;;
|
|
53
|
+
*) continue ;; # not for this profile
|
|
54
|
+
esac
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
tmpl_apply "pages/${src}" "${target}/${dest}"
|
|
58
|
+
done < "$manifest"
|
|
59
|
+
|
|
60
|
+
log_success "Starter pages generated"
|
|
61
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# =============================================================================
|
|
3
|
+
# scripts/install/tasks/readme.sh — Write INSTALLATION.md and README seed
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Writes: INSTALLATION.md
|
|
6
|
+
# Writes: README.md (only when target does not have one yet)
|
|
7
|
+
# Bash 3.2 compatible. No set -euo pipefail here.
|
|
8
|
+
# =============================================================================
|
|
9
|
+
[[ -n "${_HAS_TASK_README:-}" ]] && return 0
|
|
10
|
+
_HAS_TASK_README=1
|
|
11
|
+
|
|
12
|
+
task_readme_run() {
|
|
13
|
+
local target="$1"
|
|
14
|
+
|
|
15
|
+
log_info "Writing documentation..."
|
|
16
|
+
|
|
17
|
+
tmpl_apply "config/INSTALLATION.md.template" "${target}/INSTALLATION.md"
|
|
18
|
+
|
|
19
|
+
# Write README.md only if missing (never overwrite an existing README)
|
|
20
|
+
if [[ ! -f "${target}/README.md" ]]; then
|
|
21
|
+
tmpl_apply "config/README.md.template" "${target}/README.md"
|
|
22
|
+
else
|
|
23
|
+
log_debug "README.md already exists — skipping (use --force to overwrite)"
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
log_success "Documentation written"
|
|
27
|
+
}
|