mirror of
https://github.com/SqrtMinusOne/sqrtminusone.github.io.git
synced 2025-12-10 07:43:03 +03:00
emacs-packages: v1
This commit is contained in:
parent
92168e3520
commit
763feaf213
9 changed files with 102 additions and 56 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,8 +1,12 @@
|
|||
org/configs/**
|
||||
!org/configs/.gitkeep
|
||||
org/packages/**
|
||||
!org/packages/.gitkeep
|
||||
/_data/
|
||||
/__data/
|
||||
/public/
|
||||
resources/_gen
|
||||
/content/configs/
|
||||
/.log/
|
||||
/.hugo_build.lock
|
||||
/content/packages/
|
||||
|
|
|
|||
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -1,3 +1,6 @@
|
|||
[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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
7
content/emacs-packages.md
Normal file
7
content/emacs-packages.md
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
+++
|
||||
title = "My Emacs packages"
|
||||
author = ["Pavel Korytov"]
|
||||
draft = false
|
||||
+++
|
||||
|
||||
- [Lyrics Fetcher](/packages/lyrics-fetcher)
|
||||
0
org/packages/.gitkeep
Normal file
0
org/packages/.gitkeep
Normal file
5
org/pages/emacs-packages.org
Normal file
5
org/pages/emacs-packages.org
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#+HUGO_BASE_DIR: ../..
|
||||
#+HUGO_SECTION:
|
||||
#+TITLE: My Emacs packages
|
||||
|
||||
- [[/packages/lyrics-fetcher][Lyrics Fetcher]]
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit f12737bb44edafecec2b79b8d9a70d5ed1a1ff99
|
||||
Subproject commit bea3dd52b4c7d5083502aeab4335e3900ec5ec4e
|
||||
1
repos/lyrics-fetcher
Submodule
1
repos/lyrics-fetcher
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 4cf7f342127b8acae8cbd4d8387a3b40f065300c
|
||||
|
|
@ -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,85 @@
|
|||
(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"))
|
||||
|
||||
(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-temp-buffer
|
||||
(insert-file-contents (format "./%s.org" package))
|
||||
(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))))))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue