From a395c3e016311a3ab4cbdf1cf0d132f2195b5f71 Mon Sep 17 00:00:00 2001 From: veclav talica Date: Sat, 10 Feb 2024 22:53:26 +0500 Subject: [PATCH] fix url in preview embeds --- compile.sh | 4 ++-- tools/article_wrapper.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compile.sh b/compile.sh index c0043c1..ba7d3e6 100755 --- a/compile.sh +++ b/compile.sh @@ -19,8 +19,8 @@ for d in ./articles/*/; do mkdir -p "./html/articles/$(basename -- $d)" cp -r "$d/.static/." "./html/articles/$(basename -- $d)/" fi - ./tools/article_wrapper.py "$d/page.mmd" https://mjestecko.neocities.org/ | ./tools/mmd/build/multimarkdown > "./html/articles/$(basename -- $d).html" + ./tools/article_wrapper.py "$d/page.mmd" https://mjestecko.neocities.org | ./tools/mmd/build/multimarkdown > "./html/articles/$(basename -- $d).html" fi done -./tools/feed_generator.py ./articles/ https://mjestecko.neocities.org/ > ./html/feed.xml +./tools/feed_generator.py ./articles/ https://mjestecko.neocities.org > ./html/feed.xml diff --git a/tools/article_wrapper.py b/tools/article_wrapper.py index 91a179f..758f0c8 100755 --- a/tools/article_wrapper.py +++ b/tools/article_wrapper.py @@ -4,6 +4,7 @@ from sys import argv, exit import time, urllib.parse, re +import os.path as path from article_utils import the_line_after_metadata, parse_metadata from page_shares import wrap_page, MONTHS @@ -21,6 +22,7 @@ with open(argv[1], "r") as f: i = the_line_after_metadata(content) metadata = parse_metadata(argv[1]) +directory = path.split(path.dirname(path.abspath(argv[1])))[-1] title = metadata.get("Title", "Oopsie, somebody forgot to name the article!") article_head = "\n# " + title + "\n" @@ -46,10 +48,9 @@ if tags: article_head += "---\n\n" -# todo: Article namespace with related metadata. header = f"""HTML header: - + """ if not brief is None: header += f"""\n"""