Starting a blog this days couldn’t be easier. Ten simple steps to get started.
-
Check it out locally, e.g. to
~/blog. Every file you put in the repo will be published automatically:By default, Jekyll doesn’t build files or folders that:
- are located in a folder called
/node_modulesor/vendor - start with
_,., or# - end with
~ - are excluded by the exclude setting in your configuration file
- are located in a folder called
-
Configure custom domain or just use the default
<repo>.github.io. -
Create
~/blog/_hugo/config.tomlbaseURL = "http://sarg.org.ru/" languageCode = "en-us" title = "Random forest" theme = "anubis" # see the next step publishDir = "../" # github pages look in the root folder by default -
Checkout some theme.
git submodule add \ https://github.com/Mitrichius/hugo-theme-anubis.git \ _hugo/themes/anubis -
Add
_hugo/contentto.gitignore.This directory will be generated by
ox-hugo, no need to store it in git. -
Create
org-modefile where all the content would be placed.Use the instruction from
ox-hugodocumentation. But make sure that#+HUGO_BASE_DIRpoints to_hugodirectory. You can put the file whenever you want, not strictly necessary in the repository. -
Export the file with
ox-hugo.Press
C-c C-e H Ato export everything. Now_hugo/contentshould be populated. You might want to enable auto export on saving. -
Check that your blog works locally.
Go to
_hugo/and runhugo server -D. Hugo should start on http://localhost:1313 -
Generate html for github pages.
Run
hugoand it’ll create all the files inpublishDir. -
Commit and push all the changes. You’re done! 🎉