Exclude drafts from uploaded builds
This commit is contained in:
parent
bf7e19ad61
commit
5c69465509
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
.PHONY: *
|
||||
|
||||
build:
|
||||
./build.py out/
|
||||
./build.py out/ --draft
|
||||
pagefind --site out/
|
||||
|
||||
clean:
|
||||
|
4
build.py
4
build.py
@ -15,6 +15,7 @@ import markdown
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("out", help="output directory")
|
||||
parser.add_argument("--draft", action="store_true", help="include draft pages")
|
||||
args = parser.parse_args()
|
||||
|
||||
src = pathlib.Path("src")
|
||||
@ -123,6 +124,9 @@ def main():
|
||||
page.header.append(aside)
|
||||
|
||||
# RSS metadata
|
||||
if "pubdate" in meta and meta["pubdate"][0] == "draft" and not args.draft:
|
||||
continue
|
||||
|
||||
if "feed" in meta and "pubdate" in meta and meta["pubdate"][0] != "draft":
|
||||
pubdate = datetime.fromisoformat(meta["pubdate"][0])
|
||||
link = f"https://www.alogoulogoi.com/{dest.relative_to(out).as_posix()}"
|
||||
|
Loading…
Reference in New Issue
Block a user