emacs-love / weblorg

Static Site Generator for Emacs
https://emacs.love/weblorg
GNU General Public License v3.0
278 stars 20 forks source link

As blogger I want to create my blog from org files using Emacs, so that I can blog without exiting Emacs. #1

Closed guilhermecomum closed 3 years ago

clarete commented 3 years ago

Thanks for taking the time to write the stories you're expecting blorg to fulfill, dear @guilhermecomum! Do you think the current implementation of blorg-cli with the details below is enough to declare this feature implemented?

As we'll see in the documentation, this is how blorg-cli can currently be used to achieve that:

Code

(blorg-cli
 :base-dir "~/blog"
 :input-pattern "posts/.*\\.org$"
 :template "post.html"
 :output "www/{{ slug }}.html")

Directory structure

The ~/blog directory structure must look like the following:

~/blog
├── publish.el*
├── posts
│   ├── a-great-post.org
│   ├── ...
│   └── another-blog-post.org
├── pub
│   ├── ...
│   └── style.css
└── templates*
    ├── ...
    └── post.html

Considerations

  1. If the :base-dir parameter isn't provided, we use default-directory. That allows authors to have the code snippet in a file like publish.el in the root directory of the blog. But since the story here is about doing it from within Emacs, I wanted to note that it's the users' choice to use blorg either from within Emacs or from a .el file ran with emacs --script
  2. blorg will most likely provide a base theme, so might not be strictly necessary to have the templates directory there.
guilhermecomum commented 3 years ago

Perfect! Sounds amazing!