-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add URL debug message shown when
baseurl
is not configured correctly
- Loading branch information
Showing
3 changed files
with
26 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<div id="url-debug-message" class="row mt-3 d-none"> | ||
<div class="col"> | ||
<div class="alert alert-warning my-0" role="alert"> | ||
<h5><i class="fas fa-exclamation-triangle"></i> Action required</h5> | ||
<strong>Problem:</strong> | ||
The current root path of this site is <code class="root-path-text"></code>, | ||
which does not match the <code>baseurl</code> (<code>{{ site.baseurl }}</code>) configured in <code>_config.yml</code>. | ||
<br> | ||
|
||
<strong>Solution:</strong> | ||
Please set the <code>baseurl</code> in <code>_config.yml</code> to "<code class="root-path-text"></code>". | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
if(location.pathname != "{{ site.baseurl }}"){ | ||
document.getElementById("url-debug-message").classList.remove('d-none'); | ||
} | ||
document.querySelectorAll(".root-path-text").forEach(function(element){ | ||
element.textContent = location.pathname; | ||
}); | ||
</script> |
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