fix(preview.html): correct back to parent directory link
Updated the "Back to Parent Directory" link to handle file paths starting with a slash. This adjustment ensures the URL is properly constructed, preventing broken links and enhancing navigation usability in the preview view.
This commit is contained in:
parent
755719daec
commit
74e6a1310b
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<h1>{{ owner }}/{{ repo }} - <small>{{ file_path }}</small></h1>
|
<h1>{{ owner }}/{{ repo }} - <small>{{ file_path }}</small></h1>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<a href="/{{ owner }}/{{ repo }}/tree/main/{{ file_path.rsplit('/', 1)[0] }}">
|
<a href="/{{ owner }}/{{ repo }}/tree/main/{{ ("/" + file_path).rsplit('/', 1)[0].lstrip("/") }}">
|
||||||
<img class="icon" src="/assets/dist/icons/folder.svg" alt="Back to Parent Directory"> Back to Parent Directory
|
<img class="icon" src="/assets/dist/icons/folder.svg" alt="Back to Parent Directory"> Back to Parent Directory
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue