summaryrefslogtreecommitdiff
path: root/atom
diff options
context:
space:
mode:
Diffstat (limited to 'atom')
-rwxr-xr-xatom/atom.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/atom/atom.py b/atom/atom.py
index 3a77d5f..c6e38d2 100755
--- a/atom/atom.py
+++ b/atom/atom.py
@@ -74,7 +74,9 @@ def add_comic(num, dryrun=False):
"url": f"https://fkfd.me/comics/{info['num']}",
"title": "Comic: " + info["title"],
"date": utc_date(),
- "html": '<p><img src="{0}"/></p><p>{1}</p>'.format(info["img"], info["alt"]),
+ "html": '<p><img src="{0}" alt="{1}"></p><p>{2}</p>'.format(
+ info["img"], info["transcript"], info["alt"]
+ ),
},
dryrun=dryrun,
)
@@ -82,6 +84,7 @@ def add_comic(num, dryrun=False):
def add_blogpost(path, dryrun=False):
# example path: "shitpost/flat_egg", "projects/byseekel"
+ path = path.strip("/")
try:
f = open(BLOG_DIR + f"/site/{path}/index.html")
except FileNotFoundError:
@@ -92,13 +95,16 @@ def add_blogpost(path, dryrun=False):
f.close()
soup = BeautifulSoup(html, "html.parser")
main = soup.find(role="main")
- url = f"https://fkfd.me/{path.strip('/')}/" # trailing slash necessary
+ url = f"https://fkfd.me/{path}/" # trailing slash necessary
# convert all relative paths to absolute URLs
for img in main.find_all("img"):
img["src"] = urlparse.urljoin(url, img["src"])
for a in main.find_all("a"):
+ if "headerlink" in a["class"]: # remove "ΒΆ"
+ a.decompose()
+ continue
a["href"] = urlparse.urljoin(url, a["href"])
add_entry(