Skip to content

Commit e10503a

Browse files
committed
Betre hantering av eksplisitt frontmatter
1 parent 6d3d3c3 commit e10503a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/docsygen.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ jobs:
5252
# First check if the source file already has frontmatter
5353
if head -n 1 "$mdfile" | grep -q "^---$"; then
5454
echo "Source file already has frontmatter, using as-is"
55-
# Don't copy directly - we still need to process images
5655
echo "=== Processing file with existing frontmatter ==="
57-
# Extract frontmatter
56+
# Extract frontmatter (from first --- to second ---)
5857
awk '/^---$/{count++} count==1{print} count==2{print; exit}' "$mdfile" > "$slidev_dir/slides.md"
59-
# Extract content after frontmatter for processing
60-
awk '/^---$/{count++} count>=2{next} count==2' "$mdfile" > "$slidev_dir/step1.md"
58+
# Extract content after second ---
59+
awk '/^---$/{count++; if(count==2) skip=1; next} skip && NF' "$mdfile" > "$slidev_dir/step1.md"
6160
else
6261
echo "Adding default frontmatter to source file"
6362
echo "---" > "$slidev_dir/slides.md"
@@ -149,6 +148,9 @@ jobs:
149148
150149
# Process content step by step using temp files
151150
echo "=== Step 1 - Original content ==="
151+
echo "Content of step1.md:"
152+
cat "$slidev_dir/step1.md"
153+
echo "--- End of step1.md ---"
152154
grep "images/" "$slidev_dir/step1.md" || echo "No images found"
153155
154156
sed 's/^# /---\n\n# /' "$slidev_dir/step1.md" > "$slidev_dir/step2.md"

0 commit comments

Comments
 (0)