LeonardoE95 / comments.blog.leonardotamiano.xyz

0 stars 0 forks source link

tech/year-1-review/ #3

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

2020/2021 Yearly Blog Review (Year #1) :: Leonardo Tamiano's Cyberspace

It was the 2020-07-28 (yyyy-mm-dd), that is, yesterday of one year ago, when I published my first blog-post ever. From now on this date will officially represent the birth of this blog/site. The actual content of my first blog-post was pretty specific and technical. It detailed how I configured mu4e, an Emacs package for reading and sending emails (link). To be honest I had no intention of publishing it, I just did it because a friend of mine asked about my mu4e setup, and to explain it to him it took longer than I thought.

https://blog.leonardotamiano.xyz/posts/year-1-review/

dr-neptune commented 2 years ago

Very cool, thanks for writing this up!

In the "How I write my content" animation, it seems that you have hot-reloading occurring? Is this an elisp function you are using? Is it a part of ox-hugo?

Also, have you considered using org babel tangle with references to individual files to split out your content instead of keeping it in one large file?

LeonardoE95 commented 2 years ago

Very cool, thanks for writing this up!

In the "How I write my content" animation, it seems that you have hot-reloading occurring? Is this an elisp function you are using? Is it a part of ox-hugo?

Also, have you considered using org babel tangle with references to individual files to split out your content instead of keeping it in one large file?

Hey, thanks for writing, appreciate it!

As far as your questions go, let me answer each one separately:

  1. The "hot-reloading" is a mix of things. In the future I will write a more thorough post, but for now let me briefly describe how to I manage my content:
    • First I start a local webserver by going in the hugo folder and executing hudo serve -D. This web server listens on http://localhost:1313/
    • Then I create a new outline in my org-file, the outline has to have the property EXPORT_HUGO_SECTION, and EXPORT_FILE_NAME, which are used by ox-hugo to recognize that this outline must be exported into an .md file, which then gets compiled down to .html by hugo.
    • In the same org file I use to manage all blog posts, I have a bunch of elisp code which is always executed upon the start, that is when I load the file into emacs. The elisp code creates a hook that executes the ox-hugo function org-hugo-export-wim-to-md-after-save function everytime I save something in this local buffer. This is done by using local variables, which is a concept not related to ox-hugo necessarily but its a general feature of emacs. At the end of my org-file essentially I have the following
* COMMENT Local Variables                                           :ARCHIVE:
# Local Variables:
# eval: (add-hook 'after-save-hook #'org-hugo-export-wim-to-md-after-save :append :local)
# eval: (auto-fill-mode 1)
# End:
  1. As far as the managing of content, in the future, when I will have lots more content, and loading the file will start to become slow, I will think about splitting it. For now I find it more comfortable to just have a big file, because I can always have a bird's eye of my content, and I can change anything I want in a matter of seconds, without remembering where I have the file for the particular post. The problem will come I suppose when the file gets too big. For now I have around 16k lines and its still manageable without performance issues. Maybe a trade-off could be to have a big org file per year, and split it like that.