diff --git a/content/emacs-packages.md b/content/emacs-packages.md index af7418f..221fd57 100644 --- a/content/emacs-packages.md +++ b/content/emacs-packages.md @@ -2,6 +2,7 @@ title = "My Emacs packages" author = ["Pavel Korytov"] draft = false +norss = true +++ - [Lyrics Fetcher](/packages/lyrics-fetcher) diff --git a/layouts/index.xml b/layouts/index.xml index adf162a..50dc954 100644 --- a/layouts/index.xml +++ b/layouts/index.xml @@ -6,6 +6,8 @@ {{- else -}} {{- $pages = $pctx.Pages -}} {{- end -}} +{{- $pages = where $pages "Section" "!=" "configs" -}} +{{- $pages = where $pages ".Params.norss" "!=" "true" -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} @@ -25,7 +27,7 @@ {{- with .OutputFormats.Get "RSS" -}} {{ printf "" .Permalink .MediaType | safeHTML }} {{- end -}} - {{ range where $pages "Section" "!=" "configs" }} + {{ range $pages }} {{ .Title }} {{ .Permalink }} diff --git a/layouts/packages/section.xml b/layouts/packages/section.xml new file mode 100644 index 0000000..adf162a --- /dev/null +++ b/layouts/packages/section.xml @@ -0,0 +1,41 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := slice -}} +{{- if or $.IsHome $.IsSection -}} +{{- $pages = $pctx.RegularPages -}} +{{- else -}} +{{- $pages = $pctx.Pages -}} +{{- end -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | 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 -- gohugo.io{{ with .Site.LanguageCode }} + {{.}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{- with .OutputFormats.Get "RSS" -}} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{- end -}} + {{ range where $pages "Section" "!=" "configs" }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + + {{ .Content | html }} + + + {{ end }} + + diff --git a/layouts/packages/single.html b/layouts/packages/single.html new file mode 100644 index 0000000..0c7f5d1 --- /dev/null +++ b/layouts/packages/single.html @@ -0,0 +1,28 @@ +{{ define "main" }} + + + + {{ .Title }} + {{ if .Params.repo }} + + {{ end }} + + + + {{ .Title }} + {{ if .Params.repo }} + + {{ end }} + + {{ .Content }} + + + + Table of Contents + {{ .TableOfContents }} + + <Expand> + <Collapse> + + +{{ end }} diff --git a/org/pages/emacs-packages.org b/org/pages/emacs-packages.org index 34718a1..1fbd1c2 100644 --- a/org/pages/emacs-packages.org +++ b/org/pages/emacs-packages.org @@ -1,5 +1,6 @@ #+HUGO_BASE_DIR: ../.. #+HUGO_SECTION: #+TITLE: My Emacs packages +#+HUGO_CUSTOM_FRONT_MATTER: :norss true - [[/packages/lyrics-fetcher][Lyrics Fetcher]] diff --git a/repos/lyrics-fetcher b/repos/lyrics-fetcher index 4cf7f34..3707e8c 160000 --- a/repos/lyrics-fetcher +++ b/repos/lyrics-fetcher @@ -1 +1 @@ -Subproject commit 4cf7f342127b8acae8cbd4d8387a3b40f065300c +Subproject commit 3707e8c53feb066c6985c20eef51d240d7073c02 diff --git a/scripts/publish-configs.el b/scripts/publish-configs.el index 3f7eb58..6f71b70 100644 --- a/scripts/publish-configs.el +++ b/scripts/publish-configs.el @@ -119,8 +119,26 @@ (expand-file-name (format "%s/repos/%s/img" root package)) (format "./static/%s-img" package) t t)) - (with-temp-buffer + (with-current-buffer (generate-new-buffer "tmp") (insert-file-contents (format "./%s.org" package)) + (goto-char (point-min)) + (insert + "#+HUGO_CUSTOM_FRONT_MATTER: :repo " + (let ((default-directory (format "%s/repos/%s/" root package))) + (string-trim + (shell-command-to-string + "git remote get-url origin | sed 's/.*SqrtMinusOne\\/\\(.*\\)\\.git/\\1/'"))) + "\n") + (when-let + (published-at + (with-temp-buffer + (insert-file-contents (format "%s/repos/%s/%s.el" root package package)) + (goto-char (point-min)) + (when (re-search-forward (rx bol ";; Published-At:" (0+ space) (group (1+ nonl))) nil t) + (substring-no-properties + (match-string 1))))) + (insert + "#+DATE: " published-at "\n")) (replace-string "./img/" (format "./static/%s-img/" package) nil (point-min) (point-max)) (setq-local buffer-file-name (format "./%s.org" package))