Ox-zola is an Org exporter backend that exports Org mode to Markdown with TOML frontmatter compatible with the Zola static site generator.
Drop-in replacement for ox-hugo when targeting Zola. If you’re migrating your blog from Hugo to Zola, you can keep your existing Org files with HUGO_* keywords unchanged! Just switch to ox-zola and your exports will produce Zola-compatible output.
Configure your Zola site in your Emacs config:
(setq ox-zola-base-dir "~/my-zola-site")
(setq ox-zola-section "posts") ; default sectionOr configure per-file with keywords:
#+zola_base_dir: /path/to/your/zola/project
#+zola_section: posts
Write your posts as Org headings:
* My First Post
:PROPERTIES:
:EXPORT_FILE_NAME: my-first-post
:END:
This is my first post written in Org-mode!
Export with the Org export dispatcher (M-x org-export-dispatch or C-c C-e). The Zola backend appears under the Z key:
[Z] Export to Zola Markdown
[z] Subtree or File to Md file [Z] File to a temporary Md buffer
[O] Subtree or File to Md file and open [f] File to Md file
[A] All subtrees (or File) to Md file(s) [o] File to Md file and open
It builds on top of ox-hugo, so all ox-hugo features work: subtree exports, property inheritance, WIM detection, and more. See the ox-hugo documentation for the full feature set.
Use Org tags for taxonomies:
* My First Post :@blogging:emacs:
This creates a category blogging and a tag emacs.
Or use file-level keywords:
#+zola_categories: blogging
#+zola_tags: emacs org-mode
Both produce proper Zola frontmatter:
[taxonomies]
categories = ["blogging"]
tags = ["emacs", "org-mode"]To create a page bundle with assets in the same directory:
* My First Post :@blogging:emacs:
:PROPERTIES:
:EXPORT_HUGO_SECTION: posts/my-first-post
:EXPORT_FILE_NAME: index
:END:
If you’re switching your blog from Hugo to Zola:
- Keep your existing Org files -
HUGO_*keywords work unchanged - Replace your config:
;; Before (ox-hugo) (require 'ox-hugo) (setq org-hugo-base-dir "~/blog") ;; After (ox-zola) (require 'ox-zola) (setq ox-zola-base-dir "~/blog")
- Use
ox-zola-export-*instead oforg-hugo-export-*
ox-zola automatically transforms the output for Zola:
| ox-hugo (Hugo) | ox-zola (Zola) |
|---|---|
tags = [...] at root | [taxonomies] section |
lastmod | updated |
layout | template |
{{< shortcode >}} | {{ shortcode() }} |
relref shortcodes | @/ path syntax |
If you have different websites generated with Zola and Hugo, you’re covered. ox-zola doesn’t break ox-hugo: both can coexist!
(use-package ox-zola
:straight (ox-zola :host github :repo "gicrisf/ox-zola"))(use-package ox-zola
:vc (:url "https://github.com/gicrisf/ox-zola"
:rev :newest
:branch "main"))In ~/.config/doom/packages.el:
(package! ox-zola :recipe (:host github :repo "gicrisf/ox-zola"))In ~/.config/doom/config.el:
(use-package! ox-zola)Then run doom sync.
Did you find this package useful? Buy me a coffee!
Open sourced under the GPL-3.0 license.