From a62c709cf78cbce8e043fcc88c331fa4d32215d0 Mon Sep 17 00:00:00 2001 From: Travis Doughty Date: Tue, 10 Sep 2024 14:45:46 -0400 Subject: [PATCH] Ignore adding deeplinks on certain pages --- css/site.css | 6 +----- js/global.js | 13 ++++++++++++- less/site.less | 15 +++++---------- templates/data/meta-info.json | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/css/site.css b/css/site.css index 3a6c0773..3f7c18b7 100644 --- a/css/site.css +++ b/css/site.css @@ -47,15 +47,11 @@ main { } .plp .plp-list .item-wrapper .icon-wrapper h5 { display: block; - padding: 20px; -} -.plp .plp-list .item-wrapper .icon-wrapper h5 a { color: #000; font-weight: bold; font-size: 1.5rem; - padding: 20px; + padding: 40px 20px; margin: auto; - display: inline-block; } .plp .plp-list .item-wrapper .icon-wrapper .icon { min-height: 100px; diff --git a/js/global.js b/js/global.js index 4df9335d..357e7f28 100644 --- a/js/global.js +++ b/js/global.js @@ -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"]')); @@ -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) => { diff --git a/less/site.less b/less/site.less index 1a83b1d0..7cef7a5f 100644 --- a/less/site.less +++ b/less/site.less @@ -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 { diff --git a/templates/data/meta-info.json b/templates/data/meta-info.json index a490b90c..7960e0db 100644 --- a/templates/data/meta-info.json +++ b/templates/data/meta-info.json @@ -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",