Compare commits

..

No commits in common. "63a263724ce830251d45f60c0caf12aa20640e15" and "30d6f99c9b24782d667e3edc82bddda01a76f808" have entirely different histories.

2 changed files with 3 additions and 5 deletions

View File

@ -1,8 +1,8 @@
"""Generate Atom and RSS feeds based on content in a blog-ish location. """Generate Atom and RSS feeds based on content in a blog-ish location.
This parses a special root directory, feed/, for YYYYMMDD-foo.md files, This parses a special root directory, feed/, for feed/YYYY/MM/DD/file files,
and combines them into an Atom or RSS feed. These files *should* be symlinks and combines them into an Atom or RSS feed. These files *should* be symlinks
to the real pages, which may mirror the same YYYYMMDD-foo.md file naming scheme to the real pages, which may mirror the same YYYY/MM/DD/file naming scheme
under pages/ (which may make sense for a blog) if they want, but could just under pages/ (which may make sense for a blog) if they want, but could just
as well be pages/foo content. as well be pages/foo content.
@ -68,6 +68,6 @@ def serve_feed(feed_type):
def _generate_feed_id(feed_entry_path): def _generate_feed_id(feed_entry_path):
"""For a relative file path, generate the Atom/RSS feed ID for it.""" """For a relative file path, generate the Atom/RSS feed ID for it."""
date = re.sub(r'.*(\d{4})(\d{2})(\d{2}).*', r'\1-\2-\3', feed_entry_path) date = re.sub(r'.*/(\d+)/(\d+)/(\d+).*', r'\1-\2-\3', feed_entry_path)
cleaned = feed_entry_path.replace('#', '/').replace('feed/', '', 1).replace(app.instance_path, '') cleaned = feed_entry_path.replace('#', '/').replace('feed/', '', 1).replace(app.instance_path, '')
return f'tag:{app.config["DOMAIN_NAME"]},{date}:{cleaned}' return f'tag:{app.config["DOMAIN_NAME"]},{date}:{cleaned}'

View File

@ -9,8 +9,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="{{ user_style }}"> <link rel="stylesheet" href="{{ user_style }}">
<link rel="icon" href="{% if config.FAVICON %}{{ config.FAVICON }}{% else %}{{ url_for('static', filename='img/favicon.png') }}{% endif %}"> <link rel="icon" href="{% if config.FAVICON %}{{ config.FAVICON }}{% else %}{{ url_for('static', filename='img/favicon.png') }}{% endif %}">
<link rel="alternate" type="application/atom+xml" href="/feed/atom" />
<link rel="alternate" type="application/rss+xml" href="/feed/rss" />
<div {% block site_class %}class="site-wrap site-wrap-normal-width"{% endblock %}> <div {% block site_class %}class="site-wrap site-wrap-normal-width"{% endblock %}>
{% block header %} {% block header %}