Compare commits
No commits in common. "main" and "v0.2.21" have entirely different histories.
|
@ -1,10 +1,5 @@
|
|||
# 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
|
||||
|
|
|
@ -1 +1 @@
|
|||
__version__ = "0.2.29"
|
||||
__version__ = '0.2.21'
|
||||
|
|
|
@ -61,17 +61,20 @@ class BlogApp(Flask):
|
|||
with open(md_file, "r") as f:
|
||||
metadata["uri"] = "/article/" + page[:-3]
|
||||
|
||||
for line in f:
|
||||
for line in f.readlines():
|
||||
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":
|
||||
try:
|
||||
metadata[m.group(1)] = datetime.date.fromisoformat(m.group(2))
|
||||
except ValueError:
|
||||
metadata[m.group(1)] = datetime.datetime.fromisoformat(
|
||||
m.group(2)
|
||||
).date()
|
||||
)
|
||||
else:
|
||||
metadata[m.group(1)] = m.group(2)
|
||||
|
||||
|
@ -140,7 +143,7 @@ class BlogApp(Flask):
|
|||
else None
|
||||
),
|
||||
content=markdown(
|
||||
f.read(), extensions=["fenced_code", "codehilite", "tables", MarkdownLatex()]
|
||||
f.read(), extensions=["fenced_code", "codehilite", MarkdownLatex()]
|
||||
),
|
||||
skip_header=skip_header,
|
||||
skip_html_head=skip_html_head,
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import os
|
||||
import re
|
||||
from typing import Optional
|
||||
from urllib.parse import urljoin
|
||||
|
||||
from flask import (
|
||||
jsonify,
|
||||
|
@ -162,29 +160,22 @@ def rss_route():
|
|||
<link>{base_link}{link}</link>
|
||||
<pubDate>{published}</pubDate>
|
||||
<description><![CDATA[{content}]]></description>
|
||||
<media:content medium="image" url="{image}" width="200" height="150" />
|
||||
<media:content medium="image" url="{base_link}{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")
|
||||
published=page["published"].strftime(
|
||||
"%a, %d %b %Y %H:%M:%S GMT"
|
||||
)
|
||||
if "published" in page
|
||||
else ""
|
||||
),
|
||||
content=(
|
||||
page.get("description", "")
|
||||
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", "")
|
||||
),
|
||||
else page.get("content", ""),
|
||||
image=page.get("image", ""),
|
||||
)
|
||||
for _, page in pages
|
||||
]
|
||||
|
|
|
@ -9,15 +9,10 @@ main .content ul {
|
|||
text-align: justify;
|
||||
overflow-wrap: break-word;
|
||||
word-break: break-word;
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
main .content p {
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
main .content code, .codehilite {
|
||||
font-size: 0.9em;
|
||||
font-size: .85em;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
|
|
|
@ -2,8 +2,7 @@ html {
|
|||
height: -webkit-fill-available;
|
||||
height: -moz-available;
|
||||
font-size: 20px;
|
||||
/* font-family: Lora, "Palatino Linotype", "Book Antiqua", "New York", "DejaVu serif", serif; */
|
||||
font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
||||
font-family: -apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Open Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-weight: 400;
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
@ -120,10 +119,6 @@ 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;
|
||||
|
@ -134,7 +129,3 @@ 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;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
[bumpversion]
|
||||
current_version = 0.2.29
|
||||
current_version = 0.2.21
|
||||
commit = True
|
||||
tag = True
|
||||
|
||||
[metadata]
|
||||
description-file = README.md
|
||||
|
||||
|
|
38
setup.py
38
setup.py
|
@ -5,38 +5,38 @@ from setuptools import setup, find_packages
|
|||
|
||||
|
||||
def readfile(file):
|
||||
with open(file, "r") as f:
|
||||
with open(file, 'r') as f:
|
||||
return f.read()
|
||||
|
||||
|
||||
setup(
|
||||
name="madblog",
|
||||
version="0.2.29",
|
||||
author="Fabio Manganiello",
|
||||
author_email="info@fabiomanganiello.com",
|
||||
description="A minimal platform for Markdown-based blogs",
|
||||
license="MIT",
|
||||
python_requires=">= 3.8",
|
||||
keywords="blog markdown",
|
||||
url="https://git.platypush.tech/blacklight/madblog",
|
||||
packages=find_packages(include=["madblog"]),
|
||||
name='madblog',
|
||||
version='0.2.21',
|
||||
author='Fabio Manganiello',
|
||||
author_email='info@fabiomanganiello.com',
|
||||
description='A minimal platform for Markdown-based blogs',
|
||||
license='MIT',
|
||||
python_requires='>= 3.8',
|
||||
keywords='blog markdown',
|
||||
url='https://git.platypush.tech/blacklight/madblog',
|
||||
packages=find_packages(include=['madblog']),
|
||||
include_package_data=True,
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
"madblog=madblog.cli:run",
|
||||
'console_scripts': [
|
||||
'madblog=madblog.cli:run',
|
||||
],
|
||||
},
|
||||
long_description=readfile("README.md"),
|
||||
long_description_content_type="text/markdown",
|
||||
long_description=readfile('README.md'),
|
||||
long_description_content_type='text/markdown',
|
||||
classifiers=[
|
||||
"Topic :: Utilities",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Development Status :: 4 - Beta",
|
||||
],
|
||||
install_requires=[
|
||||
"flask",
|
||||
"markdown",
|
||||
"pygments",
|
||||
"pyyaml",
|
||||
'flask',
|
||||
'markdown',
|
||||
'pygments',
|
||||
'pyyaml',
|
||||
],
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue