File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44*/
55import { v4 as uuidv4 } from "uuid" ;
66
7+ // The cookie banner markup comes from the @canonical /cookie-policy package,
8+ // so it can't be tagged in our templates. Watch for it being inserted (and
9+ // re-inserted, since it's recreated each time it's opened) and mark it
10+ // nosnippet so it isn't pulled into search/AI page summaries.
11+ function watchCookieBanner ( ) {
12+ new MutationObserver ( ( mutations ) => {
13+ for ( const mutation of mutations ) {
14+ for ( const node of mutation . addedNodes ) {
15+ if ( node . nodeType === 1 && node . matches ( ".cookie-policy" ) ) {
16+ node . setAttribute ( "data-nosnippet" , "" ) ;
17+ }
18+ }
19+ }
20+ } ) . observe ( document . body , { childList : true } ) ;
21+ }
22+
23+ if ( document . body ) {
24+ watchCookieBanner ( ) ;
25+ } else {
26+ document . addEventListener ( "DOMContentLoaded" , watchCookieBanner ) ;
27+ }
28+
729const getCookie = ( targetCookie ) =>
830 document . cookie . match ( new RegExp ( "(^| )" + targetCookie + "=([^;]+)" ) ) ;
931let cookieAcceptanceValue = getCookie ( "_cookies_accepted" ) ;
Original file line number Diff line number Diff line change 11< div class ="p-strip is-dark l-footer--sticky ">
2- < footer class ="row ">
2+ < footer class ="row " data-nosnippet >
33 < div class ="col-3 ">
44 < p >
55 Copyright © {{ now("%Y") }}
Original file line number Diff line number Diff line change 11{% set page_bubble = get_current_page_bubble(request.path).page_bubble %}
22
33< header id ="navigation "
4+ data-nosnippet
45 class ="p-navigation{% if page_bubble %}--reduced{% else %}--sliding{% endif %} is-dark ">
56 < div class ="p-navigation__row--25-75 ">
67 < div class ="p-navigation__banner ">
Original file line number Diff line number Diff line change 11< div id ="secondary-navigation "
2- class ="p-navigation is-sticky is-secondary is-dark ">
2+ class ="p-navigation is-sticky is-secondary is-dark "
3+ data-nosnippet >
34 < div class ="p-navigation__row--25-75 ">
45 < div class ="p-navigation__banner ">
56 < div class ="p-navigation__tagged-logo ">
Original file line number Diff line number Diff line change 1- < footer class ="p-footer l-footer--sticky is-dark ">
1+ < footer class ="p-footer l-footer--sticky is-dark " data-nosnippet >
22 < div class ="row ">
33 < div class ="col-4 col-small-4 u-hide--large ">
44 < ul class ="p-inline-list-icons u-no-padding--left u-no-margin--left ">
You can’t perform that action at this time.
0 commit comments