Hacker News new | ask | show | jobs
by kqr 2905 days ago
Do you have any experience with Org publish/export, and does it suffer from the same problems?
3 comments

Hello kqr! I didn't expect Org mode to be mentioned in this Hugo thread. So I'd like to mention my ox-hugo[1] project here. Here are few real-world examples of people using ox-hugo + Hugo: https://ox-hugo.scripter.co/doc/examples/ (while on that page, also search for "Exported from" :)).

ox-hugo basically lets each tool to do what they are best at: Org mode deals with the rich markup and Emacs/Elisp processing, and Hugo deals with the super-fast Markdown->HTML conversion.

[1] ox-hugo is an Emacs package that exports from Org mode to Markdown format that's compatible with Hugo/Blackfriday + automagically converts natural Org metadata to TOML/YAML front-matter.

I love org-mode, but the export is a mess. It produces sloppy HTML and garbage CSS, what I want is semantic HTML5 and custom CSS. Actually, I should probably just spend the time to build what I want and contribute it back to the org project.

I actually have it customized to put some CSS in, but it is suboptimal.

    (setq org-html-doctype "html5")
    (setq org-html-head-include-default-style nil)
    (setq org-html-head
          (concat "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
    <link href=\"https://cdnjs.cloudflare.com/ajax/libs/normalize/4.1.1/normalize.css\" rel=\"stylesheet\">
    <style>" (string-from-file (concat eddie/default-emacs-dir "style.css")) "</style"))
    (setq org-html-head-include-scripts nil)
Hugo is by far better and more stable than org-mode exporters. Tried all, stayed with hugo, even if I don't like go that much.
Can you expand on that a bit? Can Hugo not take other formats?

I use Pelican. It supports markdown and rst out of the box. It's fairly easy to write a plugin to support another format. So I wrote one that takes in Org files (I think it just uses pandoc behind the scenes to convert to rst). Writing posts is much better now that I can author them in Org mode.

So if someone wants to author in Org mode, but not use the clunky Org exporters, consider using a static site generator that allows you to have a custom input format.