Skip to content

Commit

Permalink
Ignore adding deeplinks on certain pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Doughty committed Sep 10, 2024
1 parent 7aa3885 commit a62c709
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
6 changes: 1 addition & 5 deletions css/site.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion js/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ function buildFlyoutMenuHTML() {
EnableFlyout.init();
}

function includesUrl(string) {
if (location.href.includes(string)) {
return true;
}
return false;
}

function initEnable() {
offscreenObserver.init(document.querySelector('[role="banner"]'));

Expand All @@ -86,7 +93,11 @@ function initEnable() {
// applied to the heading.
let headingIndex = 0;

if (location.href.indexOf('index.php') === -1) {
const indexPage = includesUrl('index.php')
const componentsPage = includesUrl('components.php');
const codePatternsPage = includesUrl('code-patterns.php');

if (!indexPage && !componentsPage && !codePatternsPage) {
document
.querySelectorAll('h1, h2, h3, h4, h5, h6, [role="heading"]')
.forEach((el) => {
Expand Down
15 changes: 5 additions & 10 deletions less/site.less
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,11 @@ main {

h5 {
display: block;
padding: 20px;

a {
color: #000;
font-weight: bold;
font-size: (24 / @px);
padding: 20px;
margin: auto;
display: inline-block;
}
color: #000;
font-weight: bold;
font-size: (24 / @px);
padding: 40px 20px;
margin: auto;
}

.icon {
Expand Down
2 changes: 1 addition & 1 deletion templates/data/meta-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"alert.php": {
"title": "ARIA Alert",
"desc": "How to let screen reader users know when new information appears on the page using the ARIA alert role or the HTML5 output tag"
"desc": "How to let screen reader users know when new information appears on the page using the ARIA alert role or the HTML5 output tag."
},
"animated-gif-with-pause-button.php": {
"title": "Animated GIFs with Pause Buttons",
Expand Down

0 comments on commit a62c709

Please sign in to comment.