add back-end support for asciidoc and rst #40

This commit is contained in:
Henrique Dias
2016-02-07 09:01:17 +00:00
parent 7ab6cc7aba
commit cf23f6362a
5 changed files with 13 additions and 9 deletions

View File

@@ -57,7 +57,7 @@ func GET(w http.ResponseWriter, r *http.Request, c *config.Config, filename stri
// Handle the content depending on the file extension
switch page.Mode {
case "markdown":
case "markdown", "asciidoc", "rst":
if hasFrontMatterRune(file) {
// Starts a new buffer and parses the file using Hugo's functions
buffer := bytes.NewBuffer(file)
@@ -138,12 +138,14 @@ func appendFrontMatterRune(frontmatter []byte, language string) []byte {
func sanitizeMode(extension string) string {
switch extension {
case "markdown", "md":
case "md", "markdown", "mdown", "mmark":
return "markdown"
case "css", "scss":
return "css"
case "html":
return "htmlmixed"
case "asciidoc", "adoc", "ad":
return "asciidoc"
case "rst":
return "rst"
case "html", "htm":
return "html"
case "js":
return "javascript"
default: