Skip to content

Commit

Permalink
Add github repo name debug message
Browse files Browse the repository at this point in the history
  • Loading branch information
luost26 committed Oct 20, 2024
1 parent 623ad1b commit 8b8c6d3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions _includes/widgets/url_debug_message.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ <h5><i class="fas fa-exclamation-triangle"></i> Action required</h5>
</div>
</div>

<div id="ghpages-domain-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> Warning</h5>
<strong>Problem:</strong>
The name of your GitHub Pages repository ("<code class="repo-name-text"></code>") does not match your GitHub username.
<br>
<strong>Solution:</strong> Please consider renaming the repository to "<code class="domain-name-text"></code>".
</div>
</div>
</div>

<script>
striped_pathname = location.pathname.replace(/\/+$/, "");
if(striped_pathname != "{{ site.baseurl }}"){
Expand All @@ -21,4 +33,15 @@ <h5><i class="fas fa-exclamation-triangle"></i> Action required</h5>
document.querySelectorAll(".root-path-text").forEach(function(element){
element.textContent = striped_pathname;
});
document.querySelectorAll(".repo-name-text").forEach(function(element){
element.textContent = striped_pathname.replace("/", "");
});
document.querySelectorAll(".domain-name-text").forEach(function(element){
element.textContent = location.hostname;
});

if (striped_pathname.search("github.io") != -1){
document.getElementById("ghpages-domain-debug-message").classList.remove('d-none');
}

</script>

0 comments on commit 8b8c6d3

Please sign in to comment.