19

I am running Emacs 24.3 and org-mode 8.25f. When I use M-x org-publish command, the org-mode only convert the new .org files to .html and skip all the others which have not been modified since last publish operation.

However, usually I have some changes in the publish setup and some CSS code changes. I want them to take effect to all the files, not just the recently modified ones.

So, can I tell org-mode not to skip these unchanged files?

2 Answers 2

23

This should work:

M-: (org-publish "project name" t)

This runs org-publish with FORCE set to t. From the docs:

When optional argument FORCE is non-nil, force publishing all
files in PROJECT.  With a non-nil optional argument ASYNC,
publishing will be done asynchronously, in another process.

As you discovered yourself, a prefix argument will also force Org to publish all files:

C-u M-x org-publish
4
  • 1
    how to add this functionality to config file?
    – slk500
    Jul 31, 2021 at 8:10
  • 1
    What do you mean by "add this functionality to config file"? You want to make this the default when you run org-publish?
    – Chris
    Aug 1, 2021 at 1:04
  • 1
    yes, I just make my own function, but maybe it can be simpler that that.
    – slk500
    Aug 1, 2021 at 11:00
  • That's probably best.
    – Chris
    Aug 1, 2021 at 12:22
0

The export dispatcher, which you can summon with C-c C-e in the Org mode, provides the relevant "Force publishing" option under C-f. Thus, to force-publish the current file, type C-c C-e C-f P f.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.