diff options
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | lib/generate.source.sh | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -103,7 +103,7 @@ It is up to you to set up a Gemini server for the Gemtext, a Webserver for the H ## Content filter -Once your capsule reaches a certain size it can become anoying to re-generate everything if you only want to modify one single Gemtext file. The following will add a filter to only generate the files matching a regular expression: +Once your capsule reaches a certain size it can become anoying to re-generate everything if you only want to preview one single content file. The following will add a filter to only generate the files matching a regular expression: ``` ./gemtexter --generate '.*hello.*' diff --git a/lib/generate.source.sh b/lib/generate.source.sh index b2dafbc..f72f84b 100644 --- a/lib/generate.source.sh +++ b/lib/generate.source.sh @@ -124,6 +124,11 @@ generate::fromgmi () { # Add content while read -r src; do + # User can specify a content filter + if test ! -z "$CONTENT_FILTER" && ! $GREP -q "$CONTENT_FILTER" <<< "$src"; then + continue + fi + num_gmi_files=$(( num_gmi_files + 1 )) log INFO "Generating output formats from $src" for format in "$@"; do |
