Skip to content

Latest commit

 

History

History
114 lines (85 loc) · 2.26 KB

README.org

File metadata and controls

114 lines (85 loc) · 2.26 KB

Hugo Flavored Markdown exporter for Org Mode

This project has been deprecated, please use ox-hugo

Lovely you:

  • Writing with Org.
  • Making website with Hugo.

Yean! ox-hugo

Installation

  1. Manual

Download:

$ git clone https://github.com/helloyi/ox-hugo /your/ox-hugo/path

Config emacs:

(add-to-list 'load-path (expand-file-name "/your/ox-hugo/path"))
(require 'ox-hugo)
  1. Automatic
$ git clone https://github.com/helloyi/ox-hugo /your/ox-hugo/path
$ mv /your/ox-hugo/path/ox-hugo.el /to/your/org/lisp/dir

Export options

First, setting hugo metadata format with #+HUGO_METADATA_FORMAT (default toml). This keyword can be set to either toml or yaml.

Supported keywords:

org keywordhugo metadatadefault
#+TITLEtitle<filename>
#+DATEdate<export time>
#+HUGO_DESCRIPTIONdescription<nil>
#+HUGO_TAGStags<nil>
#+HUGO_CATEGORIEScategories<nil>
#+HUGO_SLUGslug<nil>
#+HUGO_URLurl<nil>
#+HUGO_METADATA_FORMAT“toml”

Example

  • Default metadata export

org source:

#+HUGO_CATEGORIES: test

markdown source:

+++
title = "filename"
date = "2016-07-16 22:44:35 +0800"
categories = ["test"]
+++
  • Metadata export

org source:

#+TITLE: test
#+DATE: <2015-07-05 21:30 +0800>
#+HUGO_TAGS: test tag1 tag2
#+HUGO_CATEGORIES: test
#+HUGO_DESCRIPTION: Just test

markdown source:

+++
title = "test"
date = "2015-07-05 21:30:00 +0800"
description = "Just test"
tags = ["test", "tag1", "tag2"]
categories = ["test"]
+++
  • Source Block export

org source:

#+BEGIN_SRC go
var a string
var b int64
#+END_SRC

markdown source:

{{< highlight go >}}
var a string
var b int64
{{< /highlight >}}