2022-07-13 16:26:16 +08:00
|
|
|
;; this file and Makefile from:
|
|
|
|
;; https://www.cnblogs.com/banjia/archive/2012/09/29/2708966.html
|
2022-09-15 11:33:55 +08:00
|
|
|
;; CSDN, 阿里云, 这些垃圾都在未授权盗搬, 结果这个东西有些地方都过时了. 能不能有点创新...
|
|
|
|
|
|
|
|
;; System Crafter's video: https://youtu.be/AfkrzFodoNw
|
2022-07-13 16:26:16 +08:00
|
|
|
|
2022-10-21 20:07:00 +08:00
|
|
|
(eval-when-compile
|
|
|
|
(require 'package)
|
|
|
|
(package-initialize)
|
2022-07-13 19:33:17 +08:00
|
|
|
|
2022-10-21 20:07:00 +08:00
|
|
|
(require 'org)
|
|
|
|
(require 'ox)
|
|
|
|
(require 'webfeeder))
|
|
|
|
|
|
|
|
;; https://emacs.stackexchange.com/questions/36366/disable-auto-id-generation-in-org-mode-html-export
|
|
|
|
(defun html-body-id-filter (output backend info)
|
|
|
|
"Remove random ID attributes generated by Org."
|
|
|
|
(when (eq backend 'html)
|
|
|
|
(replace-regexp-in-string
|
|
|
|
" href=\"#org[[:alnum:]]\\{7\\}\""
|
|
|
|
""
|
|
|
|
(replace-regexp-in-string
|
|
|
|
" id=\"[[:alpha:]-]*org[[:alnum:]]\\{7\\}\""
|
|
|
|
""
|
|
|
|
output t)
|
|
|
|
t)))
|
|
|
|
(add-to-list 'org-export-filter-final-output-functions 'html-body-id-filter)
|
|
|
|
|
|
|
|
(setq org-html-validation-link nil
|
|
|
|
org-export-with-sub-superscripts nil)
|
2022-07-13 16:26:16 +08:00
|
|
|
(setq org-publish-project-alist
|
|
|
|
'(("org-pages"
|
|
|
|
:base-directory "."
|
|
|
|
:base-extension "org"
|
2022-09-11 11:20:31 +08:00
|
|
|
:publishing-directory "./../"
|
2022-07-13 16:26:16 +08:00
|
|
|
:recursive t
|
2022-09-09 12:54:49 +08:00
|
|
|
:exclude "画大饼.org"
|
2022-07-13 19:33:17 +08:00
|
|
|
:publishing-function org-html-publish-to-html
|
2022-09-10 22:00:14 +08:00
|
|
|
:preserve-breaks t
|
2022-09-15 11:33:55 +08:00
|
|
|
|
|
|
|
:org-html-validation-link nil
|
2022-09-09 16:08:21 +08:00
|
|
|
;; https://github.com/rgb-24bit/org-html-theme-list org-joshua
|
2022-09-15 11:45:58 +08:00
|
|
|
:html-head "<link rel='stylesheet' type='text/css' href='css/main.css' />"
|
2022-09-10 22:00:14 +08:00
|
|
|
:html-link-home "https://dongdigua.github.io"
|
2022-10-30 15:09:37 +08:00
|
|
|
:html-link-up "./../posts"
|
2022-07-13 16:26:16 +08:00
|
|
|
)))
|
|
|
|
|
2022-09-25 12:53:07 +08:00
|
|
|
;; from .emacs
|
|
|
|
(defun my/orgurl (proto)
|
|
|
|
(defvar proto proto) ;; important
|
|
|
|
(org-link-set-parameters proto
|
|
|
|
:export
|
|
|
|
(lambda (link description format _)
|
|
|
|
(let ((url (format "%s:%s" proto link)))
|
|
|
|
(format "<a href=\"%s\">%s</a>" url (or description url))))))
|
|
|
|
(my/orgurl "gopher")
|
|
|
|
(my/orgurl "gemini")
|
|
|
|
|
2022-07-13 16:26:16 +08:00
|
|
|
(defun myweb-publish ()
|
|
|
|
"Publish myweb."
|
|
|
|
(interactive)
|
|
|
|
(setq debug-on-error t)
|
2022-09-10 22:00:14 +08:00
|
|
|
(org-publish-all)
|
|
|
|
|
|
|
|
(webfeeder-build
|
2022-10-23 16:54:07 +08:00
|
|
|
"feed.xml"
|
2022-09-11 11:20:31 +08:00
|
|
|
"./../"
|
2022-09-10 22:00:14 +08:00
|
|
|
"https://dongdigua.github.io"
|
2022-10-30 14:25:15 +08:00
|
|
|
(delete "xmr.html" (delete "index.html" (directory-files "./../" nil ".*\.html$")))
|
2022-09-10 22:00:14 +08:00
|
|
|
:title "dongdigua's blog"
|
|
|
|
:description "Blog!"
|
|
|
|
:builder 'webfeeder-make-rss)
|
|
|
|
)
|
2022-07-13 16:26:16 +08:00
|
|
|
|