generator.py

add generator meta tag


render function

None

render source
def render(markata: Markata) -> None:
    should_prettify = markata.config.get("prettify_html", False)
    for article in markata.iter_articles("add ssg tag"):
        soup = BeautifulSoup(article.html, features="lxml")
        tag = soup.new_tag("meta")
        tag.attrs["content"] = f"markata {__version__}"
        tag.attrs["name"] = "generator"
        soup.head.append(tag)

        if should_prettify:
            article.html = soup.prettify()
        else:
            article.html = str(soup)