Skip to content

Commit 6821055

Browse files
committed
Fix: Include repository name in permalink URLs
1 parent 539fd94 commit 6821055

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fetch_blogs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ def main() :
114114
title = remove_date_from_title(content_file.name[:-3])
115115
# Check if permalink exists in front matter, otherwise construct from filename
116116
if 'permalink' in first_lines and first_lines['permalink']:
117-
repo_url = f"https://xrdocs.io{first_lines['permalink']}"
117+
# Permalink is relative, prepend repo name
118+
repo_url = f"https://xrdocs.io/{repo_name}{first_lines['permalink']}"
118119
else:
119120
repo_url = f'https://xrdocs.io/{repo_name}/{directory[1:]}/{content_file.name[:-3]}/'
120121
description = first_lines.get('excerpt', '')

0 commit comments

Comments
 (0)