From b7acf1be64b6845a0b826a1af4c0db62e70e9aba Mon Sep 17 00:00:00 2001 From: tdro Date: Wed, 21 Dec 2022 19:20:43 -0500 Subject: themes/default/layouts/partials/function-strip-filechars: Use replace here function-strip-urlchars -> function-strip-filechars --- .../layouts/partials/function-generate-feeds.html | 2 +- .../layouts/partials/function-strip-filechars.html | 28 ++++++++++++++++++++ .../layouts/partials/function-strip-urlchars.html | 30 ---------------------- 3 files changed, 29 insertions(+), 31 deletions(-) create mode 100644 themes/default/layouts/partials/function-strip-filechars.html delete mode 100644 themes/default/layouts/partials/function-strip-urlchars.html 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 -}} -- cgit v1.2.3