From 162142b3ddbdb9c8aa77fbf07b69acbb2fd935a2 Mon Sep 17 00:00:00 2001 From: Justin Forest Date: Mon, 5 Aug 2024 17:12:11 +0400 Subject: [PATCH] Fix injecting backlinks --- bin/update-backlinks | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/update-backlinks b/bin/update-backlinks index f405694..6d92f9b 100755 --- a/bin/update-backlinks +++ b/bin/update-backlinks @@ -137,6 +137,12 @@ def test_has_placeholder(): def inject_backlinks(lines, parts): + try: + index = lines.index("__BACKLINKS__") + lines[index] = "__BACKLINKS__\n" + except ValueError: + pass + try: index = lines.index("__BACKLINKS__\n") lines[index] = "".join(parts)