To publish a blog, we have to convert the org-mode files to html files of all of our posts.

In short, we gotta go from this:

To this:

The builtin way to do that is to simply assign a variable called org-publish-project-alist with an alist containing the following information:

( setq org-publish-project-alist ` ( ( "org-files" :base-directory "~/blog/org/" :base-extension "org" :recursive t :publishing-directory "~/blog/_posts/" :publishing-function org-html-publish-to-html ) ( "static-files" :base-directory "~/blog/org/" :base-extension "png \\ | jpg" :publishing-directory "~/blog/res/" :recursive t :publishing-function org-publish-attachment ) ( "blog" :components ( "org-files" "static-files" ) ) ) )

After this variable is loaded, we can call the command M-x org-publish , then the prompt will let you choose among three values: blog , org-files and static-files .

When we select the org-files value, for example, org-mode will search recursively for files with the .org extension ( base-extension ) in ~/blog/org folder ( base-directory ), perform the conversion of org to html with the function org-html-publish-to-html ( publishing-function ) and, lastly, copy the resulting file in ~/blog/_posts ( publishing-directory ). The same idea applies to static-files , but, in this case, it'll copy the .png and .jpg files without any modification to ~/blog/res. The blog option will perform these two actions automatically.