diff --git a/content/talks/_index.cs.md b/content/talks/_index.cs.md index d762785..34f533e 100644 --- a/content/talks/_index.cs.md +++ b/content/talks/_index.cs.md @@ -11,6 +11,11 @@ menu: landing: weight: 4 title: "Talks" +cascade: + outputs: + - HTML + - RSS + - Calendar --- Dle známého českého přísloví *„Kdo umí, umí, kdo neumí, učí.“* si členové, kteří vědí něco, co ostatní neví, připravují jednou za čas přednášky o tématech, která jim připadají zajímavá. Vzhledem k tomu, že většina starších členů Pátku jsou skalní informatici, se většina přednášek ubírá tímto směrem, avšak kdo má odvahu, může se jim postavit se svým tématem. diff --git a/content/talks/_index.en.md b/content/talks/_index.en.md index ce72e16..d60c92d 100644 --- a/content/talks/_index.en.md +++ b/content/talks/_index.en.md @@ -11,6 +11,11 @@ menu: landing: weight: 4 title: "Talks" +cascade: + outputs: + - HTML + - RSS + - Calendar --- In the spirit of a known Czech saying, that can be roughly translated to *"Who is good at something does it, who is bad at something teaches it."* students, who know something the others don't, prepare talks about topics they consider interesting. Because most members are conservative computer scientists, most these talks follow this direction, but if there is anyone brave enough, they can stand up to them with their topics. diff --git a/themes/patek/assets/css/main.scss b/themes/patek/assets/css/main.scss index 60d0e1b..f66bab1 100644 --- a/themes/patek/assets/css/main.scss +++ b/themes/patek/assets/css/main.scss @@ -316,6 +316,12 @@ patek-logo { // To make the color constrast enought with white to pass the WCAG AA requirements color: #737373 !important; } + +.rel-alternate-buttons { + display: flex; + flex-direction: row-reverse; +} + // /Custom styles .patek-logo-top { diff --git a/themes/patek/layouts/partials/icalEscape.ics b/themes/patek/layouts/partials/icalEscape.ics new file mode 100644 index 0000000..e27ddc4 --- /dev/null +++ b/themes/patek/layouts/partials/icalEscape.ics @@ -0,0 +1,18 @@ +{{- /* Note this file has CRLF line endings as required by the specs */ -}} +{{- /* replace does not support piping */ -}} +{{- $escaped := replace (replace (replace (replace . "\\" "\\\\") "\n" "\\n") "," "\\,") ";" "\\;" -}} +{{- $escapedLen := strings.RuneCount $escaped -}} +{{- $lineLen := 60 -}} +{{- $parts := (div $escapedLen $lineLen) -}} +{{- if (not (modBool $escapedLen $lineLen)) -}} + {{- $parts = (add $parts 1) -}} +{{- end -}} + +{{- /* print the string by parts of at most 75 chars as required by the specs */ -}} +{{- range (seq (sub $parts 0)) -}} +{{- if (eq . 1) -}} +{{- substr $escaped (mul (sub . 1) $lineLen) $lineLen -}} +{{- else }}{{- /* the leading whitespace is important here */}} + {{ substr $escaped (mul (sub . 1) $lineLen) $lineLen -}} +{{- end -}} +{{- end -}} diff --git a/themes/patek/layouts/partials/talkIcal.ics b/themes/patek/layouts/partials/talkIcal.ics new file mode 100644 index 0000000..1473010 --- /dev/null +++ b/themes/patek/layouts/partials/talkIcal.ics @@ -0,0 +1,14 @@ +{{- /* Note this file has CRLF line endings as required by the specs */ -}} +BEGIN:VEVENT +UID:{{ partial "icalEscape.ics" .Permalink }} +CREATED:{{ dateFormat "20060102T150405Z" .Date.UTC }} +DTSTAMP:{{ dateFormat "20060102T150405Z" (now).UTC }} +SUMMARY:{{ .Title | plainify | partial "icalEscape.ics" }} +DESCRIPTION:{{ printf "%s %s" (.Content | plainify | truncate 200) .Permalink | partial "icalEscape.ics" }} +DTSTART:{{ dateFormat "20060102T150405Z" (time .Params.When).UTC }} +DTEND:{{ $length := 30 -}} +{{- with .Params.Length -}} +{{ $length = (int .) }} +{{- end -}} +{{- dateFormat "20060102T150405Z" (time (add (time .Params.When).Unix (mul $length 60))).UTC }} +END:VEVENT diff --git a/themes/patek/layouts/partials/talksPageHeader.html b/themes/patek/layouts/partials/talksPageHeader.html index ff2f184..af826b8 100644 --- a/themes/patek/layouts/partials/talksPageHeader.html +++ b/themes/patek/layouts/partials/talksPageHeader.html @@ -1,7 +1,7 @@

{{ T "talks-paginator-heading" }}:

{{ $paginator := .Paginate ((.Pages.ByParam "when").Reverse) }} - {{ partial "paginator-buttons.html" $paginator }} +
+ {{ partial "paginator-buttons.html" $paginator }} +
+ +
+
{{ range $paginator.Pages }}
diff --git a/themes/patek/layouts/talks/section.ics b/themes/patek/layouts/talks/section.ics new file mode 100644 index 0000000..a365738 --- /dev/null +++ b/themes/patek/layouts/talks/section.ics @@ -0,0 +1,9 @@ +{{- /* Note this file has CRLF line endings as required by the specs */ -}} +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:gohugo +CALSCALE:GREGORIAN +{{ range .RegularPages -}} +{{ partial "talkIcal.ics" . -}} +{{- end -}} +END:VCALENDAR diff --git a/themes/patek/layouts/talks/single.ics b/themes/patek/layouts/talks/single.ics new file mode 100644 index 0000000..65f063d --- /dev/null +++ b/themes/patek/layouts/talks/single.ics @@ -0,0 +1,7 @@ +{{- /* Note this file has CRLF line endings as required by the specs */ -}} +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:gohugo +CALSCALE:GREGORIAN +{{ partial "talkIcal.ics" . -}} +END:VCALENDAR