-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy path.makim.yaml
More file actions
67 lines (61 loc) · 2.54 KB
/
.makim.yaml
File metadata and controls
67 lines (61 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
groups:
pages:
tasks:
pre-build:
help: pre-build step
backend: bash
run: |
set -e
mkdir -p build
# Directory to search for blog sources
export SEARCH_DIR="pages/blog"
# 1) Convert legacy .ipynb posts to Markdown (for now)
# This keeps existing notebook-based posts working while we
# migrate everything to Quarto.
find "$SEARCH_DIR" -path "*/.ipynb_checkpoints/*" -prune -o -name \
"*.ipynb" -exec sh -c \
'jupyter nbconvert --to markdown --template=theme/custom-markdown.tpl --output-dir "$(dirname "$0")" --output "index" "$0"' {} \;
# 2) Convert .qmd blog posts to Markdown using Quarto
# Run quarto render from inside each blog folder (Quarto rejects --output path).
if ! command -v quarto >/dev/null 2>&1; then
echo "[EE] Quarto CLI is required but not found on PATH. Install it (e.g. conda install quarto) and retry."
exit 1
fi
mapfile -d "" qmd_files < <(find "$SEARCH_DIR" -name "*.qmd" -print0)
for qmd_path in "${qmd_files[@]}"; do
dir=$(dirname "$qmd_path")
base=$(basename "$qmd_path" .qmd)
(
cd "$dir"
quarto render "$base.qmd" --to gfm -M template=default
)
done
# 3) Ensure generated index.md have YAML from .qmd (Quarto may drop it)
python scripts/inject-qmd-yaml-into-md.py
# 4) Remove console colors from generated md files
find "$SEARCH_DIR" -name "index.md" -exec sh -c \
'cat "$(dirname "$0")/index.md" | python scripts/clean-output.py > "$(dirname "$0")/temp_index.md" && mv "$(dirname "$0")/temp_index.md" "$(dirname "$0")/index.md"' {} \;
build:
help: build the static page
backend: bash
hooks:
pre-run:
- task: pages.pre-build
run: |
find build -mindepth 1 -maxdepth 1 -exec rm -rf {} +
mkdocs build --verbose --clean
mkdir -p build/.well-known
cp pages/.well-known/funding-manifest-urls \
build/.well-known/funding-manifest-urls
preview:
help: preview the web page dynamically
args:
run-pre-build:
help: Run pre-build task
type: bool
action: store_true
hooks:
pre-run:
- task: pages.pre-build
if: ${{ args.run_pre_build }}
run: mkdocs serve --watch pages --watch theme