Skip to content

Commit 2523524

Browse files
authored
Merge pull request #44 from pysv/canonicalze_blog
Canonicalize blog post frontmatter to model schema
2 parents 738c06b + 08bbba7 commit 2523524

36 files changed

Lines changed: 75 additions & 316 deletions

File tree

blog.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,26 @@
77

88
CONTENT_DIR = Path(__file__).parent / "content" / "blog"
99

10+
# Canonical field order matches models/blog-post.ini with `body` moved to
11+
# the end. Only fields declared in the model are emitted here — keeping the
12+
# scaffold aligned with the rest of content/blog/.
1013
TEMPLATE_DE = """\
1114
title: {title}
1215
---
1316
pub_date: {pub_date}
1417
---
15-
author: {author}
16-
---
17-
tags:
18+
teaser_image: preview.jpg
1819
---
1920
teaser_text:
2021
2122
Kurze Zusammenfassung des Beitrags (1-2 Sätze). Wird in der Blog-Übersicht angezeigt.
22-
23-
---
24-
teaser_image: preview.jpg
2523
---
2624
cta: Weiterlesen
2725
---
2826
show_on_homepage: False
2927
---
3028
highlighted: False
3129
---
32-
_discoverable: yes
33-
---
3430
body:
3531
3632
#### Überschrift
@@ -47,25 +43,18 @@
4743
---
4844
pub_date: {pub_date}
4945
---
50-
author: {author}
51-
---
52-
tags:
46+
teaser_image: preview.jpg
5347
---
5448
teaser_text:
5549
5650
Short summary of the post (1-2 sentences). Shown in the blog overview.
57-
58-
---
59-
teaser_image: preview.jpg
6051
---
6152
cta: Read more
6253
---
6354
show_on_homepage: False
6455
---
6556
highlighted: False
6657
---
67-
_discoverable: yes
68-
---
6958
body:
7059
7160
#### Heading
@@ -110,15 +99,12 @@ def add() -> None:
11099
print(f"Error: '{pub_date}' is not a valid date (expected YYYY-MM-DD).")
111100
sys.exit(1)
112101

113-
author = prompt("Author name", default="PySV")
114-
115102
slug = f"{year}-{slugify(title)}"
116103
post_dir = CONTENT_DIR / slug
117104

118105
print(f"\n── Summary ──")
119106
print(f" Title: {title}")
120107
print(f" Date: {pub_date}")
121-
print(f" Author: {author}")
122108
print(f" Directory: content/blog/{slug}/")
123109
print(f" Files: contents.lr (DE), contents+en.lr (EN)\n")
124110

@@ -129,7 +115,7 @@ def add() -> None:
129115

130116
post_dir.mkdir(parents=True, exist_ok=False)
131117

132-
fields = {"title": title, "pub_date": pub_date, "author": author}
118+
fields = {"title": title, "pub_date": pub_date}
133119
(post_dir / "contents.lr").write_text(TEMPLATE_DE.format(**fields))
134120
(post_dir / "contents+en.lr").write_text(TEMPLATE_EN.format(**fields))
135121

content/blog/2017-jugendhalle/contents.lr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ title: Jugend hackt Halle – Bericht vom November 2017
22
---
33
pub_date: 2017-11-01
44
---
5-
author: Python Software Verband
6-
---
7-
tags: python, JugendHackt, grants, 2017
8-
---
95
teaser_text:
106

117
Während Wettbewerbe wie »Jugend musiziert« und »Jugend forscht« seit Jahrzehnten etabliert sind, finden junge Talente aus dem Bereich der Softwareentwicklung kaum einen Platz in staatlich geförderten Initiativen, obgleich das Thema in digitalisierten Gesellschaften zunehmend an Bedeutung gewinnt.

content/blog/2017-pythoncamp/contents.lr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ title: PythonCamp 2017
22
---
33
pub_date: 2017-05-01
44
---
5-
author: Python Software Verband
6-
---
7-
tags: python, pythonCamp, grants, 2017
8-
---
95
teaser_text:
106

117
Im April 2017 fand zum achten Mal das Kölner [PythonCamp](https://barcamps.eu/pycamp201704/) statt. Gleichfalls im achten Jahr unterstützte die [GFU Cyrus AG](https://www.gfu.net) die Veranstaltung indem sie Schulungsräume zur Nutzung freigab, so dass wieder ein Umfang von 75 Teilnehmern möglich wurde. Wie auch schon in den vergangenen Jahren war das PythonCamp bereits nach wenigen Tagen ausgebucht.

content/blog/2018-geopython/contents.lr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ title: GeoPython 2018
22
---
33
pub_date: 2018-06-01
44
---
5-
author: Python Software Verband
6-
---
7-
tags: python, geopython, grants, 2018
8-
---
95
teaser_text: zum dritten Mal in Folge die GeoPython-Konferenz, organisiert durch Prof. Martin Christen, am Institut Geomatik der Fachhochschule Nordwestschweiz in Muttenz/Basel stattgefunden
106
---
117
body:

content/blog/2018-pyladies-hh/contents+en.lr

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ title: PyLadies x MicroPython @ PyCon DE 2018
22
---
33
pub_date: 2018-11-01
44
---
5-
author: Python Software Verband
6-
---
7-
tags: python, pyladies, grants, pycon
8-
---
95
body:
106

117
####Im Rahmen unseres Förderprogramms unterstützen wir die PyLadies bei einem Workshop auf der PyConDE um Teilnehmer*innen mit Hardware auszustatten.
@@ -54,4 +50,4 @@ primarily to empower women tech community. We request non female
5450
attendees to be aware of these situation and make their presence
5551
discrete. Eg. by coming with a female plus one to ensure gender
5652
balance, avoiding to be heard more than the rest of the attendees in
57-
discussions and question sections.
53+
discussions and question sections.

content/blog/2018-pyladies-hh/contents.lr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ title: PyLadies x MicroPython @ PyCon DE 2018
22
---
33
pub_date: 2018-11-01
44
---
5-
author: Python Software Verband
6-
---
7-
tags: python, pyladies, grants, pycon
8-
---
95
teaser_text:
106

117
Im Rahmen unseres Förderprogramms unterstützen wir die PyLadies bei einem Workshop auf der PyConDE um Teilnehmer*innen mit Hardware auszustatten.

content/blog/2018-pythoncamp/contents.lr

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
model: _blog-post
2-
---
31
title: PythonCamp 2018
42
---
53
pub_date: 2018-05-01
64
---
7-
author: Python Software Verband
8-
---
9-
tags: python, pythonCamp, grants, 2017
10-
---
115
teaser_text:
126

137
Am 7. und 8. April 2018 gabs zum neuntem Mail das Kölner PythonCamp in den Räumnen der GFU Cyrus AG.

content/blog/2019-pycon-de-pydata-berlin/contents.lr

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
title: Entwurf: PyCon DE & PyData Berlin 2019
22
---
3-
author: Python Software Verband
4-
---
5-
show_on_homepage: no
3+
pub_date: 2019-10-11
64
---
75
teaser_image:
86
---
97
teaser_text:
108

119
Die PyCon DE & PyData Berlin 2019 war ein voller Erfolg: 1.111 Teilnehmende, ausverkauft zwei Monate im Voraus, mit 800 weiteren auf der Warteliste.
1210
---
11+
show_on_homepage: no
12+
---
1313
body:
1414

1515
## PyCon DE & PyData Berlin 2019
@@ -41,9 +41,3 @@ Die Konferenz wurde vom **Python Software Verband e.V.** in Zusammenarbeit mit *
4141
---
4242

4343
*Dieser Beitrag ist ein Entwurf und wird noch ergänzt.*
44-
---
45-
tags: pycon-de, pydata, konferenz, berlin, 2019
46-
---
47-
_discoverable: yes
48-
---
49-
pub_date: 2019-10-11

content/blog/2020-barcamp/contents.lr

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ title: Erstes Python BarCamp in Leipzig am 19. Januar 2020
22
---
33
pub_date: 2020-01-19
44
---
5-
author: Python Software Verband
6-
---
7-
avatar: custom_name.jpg
8-
---
9-
tags: python, barcamp, grants
10-
---
115
teaser_text:
126

137
Am 19. Januar 2020 findet im Leipziger Co-Workings-Space Basislager das erste Python BarCamp statt.

content/blog/2021-grants-techkids/contents.lr

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ title: Teckids e.V.: Hack'n'Sun 2021
22
---
33
pub_date: 2021-08-17
44
---
5-
author: Teckids
6-
---
7-
avatar: avatar_1f6650.svg
8-
---
9-
tags: community, kids, 2021, grants
10-
---
115
teaser_text:
126

137
Vom 7. bis zum 13. Juli 2021 fanden, erstmals unter dem Namen Hack'n'Sun, unsere diesjährigen Sommerfreizeiten, aufgeteilt in zwei Gruppen mit insgesamt 79 Teilnehmenden, statt. Diese konnten sich in einem Chat vor der Freizeit schon kennenlernen und erlernten in verschiedenen Workshops beim Basteln an ihren Projekten neue Fähigkeiten.

0 commit comments

Comments
 (0)