diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2114aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +org/configs/** +!org/configs/publish.el \ No newline at end of file diff --git a/config.toml b/config.toml index dc11cc8..5b338dc 100644 --- a/config.toml +++ b/config.toml @@ -24,7 +24,9 @@ staticDir = ["static"] name = "Posts" url = "/posts/" weight = 1 - + [[menu.main]] + name = "Configs" + url = "/configs/readme" [markup.goldmark.renderer] unsafe = true # allow raw HTML in markdown files \ No newline at end of file diff --git a/org/configs/publish.el b/org/configs/publish.el new file mode 100644 index 0000000..a57e80d --- /dev/null +++ b/org/configs/publish.el @@ -0,0 +1,54 @@ +(require 'package) + +(setq package-user-dir (expand-file-name "./.packages")) + +(setq package-archives '(("melpa" . "https://melpa.org/packages/") + ("elpa" . "https://elpa.gnu.org/packages/"))) + +;; Initialize the package system +(package-initialize) +(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) + +(setq org-hugo-section "configs") +(setq org-hugo-base-dir "../../") + +(setq my/config-files '("README.org" + "Emacs.org" + "Desktop.org" + "Console.org" + "Mail.org" + "Guix.org")) + +(dolist (file my/config-files) + (copy-file (expand-file-name (format "~/%s" file)) file 'overwrite)) + +(copy-directory (expand-file-name "~/dot-stats/img") "dot-stats/img" t t) + +(dolist (file my/config-files) + (with-temp-buffer + (org-mode) + (insert-file-contents file) + (unless (string-equal file "README.org") + (setq org-make-toc-link-type-fn #'org-make-toc--link-entry-org) + (org-make-toc)) + (setq-local buffer-file-name file) + (message "Publish %s" file) + (org-hugo-export-to-md))) diff --git a/static/ox-hugo/all.png b/static/ox-hugo/all.png new file mode 100644 index 0000000..1b69d36 Binary files /dev/null and b/static/ox-hugo/all.png differ diff --git a/static/ox-hugo/emacs-vim.png b/static/ox-hugo/emacs-vim.png new file mode 100644 index 0000000..34f3110 Binary files /dev/null and b/static/ox-hugo/emacs-vim.png differ diff --git a/static/ox-hugo/literate-config.png b/static/ox-hugo/literate-config.png new file mode 100644 index 0000000..fd508de Binary files /dev/null and b/static/ox-hugo/literate-config.png differ