diff options
author | tdro <tdro@noreply.example.com> | 2022-12-21 19:20:43 -0500 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-12-21 19:20:43 -0500 |
commit | b7acf1be64b6845a0b826a1af4c0db62e70e9aba (patch) | |
tree | 27c47c722f035ebdf210dabdda025467d7431ec1 | |
parent | 1ee7be4fb6e73ced1a314712e870759e8ff7eff5 (diff) | |
download | canory-b7acf1be64b6845a0b826a1af4c0db62e70e9aba.tar.gz canory-b7acf1be64b6845a0b826a1af4c0db62e70e9aba.tar.bz2 canory-b7acf1be64b6845a0b826a1af4c0db62e70e9aba.zip |
themes/default/layouts/partials/function-strip-filechars: Use replace here
function-strip-urlchars -> function-strip-filechars
3 files changed, 29 insertions, 31 deletions
diff --git a/themes/default/layouts/partials/function-generate-feeds.html b/themes/default/layouts/partials/function-generate-feeds.html index 9c5045a..d97d647 100644 --- a/themes/default/layouts/partials/function-generate-feeds.html +++ b/themes/default/layouts/partials/function-generate-feeds.html @@ -205,7 +205,7 @@ {{- $alias := truncate 255 "" (delimit (first 8 (split (.FeedTitle | urlize) "-")) "-" | humanize | urlize) -}} {{- $hash := .FeedLink | sha256 | truncate 8 "" -}} {{- $file := print $alias "-" $hash -}} - {{- $file = partial "function-strip-urlchars.html" $file -}} + {{- $file = partial "function-strip-filechars.html" $file -}} {{- $path := print "/data/generates/content/" $author.user "/feeds/" $file ".md" -}} {{- $content := .FeedContentShort -}} diff --git a/themes/default/layouts/partials/function-strip-filechars.html b/themes/default/layouts/partials/function-strip-filechars.html new file mode 100644 index 0000000..b68daa0 --- /dev/null +++ b/themes/default/layouts/partials/function-strip-filechars.html @@ -0,0 +1,28 @@ +{{- $input := . -}} +{{- $output := $input -}} + +{{- $output = replace $output `{` "" -}} +{{- $output = replace $output `}` "" -}} +{{- $output = replace $output `|` "" -}} +{{- $output = replace $output `\` "" -}} +{{- $output = replace $output `^` "" -}} +{{- $output = replace $output `[` "" -}} +{{- $output = replace $output `]` "" -}} +{{- $output = replace $output "`" "" -}} +{{- $output = replace $output `;` "" -}} +{{- $output = replace $output `/` "" -}} +{{- $output = replace $output `?` "" -}} +{{- $output = replace $output `:` "" -}} +{{- $output = replace $output `@` "" -}} +{{- $output = replace $output `&` "" -}} +{{- $output = replace $output `=` "" -}} +{{- $output = replace $output `+` "" -}} +{{- $output = replace $output `$` "" -}} +{{- $output = replace $output `,` "" -}} +{{- $output = replace $output `<` "" -}} +{{- $output = replace $output `>` "" -}} +{{- $output = replace $output `#` "" -}} +{{- $output = replace $output `%` "" -}} +{{- $output = replace $output `\` "" -}} + +{{- return $output -}} diff --git a/themes/default/layouts/partials/function-strip-urlchars.html b/themes/default/layouts/partials/function-strip-urlchars.html deleted file mode 100644 index bc88d38..0000000 --- a/themes/default/layouts/partials/function-strip-urlchars.html +++ /dev/null @@ -1,30 +0,0 @@ -{{- $input := . -}} - -{{- - $output := $input | - replaceRE "{" "" | - replaceRE "}" "" | - replaceRE "|" "" | - replaceRE "\\\\" "" | - replaceRE "^" "" | - replaceRE "\\[" "" | - replaceRE "\\]" "" | - replaceRE "`" "" | - replaceRE ";" "" | - replaceRE "/" "" | - replaceRE "\\?" "" | - replaceRE ":" "" | - replaceRE "@" "" | - replaceRE "&" "" | - replaceRE "=" "" | - replaceRE "\\+" "" | - replaceRE "$" "" | - replaceRE "," "" | - replaceRE "<" "" | - replaceRE ">" "" | - replaceRE "#" "" | - replaceRE "%" "" | - replaceRE "\"" "" --}} - -{{- return $output -}} |