generated from irfansofyana/til-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
076ea5d
commit 4c90847
Showing
4 changed files
with
11 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ <h2>Search Features</h2> | |
</ul> | ||
</div> | ||
|
||
<link rel="stylesheet" href="{{ site.baseurl }}/assets/css/search.css"> | ||
<link rel="stylesheet" href="{{ '/assets/css/search.css' | relative_url }}"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script> | ||
|
||
<div class="search-container"> | ||
|
@@ -26,6 +26,9 @@ <h2>Search Features</h2> | |
</div> | ||
|
||
<script> | ||
// Pre-compute URLs | ||
const tagsBaseUrl = "{{ '/tags' | relative_url }}"; | ||
|
||
// Initialize search data | ||
const searchStore = { | ||
{% for post in site.til %} | ||
|
@@ -148,7 +151,7 @@ <h2><a href="${item.url}">${title}</a></h2> | |
${tags.length ? ` | ||
<div class="tags"> | ||
${tags.map(tag => ` | ||
<a href="{{ site.baseurl }}/tags#${tag.toLowerCase()}" | ||
<a href="${tagsBaseUrl}#${tag.toLowerCase()}" | ||
class="tag">${tag}</a> | ||
`).join('')} | ||
</div> | ||
|