[Export, Drone] Update export.el and .drone.yml
export.el: Now export all org files in specified directories Code a bit cleaner .drone.yml: Send all the content of org/config to the remote server
This commit is contained in:
parent
d776dae8fb
commit
a04de69b10
@ -22,8 +22,7 @@ steps:
|
|||||||
target:
|
target:
|
||||||
from_secret: ssh_target
|
from_secret: ssh_target
|
||||||
source:
|
source:
|
||||||
- !org/config/LICENSE.md
|
- org/config/*
|
||||||
- org/config/*.html
|
|
||||||
strip_components: 2
|
strip_components: 2
|
||||||
username:
|
username:
|
||||||
from_secret: ssh_username
|
from_secret: ssh_username
|
||||||
|
32
export.el
32
export.el
@ -1,22 +1,30 @@
|
|||||||
#!/usr/bin/env -S emacs -Q --script
|
#!/usr/bin/env -S emacs -Q --script
|
||||||
|
|
||||||
(require 'package)
|
(require 'package)
|
||||||
(require 'org)
|
(require 'org)
|
||||||
(require 'ox-html)
|
(require 'ox-html)
|
||||||
|
|
||||||
(setq package-archives '(("melpa" . "https://melpa.org/packages/")))
|
(setq package-archives '(("melpa" . "https://melpa.org/packages/")))
|
||||||
(package-initialize)
|
(package-initialize)
|
||||||
(package-refresh-contents)
|
(package-refresh-contents)
|
||||||
(package-install 'htmlize)
|
(package-install 'htmlize)
|
||||||
|
|
||||||
(setq org-confirm-babel-evaluate nil
|
(setq org-confirm-babel-evaluate nil
|
||||||
org-html-validation-link nil)
|
org-html-validation-link nil)
|
||||||
(let ((files (mapcar #'expand-file-name
|
|
||||||
(file-expand-wildcards "org/config/*.org"))))
|
(defun export-and-clean (directory)
|
||||||
(mapc (lambda (file)
|
(progn (mapc (lambda (file)
|
||||||
(message (format "==========\nExporting %S\n==========" file))
|
(progn (message (concat "====================\n"
|
||||||
(with-current-buffer (find-file file)
|
"Exporting "
|
||||||
(org-html-export-to-html)))
|
file
|
||||||
files))
|
"\n"
|
||||||
(let* ((files (mapcar #'expand-file-name
|
"====================\n"))
|
||||||
(file-expand-wildcards "org/config/*.html~"))))
|
(with-current-buffer (find-file file)
|
||||||
(mapc (lambda (file)
|
(org-html-export-to-html))))
|
||||||
(delete-file file))
|
(directory-files directory t (regexp-quote ".org")))
|
||||||
files))
|
(mapc (lambda (file)
|
||||||
|
(delete-file file nil))
|
||||||
|
(directory-files directory t (regexp-quote "html~")))))
|
||||||
|
|
||||||
|
(dolist (dir '("org/config/" "org/config/Deprecated/" "org/config/WIP"))
|
||||||
|
(export-and-clean dir))
|
||||||
|
Loading…
Reference in New Issue
Block a user