mirror of
https://github.com/SqrtMinusOne/sqrtminusone.github.io.git
synced 2025-12-10 15:53: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/**
|
||||||
!org/configs/.gitkeep
|
!org/configs/.gitkeep
|
||||||
|
org/packages/**
|
||||||
|
!org/packages/.gitkeep
|
||||||
/_data/
|
/_data/
|
||||||
/__data/
|
/__data/
|
||||||
/public/
|
/public/
|
||||||
resources/_gen
|
resources/_gen
|
||||||
/content/configs/
|
/content/configs/
|
||||||
/.log/
|
/.log/
|
||||||
|
/.hugo_build.lock
|
||||||
|
/content/packages/
|
||||||
|
|
|
||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -1,3 +1,6 @@
|
||||||
[submodule "repos/dotfiles"]
|
[submodule "repos/dotfiles"]
|
||||||
path = repos/dotfiles
|
path = repos/dotfiles
|
||||||
url = https://github.com/SqrtMinusOne/dotfiles.git
|
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"
|
name = "Posts"
|
||||||
url = "/posts/"
|
url = "/posts/"
|
||||||
weight = 1
|
weight = 1
|
||||||
|
[[menu.main]]
|
||||||
|
name = "Emacs packages"
|
||||||
|
url = "/emacs-packages/"
|
||||||
[[menu.main]]
|
[[menu.main]]
|
||||||
name = "Configs"
|
name = "Configs"
|
||||||
url = "/configs/readme"
|
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 'package)
|
||||||
(require 'vc)
|
(require 'vc)
|
||||||
(require 'files)
|
(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-user-dir (expand-file-name "./.packages"))
|
||||||
|
|
||||||
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
|
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
|
||||||
|
|
@ -15,22 +13,11 @@
|
||||||
(unless package-archive-contents
|
(unless package-archive-contents
|
||||||
(package-refresh-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)
|
(unless (package-installed-p 'use-package)
|
||||||
(package-install 'use-package))
|
(package-install 'use-package))
|
||||||
(require 'use-package)
|
(require 'use-package)
|
||||||
|
|
||||||
(use-package ox-hugo
|
;; Org Hugo
|
||||||
:ensure t)
|
|
||||||
|
|
||||||
(use-package org-make-toc
|
|
||||||
:ensure t)
|
|
||||||
|
|
||||||
(setq org-make-toc-link-type-fn #'org-make-toc--link-entry-org)
|
|
||||||
|
|
||||||
(defvar-local my/org-hugo-heading-slugs nil)
|
(defvar-local my/org-hugo-heading-slugs nil)
|
||||||
|
|
||||||
|
|
@ -60,49 +47,85 @@
|
||||||
(puthash slug t my/org-hugo-heading-slugs))
|
(puthash slug t my/org-hugo-heading-slugs))
|
||||||
slug))
|
slug))
|
||||||
|
|
||||||
(setq org-hugo-anchor-functions '(org-hugo-get-page-or-bundle-name
|
(use-package ox-hugo
|
||||||
org-hugo-get-custom-id
|
:ensure t
|
||||||
my/org-hugo-get-heading-slug
|
:config
|
||||||
org-hugo-get-md5))
|
(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")
|
;; Org Make TOC
|
||||||
(setq org-hugo-base-dir (vc-find-root default-directory ".git"))
|
|
||||||
|
|
||||||
;; (setq org-hugo-export-with-toc 6)
|
(use-package org-make-toc
|
||||||
|
:ensure t
|
||||||
(setq my/config-files '("README.org"
|
:config
|
||||||
"Emacs.org"
|
(setq org-make-toc-link-type-fn #'org-make-toc--link-entry-org))
|
||||||
"Desktop.org"
|
|
||||||
"Console.org"
|
|
||||||
"Mail.org"
|
|
||||||
"Guix.org"))
|
|
||||||
|
|
||||||
|
|
||||||
(dolist (file my/config-files)
|
;; Export dotfiles
|
||||||
(copy-file (expand-file-name
|
|
||||||
(format "%s/repos/dotfiles/%s"
|
|
||||||
(vc-find-root default-directory ".git")
|
|
||||||
file))
|
|
||||||
file 'overwrite))
|
|
||||||
|
|
||||||
(copy-directory
|
(setq my/config-files
|
||||||
(expand-file-name
|
'("README.org" "Emacs.org" "Desktop.org" "Console.org" "Mail.org" "Guix.org"))
|
||||||
(format "%s/repos/dotfiles/dot-imgs/"
|
|
||||||
(vc-find-root default-directory ".git")))
|
|
||||||
"dot-imgs" t t)
|
|
||||||
|
|
||||||
(dolist (file my/config-files)
|
(defun my/export-dotfiles ()
|
||||||
(with-temp-buffer
|
(cd (concat (vc-find-root default-directory ".git") "org/configs"))
|
||||||
(org-mode)
|
(dolist (file my/config-files)
|
||||||
(insert-file-contents file)
|
(copy-file (expand-file-name
|
||||||
(unless (string-equal file "README.org")
|
(format "%s/repos/dotfiles/%s"
|
||||||
(org-make-toc))
|
(vc-find-root default-directory ".git")
|
||||||
(replace-string "conf-space" "vim" t (point-min) (point-max))
|
file))
|
||||||
(replace-string "conf-unix" "ini" t (point-min) (point-max))
|
file 'overwrite))
|
||||||
(replace-string "conf-windows" "ini" t (point-min) (point-max))
|
(copy-directory
|
||||||
(replace-string "conf-xdefaults" "vim" t (point-min) (point-max))
|
(expand-file-name
|
||||||
(replace-string "conf-toml" "toml" t (point-min) (point-max))
|
(format "%s/repos/dotfiles/dot-imgs/"
|
||||||
(replace-string ":noweb yes" ":noweb no-export" nil (point-min) (point-max))
|
(vc-find-root default-directory ".git")))
|
||||||
(setq-local buffer-file-name file)
|
"dot-imgs" t t)
|
||||||
(message "Publish %s" file)
|
(dolist (file my/config-files)
|
||||||
(org-hugo-export-to-md)))
|
(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