Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Broken RSS/Atom Feed Generation #69

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ title = "Zola Terminimal theme"
compile_sass = true

# The theme supports feeds (RSS and ATOM)
generate_feed = true
generate_feeds = true

# Use `rss.xml` for RSS feeds and `atom.xml` for ATOM.
feed_filename = "atom.xml"
feed_filenames = ["atom.xml"]

# Optional: enable tags
taxonomies = [
Expand Down
27 changes: 27 additions & 0 deletions sass/font-exo2.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@font-face {
font-family: 'Exo2';
src: url('fonts/Exo2-Regular.woff2?sha=123456789') format('woff2'), url('fonts/Exo2-Regular.woff?sha=123456789') format('woff');
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: 'Exo2';
src: url('fonts/Exo2-Bold.woff2?sha=123456789') format('woff2'), url('fonts/Exo2-Bold.woff?sha=123456789') format('woff');
font-weight: 700;
font-style: normal;
}

@font-face {
font-family: 'Exo2';
src: url('fonts/Exo2-Italic.woff2?sha=123456789') format('woff2'), url('fonts/Exo2-Italic.woff?sha=123456789') format('woff');
font-weight: 400;
font-style: italic;
}

@font-face {
font-family: 'Exo2';
src: url('fonts/Exo2-BoldItalic.woff2?sha=123456789') format('woff2'), url('fonts/Exo2-BoldItalic.woff?sha=123456789') format('woff');
font-weight: 700;
font-style: italic;
}
8 changes: 4 additions & 4 deletions sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ html {
body {
margin: 0;
padding: 0;
font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
font-size: 1rem;
font-family: Exo2, Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
font-size: 1.25rem;
line-height: 1.54;
background-color: var(--background);
color: var(--color);
Expand Down Expand Up @@ -123,11 +123,11 @@ code {
background: var(--accent-alpha-20);
padding: 1px 6px;
margin: 0 2px;
font-size: .95rem;
font-size: 1rem;
}

pre {
font-family: Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
font-family: Exo2, Hack, DejaVu Sans Mono, Monaco, Consolas, Ubuntu Mono, monospace;
padding: 20px;
font-size: .95rem;
overflow: auto;
Expand Down
Binary file added static/fonts/Exo2-Bold.woff
Binary file not shown.
Binary file added static/fonts/Exo2-Bold.woff2
Binary file not shown.
Binary file added static/fonts/Exo2-BoldItalic.woff
Binary file not shown.
Binary file added static/fonts/Exo2-BoldItalic.woff2
Binary file not shown.
Binary file added static/fonts/Exo2-Italic.woff
Binary file not shown.
Binary file added static/fonts/Exo2-Italic.woff2
Binary file not shown.
Binary file added static/fonts/Exo2-Regular.woff
Binary file not shown.
Binary file added static/fonts/Exo2-Regular.woff2
Binary file not shown.
24 changes: 16 additions & 8 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,25 @@

{%- block open_graph %}{{ head_macros::open_graph(config=config) }}{% endblock open_graph -%}

{%- if config.generate_feed %}
{%- if "rss" in config.feed_filename %}
{% set feed_type = 'rss+xml' %}
{%- else %}
{% set feed_type = 'atom+xml' %}
{% endif -%}
<link rel="alternate" type="application/{{ feed_type }}" title="RSS" href="{{ get_url(path=config.feed_filename) | safe }}">
{%- if config.generate_feeds %}
{%- for feed in config.feed_filenames %}

{%- if feed is containing('atom') %}
<link rel="alternate" type="application/atom+xml" title="{{ config.title }} Atom Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
{%- endif %}

{%- if feed is containing('rss') %}
<link rel="alternate" type="application/rss+xml" title="{{ config.title }} RSS Feed" href="{{ get_url(path=feed, trailing_slash=false, lang=lang) | safe }}" />
{%- endif %}

{%- endfor %}
{% endif -%}

{%- if config.extra.favicon %}
<link rel="shortcut icon" type="{{ config.extra.favicon_mimetype | default(value="image/x-icon") | safe }}" href="{{ config.extra.favicon | safe }}">
<link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png"><!-- 180×180 -->
<link rel="manifest" href="/manifest.webmanifest">
{% endif -%}

{%- block extra_head %}
Expand Down
5 changes: 4 additions & 1 deletion templates/macros/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
{% endif -%}
{% endif -%}

{%- if config.extra.use_full_hack_font %}
{%- if config.extra.use_full_hack_font == "exo2" %}
<link rel="stylesheet" href="{{ get_url(path="font-exo2.css", trailing_slash=false) | safe }}">
<link rel="stylesheet" href="{{ get_url(path="font-hack.css", trailing_slash=false) | safe }}">
{%- elif config.extra.use_full_hack_font %}
<link rel="stylesheet" href="{{ get_url(path="font-hack.css", trailing_slash=false) | safe }}">
{% else %}
<link rel="stylesheet" href="{{ get_url(path="font-hack-subset.css", trailing_slash=false) | safe }}">
Expand Down