diff --git a/.gitignore b/.gitignore index 62bb8f7..5e9be50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,13 @@ org/configs/** !org/configs/.gitkeep +org/packages/** +!org/packages/.gitkeep /_data/ /__data/ /public/ resources/_gen /content/configs/ /.log/ +/.hugo_build.lock +/content/packages/ +/static/*-img/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index ca289c3..8d6aa5d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,42 @@ [submodule "repos/dotfiles"] path = repos/dotfiles url = https://github.com/SqrtMinusOne/dotfiles.git +[submodule "repos/lyrics-fetcher"] + path = repos/lyrics-fetcher + url = https://github.com/SqrtMinusOne/lyrics-fetcher.el.git +[submodule "repos/elfeed-summary"] + path = repos/elfeed-summary + url = git@github.com:SqrtMinusOne/elfeed-summary.git +[submodule "repos/org-journal-tags"] + path = repos/org-journal-tags + url = git@github.com:SqrtMinusOne/org-journal-tags.git +[submodule "repos/elfeed-sync"] + path = repos/elfeed-sync + url = git@github.com:SqrtMinusOne/elfeed-sync.git +[submodule "repos/password-store-ivy"] + path = repos/password-store-ivy + url = git@github.com:SqrtMinusOne/password-store-ivy.git +[submodule "repos/biome"] + path = repos/biome + url = git@github.com:SqrtMinusOne/biome.git +[submodule "repos/org-clock-agg"] + path = repos/org-clock-agg + url = git@github.com:SqrtMinusOne/org-clock-agg.git +[submodule "repos/avy-dired"] + path = repos/avy-dired + url = git@github.com:SqrtMinusOne/avy-dired.git +[submodule "repos/pomm"] + path = repos/pomm + url = git@github.com:SqrtMinusOne/pomm.el.git +[submodule "repos/micromamba"] + path = repos/micromamba + url = git@github.com:SqrtMinusOne/micromamba.el.git +[submodule "repos/reverso"] + path = repos/reverso + url = git@github.com:SqrtMinusOne/reverso.el.git +[submodule "repos/perspective-exwm"] + path = repos/perspective-exwm + url = git@github.com:SqrtMinusOne/perspective-exwm.el.git +[submodule "repos/exwm-modeline"] + path = repos/exwm-modeline + url = git@github.com:SqrtMinusOne/exwm-modeline.git diff --git a/assets/sass/researcher.scss b/assets/sass/researcher.scss index da80aa0..f0eba27 100644 --- a/assets/sass/researcher.scss +++ b/assets/sass/researcher.scss @@ -177,6 +177,9 @@ $toc-left-width: $toc-width + $max-width + 25px; margin: $y-medium auto; max-width: 100%; } + a > img { + margin: $y-medium 4px $y-medium 0px !important; + } .avatar > img { border-radius: 50%; float: right; diff --git a/config.toml b/config.toml index 680c487..e373e94 100644 --- a/config.toml +++ b/config.toml @@ -33,6 +33,9 @@ staticDir = ["static"] name = "Posts" url = "/posts/" weight = 1 + [[menu.main]] + name = "Emacs packages" + url = "/emacs-packages/" [[menu.main]] name = "Configs" url = "/configs/readme" diff --git a/content/emacs-packages.md b/content/emacs-packages.md new file mode 100644 index 0000000..221fd57 --- /dev/null +++ b/content/emacs-packages.md @@ -0,0 +1,8 @@ ++++ +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 }} +
+ + +
+
+{{ end }} diff --git a/org/packages/.gitkeep b/org/packages/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/org/pages/emacs-packages.org b/org/pages/emacs-packages.org new file mode 100644 index 0000000..1fbd1c2 --- /dev/null +++ b/org/pages/emacs-packages.org @@ -0,0 +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/avy-dired b/repos/avy-dired new file mode 160000 index 0000000..01abcc0 --- /dev/null +++ b/repos/avy-dired @@ -0,0 +1 @@ +Subproject commit 01abcc027bf49b8c5516b70da63ac79e8b4ecc58 diff --git a/repos/biome b/repos/biome new file mode 160000 index 0000000..599a55f --- /dev/null +++ b/repos/biome @@ -0,0 +1 @@ +Subproject commit 599a55fa20a7ba38c3aead07e0af7b7b02902dfa diff --git a/repos/dotfiles b/repos/dotfiles index f12737b..bea3dd5 160000 --- a/repos/dotfiles +++ b/repos/dotfiles @@ -1 +1 @@ -Subproject commit f12737bb44edafecec2b79b8d9a70d5ed1a1ff99 +Subproject commit bea3dd52b4c7d5083502aeab4335e3900ec5ec4e diff --git a/repos/elfeed-summary b/repos/elfeed-summary new file mode 160000 index 0000000..efa30b8 --- /dev/null +++ b/repos/elfeed-summary @@ -0,0 +1 @@ +Subproject commit efa30b88d7f048a2df4958e59da8002ebd2dbb29 diff --git a/repos/elfeed-sync b/repos/elfeed-sync new file mode 160000 index 0000000..7fb24f8 --- /dev/null +++ b/repos/elfeed-sync @@ -0,0 +1 @@ +Subproject commit 7fb24f88f71f5e08208b75a001c50a6066a025af diff --git a/repos/exwm-modeline b/repos/exwm-modeline new file mode 160000 index 0000000..f72e658 --- /dev/null +++ b/repos/exwm-modeline @@ -0,0 +1 @@ +Subproject commit f72e65818f90c754edb8d0dcff47e8248a7f0a56 diff --git a/repos/lyrics-fetcher b/repos/lyrics-fetcher new file mode 160000 index 0000000..bcde34a --- /dev/null +++ b/repos/lyrics-fetcher @@ -0,0 +1 @@ +Subproject commit bcde34a7ae8db84170bfe76260eefed64686ddf0 diff --git a/repos/micromamba b/repos/micromamba new file mode 160000 index 0000000..cd3ce4b --- /dev/null +++ b/repos/micromamba @@ -0,0 +1 @@ +Subproject commit cd3ce4b7142790f25f20e5cfd6ed5ebbf4498c6c diff --git a/repos/org-clock-agg b/repos/org-clock-agg new file mode 160000 index 0000000..4cc6103 --- /dev/null +++ b/repos/org-clock-agg @@ -0,0 +1 @@ +Subproject commit 4cc610315bdc4a656682ded736a6c5345108267f diff --git a/repos/org-journal-tags b/repos/org-journal-tags new file mode 160000 index 0000000..c9dba48 --- /dev/null +++ b/repos/org-journal-tags @@ -0,0 +1 @@ +Subproject commit c9dba4817f098281139c85db5b1bcbf79edc419b diff --git a/repos/password-store-ivy b/repos/password-store-ivy new file mode 160000 index 0000000..60a2862 --- /dev/null +++ b/repos/password-store-ivy @@ -0,0 +1 @@ +Subproject commit 60a2862cb827672de18619cd8e3239e0f146e55d diff --git a/repos/perspective-exwm b/repos/perspective-exwm new file mode 160000 index 0000000..68fb0ca --- /dev/null +++ b/repos/perspective-exwm @@ -0,0 +1 @@ +Subproject commit 68fb0ca2d482e0f4a92c4ceb19bf2262ea937e95 diff --git a/repos/pomm b/repos/pomm new file mode 160000 index 0000000..a717c3a --- /dev/null +++ b/repos/pomm @@ -0,0 +1 @@ +Subproject commit a717c3a05352cb8a233a5b4330186ead077746ba diff --git a/repos/reverso b/repos/reverso new file mode 160000 index 0000000..47812d7 --- /dev/null +++ b/repos/reverso @@ -0,0 +1 @@ +Subproject commit 47812d7738047277e2ab365c45a9512e8258422c diff --git a/scripts/publish-configs.el b/scripts/publish-configs.el index 668fb9c..d3992fe 100644 --- a/scripts/publish-configs.el +++ b/scripts/publish-configs.el @@ -1,10 +1,8 @@ +;; -*- lexical-binding: t; -*- (require 'package) (require 'vc) (require 'files) -(message (concat (vc-find-root default-directory ".git") "org/configs")) -(cd (concat (vc-find-root default-directory ".git") "org/configs")) - (setq package-user-dir (expand-file-name "./.packages")) (setq package-archives '(("melpa" . "https://melpa.org/packages/") @@ -15,22 +13,11 @@ (unless package-archive-contents (package-refresh-contents)) -(setq package-user-dir (expand-file-name "./.packages")) - -(setq package-archives '(("melpa" . "https://melpa.org/packages/") - ("elpa" . "https://elpa.gnu.org/packages/"))) - (unless (package-installed-p 'use-package) (package-install 'use-package)) (require 'use-package) -(use-package ox-hugo - :ensure t) - -(use-package org-make-toc - :ensure t) - -(setq org-make-toc-link-type-fn #'org-make-toc--link-entry-org) +;; Org Hugo (defvar-local my/org-hugo-heading-slugs nil) @@ -60,49 +47,115 @@ (puthash slug t my/org-hugo-heading-slugs)) slug)) -(setq org-hugo-anchor-functions '(org-hugo-get-page-or-bundle-name - org-hugo-get-custom-id - my/org-hugo-get-heading-slug - org-hugo-get-md5)) +(use-package ox-hugo + :ensure t + :config + (setq org-hugo-anchor-functions '(org-hugo-get-page-or-bundle-name + org-hugo-get-custom-id + my/org-hugo-get-heading-slug + org-hugo-get-md5)) + (setq org-hugo-base-dir (vc-find-root default-directory ".git"))) -(setq org-hugo-section "configs") -(setq org-hugo-base-dir (vc-find-root default-directory ".git")) +;; Org Make TOC -;; (setq org-hugo-export-with-toc 6) - -(setq my/config-files '("README.org" - "Emacs.org" - "Desktop.org" - "Console.org" - "Mail.org" - "Guix.org")) +(use-package org-make-toc + :ensure t + :config + (setq org-make-toc-link-type-fn #'org-make-toc--link-entry-org)) -(dolist (file my/config-files) - (copy-file (expand-file-name - (format "%s/repos/dotfiles/%s" - (vc-find-root default-directory ".git") - file)) - file 'overwrite)) +;; Export dotfiles -(copy-directory - (expand-file-name - (format "%s/repos/dotfiles/dot-imgs/" - (vc-find-root default-directory ".git"))) - "dot-imgs" t t) +(setq my/config-files + '("README.org" "Emacs.org" "Desktop.org" "Console.org" "Mail.org" "Guix.org")) -(dolist (file my/config-files) - (with-temp-buffer - (org-mode) - (insert-file-contents file) - (unless (string-equal file "README.org") - (org-make-toc)) - (replace-string "conf-space" "vim" t (point-min) (point-max)) - (replace-string "conf-unix" "ini" t (point-min) (point-max)) - (replace-string "conf-windows" "ini" t (point-min) (point-max)) - (replace-string "conf-xdefaults" "vim" t (point-min) (point-max)) - (replace-string "conf-toml" "toml" t (point-min) (point-max)) - (replace-string ":noweb yes" ":noweb no-export" nil (point-min) (point-max)) - (setq-local buffer-file-name file) - (message "Publish %s" file) - (org-hugo-export-to-md))) +(defun my/export-dotfiles () + (cd (concat (vc-find-root default-directory ".git") "org/configs")) + (dolist (file my/config-files) + (copy-file (expand-file-name + (format "%s/repos/dotfiles/%s" + (vc-find-root default-directory ".git") + file)) + file 'overwrite)) + (copy-directory + (expand-file-name + (format "%s/repos/dotfiles/dot-imgs/" + (vc-find-root default-directory ".git"))) + "dot-imgs" t t) + (dolist (file my/config-files) + (with-temp-buffer + (let ((org-mode-hook nil) (text-mode-hook nil)) + (org-mode)) + (insert-file-contents file) + (unless (string-equal file "README.org") + (org-make-toc)) + (replace-string "conf-space" "vim" t (point-min) (point-max)) + (replace-string "conf-unix" "ini" t (point-min) (point-max)) + (replace-string "conf-windows" "ini" t (point-min) (point-max)) + (replace-string "conf-xdefaults" "vim" t (point-min) (point-max)) + (replace-string "conf-toml" "toml" t (point-min) (point-max)) + (replace-string ":noweb yes" ":noweb no-export" nil (point-min) (point-max)) + (setq-local buffer-file-name file) + (message "Publish %s" file) + (let ((org-hugo-section "configs") + (org-mode-hook nil) + (text-mode-hook nil)) + (org-hugo-export-to-md))))) + +;; Export packages +(setq my/emacs-packages + '("lyrics-fetcher" + "pomm" + "elfeed-summary" + "exwm-modeline" + "perspective-exwm" + "org-journal-tags" + "elfeed-sync" + "password-store-ivy" + "avy-dired" + "reverso" + "micromamba" + "biome" + "org-clock-agg")) + +(defun my/export-packages () + (cd (concat (vc-find-root default-directory ".git") "org/packages")) + (let ((root (vc-find-root default-directory ".git"))) + (dolist (package my/emacs-packages) + (copy-file + (expand-file-name + (format "%s/repos/%s/README.org" root package)) + (format "./%s.org" package) 'overwrite) + (when (file-directory-p (format "%s/repos/%s/img" root package)) + (copy-directory + (expand-file-name + (format "%s/repos/%s/img" root package)) + (format "./static/%s-img" package) t t)) + (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)) + (message "Publish %s" package) + (let ((org-hugo-section "packages") + (org-mode-hook nil) + (text-mode-hook nil)) + (org-hugo-export-to-md))))))