Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Fabio Manganiello | 38b079d42d | |
Fabio Manganiello | 43897cc961 | |
Fabio Manganiello | bf714a30bc | |
Fabio Manganiello | 89ea18a805 |
|
@ -1 +1 @@
|
|||
__version__ = '0.2.22'
|
||||
__version__ = '0.2.23'
|
||||
|
|
|
@ -61,11 +61,11 @@ class BlogApp(Flask):
|
|||
with open(md_file, "r") as f:
|
||||
metadata["uri"] = "/article/" + page[:-3]
|
||||
|
||||
for line in f.readlines():
|
||||
for line in f:
|
||||
if not line:
|
||||
continue
|
||||
|
||||
if not (m := re.match(r"^\[//]: # \(([^:]+):\s*([^)]+)\)\s*$", line)):
|
||||
if not (m := re.match(r"^\[//]: # \(([^:]+):\s*(.*)\)\s*$", line)):
|
||||
break
|
||||
|
||||
if m.group(1) == "published":
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import os
|
||||
import re
|
||||
from typing import Optional
|
||||
from urllib.parse import urljoin
|
||||
|
||||
from flask import (
|
||||
jsonify,
|
||||
|
@ -160,22 +162,29 @@ def rss_route():
|
|||
<link>{base_link}{link}</link>
|
||||
<pubDate>{published}</pubDate>
|
||||
<description><![CDATA[{content}]]></description>
|
||||
<media:content medium="image" url="{base_link}{image}" width="200" height="150" />
|
||||
<media:content medium="image" url="{image}" width="200" height="150" />
|
||||
</item>
|
||||
"""
|
||||
).format(
|
||||
base_link=config.link,
|
||||
title=page.get("title", "[No Title]"),
|
||||
link=page.get("uri", ""),
|
||||
published=page["published"].strftime(
|
||||
"%a, %d %b %Y %H:%M:%S GMT"
|
||||
)
|
||||
if "published" in page
|
||||
else "",
|
||||
content=page.get("description", "")
|
||||
if short_description
|
||||
else page.get("content", ""),
|
||||
image=page.get("image", ""),
|
||||
published=(
|
||||
page["published"].strftime("%a, %d %b %Y %H:%M:%S GMT")
|
||||
if "published" in page
|
||||
else ""
|
||||
),
|
||||
content=(
|
||||
page.get("description", "")
|
||||
if short_description
|
||||
else page.get("content", "")
|
||||
),
|
||||
image=(
|
||||
urljoin(config.link, page["image"])
|
||||
if page.get("image")
|
||||
and not re.search(r"^https?://", page["image"])
|
||||
else page.get("image", "")
|
||||
),
|
||||
)
|
||||
for _, page in pages
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[bumpversion]
|
||||
current_version = 0.2.22
|
||||
current_version = 0.2.23
|
||||
commit = True
|
||||
tag = True
|
||||
|
||||
|
|
Loading…
Reference in New Issue