Skip to content

Commit 6363ee1

Browse files
Grzegorz Kocjangkocjan
authored andcommitted
Generate meetup in a dynamic way for better content handling
1 parent 37febbd commit 6363ee1

File tree

13 files changed

+191
-27
lines changed

13 files changed

+191
-27
lines changed

assets/css/custom.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* limits Table of Content item length */
2+
nav#TableOfContents ul li a {
3+
display: inline-block;
4+
max-width: 20ch;
5+
overflow: hidden;
6+
text-overflow: ellipsis;
7+
white-space: nowrap;
8+
vertical-align: bottom;
9+
}
810 KB
Loading
803 KB
Loading

config/_default/params.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ disableTextInHeader = false
2626

2727
highlightCurrentMenuArea = true
2828
smartTOC = true
29-
smartTOCHideUnfocusedChildren = true
29+
smartTOCHideUnfocusedChildren = false
3030

3131
giteaDefaultServer = "https://git.fsfe.org"
3232
forgejoDefaultServer = "https://v8.next.forgejo.org"
@@ -72,7 +72,7 @@ forgejoDefaultServer = "https://v8.next.forgejo.org"
7272
seriesOpened = false
7373
showHeadingAnchors = true
7474
showPagination = true
75-
invertPagination = false
75+
invertPagination = true
7676
showReadingTime = false
7777
showTableOfContents = true
7878
# showRelatedContent = false

content/spotkania/_content.gotmpl

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{{ range $meetup_number, $meetup := site.Data.meetups }}
2+
3+
{{ $time := .Site.Params.dateParse "2006-01-02" $meetup.date }}
4+
5+
{{ $contentValue := printf `
6+
## Informacje
7+
8+
**📅 data:** %s</br>
9+
**🕕 godzina:** %s</br>
10+
**📍 miejsce:** %s</br>`
11+
$meetup.date $meetup.time $meetup.place
12+
}}
13+
14+
{{ if $meetup.live_stream }}
15+
{{ $liveLink := printf "{{< youtubeLite id=\"%s\" label=\"%s\" >}}" $meetup.live_stream "Label" }}
16+
{{ $contentValue = printf "%s \n ## Live Stream \n %s" $contentValue $liveLink }}
17+
{{ end }}
18+
19+
{{ $contentValue := printf "%s \n ## Prelekcje" $contentValue}}
20+
21+
{{ range $meetup.talks }}
22+
{{ $cleanedTitle := replace (replace .talk_title "\n" " ") "\t" " " }}
23+
{{ $cleanedTitle = replaceRE `\s+` " " $cleanedTitle }}
24+
{{ $contentValue = printf "%s \n ### %s" $contentValue $cleanedTitle }}
25+
{{ $contentValue = printf "%s \n %s" $contentValue (printf "{{< speaker speaker_id=\"%s\" >}}" .speaker_id) }}
26+
{{ if .talk_description }}
27+
{{ $contentValue = printf "%s \n %s" $contentValue .talk_description }}
28+
{{ end }}
29+
{{ end }}
30+
31+
{{ $contentValue = printf "%s \n ## Sponsorzy" $contentValue }}
32+
{{ range $meetup.sponsors }}
33+
{{ $contentValue = printf "%s \n %s </br>" $contentValue (printf "{{< article link=\"/sponsorzy/%s/\" >}}" .) }}
34+
{{ end }}
35+
36+
{{/* Add page. */}}
37+
{{ $content := dict "mediaType" "text/markdown" "value" $contentValue }}
38+
{{ $params := dict "talks" $meetup.talks }}
39+
40+
{{ $dates := dict "date" (time.AsTime $meetup.date) }}
41+
{{ $page := dict
42+
"content" $content
43+
"dates" $dates
44+
"time" $meetup.time
45+
"place" $meetup.place
46+
"params" $params
47+
"path" $meetup_number
48+
"title" $meetup.title
49+
}}
50+
{{ $.AddPage $page }}
51+
52+
{{/* Add featured image. */}}
53+
{{ $info_graphic := ""}}
54+
{{ if eq (len $meetup.talks) 1 }}
55+
{{- $info_graphic = partial "infographic-image-solo.html" (dict "meetup" $meetup) -}}
56+
{{ end }}
57+
{{ if eq (len $meetup.talks) 2 }}
58+
{{- $info_graphic = partial "infographic-image-duo.html" (dict "meetup" $meetup) -}}
59+
{{ end }}
60+
61+
{{ $content := dict
62+
"mediaType" $info_graphic.MediaType.Type
63+
"value" $info_graphic
64+
}}
65+
{{ $resource := dict
66+
"content" $content
67+
"path" (printf "%s/featured.png" $meetup_number)
68+
}}
69+
{{ $.AddResource $resource }}
70+
71+
72+
73+
{{ end }}

content/spotkania/_index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
---
3+
title: Spotkania
4+
orderByWeight: false
5+
---
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
title: "Meetup #55"
32
date: 2024-11-27
43
time: "18:00"
@@ -18,8 +17,3 @@ talks:
1817
talk_description: "W tej prezentacji omówimy różnice między standardowym loggerem a Loguru, pokażemy, jak efektywnie wykorzystać ustrukturyzowane logi w projekcie oraz podkreślimy znaczenie logów w procesie tworzenia oprogramowania dla zapewnienia wysokiej jakości i niezawodności aplikacji."
1918
language: "pl"
2019
youtube: "xA6o40uxuso"
21-
22-
---
23-
24-
{{< meetup-details >}}
25-
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
title: "Meetup #56"
32
date: 2025-01-29
43
time: "18:00"
@@ -11,7 +10,4 @@ talks:
1110
talk_title: "Nowość w Pythonie 3.14 oraz PyScript"
1211
language: "pl"
1312
youtube: "9POijqwrHuw"
14-
---
15-
16-
{{< meetup-details >}}
1713

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
title: "Meetup #57"
32
date: 2025-03-26
43
time: "18:00"
@@ -36,7 +35,3 @@ talks:
3635
talk_title: "Detektyw w świecie Pythona"
3736
talk_description: "Wcielimy się w rolę detektywów, którzy z użyciem narzędzi do profilowania odkryją tajemnice tych narzędzi. Opowiem czym są takie narzędzia oraz jak działają. Dodatkowo wspólnie przejdziemy przez różne codebase-y, na których pokaże jak korzystać z tych narzędzi aby efektywnie rozwiązać problem z wydajnością i przyspieszyć działanie naszego kodu. Wszystkie osoby zainteresowane optymalizacją aplikacji i rozwiązywaniem problemów z wydajnością są mile widziane!"
3837
language: "pl"
39-
40-
---
41-
42-
{{< meetup-details >}}

data/speakers/sebastian-buczynski.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ bio: "W branży od 12 lat z doświadczeniami lidera technicznego i architekta. T
44
social: [
55
{ facebook: "https://www.facebook.com/sebastian.buczynski.tsn" },
66
{ linkedin: "https://www.linkedin.com/in/sebastianbuczynski" },
7-
{ link: "https://michalmoroz.com/" },
8-
{ link: "https://makimo.com/" }
97
]
108

0 commit comments

Comments
 (0)