diff options
author | Bjørn Erik Pedersen <[email protected]> | 2022-05-27 15:19:02 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2022-05-30 11:32:55 +0200 |
commit | 322d19a81fedbf423a047bdf286499d2e25d14be (patch) | |
tree | 0bfff44177d7bd6fde36fa84c45597e6069b3c2a /media | |
parent | 7cb484e121da73b63aab231ba29bb644b5f7965e (diff) | |
download | hugo-322d19a81fedbf423a047bdf286499d2e25d14be.tar.gz hugo-322d19a81fedbf423a047bdf286499d2e25d14be.zip |
Add Markdown as an output format
The motivation behind this is not to make it easier to publish Markdown files, as that sounds unusual.
This is mainly meant for shortcodes that produces Markdown to be inlined.
You would do this by creating shortcodes with `*.md` suffix (e.g. `layouts/shortcodes/myshortcode.md`).
This output format is defined as plain text, and will use Go's much more lenient text template parser.
Updates #9821
Diffstat (limited to 'media')
-rw-r--r-- | media/mediaType.go | 4 | ||||
-rw-r--r-- | media/mediaType_test.go | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/media/mediaType.go b/media/mediaType.go index 69bb9182a..3ac3123ac 100644 --- a/media/mediaType.go +++ b/media/mediaType.go @@ -257,7 +257,8 @@ var ( OpenTypeFontType = newMediaType("font", "otf", []string{"otf"}) // Common document types - PDFType = newMediaType("application", "pdf", []string{"pdf"}) + PDFType = newMediaType("application", "pdf", []string{"pdf"}) + MarkdownType = newMediaType("text", "markdown", []string{"md", "markdown"}) // Common video types AVIType = newMediaType("video", "x-msvideo", []string{"avi"}) @@ -278,6 +279,7 @@ var DefaultTypes = Types{ SCSSType, SASSType, HTMLType, + MarkdownType, JavascriptType, TypeScriptType, TSXType, diff --git a/media/mediaType_test.go b/media/mediaType_test.go index 34571f7ee..af7123cb5 100644 --- a/media/mediaType_test.go +++ b/media/mediaType_test.go @@ -63,7 +63,7 @@ func TestDefaultTypes(t *testing.T) { } - c.Assert(len(DefaultTypes), qt.Equals, 33) + c.Assert(len(DefaultTypes), qt.Equals, 34) } func TestGetByType(t *testing.T) { |