Compare commits

...

11 Commits

7 changed files with 39 additions and 18 deletions

View File

@ -1,5 +1,10 @@
# Changelog
## 0.2.24
- Better default fonts - `sans-serif` style for the index and the titles,
`serif` for the articles' body.
## 0.2.19
- Added `short_feed` configuration flag to permanently disable returning the

View File

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

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":
@ -140,7 +140,7 @@ class BlogApp(Flask):
else None
),
content=markdown(
f.read(), extensions=["fenced_code", "codehilite", MarkdownLatex()]
f.read(), extensions=["fenced_code", "codehilite", "tables", MarkdownLatex()]
),
skip_header=skip_header,
skip_html_head=skip_html_head,

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

@ -2,7 +2,7 @@ html {
height: -webkit-fill-available;
height: -moz-available;
font-size: 20px;
font-family: -apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Open Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: Lora, "Palatino Linotype", "Book Antiqua", "New York", "DejaVu serif", serif;
font-weight: 400;
text-rendering: optimizeLegibility;
}
@ -119,6 +119,10 @@ h2 {
line-height: 1.1em;
}
h1, h2, h3, h4, h5, h6 {
font-family: -apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Open Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
footer {
width: 100%;
font-size: .65em;
@ -129,3 +133,7 @@ footer {
text-align: center;
box-shadow: 1px -2px 2px 0 #bbb;
}
.index {
font-family: -apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Open Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

View File

@ -1,8 +1,7 @@
[bumpversion]
current_version = 0.2.22
current_version = 0.2.26
commit = True
tag = True
[metadata]
description-file = README.md

View File

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