Skip to content
Snippets Groups Projects
Commit 29ab06a2 authored by Paweł Wieczorek's avatar Paweł Wieczorek
Browse files

Replace internal task numbers with tracker links

This patch uses replaceRE [0] Hugo function as suggested by the
community [1].

Task number has to be in parentheses in order to be replaced. Remember
to add tracker address in the "config.toml" file. Tracker address must
include its protocol, otherwise resulting links will be relative to the
Hugo site (e.g. "http://localhost:1313/tracker.address/T1234" instead of
"https://tracker.address/T1234").

[0] https://gohugo.io/functions/replaceRe
[1] https://discourse.gohugo.io/t/auto-replace-text-to-link/11945/7



Signed-off-by: default avatarPaweł Wieczorek <pawiecz@collabora.com>
parent f8302d40
No related branches found
No related tags found
2 merge requests!42Manage task numbers,!40Add initial roadmap proposal
Pipeline #54834 passed with stage
in 10 seconds
......@@ -23,6 +23,7 @@ pygmentCodeFences = true
comments = true
searchbox = true
# gcse = "012345678901234567890:abcdefghijk" # Get your code from google.com/cse. Make sure to go to "Look and Feel" and change Layout to "Full Width" and Theme to "Classic"
tracker = ""
#[[Params.bigimg]]
# src = "img/triangle.jpg"
......
......@@ -3,7 +3,7 @@
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<article role="main" class="blog-post">
{{ .Content }}
{{ .Content | replaceRE `(?P<task>T[[:digit:]]+)` (print `<a href="` .Site.Params.tracker `/$task">$task</a>`) | safeHTML }}
</article>
<ul class="pager blog-pager">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment