Each heading or search query is now in a separate page, so once those new pages are indexed by search engine, the search result will lead directly to a page that only contains the relevant search query, e.g. FileFix detection.
from os import chdir, path
from re import S, findall, sub
chdir(path.dirname(__file__))
template = """---
title: {title}
layout: page
date: 2025-07-27
---
{content}"""
with open("index.md") as f:
s = f.read()
# https://stackoverflow.com/a/66619938
for title, content in findall(r"(?:^|\n)##\s([^\n]+)\n(.*?)(?=\n##?\s|$)", s, S):
# https://stackoverflow.com/a/74260791
fname = sub(r"\W+", "-", title).strip("-").lower()
with open(fname + ".md", "w") as w:
w.write(template.format(title=title, content=content))
with open("index-new.md", "a") as a:
a.write(f"- [{title}]({fname})\n")