summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2025-02-19 21:53:27 +0100
committerYuval Adam <_@yuv.al>2025-02-19 22:02:43 +0100
commiteaad8c14b21fa79c943a57cfcbcc504c88573e6b (patch)
tree0896efb7c0b9cbb60d81536acbbb5cf571a3c9b0
parent94c14130d1db2e2267a06f2c8a44f558944f9541 (diff)
Render nofollow links for candidates
-rw-r--r--cli/build.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/build.py b/cli/build.py
index f8fef5d..01bc020 100644
--- a/cli/build.py
+++ b/cli/build.py
@@ -51,11 +51,13 @@ def build(verbose):
def render_link(value, classes):
name = unidecode(value.name).lower().split(" ")
domain = unidecode(value.domain).replace(".", "")
+ candidate = value.candidate
+ rel = ' rel="nofollow"' if candidate else ""
res = []
for part in name:
if part == domain:
url = value.url or "https://" + value.domain
- res.append(f'<a href="{url}" class="{classes}">{value.domain}</a>')
+ res.append(f'<a href="{url}" class="{classes}"{rel}>{value.domain}</a>')
else:
res.append(part)
return " ".join(res)