Compare commits

...

4 Commits

5 changed files with 24 additions and 15 deletions

View File

@ -1 +1 @@
__version__ = '0.2.22'
__version__ = '0.2.23'

View File

@ -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":

View File

@ -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
]

View File

@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.22
current_version = 0.2.23
commit = True
tag = True

View File

@ -11,7 +11,7 @@ def readfile(file):
setup(
name='madblog',
version='0.2.22',
version='0.2.23',
author='Fabio Manganiello',
author_email='info@fabiomanganiello.com',
description='A minimal platform for Markdown-based blogs',