It turns out to be that the titles are cached and originally they are not supposed to change frequently.
One workaround is to delete all the cache:
Cache in ~/.org-timestamps
doesn't get updated to reflect the change in page title. Deleting everything under the folder and re-publish then everything goes fine, until page titles are changed again.
For more detail, see the link in the comment below.
In my org-mode project, modified page title is not updated in sitemap after re-publish. I did following steps to reproduce:
a.org(title A) --> change title to AA --> re-publish --> title in sitemap.org: A -->
rename a.org(AA) to b.org(AA) --> re-publish --> title in sitemap.org: AA -->
change b.org(AA) to b.org(BB) --> re-publish --> title in sitemap.org: AA
Here for (1) and (3) the sitemap doesn't reflect the change in page title.
What I tried:
Invoke
org-publish-project
, delete published contents, re-publish, doesn't workAdd prefix
C-u
toorg-publish-project
, delete published contents, re-publish, doesn't work
It seems to be some kinds of sitemap cache, but I couldn't find any clue.
I am using GNU Emacs for Mac OS X 26.1.
Below is my project configuration init.el
:
(setq make-backup-files nil)
(setq project-dir (file-name-directory load-file-name))
(setq publish-dir (concat project-dir (file-name-as-directory "publish")))
(setq css-dir (concat project-dir (file-name-as-directory "css")))
(setq current-theme "readtheorg")
(load (concat project-dir "src/theme.el"))
;; for latex
(setq org-latex-pdf-process
'("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f"))
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(clojure . t)
(shell . t)
(ditaa . t)
(dot . t)
(plantuml . t)))
;; org project
(require 'ox-publish)
(setq org-publish-project-alist
`(("org"
:components("org-pages" "org-assets"))
("org-pages"
:base-directory "."
:base-extension "org"
:publishing-directory ,publish-dir
:makeindex t
:recursive t
:publishing-function org-html-publish-to-html
:with-author "Myself"
:headline-levels 4
:auto-preamble t
:auto-sitemap t
:sitemap-title "Notes"
)
("org-assets"
:base-directory "."
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
:publishing-directory ,publish-dir
:recursive t
:publishing-function org-publish-attachment)
))
(org-publish "org" t)
(delete-directory "./publish/publish" t)
(defun pub ()
"Publish org-project \"org\""
(interactive)
(org-publish-project "org")
(delete-directory (concat publish-dir (file-name-as-directory "publish")) t))
Any help is appreciated! Thanks!