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