feat(configs): publish configs v1

This commit is contained in:
Pavel Korytov 2021-08-21 22:24:12 +03:00
parent 2e803f156e
commit 7937c70bcb
6 changed files with 59 additions and 1 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
org/configs/**
!org/configs/publish.el

View file

@ -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

54
org/configs/publish.el Normal file
View file

@ -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)))

BIN
static/ox-hugo/all.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB