pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/scientific-python/scientific-python-hugo-theme/pull/692/files

tives-7f694b60439d06c0.css" /> Add partial decorators for better composability by agriyakhetarpal · Pull Request #692 · scientific-python/scientific-python-hugo-theme · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/netlify.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build.environment]
PYTHON_VERSION = "3.13"
HUGO_VERSION = "0.152.2"
HUGO_VERSION = "0.158.0"
DART_SASS_VERSION = "1.93.2"
DART_SASS_URL = "https://github.com/sass/dart-sass/releases/download/"

Expand Down
124 changes: 124 additions & 0 deletions layouts/_default/list.atom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{{ printf `<?xml version="1.0" encoding="utf-8"?>` | safeHTML }} {{/* ref: https://validator.w3.org/feed/docs/atom.html */}}
<feed xmlns="http://www.w3.org/2005/Atom"{{ with site.LanguageCode }} xml:lang="{{ . }}"{{ end }}>
<generator uri="https://gohugo.io/" version="{{ hugo.Version }}">Hugo</generator>
{{- $title := site.Title -}}
{{- with .Title -}}
{{- if (not (eq . site.Title)) -}}
{{- $title = printf `%s %s %s` . (i18n "feed_title_on" | default "on") site.Title -}}
{{- end -}}
{{- end -}}
{{- if .IsTranslated -}}
{{ $title = printf "%s (%s)" $title (index site.Data.i18n.languages .Lang) }}
{{- end -}}
{{ printf `<title type="html"><![CDATA[%s]]></title>` $title | safeHTML }}
{{ with (or (.Param "subtitle") (.Param "tagline")) }}
{{ printf `<subtitle type="html"><![CDATA[%s]]></subtitle>` . | safeHTML }}
{{ end }}
{{ $output_formats := .OutputFormats }}
{{ range $output_formats -}}
{{- $rel := (or (and (eq "atom" (.Name | lower)) "self") "alternate") -}}
{{ with $output_formats.Get .Name }}
{{ printf `<link href=%q rel=%q type=%q title=%q />` .Permalink $rel .MediaType.Type .Name | safeHTML }}
{{- end -}}
{{- end }}
{{- range .Translations }}
{{ $output_formats := .OutputFormats }}
{{- $lang := .Lang }}
{{- $langstr := index site.Data.i18n.languages .Lang }}
{{ range $output_formats -}}
{{ with $output_formats.Get .Name }}
{{ printf `<link href=%q rel="alternate" type=%q hreflang=%q title="[%s] %s" />` .Permalink .MediaType.Type $lang $langstr .Name | safeHTML }}
{{- end -}}
{{- end }}
{{- end }}
<updated>{{ now.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{ with site.Copyright }}
{{- $copyright := replace . "{year}" now.Year -}} {{/* In case the site.copyright uses a special string "{year}" */}}
{{- $copyright = replace $copyright "&copy;" "©" -}}
<rights>{{ $copyright | plainify }}</rights>
{{- end }}
{{ with .Param "feed" }}
{{/* For this to work, the $icon file should be present in the assets/ directory */}}
{{- $icon := .icon | default "icon.svg" -}}
{{- with resources.Get $icon -}}
<icon>{{ (. | fingerprint).Permalink }}</icon>
{{- end }}

{{/* For this to work, the $logo file should be present in the assets/ directory */}}
{{- $logo := .logo | default "logo.svg" -}}
{{- with resources.Get $logo -}}
<logo>{{ (. | fingerprint).Permalink }}</logo>
{{- end }}
{{ end }}
{{ with site.Params.author }}
{{ with .name -}}
<author>
<name>{{ . }}</name>
{{ with $.Site.Params.author.email }}
<email>{{ . }}</email>
{{ end -}}
</author>
{{- end }}
{{ end }}
{{ with site.Params.id }}
<id>{{ . | plainify }}</id>
{{ else }}
<id>{{ .Permalink }}</id>
{{ end }}
{{- $limit := (cond (le site.Config.Services.RSS.Limit 0) 65536 site.Config.Services.RSS.Limit) }}
{{- $feed_sections := site.Params.feedSections | default site.Params.mainSections -}}
{{/* Range through only the pages with a Type in $feed_sections. */}}
{{- $pages := where .RegularPages "Type" "in" $feed_sections -}}
{{- if (eq .Kind "home") -}}
{{- $pages = where site.RegularPages "Type" "in" $feed_sections -}}
{{- end -}}
{{/* Remove the pages that have the disable_feed parameter set to true. */}}
{{- $pages = where $pages ".Params.disable_feed" "!=" true -}}
{{/* Remove the pages that have the unlisted parameter set to true. */}}
{{- $pages = where $pages ".Params.unlisted" "!=" true -}}
{{- range first $limit $pages }}
{{ $page := . }}
<entry>
{{ printf `<title type="html"><![CDATA[%s]]></title>` .Title | safeHTML }}
<link href="{{ .Permalink }}?utm_source=atom_feed" rel="alternate" type="text/html" />
{{- range .Translations }}
{{- $link := printf "%s?utm_source=atom_feed" .Permalink | safeHTML }}
{{- printf `<link href=%q rel="alternate" type="text/html" hreflang=%q />` $link .Lang | safeHTML }}
{{- end }}
{{/* rel=related: See https://validator.w3.org/feed/docs/atom.html#link */}}
{{- range first 5 (site.RegularPages.Related .) }}
<link href="{{ .Permalink }}?utm_source=atom_feed" rel="related" type="text/html" title="{{ .Title }}" />
{{- end }}
{{ with .Params.id }}
<id>{{ . | plainify }}</id>
{{ else }}
<id>{{ .Permalink }}</id>
{{ end }}
{{ with .Params.authors -}}
{{- range . -}}
<author>
<name>{{ . }}</name>
</author>
{{- end -}}
{{- end }}
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
{{ $description1 := .Description | default "" }}
{{ $description := (cond (eq "" $description1) "" (printf "<blockquote>%s</blockquote>" ($description1 | markdownify))) }}
{{ printf `<content type="html"><![CDATA[%s%s]]></content>` $description .Content | safeHTML }}
{{ with site.Taxonomies }}
{{ range $taxo,$_ := . }} <!-- Defaults taxos: "tags", "categories" -->
{{ with $page.Param $taxo }}
{{ $taxo_list := . }} <!-- $taxo_list will be the tags/categories list -->
{{ with site.GetPage (printf "/%s" $taxo) }}
{{ $taxonomy_page := . }}
{{ range $taxo_list }} <!-- Below, assuming pretty URLs -->
<category scheme="taxonomy:{{ printf "%s" $taxo | humanize }}" term="{{ (. | urlize) }}" label="{{ . }}" />
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</entry>
{{ end }}
</feed>
9 changes: 2 additions & 7 deletions layouts/_default/section.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{{ define "main" }}
<section class="section content-padding">
<div class="content-container">
{{ partial "breadcrumbs.html" . }}
<h1>{{ .Title }}</h1>
{{ if .Params.Subtitle }}
<h5 class="subtitle">{{ .Params.Subtitle }}</h5>
{{ end }}
{{ with partial "_decorators/content-container.html" . }}
{{ if .Content }}
{{ .Content }}
{{ end }}
Expand All @@ -20,7 +15,7 @@ <h5 class="subtitle">{{ .Params.Subtitle }}</h5>
</ul>
</div>
{{ end }}
</div>
{{ end }}
{{ if .Content }}
{{ partial "shortcuts.html" . }}
{{ end }}
Expand Down
9 changes: 2 additions & 7 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{{ define "main" }}
<section class="content-padding">
<div class="content-container">
{{ partial "breadcrumbs.html" . }}
<h1>{{ .Title }}</h1>
{{ if .Params.Subtitle }}
<h5 class="subtitle">{{ .Params.Subtitle }}</h5>
{{ end }}
{{ with partial "_decorators/content-container.html" . }}
{{ .Content }}
</div>
{{ end }}
{{ partial "shortcuts.html" . }}
</section>
{{ end }}
6 changes: 6 additions & 0 deletions layouts/partials/_decorators/article.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<article>
<div class="post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></div>
<div>
{{- inner . -}}
</div>
</article>
8 changes: 8 additions & 0 deletions layouts/partials/_decorators/content-container.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="content-container">
{{ partial "breadcrumbs.html" . }}
<h1>{{ .Title }}</h1>
{{ if .Params.Subtitle }}
<h5 class="subtitle">{{ .Params.Subtitle }}</h5>
{{ end }}
{{- inner . -}}
</div>
11 changes: 4 additions & 7 deletions layouts/partials/posts/list-with-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

<div class="post-list">
{{ range $posts }}
<article>
<div class="post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></div>
<div>
{{ partial "posts/meta.html" . }}
{{ partial "posts/summary.html" . }}
</div>
</article>
{{ with partial "_decorators/article.html" . }}
{{ partial "posts/meta.html" . }}
{{ partial "posts/summary.html" . }}
{{ end }}
{{ end }}
</div>
11 changes: 5 additions & 6 deletions layouts/partials/posts/list-without-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

<div class="post-list">
{{ range $posts }}
<article>
<div class="post-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></div>
<div class="post-meta">
<div>{{ partial "posts/meta.html" . }}</div>
</div>
</article>
{{ with partial "_decorators/article.html" . }}
<div class="post-meta">
<div>{{ partial "posts/meta.html" . }}</div>
</div>
{{ end }}
{{ end }}
</div>
9 changes: 2 additions & 7 deletions layouts/partials/posts/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,13 @@ <h2 class="tag-cloud-title">{{ i18n "tags" }}</h2>
</ul>
{{ end }}
</div>
<div class="content-container">
{{ partial "breadcrumbs.html" . }}
<h1>{{ .Title }}</h1>
{{ if .Params.Subtitle }}
<h5 class="subtitle">{{ .Params.Subtitle }}</h5>
{{ end }}
{{ with partial "_decorators/content-container.html" . }}
{{ if .Content }}
{{ .Content }}
{{ end }}
{{ $posts := .RegularPagesRecursive.ByPublishDate.Reverse }}
{{ partial "posts/list-without-summary.html" $posts }}
</div>
{{ end }}
{{ if .Content }}
{{ partial "shortcuts.html" . }}
{{ end }}
Expand Down
11 changes: 3 additions & 8 deletions layouts/partials/posts/post.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{{- $featuredImage := .Resources.GetMatch "featuredImage" -}}
<section class="post content-padding">
<div class="content-container">
{{ partial "breadcrumbs.html" . }}
<h1>{{ .Title }}</h1>
{{ if .Params.Subtitle }}
<h5 class="subtitle">{{ .Params.Subtitle }}</h5>
{{ end }}
{{ with partial "_decorators/content-container.html" . }}
<div class="post-meta">{{ partial "posts/meta.html" . }}
<span class="post-please-comment">🖊️ Please add your comments <a href="#discourse-comments">below!</a></span>
</div>
{{- $featuredImage := .Resources.GetMatch "featuredImage" -}}
<div class="post-content">
{{ with $featuredImage }}
{{ if .Params.showOnTop }}
Expand All @@ -20,6 +15,6 @@ <h5 class="subtitle">{{ .Params.Subtitle }}</h5>
{{ .Content }}
{{ partial "posts/comments.html" .}}
</div>
</div>
{{ end }}
{{ partial "shortcuts.html" . }}
</section>
9 changes: 2 additions & 7 deletions layouts/partials/section/section.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<section class="content-padding">
<div class="content-container">
{{ partial "breadcrumbs.html" . }}
<h1>{{ .Title }}</h1>
{{ if .Params.Subtitle }}
<h5 class="subtitle">{{ .Params.Subtitle }}</h5>
{{ end }}
{{ with partial "_decorators/content-container.html" . }}
{{ if .Content }}
{{ .Content }}
{{ else }}
Expand All @@ -28,7 +23,7 @@ <h5 class="subtitle">{{ .Params.Subtitle }}</h5>
</div>
{{ end }}
{{ end }}
</div>
{{ end }}
<div id="shortcuts-container">
<div id="shortcuts">
<div id="shortcuts-header"><i class="fa-solid fa-list"></i> On this page</div>
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy