feat: ignore frontmatter option
This commit is contained in:
parent
27178dc6d8
commit
07152a3746
3 changed files with 9 additions and 15 deletions
|
@ -48,14 +48,12 @@ class ZonaBuilder:
|
|||
destination=destination,
|
||||
url=str(destination.relative_to(layout.output)),
|
||||
)
|
||||
if path.name.endswith(
|
||||
".md"
|
||||
) and not path.is_relative_to(
|
||||
if path.name.endswith(".md") and not path.is_relative_to(
|
||||
layout.root / "content" / "static"
|
||||
):
|
||||
logger.debug(f"Parsing {path.name}.")
|
||||
item.metadata, item.content = parse_metadata(path)
|
||||
if (
|
||||
if item.metadata.ignore or (
|
||||
item.metadata.draft
|
||||
and not self.config.build.include_drafts
|
||||
):
|
||||
|
@ -71,13 +69,11 @@ class ZonaBuilder:
|
|||
item.copy = False
|
||||
name = destination.stem
|
||||
if name == "index":
|
||||
item.destination = (
|
||||
item.destination.with_suffix(".html")
|
||||
item.destination = item.destination.with_suffix(
|
||||
".html"
|
||||
)
|
||||
else:
|
||||
relative = path.relative_to(base).with_suffix(
|
||||
""
|
||||
)
|
||||
relative = path.relative_to(base).with_suffix("")
|
||||
name = relative.stem
|
||||
item.destination = (
|
||||
layout.output
|
||||
|
@ -89,9 +85,7 @@ class ZonaBuilder:
|
|||
layout.output
|
||||
)
|
||||
item.url = (
|
||||
""
|
||||
if rel_url == Path(".")
|
||||
else rel_url.as_posix()
|
||||
"" if rel_url == Path(".") else rel_url.as_posix()
|
||||
)
|
||||
items.append(item)
|
||||
self.items = items
|
||||
|
@ -117,9 +111,7 @@ class ZonaBuilder:
|
|||
# write code highlighting stylesheet
|
||||
if self.config.markdown.syntax_highlighting.enabled:
|
||||
pygments_style = zmd.get_style_defs(self.config)
|
||||
pygments_path = (
|
||||
self.layout.output / "static" / "pygments.css"
|
||||
)
|
||||
pygments_path = self.layout.output / "static" / "pygments.css"
|
||||
util.ensure_parents(pygments_path)
|
||||
pygments_path.write_text(pygments_style)
|
||||
for item in self.item_map.values():
|
||||
|
|
|
@ -24,6 +24,7 @@ class Metadata:
|
|||
template: str | None = None
|
||||
post: bool | None = None
|
||||
draft: bool = False
|
||||
ignore: bool = False
|
||||
math: bool = True
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue