Skip to content

Commit 703b4aa

Browse files
committed
fix: skip YAML metadata from pages
1 parent ff3a291 commit 703b4aa

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Default target.
2-
all : commands
2+
all: commands
33

44
## commands : show all commands.
5-
commands :
5+
commands:
66
@grep -h -E '^##' ${MAKEFILE_LIST} | sed -e 's/## //g' | column -t -s ':'
77

88
## install: install minimal required packages into current environment.

scripts/build.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ def get_course_metadata(course_dir: Path) -> Dict[str, Any]:
7272
if readme_path.exists():
7373
with open(readme_path, "r", encoding="utf-8") as f:
7474
content = f.read()
75-
75+
76+
# Strip YAML front matter if present
77+
if content.startswith("---"):
78+
end = content.find("\n---", 3)
79+
if end != -1:
80+
content = content[end + 4:].lstrip("\n")
81+
7682
# Try to extract title from first heading
7783
title_match = content.split("\n")[0]
7884
if title_match.startswith("# "):

0 commit comments

Comments
 (0)