Babel is why I keep blogging with Emacs

(entropicthoughts.com)

134 points | by ibobev 4 hours ago ago

25 comments

  • akkartik 2 hours ago

    This works if your code snippets generate relatively static output. Lately I often need to create animations, often interactive ones. See https://akkartik.name/debugUIs.html, for example.

    In my life I've often switched to more manual tools when I notice that the more automated tool causes me to live within certain limitations. Sometimes it has taken me a decade to notice these limitations. Automation matters when I do something tens of times a day. But I publish a blog post once in tens of days. It feels worth some additional work to get a little more control and break out of ruts.

  • thecsw 3 hours ago

    I was in the same boat for many years! Having started using org-mode for my website in 2018 [1] (just add index.org to the path to see the source), it grew into this massive pile of obscure gen and with my limited comfort level with lisp, turned into a scary smelling concoction of dozens of perl/sed/sh scripts that modified the output to fit my needs and have them do something fancy.

    But then, really, sat down for about 48 hours on a lonely weekend when everyone was away and wrote a simple static site generator [2] that takes exact same files and produces output that I fully understand e2e, becoming the project I'm most proud of.

    There are so many other generators I tried (hugo, jekyll, rails, asciidoctor, org-publish, astro), rolling up your own gives a sense of a stable foundation. Love your website! So clean. One thing that I'm thinking of adding (though I haven't touched my generator that much, I consider it "complete") is the dynamic execution of source code blocks.

    [1] https://sandyuraz.com

    [2] https://github.com/thecsw/darkness

  • projektfu 2 hours ago
  • ashton314 2 hours ago

    I write my blog (https://lambdaland.org) entirely in Emacs now. It's Hugo, but I use ox-hugo [1] to convert from org-mode to markdown and Hugo converts it to HTML.

    What I like about this: everything else I do is in org-mode anyway, so this fits my brain. I also have some nice org-mode tooling to make things like footnotes, margin notes, etc. look really nice.

    A little convoluted, sure, but I've seen worse. :-P

    [1]: https://ox-hugo.scripter.co/

    • Lownin 2 hours ago

      It looks like Hugo also has native .org file support. Does ox-hugo provide functionality over Hugo’s native org file parsing?

      • lordgrenville an hour ago

        Didn't know that Hugo supports org files. But just one example of added functionality is being able to use one big file with a subtree for each post.

      • BeetleB 39 minutes ago

        It didn't back when ox-hugo was written.

      • globular-toast 35 minutes ago

        I started using Hugo's built-in org support, but I found it quite limiting. I can't remember the specifics, but it doesn't support everything you can do with Markdown. So I quickly switched to ox-hugo. They can co-exist though so you can try the native support then switch if you run into the same shortcomings as I did.

    • cyrialize an hour ago

      I've also thought about using ox-hugo! I have (literally) organized my life in plain text, so I keep everything in org files.

    • dima55 2 hours ago

      Does org-babel work? Do equations work?

  • m-hodges an hour ago

    > Any lightweight markup format (like Markdown or ReStructuredText or whatever) allows for embedding code blocks, but Org, through Babel, can run that code on export, and then display the output in the published document, even when the output is a table or an image.

    This is what I love about blogging with Quarto.

  • dzonga 19 minutes ago

    do people also realize you can blog with .txt files ?

    write a txt file, scp then let whatever server serve the files.

  • NeutralForest 3 hours ago

    I used to use org-mode with hugo but it got annoying, I didn't like how I needed to structure my org files, it kind of forced me into some structure. Now I use Zola with Markdown. I'm losing in power but it's so much simpler tbh.

  • BeetleB 4 hours ago

    Heh. I write my blog posts in org mode, and have a way to get Pelican[1] to read them. It doesn't support executing Babel source blocks on export - I should probably add that feature to my package.[2]

    [1]https://getpelican.com/

    [2]https://blog.nawaz.org/posts/2022/Dec/reintroducing-opel-put...

    • vunderba 3 hours ago

      I started my blog with Pelican before migrating over to Astro. I enjoyed Pelican (Python based static site generator) for the most part but the theme system wasn't to my liking.

    • zenmac 3 hours ago

      have not seen pelican before, but went with zola. IMHO a binary distro is just much cleaner than the pip/uv/npm/yarn approach. And it is fast, and can auto rendered rss/atom.

      • BeetleB an hour ago

        I stuck to Pelican because it's Python, and thus easy for me to write plugins.

        And of course, it can do Atom/RSS.

  • dima55 3 hours ago

    I blog with emacs using the long-abandoned o-blog generator. Anybody have something better? Using the org-mode exporter, with working org-babel and equations and all that. This article doesn't go into the details.

    • EnigmaCurry 3 hours ago

      > Anybody have something better?

      I wrote this to publish Org docs to S3 - https://github.com/EnigmaCurry/s3-publish.el - I wanted something extremely lightweight, not even wanting to commit things to git like I normally would and waiting for CI to build something. Uploading html directly to S3 means it gets published in <1s from push.

      • kstrauser 33 minutes ago

        o-blog in the parent comment reminded me that I use to use a similarly named SSG called blogofile, and what do you know. Small world.

      • sandinmyjoints 2 hours ago

        That's neat! For org, if it had an option to generate the HTML file name from slugifying the org file name instead of the salted hash, it could be fantastic for rapid lightweight blogging.

  • agentultra 3 hours ago

    I mean that 2000 lines, I assume, is going to only be that many lines because it will have 20-50k lines of dependencies under it.

    It’s not a bad idea to understand the software you use. A matter of where you want to spend your time. Learning about the org-mode internals is also a valid choice.

  • improgrammer007 2 hours ago

    HN and its obsession with org-mode