Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Adams <realchaseadams@gmail.com>2017-02-21 10:46:03 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-02-21 10:46:03 +0300
commit86e8dd62f0b1c8adf14e9369b089d209317aaf2d (patch)
treeabd50df60bd2486cf71268bd15aacd24ccec3a78 /parser/frontmatter.go
parenta3af4fe46e1e1d184538a83bc8375154a9669316 (diff)
all: Add org-mode support
Fixes #1483 See #936
Diffstat (limited to 'parser/frontmatter.go')
-rw-r--r--parser/frontmatter.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/parser/frontmatter.go b/parser/frontmatter.go
index ed25c08e1..e57a593ab 100644
--- a/parser/frontmatter.go
+++ b/parser/frontmatter.go
@@ -19,6 +19,7 @@ import (
"errors"
"strings"
+ "github.com/chaseadamsio/goorgeous"
toml "github.com/pelletier/go-toml"
"gopkg.in/yaml.v2"
@@ -154,6 +155,8 @@ func DetectFrontMatter(mark rune) (f *frontmatterType) {
return &frontmatterType{[]byte(TOMLDelim), []byte(TOMLDelim), HandleTOMLMetaData, false}
case '{':
return &frontmatterType{[]byte{'{'}, []byte{'}'}, HandleJSONMetaData, true}
+ case '#':
+ return &frontmatterType{[]byte("#+"), []byte("\n"), HandleOrgMetaData, false}
default:
return nil
}
@@ -189,3 +192,7 @@ func HandleJSONMetaData(datum []byte) (interface{}, error) {
err := json.Unmarshal(datum, &f)
return f, err
}
+
+func HandleOrgMetaData(datum []byte) (interface{}, error) {
+ return goorgeous.OrgHeaders(datum)
+}