Skip to content

Commit 7f68150

Browse files
authored
update to fancier minijinja templating support (#41)
* update to fancier minijinja templating support haecker-felix/hebbot#83 * update build to main Signed-off-by: HarHarLinks <[email protected]> * Escape youtube command Signed-off-by: Kim Brose <[email protected]> --------- Signed-off-by: HarHarLinks <[email protected]> Signed-off-by: Kim Brose <[email protected]>
1 parent 2f61e69 commit 7f68150

File tree

8 files changed

+73
-55
lines changed

8 files changed

+73
-55
lines changed

charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ description: A Helm chart for running ThisWeekInMatrix bot
44
type: application
55

66
version: "0.1.0"
7-
appVersion: "latest"
7+
appVersion: "20251118"

charts/files/project_template.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

charts/files/report_template.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

charts/files/section_template.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

charts/files/template.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
+++
2+
date = "{{ timestamp | datetimeformat(format="iso") }}"
3+
title = "This Week in Matrix {{ timestamp | dateformat(format="short") }}"
4+
path = "/blog/{{ timestamp | datetimeformat(format="[year]/[month]/[day]") }}/this-week-in-matrix-{{ timestamp | dateformat(format="short") }}"
5+
6+
[taxonomies]
7+
author = ["{{ editor }}"]
8+
category = ["This Week in Matrix"]
9+
+++
10+
11+
## Matrix Live
12+
13+
{% raw %}{{youtube_player(video_id="")}}{% endraw %}
14+
15+
{%- macro news(news_items) -%}
16+
{%- for item in news_items %}
17+
18+
[{{ item.reporter_display_name }}](https://matrix.to/#{{ item.reporter_id }}) {{ config.verbs | random }}
19+
20+
> {{ item.message | replace("\n", "\n> ") }}
21+
{%- if item.images -%}
22+
{%- for imgId, image in item.images | dictsort %}
23+
> ![]({{ image[0] }})
24+
{%- endfor %}
25+
{%- endif -%} {#- news item images #}
26+
27+
{%- if item.videos -%}
28+
{%- for vidId, video in item.videos | dictsort %}
29+
> {{ "{{" }}<video src="{{ video[0] }}">{{ "}}" }}
30+
{%- endfor %}
31+
{%- endif -%} {#- news item videos #}
32+
33+
{%- endfor %} {#- news_items #}
34+
{%- endmacro %}
35+
36+
{%- for key, entry in sections | dictsort %}
37+
38+
## {{entry.section.title}}
39+
40+
{{- news(entry.news) }}
41+
42+
{%- for entry in entry.projects %}
43+
44+
### {{entry.project.title}} ([website]({{entry.project.website}}))
45+
46+
{{entry.project.description}}
47+
48+
{{- news(entry.news) }}
49+
50+
{%- endfor %} {#- projects #}
51+
52+
{%- endfor %} {#- sections #}
53+
54+
## Dept of Ping
55+
56+
Here we reveal, rank, and applaud the homeservers with the lowest ping, as measured by [pingbot](https://github.com/maubot/echo), a [maubot](https://github.com/maubot/maubot) that you can host on your own server.
57+
58+
### [#ping:maunium.net](https://matrix.to/#/#ping:maunium.net)
59+
Join [#ping:maunium.net](https://matrix.to/#/#ping:maunium.net) to experience the fun live, and to find out how to add YOUR server to the game.
60+
61+
## That's all I know
62+
63+
See you next week, and be sure to stop by [#twim:matrix.org](https://matrix.to/#/#twim:matrix.org) with your updates!
64+
65+
To learn more about how to prepare an entry for TWIM check out [the TWIM guide](@/twim-guide.md).

charts/templates/config.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,5 @@ metadata:
55
data:
66
config.toml: |-
77
{{- $.Files.Get "files/config.toml" | nindent 4 }}
8-
project_template.md: |-
9-
{{- $.Files.Get "files/project_template.md" | nindent 4 }}
10-
report_template.md: |-
11-
{{- $.Files.Get "files/report_template.md" | nindent 4 }}
12-
section_template.md: |-
13-
{{- $.Files.Get "files/section_template.md" | nindent 4 }}
14-
8+
template.md: |-
9+
{{- $.Files.Get "files/template.md" | nindent 4 }}

charts/templates/statefulset.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,8 @@ spec:
4545
env:
4646
- name: CONFIG_PATH
4747
value: /config/config.toml
48-
- name: REPORT_TEMPLATE_PATH
49-
value: /config/report_template.md
50-
- name: SECTION_TEMPLATE_PATH
51-
value: /config/section_template.md
52-
- name: PROJECT_TEMPLATE_PATH
53-
value: /config/project_template.md
48+
- name: TEMPLATE_PATH
49+
value: /config/template.md
5450
- name: STORE_PATH
5551
value: /data/store.json
5652
{{- with .Values.env }}
@@ -162,4 +158,4 @@ spec:
162158
{{- else }}
163159
emptyDir: {}
164160
{{- end }}
165-
{{- end }}
161+
{{- end }}

charts/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
replicaCount: 1
22

33
image:
4-
registry: "docker.io"
5-
repository: haeckerfelix/hebbot
4+
registry: "ghcr.io"
5+
repository: harharlinks/hebbot
66
pullPolicy: IfNotPresent
77
# Overrides the image tag whose default is the chart appVersion.
88
tag: ""

0 commit comments

Comments
 (0)