Skip to content

Commit 6e85050

Browse files
committed
Merge branch 'dev'
2 parents b3dfee9 + 8ff79b3 commit 6e85050

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

WebApp/js/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class Index {
9292
renderBlogs() {
9393
let blogList = document.getElementById('blogList');
9494
if (blogList) {
95+
const pathName = window.location.pathname;
9596
blogList.innerHTML = '';
9697
this.blogs.forEach(blog => {
9798
let blogDiv = document.createElement('div');
@@ -101,7 +102,7 @@ class Index {
101102
let blogTitleDiv = document.createElement('div');
102103
blogTitleDiv.className = 'font-bold text-xl mb-2';
103104
let blogLink = document.createElement('a');
104-
blogLink.href = './blogs' + blog.Path;
105+
blogLink.href = pathName + 'blogs' + blog.Path;
105106
blogLink.target = '_blank';
106107
blogLink.className = 'block text-lg py-2 text-neutral-600 hover:text-neutral-800 dark:text-neutral-300 dark:hover:text-neutral-100';
107108
blogLink.innerText = "📑 " + blog.Title;

WebApp/ts/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Index {
2626
document.addEventListener('DOMContentLoaded', () => this.init());
2727
}
2828

29-
init(){
29+
init() {
3030
this.getData();
3131
this.addEvent();
3232
}
@@ -119,8 +119,8 @@ class Index {
119119

120120
renderBlogs(): void {
121121
let blogList = document.getElementById('blogList');
122-
123122
if (blogList) {
123+
const pathName = window.location.pathname;
124124
blogList.innerHTML = '';
125125
this.blogs.forEach(blog => {
126126
let blogDiv = document.createElement('div');
@@ -130,7 +130,7 @@ class Index {
130130
let blogTitleDiv = document.createElement('div');
131131
blogTitleDiv.className = 'font-bold text-xl mb-2';
132132
let blogLink = document.createElement('a');
133-
blogLink.href = './blogs' + blog.Path;
133+
blogLink.href = pathName + 'blogs' + blog.Path;
134134
blogLink.target = '_blank';
135135
blogLink.className = 'block text-lg py-2 text-neutral-600 hover:text-neutral-800 dark:text-neutral-300 dark:hover:text-neutral-100';
136136
blogLink.innerText = "📑 " + blog.Title;

0 commit comments

Comments
 (0)