diff --git a/assets/xsl/rss.xsl b/assets/xsl/rss.xsl new file mode 100644 index 00000000..20626dfb --- /dev/null +++ b/assets/xsl/rss.xsl @@ -0,0 +1,140 @@ +{{- $logo := resources.Get "images/logo.png" -}} +{{- $logo = partial "image_resize.html" (dict "img" $logo "width" 400) -}} + + + + + + + + + + + PyBCN feed + + + + + + + + + + + + - + + 01 + 02 + 03 + 04 + 05 + 06 + 07 + 08 + 09 + 10 + 11 + 12 + ?? + + + + + + + + + + + + <xsl:value-of select="$heading"/> + + + + +
+ + Python Barcelona +

+
+
+
+

+ + + entry + entries + , most recently changed first. + Feed readers read the XML behind this page; a browser shows it as a table. + The feed covers . +

+ + + + + + + + + + + + + + + + + +
#TitlePublished
+ + + + + + + + + + + +
+
+ + +
+ +
diff --git a/assets/xsl/sitemap.xsl b/assets/xsl/sitemap.xsl new file mode 100644 index 00000000..f1a35af9 --- /dev/null +++ b/assets/xsl/sitemap.xsl @@ -0,0 +1,104 @@ +{{- $logo := resources.Get "images/logo.png" -}} +{{- $logo = partial "image_resize.html" (dict "img" $logo "width" 400) -}} + + + + + + + PyBCN sitemap + + + + + + + + + + + + + + + + + <xsl:value-of select="$heading"/> + + + + +
+ + Python Barcelona +

+
+
+
+

+ + + URL + URLs + , most recently changed first. + Search engines read the XML behind this page; a browser shows it as a table. +

+ + + + + + + + + + + + + + + + + + +
#URLLast modified
+ + + + + +
+
+ + +
+ +
diff --git a/config.toml b/config.toml index 4d2a197a..d16a15de 100644 --- a/config.toml +++ b/config.toml @@ -20,8 +20,44 @@ timeout = "300s" isPlainText = true notAlternative = true +# One feed for the whole site, /index.xml, and none per section. Hugo built +# one for every section by default: ten feeds, nine of them a by-product, +# from /contact/index.xml with zero items to /people/index.xml with 138 +# items and no titles. The home feed carries the same pages, so a section +# feed adds nothing a reader can use (#201). [outputs] home = ["HTML", "RSS", "llms"] + section = ["HTML"] + +# Every file under content/people/ and content/sponsors/ feeds the grids and +# the modals through its front matter. Hugo also built a page from each one, +# with no inbound link anywhere on the site, and they were 206 of the 247 +# entries in the sitemap (#201). The sponsor pages are empty; 73 of the 138 +# person files carry a bio that did render. They all stop, bio or not: +# publishing only the people who happen to have a paragraph written about +# them would sort the organizers and speakers of this association into two +# classes. The pages come back with the Archive, when every person has one +# worth linking to. +# +# render = "never" stops the page and keeps the default list = "always", so +# the file stays in site.Pages, where people-grid.html and sponsors-grid.html +# look it up by id. list = "local" would take it out of site.Pages and empty +# every grid. A page that is not rendered has no permalink, which is how the +# feed template leaves it out (layouts/_default/rss.xml). +# +# /people/ had nothing but a heading and goes with them. /sponsors/ is a real +# page and stays. +[[cascade]] + [cascade._build] + render = "never" + [cascade._target] + path = "{/people,/people/**}" + +[[cascade]] + [cascade._build] + render = "never" + [cascade._target] + path = "/sponsors/*" [markup.goldmark.renderer] diff --git a/content/people/christian-adell.md b/content/people/christian-adell.md index 0c65efee..90bd8c6d 100644 --- a/content/people/christian-adell.md +++ b/content/people/christian-adell.md @@ -1,7 +1,5 @@ --- id: christian-adell -aliases: - - /people/christian-adell-querol/ name: Christian Adell photo: christian-adell.jpg diff --git a/content/people/kemalcan-bora.md b/content/people/kemalcan-bora.md index 3592c9d6..00fa978a 100644 --- a/content/people/kemalcan-bora.md +++ b/content/people/kemalcan-bora.md @@ -1,7 +1,5 @@ --- id: kemalcan-bora -aliases: - - /people/kemalkan-bora/ name: "Kemalcan Bora" photo: "kemalcan-bora.jpg" linkedin: "https://www.linkedin.com/in/kemalcanbora/" diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml new file mode 100644 index 00000000..376fe189 --- /dev/null +++ b/layouts/_default/rss.xml @@ -0,0 +1,70 @@ +{{- $authorEmail := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} +{{- end }} + +{{- $authorName := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- end }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} +{{- $pages := slice }} +{{- if or $.IsHome $.IsSection }} +{{- $pages = $pctx.RegularPages }} +{{- else }} +{{- $pages = $pctx.Pages }} +{{- end }} +{{- /* No content file carries a date, so .Date and .PublishDate are zero and the + default order is by title. .Lastmod comes from git (enableGitInfo), the same + source as the sitemap's lastmod: last change first, and the item date is the + date of the last commit that touched the file. */ -}} +{{- /* A page with _build.render = "never" stays in the collections (the people + and sponsor files feed the grids that way) but has no permalink. The feed + lists only pages a person can visit. */ -}} +{{- $pages = where $pages "Permalink" "ne" "" }} +{{- $pages = $pages.ByLastmod.Reverse }} +{{- $limit := .Site.Config.Services.RSS.Limit }} +{{- if ge $limit 1 }} +{{- $pages = $pages | first $limit }} +{{- end }} +{{- printf "" | safeHTML }} +{{- $xsl := resources.Get "xsl/rss.xsl" | resources.ExecuteAsTemplate "xsl/rss.xsl" . | resources.Fingerprint -}} +{{- printf "" $xsl.RelPermalink | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }} + Hugo + {{ site.Language.LanguageCode }}{{ with $authorEmail }} + {{.}}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with $authorEmail }} + {{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with .Site.Copyright }} + {{ . }}{{ end }}{{ if not .Date.IsZero }} + {{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} + {{ .Permalink }} + {{ .Summary | transform.XMLEscape | safeHTML }} + + {{- end }} + + diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml new file mode 100644 index 00000000..f2bb765b --- /dev/null +++ b/layouts/sitemap.xml @@ -0,0 +1,26 @@ +{{ printf "" | safeHTML }} +{{- $xsl := resources.Get "xsl/sitemap.xsl" | resources.ExecuteAsTemplate "xsl/sitemap.xsl" . | resources.Fingerprint -}} +{{- printf "" $xsl.RelPermalink | safeHTML }} + + {{ range where .Pages "Sitemap.Disable" "ne" true }} + {{- if .Permalink -}} + + {{ .Permalink }}{{ if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + {{ end }} + {{ end }} + + {{- end -}} + {{ end }} + diff --git a/static/humans.txt b/static/humans.txt index 7c74c2df..131c88a7 100644 --- a/static/humans.txt +++ b/static/humans.txt @@ -15,7 +15,7 @@ The people are named on their own pages, which stay current: Organizers https://pybcn.org/pybcn_association/organizers/ PyLadies BCN https://pybcn.org/pyladies_bcn/organizers-and-speakers/ - Speakers https://pybcn.org/people/ + Speakers On the page of each event, https://pybcn.org/events/ /* THANKS */ diff --git a/themes/pybcn_theme/layouts/index.llms.txt b/themes/pybcn_theme/layouts/index.llms.txt index a9ea5cd1..9a07bb09 100644 --- a/themes/pybcn_theme/layouts/index.llms.txt +++ b/themes/pybcn_theme/layouts/index.llms.txt @@ -32,11 +32,10 @@ This file is generated from the site content on every build. {{- end }} ## People -One page for each speaker and organizer. {{ len (where site.RegularPages "Section" "people") }} pages, indexed at {{ "people/" | absURL }} +Organizers and speakers have no page of their own. The PyBCN organizers are listed at {{ "pybcn_association/organizers/" | absURL }}, the PyLadies BCN organizers at {{ "pyladies_bcn/organizers-and-speakers/" | absURL }}, and each event page lists its speakers. ## Sponsors -One page for each company, organization or university that supported an event. -{{ len (where site.RegularPages "Section" "sponsors") }} pages, indexed at {{ "sponsors/" | absURL }} +The companies, organizations, and universities that supported an event are listed at {{ "sponsors/" | absURL }}. Each event page lists its own sponsors. ## Archived sites {{ "archives/pybcn.org/" | absURL }} and {{ "archives/hacktoberfestbarcelona.com/" | absURL }} hold static mirrors of older PyBCN sites. They are history. Do not read them as current information. diff --git a/themes/pybcn_theme/layouts/partials/footer.html b/themes/pybcn_theme/layouts/partials/footer.html index 69d4a513..8cff3caa 100644 --- a/themes/pybcn_theme/layouts/partials/footer.html +++ b/themes/pybcn_theme/layouts/partials/footer.html @@ -13,6 +13,14 @@ {{ range $.Site.Params.social_items }} {{ end }} + {{/* The feed and the sitemap are pages of this site, not accounts + elsewhere, so they are not in social_items and do not open a + new tab. They share the icon row so they get the same size, + colour, and alignment as the icons next to them. */}} + {{ with site.Home.OutputFormats.Get "rss" }} + + {{ end }} + diff --git a/themes/pybcn_theme/layouts/partials/head.html b/themes/pybcn_theme/layouts/partials/head.html index 9319e2df..1fa4c79a 100644 --- a/themes/pybcn_theme/layouts/partials/head.html +++ b/themes/pybcn_theme/layouts/partials/head.html @@ -31,7 +31,9 @@ {{ "" | safeHTML }} - {{ with .OutputFormats.Get "rss" -}} + {{/* The site has one feed, /index.xml. Every page advertises it, so a feed + reader finds it from wherever the visitor is, not only from the home. */}} + {{ with site.Home.OutputFormats.Get "rss" -}} {{ end -}}