Skip to content

Commit

Permalink
Merge pull request #2 from qgis-ch/port_courses_to_liquid
Browse files Browse the repository at this point in the history
Port courses to liquid
  • Loading branch information
webrian authored Dec 10, 2023
2 parents f7dec11 + c42fb2d commit b8807ac
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 103 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/build-pages-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,6 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v3

- name: Setup Python environment
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install jinja2
- name: Write courses pages
run: |
cd ./scripts/; ./write-courses.py
- name: Setup Ruby environment
uses: ruby/setup-ruby@v1
with:
Expand Down
37 changes: 37 additions & 0 deletions _includes/courstable.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{%- if include.program.size >= 1 -%}
<table class="table table-striped-columns">
<tbody>
<tr>
{%- if page.lang == 'de' -%}
<th>Datum</th><th>Kurzbeschrieb</th><th>Link</th>
{%- elsif page.lang == 'fr' -%}
<th>Date</th><th>Brève description</th><th>Lien</th>
{%- endif -%}
</tr>
{% for d in include.program %}
{% comment %}
see also: https://stackoverflow.com/questions/7087376/comparing-dates-in-liquid
{% endcomment %}
{% capture nowunix %}{{ 'now' | date: '%s' }}{% endcapture %}
{% capture posttime %}{{ d.date | date: '%s' }}{% endcapture %}
{% if posttime > nowunix %}
<tr>
<td>{{ d.date }}</td>
{% if page.lang == 'de' %}
<td>{{ d.title_de }}</td>
{% elsif page.lang == 'fr' %}
<td>{{ d.title_fr }}</td>
{% endif %}
<td><a href="{{ d.url }}" class="external-link">{{ d.url }}</a></td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{%- else -%}
{%- if lang == "de" -%}
<i>Keine bevorstehenden Veranstaltungen oder Kurse eingetragen</i>
{%- else -%}
<i>Aucun événement ou cours à venir</i>
{%- endif -%}
{%- endif -%}
2 changes: 1 addition & 1 deletion de/kurse/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ für QGIS Anwender sind. Sämtliche Kurse oder Veranstaltungen werden von extern
Firmen oder Organisationen durchgeführt, für weitere Fragen wenden Sie sich bitte
direkt an die Organisatoren.

{% include courstable-de.html %}
{% include courstable.html program=site.data.kurse-cours %}

Veranstalten Sie einen Kurs oder Veranstaltung, welche im Interesse von QGIS
Anwendern ist? Wenden Sie sich bitte an den Vorstand oder erstellen Sie direkt
Expand Down
4 changes: 2 additions & 2 deletions fr/cours/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ intéresser les utilisateurs de QGIS. Tous les cours ou activités sont organis
par des entreprises ou organisations externes. Pour plus d'informations, veuillez
contacter directement les organisateurs.

{% include courstable-fr.html %}
{% include courstable.html program=site.data.kurse-cours %}

Organisez-vous un cours ou une activité dans l'intérêt des utilisateurs de QGIS?
Veuillez vous adresser au comité ou créez directement un
[Pull Request dans le GitHub Repository](https://github.com/qgis-ch/qgis-ch-website/blob/main/_data/kurse-cours.csv){: .external-link :}.
[Pull Request dans le GitHub Repository](https://github.com/qgis-ch/qgis-ch-website/blob/main/_data/kurse-cours.csv){: .external-link :}.
20 changes: 0 additions & 20 deletions scripts/template.html

This file was deleted.

66 changes: 0 additions & 66 deletions scripts/write-courses.py

This file was deleted.

0 comments on commit b8807ac

Please sign in to comment.