Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
niltor committed May 29, 2024
2 parents b3dfee9 + 8ff79b3 commit 6e85050
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion WebApp/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class Index {
renderBlogs() {
let blogList = document.getElementById('blogList');
if (blogList) {
const pathName = window.location.pathname;
blogList.innerHTML = '';
this.blogs.forEach(blog => {
let blogDiv = document.createElement('div');
Expand All @@ -101,7 +102,7 @@ class Index {
let blogTitleDiv = document.createElement('div');
blogTitleDiv.className = 'font-bold text-xl mb-2';
let blogLink = document.createElement('a');
blogLink.href = './blogs' + blog.Path;
blogLink.href = pathName + 'blogs' + blog.Path;
blogLink.target = '_blank';
blogLink.className = 'block text-lg py-2 text-neutral-600 hover:text-neutral-800 dark:text-neutral-300 dark:hover:text-neutral-100';
blogLink.innerText = "📑 " + blog.Title;
Expand Down
6 changes: 3 additions & 3 deletions WebApp/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Index {
document.addEventListener('DOMContentLoaded', () => this.init());
}

init(){
init() {
this.getData();
this.addEvent();
}
Expand Down Expand Up @@ -119,8 +119,8 @@ class Index {

renderBlogs(): void {
let blogList = document.getElementById('blogList');

if (blogList) {
const pathName = window.location.pathname;
blogList.innerHTML = '';
this.blogs.forEach(blog => {
let blogDiv = document.createElement('div');
Expand All @@ -130,7 +130,7 @@ class Index {
let blogTitleDiv = document.createElement('div');
blogTitleDiv.className = 'font-bold text-xl mb-2';
let blogLink = document.createElement('a');
blogLink.href = './blogs' + blog.Path;
blogLink.href = pathName + 'blogs' + blog.Path;
blogLink.target = '_blank';
blogLink.className = 'block text-lg py-2 text-neutral-600 hover:text-neutral-800 dark:text-neutral-300 dark:hover:text-neutral-100';
blogLink.innerText = "📑 " + blog.Title;
Expand Down

0 comments on commit 6e85050

Please sign in to comment.