Skip to content

Commit 5534494

Browse files
committed
vimhelp: Use './' instead of index.html in hybrid web mode
Also update sitemap generation script to do the same. This makes sure we will never have any public links that can link to index.html which we don't want to be visible.
1 parent f6b88fc commit 5534494

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

scripts/generate_sitemap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e -o pipefail
77
# We also exclude the redirect.html since it's not really useful to crawl.
88
echo "https://macvim.org/docs/"
99
for f in *.html; do
10-
if [[ "$f" != "redirect.html" ]]; then
10+
if [[ "$f" != "redirect.html" && "$f" != "index.html" ]]; then
1111
echo "https://macvim.org/docs/$f"
1212
fi
1313
done

vimhelp/vimhelp/vimh2h.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ def add_tags(self, filename, contents):
186186

187187
def do_add_tag(self, filename, tag):
188188
if filename == "help.txt":
189-
if self._mode == "online":
190-
htmlfilename = "/"
189+
if self._mode != "offline":
190+
htmlfilename = "./"
191191
else:
192192
htmlfilename = "index.html"
193193
else:
@@ -247,7 +247,7 @@ def to_redirect_html(self):
247247

248248
filename = "redirect"
249249
static_dir = "/" if self._mode == "online" else ""
250-
helptxt = "./" if self._mode == "online" else "index.html"
250+
helptxt = "./" if self._mode != "offline" else "index.html"
251251
sidebar_headings = None
252252

253253
current_time = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%SZ")
@@ -379,7 +379,7 @@ def to_html(self, filename, contents):
379379
out.append(FAQ_LINE)
380380

381381
static_dir = "/" if self._mode == "online" else ""
382-
helptxt = "./" if self._mode == "online" else "index.html"
382+
helptxt = "./" if self._mode != "offline" else "index.html"
383383

384384
current_time = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%SZ")
385385

0 commit comments

Comments
 (0)