Compare commits

...

2 Commits

Author SHA1 Message Date
TEC 42be4d084d
Don't time-stamp index/404/archive pages 2024-01-11 15:57:56 +08:00
TEC 9dcf7cee5d
Reset draft commits instead of amending 2024-01-11 15:57:56 +08:00
1 changed files with 11 additions and 7 deletions

View File

@ -340,6 +340,7 @@ PROJECT is the current project."
:include ("index.org")
:recursive nil
:publishing-function org-html-publish-to-html
:time-stamp-file nil
:headline-levels 4
:section-numbers nil
:with-toc nil
@ -355,6 +356,7 @@ PROJECT is the current project."
:include ("archive.org" "404.org")
:recursive nil
:publishing-function org-html-publish-to-html
:time-stamp-file nil
:headline-levels 4
:section-numbers nil
:with-toc nil
@ -487,13 +489,15 @@ PROJECT is the current project."
(if (= html-changed-files 0)
(warn! "No changes to push")
(let ((default-directory html-dir))
(unless source-draft-p
(dolist (file (mapcar #'cdr (get-unstaged-changes)))
(when (and (file-exists-p file)
(string-prefix-p "DRAFT-" (file-name-base file)))
(delete-file file))))
(and (git-try-command "add" "-A")
(git-try-command "commit" (and html-draft-p "--amend") "--message" commit-message)
(and (or source-draft-p
(prog1 (or (not html-draft-p)
(git-try-command "reset" "--soft" "HEAD~1"))
(dolist (file (mapcar #'cdr (get-unstaged-changes)))
(when (and (file-exists-p file)
(string-prefix-p "DRAFT-" (file-name-base file)))
(delete-file file)))))
(git-try-command "add" "-A")
(git-try-command "commit" "--message" commit-message)
(git-try-command "push" (and html-draft-p "--force-with-lease"))))))
(section! "Finished")