notes | journal | about | archive | sourcehut | github

Publishing a website from Org-mode

  • editing webpages
  • go-org
  • Technical notes about my Org-mode and go-org setup. Still a work in progress.

    editing webpages

    I previously used Markdown, which is simpler.

    go-org

    Niklas Fasching's go-org is a remarkably complete parser, making it easy to generate a website with a simple Go script. I've been running through a couple of files like drafts.org, posts.org, and journal.org and creating a new page for each top level heading.

    d1 := org.New().Parse(f, "./") // new org.Document
    
    for _, heading := range d1.Nodes { // for each heading in the file
    	
    	// pull full content of the heading as a new org.Document
    	input := strings.NewReader(heading.String())
    	d := org.New().Parse(input, "./")
    
    - item 1
    - item 2, a multiline item Lorem ipsum dolor sit amet, consectetur 
        adipiscing elit. Aenean quis semper orci. Aenean a est eu est
        dapibus. Nam felis libero, dapibus a maximus ut, condimentum .
    
     * Heading