Notes on Hugo created via Orgzly

Table of Contents

1 Notes Entered in WordPress

Start

https://gohugo.io/themes/ "Excellent Go template lib". Link?

Create theme

–> "templates lookup order". Ok… WTH is "taxonomy"? –> Taxonomy Templates. –> Taxonomies Under Content Management. Ok, now I sort of have a handle.

Single Page Template

(Back to "template lookup order".) So, now it's clear I need to learn yet another templating language.

Go templating

HTML templating (security aspects, mostly); text templating (I guess start here). Nice: https://golang.org/pkg/text/template/#hdr-Actions Oh, we have argument chaining and pipeline chaining. Seems confusing. Couldn't we talk about pipeline "construction" from "stages" or "sections" or "segments"?

2 Go templating

So, that actually seems reasonable.

More/better info here: https://gohugo.io/templates/introduction/

2.1 Hugo adds more functions to base set provided by Go templating libraries

3 Configuration (without default structure created by hugo)

I have a bunch of org-mode files with images in the same directory as the file, and so on. Plus, it's not a blog; it's more of a personal wiki. So I won't be using the hugo command to generate a new empty structure, but instead I'll be using the existing structure(s) I have.

So, configuration is important. https://gohugo.io/getting-started/configuration/

3.1 TOML

https://github.com/toml-lang/toml

(Tom Preston-Werner is… founder of GitHub. =:o )

3.2 Basic structure

From https://gohugo.io/getting-started/configuration/:

Hugo uses the config.toml, config.yaml, or config.json (if found in the site root) as the default site config file.

4 Attempting to run hugo w/just plain org-mode input doesn't work

Doesn't work. Hugo's understanding of org-mode is lacking. "Comment" sections appeared (shouldn't have), nested lists weren't nested, links weren't generated, properties were displayed (shouldn't have been).

5 ox-hugo

Org-mode to Hugo. https://ox-hugo.scripter.co/

Add this to every org-mode file you want to do this with:

#+HUGO_BASE_DIR: .

Need to find a way to set this so output matches input directory structure. Maybe via org publish. (See org-mode "publish" operation.)

Then, when you create a directory hierarchy, you (a) won't get name collisions because everything's going into one output directory, and (b) the ox-hugo output will sort of "travel with" the org-mode files.

Also, set this in your .emacs (or whereever you configure stuff; maybe you use that newfangled "customize" thing):

(if (member 'ox-hugo features)
    (progn
      (setq org-hugo-default-section-directory "org-mode")
      )
  )

(Obviously, don't have to use "org-mode".)

6 org-mode "publish" operation

Looks like I need to write a tiny publishing function that looks at the file extension (suffix) and dispatches to one of org-html-publish-to-html or org-publish-attachment. See info:org#Publishing action.

Actually, here's the whole publishing configuration:

(setq org-publish-project-alist
      '(("tarheel-nc"
         :base-directory "c:/Users/J6L/Documents/AmazonS3/Tarheel-NC"
         :base-extension any
         :exclude "^\\.git\\|\\(\\\\\\|/\\)#\\|~$\\|template\.org" ;.git subdir, Temp. and backup files.
         :publishing-directory "c:/Users/J6L/Documents/AmazonS3/Tarheel-NC-published"
         :recursive t
         :headline-levels 12
         :with-author nil
         :with-creator t
         :publishing-function lusk-org-publish
         )
        )
      )

(defun lusk-org-publish (prop-list filename dest-pub-dir)
  "Choose what to do with a given file.  Useful if all your org-mode files live in the directory (org, attachments,
javascript, css, etc."
  (if (string-suffix-p ".org" filename t)
      (org-html-publish-to-html prop-list filename dest-pub-dir)
    (org-publish-attachment prop-list filename dest-pub-dir)))

(provide 'org-projects)

(Not 100% sure I need all those backslashes to find temporary files, whatever, it seems to be working ok so far.)

7 TOC presentation

Need to make it both less obvious and more present, like fade-out/fade-in in top right corner. User sees it on first page load (below title?) but it removes itself when scroll starts.

7.1 Fixed position

7.2 State change (shown, minimized)

7.3 CSS Animation

7.4 Scrolling

8 Basic minimal template

8.1 Root/index

8.2 Directories

Created: 2018-10-19 Fri 17:32

Emacs 25.2.1 (Org mode 9.1.2)

Validate