Tweak Atom feed
continuous-integration/drone/push Build is passing Details

pull/1/head
mat ess 2022-11-18 22:56:45 -05:00
parent 10a0da5f48
commit 6223925fc1
3 changed files with 33 additions and 20 deletions

View File

@ -13,7 +13,7 @@ heroPrompt = "A rogue program hacking through the firewall, in the style of Tron
> While many readers will be very familiar with the concept of a function and the idea of parameterizing some piece of code or data, others might appreciate a bit of background. [Take a look at the appendix for a tangential explainer of some fundamental ideas referenced throughout this post.](#appendix) > While many readers will be very familiar with the concept of a function and the idea of parameterizing some piece of code or data, others might appreciate a bit of background. [Take a look at the appendix for a tangential explainer of some fundamental ideas referenced throughout this post.](#appendix)
<div id=jumpback /> <div id=jumpback></div>
From outside of a flake's Nix expression, the flake is a black box, a mapping from its input sources to the artifacts that it outputs. There is no built-in way to pass an arbitrary value, a boolean flag or string, from the command line in order to override a deeply nested configuration embedded in your flake. In most cases, this is fine, and you can work around many apparent needs for a one off override by building separate outputs for different purposes. Your flakes will probably come out better designed if you can use them strictly as intended. From outside of a flake's Nix expression, the flake is a black box, a mapping from its input sources to the artifacts that it outputs. There is no built-in way to pass an arbitrary value, a boolean flag or string, from the command line in order to override a deeply nested configuration embedded in your flake. In most cases, this is fine, and you can work around many apparent needs for a one off override by building separate outputs for different purposes. Your flakes will probably come out better designed if you can use them strictly as intended.

View File

@ -1,3 +1,4 @@
{% import "macros/macros.html" as post_macros %}
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}"> <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}">
<title>{{ config.title }} <title>{{ config.title }}
@ -8,28 +9,36 @@
{%- if config.description %} {%- if config.description %}
<subtitle>{{ config.description }}</subtitle> <subtitle>{{ config.description }}</subtitle>
{%- endif %} {%- endif %}
<author>
<name>mat ess</name>
<email>mat@mat.services</email>
<uri>https://www.mat.services</uri>
</author>
<link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/> <link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/>
<link href=" <icon>{{ get_url(path="/images/favicon.svg") }}</icon>
{%- if section -%} <rights>&#169; 2022 mat ess</rights>
{{ section.permalink | escape_xml | safe }}
{%- else -%}
{{ config.base_url | escape_xml | safe }}
{%- endif -%}
"/>
<generator uri="https://www.getzola.org/">Zola</generator> <generator uri="https://www.getzola.org/">Zola</generator>
<updated>{{ last_updated | date(format="%+") }}</updated> <updated>{{ last_updated | date(format="%+") }}</updated>
<id>{{ feed_url | safe }}</id> <id>{{ feed_url | safe }}</id>
{%- for page in pages %} {%- for page in pages %}
{%- if page.draft %} {%- if page.draft %}
{% continue %} {% continue %}
{% endif -%} {% endif %}
<entry xml:lang="{{ page.lang }}"> <entry xml:lang="{{ page.lang }}">
<title>{{ page.title }}</title> <title>{{ page.title }}</title>
<published>{{ page.date | date(format="%+") }}</published> <published>{{ page.date | date(format="%+") }}</published>
<updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated> <updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated>
<link rel="alternate" href="{{ page.permalink | safe }}" type="text/html"/> <link rel="alternate" href="{{ page.permalink | safe }}" type="text/html"/>
<id>{{ page.permalink | safe }}</id> <id>{{ page.permalink | safe }}</id>
<content type="html">{{ page.content }}</content> <summary type="html">
<![CDATA[
{{- post_macros::hero(page=page) -}}
{{ page.description | default(value="") -}}
]]>
</summary>
<content type="html">
{{ page.content }}
</content>
</entry> </entry>
{%- endfor %} {% endfor %}
</feed> </feed>

View File

@ -63,14 +63,7 @@
</div> </div>
{% endif -%} {% endif -%}
</div> </div>
{%- if page.extra.hero %} {{ post_macros::hero(page=page) }}
<figure>
<img width=1024 height=512 class="hero" alt="{{ page.extra.heroPrompt }} - generated using Stable Diffusion" src=hero.webp />
<figcaption>
<p><i>{{ page.extra.heroPrompt }}</i> - generated using Stable Diffusion</p>
</figcaption>
</figure>
{% endif -%}
{%- if page.extra.tldr %} {%- if page.extra.tldr %}
<div class="tldr"> <div class="tldr">
<strong>tl;dr:</strong> <strong>tl;dr:</strong>
@ -126,4 +119,15 @@
</div> </div>
{% endif -%} {% endif -%}
</article> </article>
{% endmacro content -%} {% endmacro content -%}
{% macro hero(page) %}
{%- if page.extra.hero %}
<figure>
<img width=1024 height=512 class="hero" alt="{{ page.extra.heroPrompt }} - generated using Stable Diffusion" src=hero.webp />
<figcaption>
<p><i>{{ page.extra.heroPrompt }}</i> - generated using Stable Diffusion</p>
</figcaption>
</figure>
{% endif -%}
{% endmacro hero -%}