Compare commits
19 commits
Author | SHA1 | Date | |
---|---|---|---|
Fabio Manganiello | ba801995a8 | ||
Fabio Manganiello | 7bea868899 | ||
Fabio Manganiello | 6de5db8485 | ||
Fabio Manganiello | aec603f2e8 | ||
Fabio Manganiello | cece2bee68 | ||
Fabio Manganiello | e11c3b2688 | ||
Fabio Manganiello | 50207d7e25 | ||
Fabio Manganiello | 8d74cb0c26 | ||
Fabio Manganiello | 90d85fedb4 | ||
Fabio Manganiello | 279d885478 | ||
Fabio Manganiello | 56417c6763 | ||
Fabio Manganiello | d78393f1b3 | ||
Fabio Manganiello | bf80f73950 | ||
Fabio Manganiello | 38b079d42d | ||
Fabio Manganiello | 43897cc961 | ||
Fabio Manganiello | bf714a30bc | ||
89ea18a805 | |||
Fabio Manganiello | e3b30e6a98 | ||
817b23ac69 |
|
@ -1,5 +1,10 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.2.24
|
||||||
|
|
||||||
|
- Better default fonts - `sans-serif` style for the index and the titles,
|
||||||
|
`serif` for the articles' body.
|
||||||
|
|
||||||
## 0.2.19
|
## 0.2.19
|
||||||
|
|
||||||
- Added `short_feed` configuration flag to permanently disable returning the
|
- Added `short_feed` configuration flag to permanently disable returning the
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
__version__ = '0.2.21'
|
__version__ = "0.2.29"
|
||||||
|
|
|
@ -61,20 +61,17 @@ class BlogApp(Flask):
|
||||||
with open(md_file, "r") as f:
|
with open(md_file, "r") as f:
|
||||||
metadata["uri"] = "/article/" + page[:-3]
|
metadata["uri"] = "/article/" + page[:-3]
|
||||||
|
|
||||||
for line in f.readlines():
|
for line in f:
|
||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not (m := re.match(r"^\[//]: # \(([^:]+):\s*([^)]+)\)\s*$", line)):
|
if not (m := re.match(r"^\[//]: # \(([^:]+):\s*(.*)\)\s*$", line)):
|
||||||
break
|
break
|
||||||
|
|
||||||
if m.group(1) == "published":
|
if m.group(1) == "published":
|
||||||
try:
|
metadata[m.group(1)] = datetime.datetime.fromisoformat(
|
||||||
metadata[m.group(1)] = datetime.date.fromisoformat(m.group(2))
|
m.group(2)
|
||||||
except ValueError:
|
).date()
|
||||||
metadata[m.group(1)] = datetime.datetime.fromisoformat(
|
|
||||||
m.group(2)
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
metadata[m.group(1)] = m.group(2)
|
metadata[m.group(1)] = m.group(2)
|
||||||
|
|
||||||
|
@ -143,7 +140,7 @@ class BlogApp(Flask):
|
||||||
else None
|
else None
|
||||||
),
|
),
|
||||||
content=markdown(
|
content=markdown(
|
||||||
f.read(), extensions=["fenced_code", "codehilite", MarkdownLatex()]
|
f.read(), extensions=["fenced_code", "codehilite", "tables", MarkdownLatex()]
|
||||||
),
|
),
|
||||||
skip_header=skip_header,
|
skip_header=skip_header,
|
||||||
skip_html_head=skip_html_head,
|
skip_html_head=skip_html_head,
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
from urllib.parse import urljoin
|
||||||
|
|
||||||
from flask import (
|
from flask import (
|
||||||
jsonify,
|
jsonify,
|
||||||
|
@ -160,22 +162,29 @@ def rss_route():
|
||||||
<link>{base_link}{link}</link>
|
<link>{base_link}{link}</link>
|
||||||
<pubDate>{published}</pubDate>
|
<pubDate>{published}</pubDate>
|
||||||
<description><![CDATA[{content}]]></description>
|
<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>
|
</item>
|
||||||
"""
|
"""
|
||||||
).format(
|
).format(
|
||||||
base_link=config.link,
|
base_link=config.link,
|
||||||
title=page.get("title", "[No Title]"),
|
title=page.get("title", "[No Title]"),
|
||||||
link=page.get("uri", ""),
|
link=page.get("uri", ""),
|
||||||
published=page["published"].strftime(
|
published=(
|
||||||
"%a, %d %b %Y %H:%M:%S GMT"
|
page["published"].strftime("%a, %d %b %Y %H:%M:%S GMT")
|
||||||
)
|
if "published" in page
|
||||||
if "published" in page
|
else ""
|
||||||
else "",
|
),
|
||||||
content=page.get("description", "")
|
content=(
|
||||||
if short_description
|
page.get("description", "")
|
||||||
else page.get("content", ""),
|
if short_description
|
||||||
image=page.get("image", ""),
|
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
|
for _, page in pages
|
||||||
]
|
]
|
||||||
|
|
|
@ -9,10 +9,15 @@ main .content ul {
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
|
font-size: 0.95em;
|
||||||
|
}
|
||||||
|
|
||||||
|
main .content p {
|
||||||
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
main .content code, .codehilite {
|
main .content code, .codehilite {
|
||||||
font-size: .85em;
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 767px) {
|
@media screen and (max-width: 767px) {
|
||||||
|
|
|
@ -2,7 +2,8 @@ html {
|
||||||
height: -webkit-fill-available;
|
height: -webkit-fill-available;
|
||||||
height: -moz-available;
|
height: -moz-available;
|
||||||
font-size: 20px;
|
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-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
text-rendering: optimizeLegibility;
|
text-rendering: optimizeLegibility;
|
||||||
}
|
}
|
||||||
|
@ -119,6 +120,10 @@ h2 {
|
||||||
line-height: 1.1em;
|
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 {
|
footer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: .65em;
|
font-size: .65em;
|
||||||
|
@ -129,3 +134,7 @@ footer {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
box-shadow: 1px -2px 2px 0 #bbb;
|
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,8 +1,7 @@
|
||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 0.2.21
|
current_version = 0.2.29
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
description-file = README.md
|
description-file = README.md
|
||||||
|
|
||||||
|
|
38
setup.py
38
setup.py
|
@ -5,38 +5,38 @@ from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
|
||||||
def readfile(file):
|
def readfile(file):
|
||||||
with open(file, 'r') as f:
|
with open(file, "r") as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='madblog',
|
name="madblog",
|
||||||
version='0.2.21',
|
version="0.2.29",
|
||||||
author='Fabio Manganiello',
|
author="Fabio Manganiello",
|
||||||
author_email='info@fabiomanganiello.com',
|
author_email="info@fabiomanganiello.com",
|
||||||
description='A minimal platform for Markdown-based blogs',
|
description="A minimal platform for Markdown-based blogs",
|
||||||
license='MIT',
|
license="MIT",
|
||||||
python_requires='>= 3.8',
|
python_requires=">= 3.8",
|
||||||
keywords='blog markdown',
|
keywords="blog markdown",
|
||||||
url='https://git.platypush.tech/blacklight/madblog',
|
url="https://git.platypush.tech/blacklight/madblog",
|
||||||
packages=find_packages(include=['madblog']),
|
packages=find_packages(include=["madblog"]),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': [
|
"console_scripts": [
|
||||||
'madblog=madblog.cli:run',
|
"madblog=madblog.cli:run",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
long_description=readfile('README.md'),
|
long_description=readfile("README.md"),
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type="text/markdown",
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Topic :: Utilities",
|
"Topic :: Utilities",
|
||||||
"License :: OSI Approved :: MIT License",
|
"License :: OSI Approved :: MIT License",
|
||||||
"Development Status :: 4 - Beta",
|
"Development Status :: 4 - Beta",
|
||||||
],
|
],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'flask',
|
"flask",
|
||||||
'markdown',
|
"markdown",
|
||||||
'pygments',
|
"pygments",
|
||||||
'pyyaml',
|
"pyyaml",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue