Skip to content

Commit

Permalink
.sh og templates update
Browse files Browse the repository at this point in the history
  • Loading branch information
abjarna committed Jul 28, 2024
1 parent 3828ca6 commit 42d6b54
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 6 deletions.
4 changes: 2 additions & 2 deletions rit/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<title>{{ cleaned_title|striptags|e }}{{ titlesuffix }}</title>

{# >>>>> Google Tag Manager #}
<script>!function(){"use strict";function l(e){for(var t=e,r=0,n=document.cookie.split(";");r<n.length;r++){var o=n[r].split("=");if(o[0].trim()===t)return o[1]}}function s(e){return localStorage.getItem(e)}function u(e){return window[e]}function d(e,t){e=document.querySelector(e);return t?null==e?void 0:e.getAttribute(t):null==e?void 0:e.textContent}var e=window,t=document,r="script",n="dataLayer",o="KQNTKH24",a="https://sst.rubik.is",i="",c="augyhclc",E="stapeUserId",I="",v="",g=!1;try{var g=!!E&&(m=navigator.userAgent,!!(m=new RegExp("Version/([0-9._]+)(.*Mobile)?.*Safari.*").exec(m)))&&16.4<=parseFloat(m[1]),A="stapeUserId"===E,f=g&&!A?function(e,t,r){void 0===t&&(t="");var n={cookie:l,localStorage:s,jsVariable:u,cssSelector:d},t=Array.isArray(t)?t:[t];if(e&&n[e])for(var o=n[e],a=0,i=t;a<i.length;a++){var c=i[a],c=r?o(c,r):o(c);if(c)return c}else console.warn("invalid uid source",e)}(E,I,v):void 0;g=g&&(!!f||A)}catch(e){console.error(e)}var m=e,E=(m[n]=m[n]||[],m[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"}),t.getElementsByTagName(r)[0]),I="dataLayer"===n?"":"&l="+n,v=f?"&bi="+encodeURIComponent(f):"",A=t.createElement(r),e=g?"kp"+c:c,n=!g&&i?i:a;A.async=!0,A.src=n+"/"+e+".js?st="+o+I+v+"",null!=(f=E.parentNode)&&f.insertBefore(A,E)}();</script>
<script>!function(){"use strict";function l(e){for(var t=e,r=0,n=document.cookie.split(";");r<n.length;r++){var o=n[r].split("=");if(o[0].trim()===t)return o[1]}}function s(e){return localStorage.getItem(e)}function u(e){return window[e]}function d(e,t){e=document.querySelector(e);return t?null==e?void 0:e.getAttribute(t):null==e?void 0:e.textContent}var e=window,t=document,r="script",n="dataLayer",o="PL8JH23F",a="https://sst.rubik.is",i="",c="augyhclc",E="stapeUserId",I="",v="",g=!1;try{var g=!!E&&(m=navigator.userAgent,!!(m=new RegExp("Version/([0-9._]+)(.*Mobile)?.*Safari.*").exec(m)))&&16.4<=parseFloat(m[1]),A="stapeUserId"===E,f=g&&!A?function(e,t,r){void 0===t&&(t="");var n={cookie:l,localStorage:s,jsVariable:u,cssSelector:d},t=Array.isArray(t)?t:[t];if(e&&n[e])for(var o=n[e],a=0,i=t;a<i.length;a++){var c=i[a],c=r?o(c,r):o(c);if(c)return c}else console.warn("invalid uid source",e)}(E,I,v):void 0;g=g&&(!!f||A)}catch(e){console.error(e)}var m=e,E=(m[n]=m[n]||[],m[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"}),t.getElementsByTagName(r)[0]),I="dataLayer"===n?"":"&l="+n,v=f?"&bi="+encodeURIComponent(f):"",A=t.createElement(r),e=g?"kp"+c:c,n=!g&&i?i:a;A.async=!0,A.src=n+"/"+e+".js?st="+o+I+v+"",null!=(f=E.parentNode)&&f.insertBefore(A,E)}();</script>
{# >>>>> End Google Tag Manager #}

{% endblock %}
Expand All @@ -36,7 +36,7 @@
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="{{ default_mode }}">

{# >>>>> Google Tag Manager (noscript) #}
<noscript><iframe src="https://sst.rubik.is/ns.html?id=GTM-KQNTKH24" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<noscript><iframe src="https://sst.rubik.is/ns.html?id=GTM-PL8JH23F" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
{# >>>>> End Google Tag Manager (noscript) #}

<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">{{ _("Skip to main content") }}</a></div>
Expand Down
2 changes: 1 addition & 1 deletion rit/_templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<title>{{ _("Search") }} &ndash; Ritsafn RÚBIK Reykjavíkur</title>

{# >>>>> Google Tag Manager #}
<script>!function(){"use strict";function l(e){for(var t=e,r=0,n=document.cookie.split(";");r<n.length;r++){var o=n[r].split("=");if(o[0].trim()===t)return o[1]}}function s(e){return localStorage.getItem(e)}function u(e){return window[e]}function d(e,t){e=document.querySelector(e);return t?null==e?void 0:e.getAttribute(t):null==e?void 0:e.textContent}var e=window,t=document,r="script",n="dataLayer",o="KQNTKH24",a="https://sst.rubik.is",i="",c="augyhclc",E="stapeUserId",I="",v="",g=!1;try{var g=!!E&&(m=navigator.userAgent,!!(m=new RegExp("Version/([0-9._]+)(.*Mobile)?.*Safari.*").exec(m)))&&16.4<=parseFloat(m[1]),A="stapeUserId"===E,f=g&&!A?function(e,t,r){void 0===t&&(t="");var n={cookie:l,localStorage:s,jsVariable:u,cssSelector:d},t=Array.isArray(t)?t:[t];if(e&&n[e])for(var o=n[e],a=0,i=t;a<i.length;a++){var c=i[a],c=r?o(c,r):o(c);if(c)return c}else console.warn("invalid uid source",e)}(E,I,v):void 0;g=g&&(!!f||A)}catch(e){console.error(e)}var m=e,E=(m[n]=m[n]||[],m[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"}),t.getElementsByTagName(r)[0]),I="dataLayer"===n?"":"&l="+n,v=f?"&bi="+encodeURIComponent(f):"",A=t.createElement(r),e=g?"kp"+c:c,n=!g&&i?i:a;A.async=!0,A.src=n+"/"+e+".js?st="+o+I+v+"",null!=(f=E.parentNode)&&f.insertBefore(A,E)}();</script>
<script>!function(){"use strict";function l(e){for(var t=e,r=0,n=document.cookie.split(";");r<n.length;r++){var o=n[r].split("=");if(o[0].trim()===t)return o[1]}}function s(e){return localStorage.getItem(e)}function u(e){return window[e]}function d(e,t){e=document.querySelector(e);return t?null==e?void 0:e.getAttribute(t):null==e?void 0:e.textContent}var e=window,t=document,r="script",n="dataLayer",o="PL8JH23F",a="https://sst.rubik.is",i="",c="augyhclc",E="stapeUserId",I="",v="",g=!1;try{var g=!!E&&(m=navigator.userAgent,!!(m=new RegExp("Version/([0-9._]+)(.*Mobile)?.*Safari.*").exec(m)))&&16.4<=parseFloat(m[1]),A="stapeUserId"===E,f=g&&!A?function(e,t,r){void 0===t&&(t="");var n={cookie:l,localStorage:s,jsVariable:u,cssSelector:d},t=Array.isArray(t)?t:[t];if(e&&n[e])for(var o=n[e],a=0,i=t;a<i.length;a++){var c=i[a],c=r?o(c,r):o(c);if(c)return c}else console.warn("invalid uid source",e)}(E,I,v):void 0;g=g&&(!!f||A)}catch(e){console.error(e)}var m=e,E=(m[n]=m[n]||[],m[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"}),t.getElementsByTagName(r)[0]),I="dataLayer"===n?"":"&l="+n,v=f?"&bi="+encodeURIComponent(f):"",A=t.createElement(r),e=g?"kp"+c:c,n=!g&&i?i:a;A.async=!0,A.src=n+"/"+e+".js?st="+o+I+v+"",null!=(f=E.parentNode)&&f.insertBefore(A,E)}();</script>
{# >>>>> End Google Tag Manager #}

{%- endblock htmltitle -%}
6 changes: 5 additions & 1 deletion sh/build-dev-dirhtml-latexpdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ find _build/html/ -name '*.html' -exec sed -i '' -e 's/<head>/<head>\n<meta name
find _build/html/ -name '*.html' -exec sed -i '' -e 's|href="https://rit.rubik.is/|href="https://rit-dev.rubik.is/|g' {} +

# Breyta Google Tag Manager kóða fyrir DEV (úr "GTM-PL8JH23F" í "GTM-MLN5L94K")
find _build/html/ -name '*.html' -exec sed -i '' -e 's|GTM-PL8JH23F|GTM-MLN5L94K|g' {} +
find _build/html/ -name '*.html' -exec sed -i '' -e 's|PL8JH23F|MLN5L94K|g' {} +

# Hafa bara eitt <meta name="viewport"...> tag í öllum HTML skrám
find _build/html/ -name '*.html' -exec sed -i '' '/<meta name="viewport"/d' {} +
find _build/html/ -name '*.html' -exec sed -i '' -e 's|<meta charset="utf-8" />|<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />|' {} +

# Breyta <title> á forsíðu, með því að fjarlægja "* &ndash; " (sem er skilgreint í "_templates/layout.html")
sed -i '' -e 's#<title>.* &ndash; Ritsafn RÚBIK Reykjavíkur</title>#<title>Ritsafn RÚBIK Reykjavíkur</title>#' _build/html/index.html
Expand Down
6 changes: 5 additions & 1 deletion sh/build-dev-html-latexpdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ find _build/html/ -name '*.html' -exec sed -i '' -e 's/<head>/<head>\n<meta name
find _build/html/ -name '*.html' -exec sed -i '' -e 's|href="https://rit.rubik.is/|href="https://rit-dev.rubik.is/|g' {} +

# Breyta Google Tag Manager kóða fyrir DEV (úr "GTM-PL8JH23F" í "GTM-MLN5L94K")
find _build/html/ -name '*.html' -exec sed -i '' -e 's|GTM-PL8JH23F|GTM-MLN5L94K|g' {} +
find _build/html/ -name '*.html' -exec sed -i '' -e 's|PL8JH23F|MLN5L94K|g' {} +

# Hafa bara eitt <meta name="viewport"...> tag í öllum HTML skrám
find _build/html/ -name '*.html' -exec sed -i '' '/<meta name="viewport"/d' {} +
find _build/html/ -name '*.html' -exec sed -i '' -e 's|<meta charset="utf-8" />|<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />|' {} +

# Breyta <title> á forsíðu, með því að fjarlægja "* &ndash; " (sem er skilgreint í "_templates/layout.html")
sed -i '' -e 's#<title>.* &ndash; Ritsafn RÚBIK Reykjavíkur</title>#<title>Ritsafn RÚBIK Reykjavíkur</title>#' _build/html/index.html
Expand Down
6 changes: 5 additions & 1 deletion sh/build-dev-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ find _build/html/ -name '*.html' -exec sed -i '' -e 's/<head>/<head>\n<meta name
find _build/html/ -name '*.html' -exec sed -i '' -e 's|href="https://rit.rubik.is/|href="https://rit-dev.rubik.is/|g' {} +

# Breyta Google Tag Manager kóða fyrir DEV (úr "GTM-PL8JH23F" í "GTM-MLN5L94K")
find _build/html/ -name '*.html' -exec sed -i '' -e 's|GTM-PL8JH23F|GTM-MLN5L94K|g' {} +
find _build/html/ -name '*.html' -exec sed -i '' -e 's|PL8JH23F|MLN5L94K|g' {} +

# Hafa bara eitt <meta name="viewport"...> tag í öllum HTML skrám
find _build/html/ -name '*.html' -exec sed -i '' '/<meta name="viewport"/d' {} +
find _build/html/ -name '*.html' -exec sed -i '' -e 's|<meta charset="utf-8" />|<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />|' {} +

# Breyta <title> á forsíðu, með því að fjarlægja "* &ndash; " (sem er skilgreint í "_templates/layout.html")
sed -i '' -e 's#<title>.* &ndash; Ritsafn RÚBIK Reykjavíkur</title>#<title>Ritsafn RÚBIK Reykjavíkur</title>#' _build/html/index.html
Expand Down
4 changes: 4 additions & 0 deletions sh/build-main-dirhtml-latexpdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ cd rit
make clean
sphinx-build -b dirhtml . _build/html

# Hafa bara eitt <meta name="viewport"...> tag í öllum HTML skrám
find _build/html/ -name '*.html' -exec sed -i '' '/<meta name="viewport"/d' {} +
find _build/html/ -name '*.html' -exec sed -i '' -e 's|<meta charset="utf-8" />|<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />|' {} +

# Breyta <title> á forsíðu, með því að fjarlægja "* &ndash; " (sem er skilgreint í "_templates/layout.html")
sed -i '' -e 's#<title>.* &ndash; Ritsafn RÚBIK Reykjavíkur</title>#<title>Ritsafn RÚBIK Reykjavíkur</title>#' _build/html/index.html

Expand Down
4 changes: 4 additions & 0 deletions sh/build-main-html-latexpdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ cd rit
make clean
sphinx-build -b html . _build/html

# Hafa bara eitt <meta name="viewport"...> tag í öllum HTML skrám
find _build/html/ -name '*.html' -exec sed -i '' '/<meta name="viewport"/d' {} +
find _build/html/ -name '*.html' -exec sed -i '' -e 's|<meta charset="utf-8" />|<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />|' {} +

# Breyta <title> á forsíðu, með því að fjarlægja "* &ndash; " (sem er skilgreint í "_templates/layout.html")
sed -i '' -e 's#<title>.* &ndash; Ritsafn RÚBIK Reykjavíkur</title>#<title>Ritsafn RÚBIK Reykjavíkur</title>#' _build/html/index.html

Expand Down
4 changes: 4 additions & 0 deletions sh/build-main-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ cd rit
make clean
sphinx-build -b html . _build/html

# Hafa bara eitt <meta name="viewport"...> tag í öllum HTML skrám
find _build/html/ -name '*.html' -exec sed -i '' '/<meta name="viewport"/d' {} +
find _build/html/ -name '*.html' -exec sed -i '' -e 's|<meta charset="utf-8" />|<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />|' {} +

# Breyta <title> á forsíðu, með því að fjarlægja "* &ndash; " (sem er skilgreint í "_templates/layout.html")
sed -i '' -e 's#<title>.* &ndash; Ritsafn RÚBIK Reykjavíkur</title>#<title>Ritsafn RÚBIK Reykjavíkur</title>#' _build/html/index.html

Expand Down

0 comments on commit 42d6b54

Please sign in to comment.