Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ rdi_current_version = "1.8.0"

# Everything below this are Site Params

# Add markdown output
[outputFormats]
[outputFormats.markdown]
name = "markdown"
baseName = "index.html"
mediaType = "text/markdown"
isPlainText = true

# Comment out if you don't want the "print entire section" link enabled.
[outputs]
section = ["HTML", "RSS"] # print
section = ["HTML", "RSS", "Markdown"] # print
page = ["HTML", "Markdown"]
14 changes: 14 additions & 0 deletions layouts/_default/section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# {{ .Title }}
{{ $content := .RawContent }}

{{/* Fix relrefs */}}
{{ $content := $content | replaceRE "\\{\\{< ?relref \"([^\"]+)\" ?>\\}\\}" "https://redis.io/docs/latest$1" }}

{{/* Fix images */}}
{{ $content := $content | replaceRE "\\{\\{< ?image filename=\"([^\"]+)\" ?>\\}\\}" "![$1](https://redis.io/docs/latest$1)" }}

{{/* Remove all shortcodes */}}
{{ $content := $content | replaceRE "\\{\\{% ?/?.*%\\}\\}" "" }}
{{ $content := $content | replaceRE "\\{\\{< ?/?.*>\\}\\}" "" }}

{{ $content }}
14 changes: 14 additions & 0 deletions layouts/_default/single.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# {{ .Title }}
{{ $content := .RawContent }}

{{/* Fix relrefs */}}
{{ $content := $content | replaceRE "\\{\\{< ?relref \"([^\"]+)\" ?>\\}\\}" "https://redis.io/docs/latest$1" }}

{{/* Fix images */}}
{{ $content := $content | replaceRE "\\{\\{< ?image filename=\"([^\"]+)\" ?>\\}\\}" "![$1](https://redis.io/docs/latest$1)" }}

{{/* Remove all shortcodes */}}
{{ $content := $content | replaceRE "\\{\\{% ?/?.*%\\}\\}" "" }}
{{ $content := $content | replaceRE "\\{\\{< ?/?.*>\\}\\}" "" }}

{{ $content }}