Skip to content

Commit

Permalink
Add filter replace_title to adjust entry titles
Browse files Browse the repository at this point in the history
  • Loading branch information
Magnus Åhall committed Sep 3, 2023
1 parent ff5d391 commit 7fa9a4d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/reader/rewrite/rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ func applyRule(entryURL string, entry *model.Entry, rule rule) {
} else {
logger.Debug("[Rewrite] Cannot find search and replace terms for replace rule %s", rule)
}
case "replace_title":
// Format: replace("search-term"|"replace-term")
if len(rule.args) >= 2 {
entry.Title = replaceCustom(entry.Title, rule.args[0], rule.args[1])
} else {
logger.Debug("[Rewrite] Cannot find search and replace terms for replace rule %s", rule)
}
case "remove":
// Format: remove("#selector > .element, .another")
if len(rule.args) >= 1 {
Expand Down

0 comments on commit 7fa9a4d

Please sign in to comment.