Skip to content

Commit

Permalink
Merge pull request #3251 from olehermanse/3.21-cherry-pick
Browse files Browse the repository at this point in the history
Fixed detection of markdown frontmatter blocks (3.21)
  • Loading branch information
olehermanse authored Mar 18, 2024
2 parents fdc2441 + f8f18ed commit 8ff960d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions generator/_scripts/cfdoc_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,17 @@ def processMetaData(file_path, config):

out_file = open(file_path, "w")
in_header = False
did_header = False
for line in lines:
if did_header:
out_file.write(line)
continue
if line.find("---") == 0:
in_header = not in_header
if not in_header: # write new tags before header is terminated
out_file.write("categories: [%s]\n" % category)
out_file.write("alias: %s.html\n" % alias)
did_header = True
if in_header: # skip hard-coded duplicates
if line.find("categories:") == 0:
continue
Expand Down

0 comments on commit 8ff960d

Please sign in to comment.