head.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. {{ $title := delimit (slice (cond (isset .Params "htmltitle") .Params.htmltitle
  2. .Page.Title) .Site.Title) " | " }} {{ $description := cond (isset .Params
  3. "description") .Params.description .Page.Description }}
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  5. <meta charset="utf-8" />
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  7. <meta name="description" content="{{ $description }}" />
  8. {{ if .Params.robots }}
  9. <meta name="robots" content="{{ .Params.robots }}">
  10. {{ end }}
  11. <title>{{ $title }}</title>
  12. <link rel="preconnect" href="https://fonts.googleapis.com" />
  13. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="true" />
  14. <link
  15. href="https://fonts.googleapis.com/css2?family=Fira+Code&family=Inter:wght@300;500;600&display=swap"
  16. rel="stylesheet"
  17. />
  18. <meta name="referrer" content="origin" />
  19. <meta name="HandheldFriendly" content="True" />
  20. <meta name="msapplication-TileColor" content="#7F4EFF" />
  21. <meta name="theme-color" content="#ffffff" />
  22. <meta property="og:locale" content="en_US" />
  23. <meta property="og:url" content="{{ .Permalink }}" />
  24. <meta property="og:type" content="article" />
  25. <meta property="og:title" content="{{ $title }}" />
  26. <meta
  27. property="og:image"
  28. content="https://user-images.githubusercontent.com/11527560/159138593-09223308-ce91-4582-a47a-a03166fef26b.gif"
  29. />
  30. <meta property="og:description" content="{{ $description }}" />
  31. <meta property="og:site_name" content="Materialize" />
  32. <meta name="twitter:card" content="summary_large_image" />
  33. <meta name="twitter:site" content="@MaterializeInc" />
  34. <meta name="twitter:creator" content="@MaterializeInc" />
  35. <meta name="twitter:title" content="{{ $title }}" />
  36. <meta
  37. name="twitter:image"
  38. content="https://user-images.githubusercontent.com/11527560/159138593-09223308-ce91-4582-a47a-a03166fef26b.gif"
  39. />
  40. <meta name="twitter:description" content="{{ $description }}" />
  41. <link
  42. rel="shortcut icon"
  43. type="image/x-icon"
  44. href="{{ .Site.BaseURL }}images/materialize_favicon_32.png"
  45. />
  46. <link
  47. rel="apple-touch-icon"
  48. sizes="180x180"
  49. href="{{ .Site.BaseURL }}images/materialize_logo_180.png"
  50. />
  51. <link
  52. rel="icon"
  53. type="image/png"
  54. sizes="32x32"
  55. href="{{ .Site.BaseURL }}images/materialize_favicon_32.png"
  56. />
  57. <link
  58. rel="mask-icon"
  59. href="{{ .Site.BaseURL }}images/materialize_logo.svg"
  60. color="#4d7cfe"
  61. />
  62. <link rel="canonical" href="{{ .Permalink }}" />
  63. {{/* Include all JavaScript files here */}}
  64. <script src="https://cmp.osano.com/Azz7yeT5NmUe93yp/01cb9c3f-e1eb-4e74-9255-1280e80cdc28/osano.js"></script>
  65. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  66. <script src="https://cdn.jsdelivr.net/npm/anchor-js/anchor.min.js"></script>
  67. <script src="https://cdn.jsdelivr.net/npm/simple-scrollspy@2.0.3/dist/simple-scrollspy.min.js"></script>
  68. <script src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>
  69. {{/* Sass processing here */}} {{ $style := resources.Get "sass/main.scss" |
  70. toCSS | fingerprint }}
  71. <link rel="stylesheet" href="{{ $style.RelPermalink }}" />
  72. {{/* Intercom */}}
  73. <script>
  74. const APP_ID = "r8661p0d";
  75. window.intercomSettings = {
  76. api_base: "https://api-iam.intercom.io",
  77. app_id: APP_ID
  78. };
  79. </script>
  80. <script>
  81. (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/' + APP_ID;var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();
  82. </script>
  83. {{/* Algolia DocSearch */}}
  84. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
  85. <script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
  86. <script defer>
  87. addEventListener("DOMContentLoaded", () => {
  88. docsearch({
  89. appId: "MB06X1VH88",
  90. apiKey: "d3aa325086974cdfb3912f28e5a8c168",
  91. indexName: "materialize",
  92. insights: true,
  93. container: "#docsearch",
  94. });
  95. });
  96. </script>
  97. {{if hugo.IsProduction}} {{/* Google Tag Manager */}}
  98. <script>
  99. (function (w, d, s, l, i) {
  100. w[l] = w[l] || [];
  101. w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
  102. var f = d.getElementsByTagName(s)[0],
  103. j = d.createElement(s),
  104. dl = l != 'dataLayer' ? '&l=' + l : '';
  105. j.async = true;
  106. j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
  107. f.parentNode.insertBefore(j, f);
  108. })(window, document, 'script', 'dataLayer', 'GTM-5VDFPSJ');
  109. </script>
  110. {{end}}
  111. {{/* Tabs */}}
  112. <script>
  113. $(document).ready(function () {
  114. // make nav-tab lists from tab-panes
  115. $(".tab-content").each(function (idx, tab) {
  116. $(tab)
  117. .find(".tab-pane")
  118. .each(function (item) {
  119. var navTabs = $(this).closest(".code-tabs").find(".nav-tabs"),
  120. title = $(this).attr("title"),
  121. id = title
  122. .toLowerCase()
  123. .replace(/ /g, "-")
  124. .replace(/[^\w-]+/g, "");
  125. navTabs.append(`<li><a href="#${id}-t${idx}">${title}</a></li>`);
  126. });
  127. });
  128. // handle click events
  129. $(".nav-tabs a").click(function (e) {
  130. var tab = $(this).parent(),
  131. tabIndex = tab.index(),
  132. tabPanel = $(this).closest(".code-tabs"),
  133. tabPane = tabPanel.find(".tab-pane").eq(tabIndex);
  134. tabPanel.find(".active").removeClass("active");
  135. tab.addClass("active");
  136. tabPane.addClass("active");
  137. });
  138. // activate first tab
  139. $(".nav-tabs li:first-child a").click();
  140. });
  141. </script>