Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added heading anchors and updated responsiveness
- Loading branch information
1 parent
dabaa3d
commit a1f8e7b
Showing
6 changed files
with
74 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
// # MODIFICATIONS FOR ALL PAGES # | ||
(function () { | ||
|
||
// append index.html to local links, if the website is being viewed on a local file system | ||
// # LINK MODIFICATIONS # | ||
if (window.location.protocol == 'file:') { | ||
// append index.html to links if this project is hosted on the local file system | ||
// it makes browsing easier offline, since otherwise links will just open the directory and not the file | ||
for (var a = document.querySelectorAll('a[href$="/"]'), i = 0, j = a.length; i < j; i++) { | ||
if (!/http/.test(a[i].href)) { | ||
a[i].href += 'index.html'; | ||
} | ||
} | ||
} | ||
|
||
|
||
// # SECTION ANCHORS # | ||
// adds an anchor link to headings | ||
for (var h = document.getElementById('content').querySelectorAll('h1, h2, h3, h4, h5, h6'), i = 0, j = h.length; i < j; i++) { | ||
if (h[i].id) { | ||
h[i].insertAdjacentHTML('afterbegin', '<a href="#' + h[i].id + '" class="anchor"><span class="anchor-icon"></span></a>'); | ||
} | ||
} | ||
|
||
}()); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.