How I Organise My Personal Blog

I use hugo to build site. As stated in the official documentation, hugo is a fast and flexible static site generator written in Golang. It converts source markup files (e.g., org, markdown, Rmarkdown, quarto) to html file.

A skeleton of website

Below is a copy from the hugo documentation.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
my-site/
├── archetypes (templates for new content)
├── assets
├── content (markup files)
├── data (data files (JSON, TOML, YAML, or XML) that augment content, configuration, localization, and navigation)
├── hugo.toml (configuration file)
├── images
├── layouts
├── netlify.toml (netlify configuration)
├── public (generated after building the site)
├── resources
├── static
└── themes (as the name says)

Build locally

Command line

1
hugo server -D

Rstudio + blogdown

I used `blogdown` for a while and I liked it. In particular, it supports the page bundle feature very well. That is, each new post has its own separate folder. However, I give up this solution because Rstudio is too heavy and slow.

1
2
3
  blogdown::new_site()
  blogdown::serve_site() ## build local website
  blogdown::new_post() ## new post, usually pops up a UI

Emacs easy-hugo

This is a lightweight but good enough solution. You can type `easy-hugo-complete-tags` to do the auto-completion stuff. However, it does not support page bundle, but I can tolerate it.

There are also other packages in Emacs like ox-hugo. But it is more for the org-mode enthusiast.

Depoly in the cloud

0%