Skip to content

Commit 5f8e211

Browse files
committed
Fix images links and remove all other shortcode usage
1 parent 9f1cdb2 commit 5f8e211

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

layouts/_default/section.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# {{ .Title }}
22
{{ $content := .RawContent }}
3+
4+
{{/* Fix relrefs */}}
35
{{ $content := $content | replaceRE "\\{\\{< ?relref \"([^\"]+)\" ?>\\}\\}" "https://redis.io/docs/latest$1" }}
6+
7+
{{/* Fix images */}}
8+
{{ $content := $content | replaceRE "\\{\\{< ?image filename=\"([^\"]+)\" ?>\\}\\}" "![$1](https://redis.io/docs/latest$1)" }}
9+
10+
{{/* Remove all shortcodes */}}
11+
{{ $content := $content | replaceRE "\\{\\{% ?/?.*%\\}\\}" "" }}
12+
{{ $content := $content | replaceRE "\\{\\{< ?/?.*>\\}\\}" "" }}
13+
414
{{ $content }}

layouts/_default/single.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
# {{ .Title }}
22
{{ $content := .RawContent }}
3+
4+
{{/* Fix relrefs */}}
35
{{ $content := $content | replaceRE "\\{\\{< ?relref \"([^\"]+)\" ?>\\}\\}" "https://redis.io/docs/latest$1" }}
6+
7+
{{/* Fix images */}}
8+
{{ $content := $content | replaceRE "\\{\\{< ?image filename=\"([^\"]+)\" ?>\\}\\}" "![$1](https://redis.io/docs/latest$1)" }}
9+
10+
{{/* Remove all shortcodes */}}
11+
{{ $content := $content | replaceRE "\\{\\{% ?/?.*%\\}\\}" "" }}
12+
{{ $content := $content | replaceRE "\\{\\{< ?/?.*>\\}\\}" "" }}
13+
414
{{ $content }}

0 commit comments

Comments
 (0)