I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2.8 KiB

Hugo

Create entire websites with Emacs.

Setup

Download and install hugo1 on your system before loading the module:

RUN apt install -y hugo

Config

It's possible to export org-mode into hugo1 specific markdown2 using the ox-hugo3 package. I have my setup configured for one-post-per-file, despite it not being the suggested method. The option will appear in the default export menu inside of an org-mode buffer, accessible by pressing C-c C-e.

(use-package ox-hugo
  :after ox)

Shortcuts

Create capture templates for creating new blog posts, and creating publicly shared notes on various topics, and other peoples published works.

Posts

I post nonsense on my personal blog, available here4. This template makes sure the file ends up going to the right location, with the configuration pre-applied.

(with-eval-after-load 'org-roam
  (add-to-list 'org-roam-capture-templates
               '("p" "Post" plain (function org-roam-capture--get-point)
                 "%?"
                 :file-name "docs/posts/${slug}"
                 :unnarrowed t
                 :head
"
,#+TITLE: ${title}
,#+AUTHOR: Christopher James Hayward
,#+DATE: %<%Y-%m-%d>

,#+OPTIONS: num:nil todo:nil tasks:nil

,#+EXPORT_FILE_NAME: ${slug}
,#+ROAM_KEY: https://chrishayward.xyz/posts/${slug}/

,#+HUGO_BASE_DIR: ../
,#+HUGO_AUTO_SET_LASTMOD: t
,#+HUGO_SECTION: posts
,#+HUGO_DRAFT: true
")))

Notes

Read my notes on various textbooks, artciles, and other un-categorized nonsense here5. This template makes sure the file ends up going to the right location, with the configuration pre-applied.

(with-eval-after-load 'org-roam
  (add-to-list 'org-roam-capture-templates
               '("n" "Notes" plain (function org-roam-capture--get-point)
                  "%?"
                  :file-name "docs/notes/${slug}"
                  :unnarrowed t
                  :head
"
,#+TITLE: ${title}
,#+AUTHOR: Christopher James Hayward

,#+OPTIONS: num:nil todo:nil tasks:nil
,#+EXPORT_FILE_NAME: ${slug}
,#+ROAM_KEY: https://chrishayward.xyz/notes/${slug}/

,#+HUGO_BASE_DIR: ../
,#+HUGO_AUTO_SET_LASTMOD: t
,#+HUGO_SECTION: notes
,#+HUGO_DRAFT: true
")))

Footnotes