default.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. {% assign version = page.url | remove_first: "/" | split: "/" | first %}
  2. {% assign upgrading = false %}
  3. {% if version == '' or version == 'releases' %}
  4. {% assign version = site.data.project.default_version %}
  5. {% assign upgrading = true %}
  6. {% endif %}
  7. {% capture version_type %}{{ version|get_version_type }}{% endcapture %}
  8. {% capture version_home %}/{{ version }}/{% endcapture %}
  9. <!DOCTYPE html>
  10. <html lang="en">
  11. <head>
  12. <meta charset="utf-8">
  13. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  14. <meta name="viewport" content="width=device-width, initial-scale=1">
  15. {% if page.description %}
  16. <meta name="description" content="{{ page.description }}">
  17. {% else if site.data.project.description %}
  18. <meta name="description" content="{{ site.data.project.description }}">
  19. {% endif %}
  20. <meta name="docsearch:version" content="{{ version }}">
  21. {% if page.url == '/' %}
  22. <title>{{ site.data.project.site_title }} - {{ site.data.project.tagline }}</title>
  23. {% else %}
  24. <title>{{ page.title }} - {{ site.data.project.site_title }}</title>
  25. {% endif %}
  26. <link rel="icon" type="image/x-icon" href="//theme.thephpleague.com/img/favicon.ico" />
  27. <link rel="apple-touch-icon-precomposed" href="//theme.thephpleague.com/img/apple-touch-icon-precomposed.png">
  28. <meta name="twitter:card" content="summary_large_image" />
  29. <meta name="twitter:site" content="@thephpleague" />
  30. <meta name="twitter:creator" content="@colinodell" />
  31. <meta property="og:url" content="https://commonmark.thephpleague.com{{ page.url }}" />
  32. {% if page.url == '/' %}
  33. <meta property="og:title" content="{{ site.data.project.site_title }} - {{ site.data.project.tagline }}" />
  34. {% else %}
  35. <meta property="og:title" content="{{ page.title }} - {{ site.data.project.site_title }}" />
  36. {% endif %}
  37. {% if page.description %}
  38. <meta property="og:description" content="{{ page.description }}" />
  39. {% else %}
  40. <meta property="og:description" content="{{ site.data.project.description }}" />
  41. {% endif %}
  42. <meta property="og:image" content="https://commonmark.thephpleague.com/images/commonmark-social.png" />
  43. <link rel="stylesheet" href="//theme.thephpleague.com/css/all.css?{{ site.github.build_revision }}">
  44. <link rel="stylesheet" href="/custom.css?{{ site.github.build_revision }}">
  45. <link rel="stylesheet" href="/global.css?{{ site.github.build_revision }}">
  46. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css">
  47. <link rel="stylesheet" href="/support.css?{{ site.github.build_revision }}">
  48. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" integrity="sha256-h20CPZ0QyXlBuAw7A+KluUYx/3pK+c7lYEpqLTlxjYQ=" crossorigin="anonymous" />
  49. <script async src="https://www.googletagmanager.com/gtag/js?id={{ site.data.project.google_analytics_tracking_id }}"></script>
  50. <script>
  51. window.dataLayer = window.dataLayer || [];
  52. function gtag() { dataLayer.push(arguments);}
  53. gtag('js', new Date());
  54. gtag('config', '{{ site.data.project.google_analytics_tracking_id }}');
  55. </script>
  56. </head>
  57. <body>
  58. <header>
  59. <div class="header-content">
  60. <h1 class="title">
  61. <a class="logo" href="/">
  62. <span class="name">
  63. <em>League\</em>CommonMark
  64. </span>
  65. </a>
  66. </h1>
  67. <div class="search"><input type="search" id="doc-search" placeholder="search the docs..."></div>
  68. <nav class="versions">
  69. <h2>{% if upgrading == true %}Notes{% else %}v{{ version }}{% endif %} &#9662;</h2>
  70. <ul>
  71. {% for v in site.data.menu.version %}
  72. <li {% if version == v[0] and upgrading == false %}class="selected"{% endif %}><a href="{{ v[0] | get_version_link : page.url }}">v{{ v[0] }}</a></li>
  73. {% endfor %}
  74. <li {% if upgrading == true %}class="selected"{% endif %}><a href="/releases/">Notes</a></li>
  75. </ul>
  76. </nav>
  77. </div>
  78. </header>
  79. <input type="checkbox" id="menu">
  80. <label for="menu" onclick>
  81. <div class="closed">&#9776;</div>
  82. <div class="open">&#10799;</div>
  83. </label>
  84. <main>
  85. <menu>
  86. <div class="versions-small">
  87. <h2>Versions</h2>
  88. <ul>
  89. {% for v in site.data.menu.version %}
  90. <li {% if version == v[0] and upgrading == false %}class="selected"{% endif %}>
  91. <a href="/{{ v[0] }}/">{{ v[0] }}</a>
  92. </li>
  93. {% endfor %}
  94. <li {% if upgrading == true %}class="selected"{% endif %}><a href="/releases/">Releases Notes</a></li>
  95. </ul>
  96. </div>
  97. {% if upgrading == false %}
  98. {% for section in site.data.menu.version[version] %}
  99. <div class="menu-section">
  100. <h2>{{ section[0] }}</h2>
  101. <ul>
  102. {% for link in section[1] %}
  103. <li {% if page.url == link[1] %}class="selected"{% endif %}>
  104. <a href="{{ link[1] }}">{{ link[0] }}</a>
  105. </li>
  106. {% endfor %}
  107. </ul>
  108. </div>
  109. {% endfor %}
  110. {% else %}
  111. {% for section in site.data.menu.upgrading %}
  112. <h2>{{ section[0] }}</h2>
  113. <ul>
  114. {% for link in section[1] %}
  115. <li {% if page.url == link[1] %}class="selected"{% endif %}>
  116. <a href="{{ link[1] }}">{{ link[0] }}</a>
  117. </li>
  118. {% endfor %}
  119. </ul>
  120. {% endfor %}
  121. {% endif %}
  122. </menu>
  123. <article>
  124. {% if version_type == 'next' %}
  125. <p class="message-notice">This is the documentation for the upcoming <code>version {{ version }}</code>. This is a work in progress</p>
  126. {% endif %}
  127. {% if version_type == 'previous' %}
  128. <p class="message-notice">This is the documentation for <code>version {{ version }}</code>. Please consider upgrading your code to <a href="{{ site.data.project.default_version|get_documentation_link }}">the latest stable version</a></p>
  129. {% endif %}
  130. {% if version_type == 'legacy' %}
  131. <p class="message-warning">This is the documentation for the unsupported <code>version {{ version }}</code>. Please consider upgrading your code to <a href="{{ site.data.project.default_version|get_documentation_link }}">the latest stable version</a></p>
  132. {% endif %}
  133. {{ content }}
  134. <hr>
  135. <p>
  136. <a class="btn btn-sm btn-black" href="{{ page.path | get_edit_link }}" title="Edit this page on GitHub" target="_blank" rel="noopener"><i class="fas fa-edit"></i> Edit this page</a>
  137. </p>
  138. </article>
  139. <aside class="support-banner-wrapper" x-data="{ show: false }" x-show.transition="show" x-init="h = localStorage.getItem('hideBanner'); (h === null || h < (new Date().getTime())) ? (setTimeout(() => show = true, 500)) : (show = false)">
  140. <div class="support-banner">
  141. <p class="support-banner-left">
  142. <strong>Love PHP Commonmark?</strong>
  143. <span class="hidden sm:inline-block lg:hidden">
  144. Show your support!
  145. </span>
  146. <span class="hidden lg:inline-block">
  147. Support development via monthly sponsorship or a one-time donation!
  148. </span>
  149. </p>
  150. <div class="support-banner-right">
  151. <a href="https://github.com/sponsors/colinodell" class="btn btn-pink btn-block">
  152. <i class="fas fa-heart fa-fw" aria-hidden="true"></i> Sponsor
  153. </a>
  154. <a href="https://www.paypal.me/colinpodell/10.00" class="btn btn-green btn-block">
  155. <i class="fas fa-donate fa-fw" aria-hidden="true"></i> Donate
  156. </a>
  157. </div>
  158. <button x-on:click="localStorage.setItem('hideBanner', new Date().getTime() + (7*24*60*60*1000)); show = false" class="support-banner-close">
  159. <i class="fas fa-times" aria-hidden="true"></i>
  160. </button>
  161. </div>
  162. </aside>
  163. </main>
  164. <footer>
  165. <span>&copy; Copyright <a href="https://www.colinodell.com">Colin O'Dell</a> &amp; <a href="//thephpleague.com">The League of Extraordinary Packages</a>.</span>
  166. <span>Site design by <a href="//reinink.ca">Jonathan Reinink</a> and <a href="//nyamsprod.com">Ignace Nyamagana Butera</a>.</span>
  167. </footer>
  168. <script src="/custom.js?{{ site.github.build_revision }}"></script>
  169. <script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
  170. <script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js" defer></script>
  171. <script> docsearch({
  172. apiKey: '8f6d6eb939fe0df83616a0bb240332c8',
  173. indexName: 'commonmark-thephpleague',
  174. inputSelector: '#doc-search',
  175. algoliaOptions: { 'facetFilters': ["version:{{ version }}"] },
  176. debug: false // Set debug to true if you want to inspect the dropdown
  177. });
  178. </script>
  179. </body>
  180. </html>