jekyll-theme-amethyst 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d478567d792fb9752288273d79106286df6ef6ef3031d87fdcf16d63020c0d7d
4
- data.tar.gz: 938cf6b1fe0b22eecb926cc6dc4315e27949e644c3682df2312fc3e90749f409
3
+ metadata.gz: 9eb8365c83817b28e320f98115fd844f545cb6ffea498929bf019491a0a348f1
4
+ data.tar.gz: 68aa630aa212dcde459e337439147af95841d37afcf255d05a7a276de628c598
5
5
  SHA512:
6
- metadata.gz: 581e0dd5940ff83d59bddaa0ffa0ccd2e03de9c3359cf2e2b89a101d50d54e2d1613ec3af8ae197588a8e77c30812066c5e1fc1c0bb15537914ba0f1533e6ab1
7
- data.tar.gz: 404fe3d0b4e3abe29168e9a8e644d6e5f482e821c4b05eec34d30e3c976bacbb73f78ed1b0d2e639f8a05438ab9d234ee7dedc63de19e7c21fa26b00392581df
6
+ metadata.gz: 4a1046d94dc73a148f6a1f577a3b779721a0516558fedcf2ba05c0ea2d69c4a4e0b463d0408877dea7c9a36b107f85b7af7ba9a47698a5f0c22e95b4b0ff39f9
7
+ data.tar.gz: 8658b2601fe8ddaf4bfc3c4fcd87f7154ed095306a51ef445c7ff8c05b4852a0c930c0dc193b1db1844dcf80b47a787381a1922be93e0c55793842b0fee05765
@@ -22,11 +22,11 @@ jobs:
22
22
  git clone --depth 5 --branch "${DEPLOY_BRANCH}" "https://github.com/${GITHUB_REPOSITORY}.git" . || git init -b "${DEPLOY_BRANCH}"
23
23
 
24
24
  - uses: ruby/setup-ruby@v1
25
- # If your site is in a subdirectory
26
- # working-directory: ./
27
25
  with:
28
26
  ruby-version: 2.7
29
27
  bundler-cache: true
28
+ # If your site is in a subdirectory
29
+ # working-directory: ./
30
30
 
31
31
  - name: Jekyll build
32
32
  # If your site is in a subdirectory
@@ -0,0 +1,29 @@
1
+ name: typesense
2
+ on:
3
+ # Once a week on Wednesday at 11:45 UTC <https://crontab.guru/>
4
+ schedule:
5
+ - cron: '45 11 * * 3'
6
+ # Or after a deployment
7
+ push:
8
+ branches:
9
+ - main
10
+ - typesense
11
+ # Or manually
12
+ workflow_dispatch:
13
+ jobs:
14
+ typesense:
15
+ name: Update Typesense
16
+ if: ${{ github.repository_owner == 'qunitjs' }} # skip on forks
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v3
20
+ - name: Docsearch Scraper
21
+ shell: bash
22
+ run: |
23
+ docker run \
24
+ -e TYPESENSE_API_KEY=${{ secrets.TYPESENSE_ADMIN_KEY }} \
25
+ -e TYPESENSE_HOST="${{ secrets.TYPESENSE_HOST }}" \
26
+ -e TYPESENSE_PORT="443" \
27
+ -e TYPESENSE_PROTOCOL="https" \
28
+ -e CONFIG="$(cat docsearch.config.json | jq -r tostring)" \
29
+ typesense/docsearch-scraper:0.6.0.rc2
data/Gemfile CHANGED
@@ -2,5 +2,3 @@ source "https://rubygems.org"
2
2
  ruby RUBY_VERSION
3
3
 
4
4
  gemspec
5
-
6
- gem "jekyll-algolia", "~> 1.7.0", group: :jekyll_plugins
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  [![Build Status: spider-check](https://github.com/qunitjs/jekyll-theme-amethyst/actions/workflows/spider-check.yaml/badge.svg)](https://github.com/qunitjs/jekyll-theme-amethyst/actions/workflows/spider-check.yaml)
2
+ [![rubygems.org: jekyll-theme-amethyst](https://badge.fury.io/rb/jekyll-theme-amethyst.svg)](https://rubygems.org/gems/jekyll-theme-amethyst)
2
3
 
3
4
  # Amethyst theme
4
5
 
@@ -17,6 +18,8 @@ Thanks to [Leo Balter](https://github.com/leobalter) for initiating the use of M
17
18
 
18
19
  ## Contributing
19
20
 
21
+ ### Local development
22
+
20
23
  Requirements:
21
24
 
22
25
  * [Ruby](https://www.ruby-lang.org/) (tested with Ruby 2.7+)
@@ -33,3 +36,21 @@ To generate the site and serve it locally at <http://localhost:4000/>:
33
36
  ```shell
34
37
  bundle exec jekyll serve
35
38
  ```
39
+
40
+ ### Releasing
41
+
42
+ * Edit `amethyst.gemspec` and set the next release number.
43
+ * Stage and commit the changes:
44
+ ```
45
+ git add -p
46
+ git commit
47
+ # Tag v0.0.0
48
+ git push
49
+ ```
50
+ * Create a signed semver tag, and push it:
51
+ ```
52
+ git tag -s v0.0.0
53
+ # Tag v0.0.0
54
+ git push --tags
55
+ ```
56
+ * CI will create and publish a new package to <https://rubygems.org/gems/jekyll-theme-amethyst>.
data/_config.yml CHANGED
@@ -45,9 +45,11 @@ amethyst:
45
45
  release_base: https://github.com/qunitjs/qunit/releases/tag/
46
46
  github: qunitjs
47
47
  gitter: qunitjs/qunit
48
- # https://github.com/qunitjs/jekyll-theme-amethyst/blob/main/docs/getting-started.md#enable-algolia-search
49
- algolia:
50
- search_only_api_key: f37678e47d7730bbf340e904a81fbbbd
48
+ # https://github.com/qunitjs/jekyll-theme-amethyst/blob/main/docs/getting-started.md#enable-typesense
49
+ typesense:
50
+ origin: https://typesense.jquery.com
51
+ collection: amethyst_demo
52
+ search_only_api_key: Zh8mMgohXECel9wjPwqT7lekLSG3OCgz
51
53
 
52
54
 
53
55
  # Conversion settings
@@ -67,19 +69,6 @@ sass:
67
69
  sourcemap: never
68
70
 
69
71
 
70
- # Backend search settings
71
- #
72
- # Docs: https://github.com/algolia/jekyll-algolia
73
- algolia:
74
- application_id: 4HMKKPGKKN
75
- index_name: amethyst-demo
76
- # By default only HTML paragraphs are indexed (and headings, albeit through a different mechanism).
77
- # * Include list items (similar to paragraphs).
78
- # * Include tables (index per row for better excerpts).
79
- # * Include <pre> (typically code examples, omit if it "poisons" results too much).
80
- nodes_to_index: "p,li,tr,pre"
81
-
82
-
83
72
  # Blog archives
84
73
  #
85
74
  # Docs: https://github.com/jekyll/jekyll-archives/
@@ -4,10 +4,14 @@
4
4
 
5
5
  - group: lorem
6
6
 
7
- - type: link
8
- url: /api/deprecated/
7
+ - group: deprecated
8
+ expand: false
9
9
  title: Deprecated
10
10
 
11
- - type: link
12
- url: /api/removed/
11
+ - group: removed
12
+ expand: false
13
13
  title: Removed
14
+
15
+ - type: link
16
+ url: /api/foo/quux/
17
+ title: Quux
@@ -45,5 +45,11 @@
45
45
  {% endif %}
46
46
  <meta name="twitter:card" content="summary_large_image">
47
47
 
48
+
49
+ {% if layout.amethyst.pagetype == "navigation" %}
50
+ <meta name="robots" content="{{ layout.amethyst.robots | default: 'noindex,follow' }}">
51
+ <meta name="docsearch:amethyst_pagetype_navigation" content="1">
52
+ {% endif %}
53
+
48
54
  {% endcapture -%}
49
55
  {{ opengraph | strip_newlines }}
@@ -1,14 +1,6 @@
1
- <form class="site-search" id="site-search-form" action="https://duckduckgo.com">
2
- <label class="screen-reader-text" for="aa-search-input">Search</label>
3
- <input type="search" name="q" id="aa-search-input" class="aa-input-search" placeholder="Search..." autocomplete="off">
4
- <input type="hidden" name="sites" value="{{ site.url | remove_first: 'http://' | remove_first: 'https://' }}">
5
- <svg class="aa-input-icon" viewBox="654 -372 1664 1664" height="20">
6
- <path d="M1806,332c0-123.3-43.8-228.8-131.5-316.5C1586.8-72.2,1481.3-116,1358-116s-228.8,43.8-316.5,131.5 C953.8,103.2,910,208.7,910,332s43.8,228.8,131.5,316.5C1129.2,736.2,1234.7,780,1358,780s228.8-43.8,316.5-131.5 C1762.2,560.8,1806,455.3,1806,332z M2318,1164c0,34.7-12.7,64.7-38,90s-55.3,38-90,38c-36,0-66-12.7-90-38l-343-342 c-119.3,82.7-252.3,124-399,124c-95.3,0-186.5-18.5-273.5-55.5s-162-87-225-150s-113-138-150-225S654,427.3,654,332 s18.5-186.5,55.5-273.5s87-162,150-225s138-113,225-150S1262.7-372,1358-372s186.5,18.5,273.5,55.5s162,87,225,150s113,138,150,225 S2062,236.7,2062,332c0,146.7-41.3,279.7-124,399l343,343C2305.7,1098.7,2318,1128.7,2318,1164z"/>
7
- </svg>
1
+ <form role="search" class="tsmb-form"{%- if site.amethyst.typesense.search_only_api_key -%} data-origin="{{ site.amethyst.typesense.origin | escape }}" data-collection="{{ site.amethyst.typesense.collection | escape }}" data-key="{{ site.amethyst.typesense.search_only_api_key | escape }}" data-foot="true"{%- endif -%} action="https://duckduckgo.com">
2
+ <input type="search" name="q" aria-label="Search" placeholder="Search..." autocomplete="off">
3
+ <input type="hidden" name="sites" value="{{ site.url | remove_first: 'http://' | remove_first: 'https://' }}">
8
4
  </form>
9
5
 
10
- {%- comment -%}
11
6
 
12
- See also search-js.html
13
-
14
- {%- endcomment -%}
@@ -22,7 +22,7 @@ Parameters:
22
22
  {%- endif -%}
23
23
 
24
24
  {%- if include.version == "unreleased" -%}
25
- not yet released
25
+ not yet released<span class="sep">.</span>
26
26
  {%- else -%}
27
- {{ include.label }}: {% if site.amethyst.release_base %}<a href="{{ site.amethyst.release_base }}{{ _full_version | escape }}">{{ include.version | escape }}</a>{% else %}{{ include.version | escape }}{% endif %}
27
+ {{ include.label }}: {% if site.amethyst.release_base %}<a href="{{ site.amethyst.release_base }}{{ _full_version | escape }}">{{ include.version | escape }}</a>{% else %}{{ include.version | escape }}{% endif %}<span class="sep">.</span>
28
28
  {%- endif -%}
data/_layouts/group.html CHANGED
@@ -3,6 +3,7 @@ layout: page-api
3
3
  amethyst:
4
4
  toc: false
5
5
  prepend_description_heading: false
6
+ pagetype: navigation
6
7
 
7
8
  # Parameters:
8
9
  #
@@ -27,29 +27,38 @@ do that here for convenience.
27
27
  {%- endunless -%}
28
28
  <div class="main main--columns wrapper">
29
29
  <div class="content" role="main">
30
+ <article>
31
+ <header>
30
32
  <h1>{{ page.title }}</h1>
31
- {%- if page.version_added or page.version_deprecated -%}
33
+ {% if page.groups -%}
34
+ <p class="post-meta">Categories: {% comment %} space {% endcomment -%}
35
+ {%- for group in page.groups -%}
36
+ {%- if page.groups.first != group %}, {% endif -%}
37
+ {%- assign group_page = site.pages | where: "layout", "group" | where: "group", group | first -%}
38
+ <a class="category" href="{{ group_page.url | relative_url }}">{{ group_page.title | escape }}</a>
39
+ {%- endfor -%}
40
+ .</p>
41
+ {%- endif %}
42
+ </header>
43
+ {% if page.version_added or page.version_deprecated -%}
32
44
  {%- assign warning = false -%}
33
45
  {%- if page.version_added == "unreleased" or page.version_deprecated or page.version_removed -%}
34
46
  {%- assign warning = true -%}
35
47
  {%- endif -%}
36
-
37
- <p class="version-details{% if warning %} note--warning{% endif %}">
38
- {%- capture lines -%}
39
- {%- if page.version_added %}
40
- {% include version.html version=page.version_added label="version added" %}
41
- {%- endif -%}
42
- {%- if page.version_deprecated %}
43
- {% include version.html version=page.version_deprecated label="deprecated" %}
44
- {%- endif -%}
45
- {%- if page.version_removed %}
46
- {% include version.html version=page.version_removed label="removed" %}
47
- {%- endif -%}
48
- {%- endcapture -%}
49
- {{ lines | strip | newline_to_br }}
50
- </p>
48
+ <p class="version-details">
49
+ {%- if page.version_added %}
50
+ {% include version.html version=page.version_added label="version added" %}
51
+ {%- endif -%}
52
+ {%- if page.version_deprecated %}
53
+ {% include version.html version=page.version_deprecated label="deprecated" %}
54
+ {%- endif -%}
55
+ {%- if page.version_removed %}
56
+ {% include version.html version=page.version_removed label="removed" %}
57
+ {%- endif -%}
58
+ </p>
51
59
  {%- endif %}
52
- {{- content }}
60
+ {{ content }}
61
+ </article>
53
62
  </div>
54
63
  {%- assign toc = true -%}
55
64
  {%- if layout.amethyst.toc == false -%}
data/_layouts/post.html CHANGED
@@ -3,15 +3,15 @@ layout: wrapper
3
3
  ---
4
4
 
5
5
  <div class="main main--columns wrapper">
6
- <div class="content">
7
- <article class="content">
6
+ <div class="content" role="main">
7
+ <article>
8
8
  <header>
9
9
  <h1>{{ page.title | escape }}</h1>
10
10
  {%- assign date_format = site.amethyst.date_format | default: "%e %B %Y" -%}
11
11
  <p class="post-meta byline">Posted on <a href="{{ page.url | relative_url }}" rel="bookmark"><time itemprop="pubdate" datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: date_format }}</time></a>{% if page.author %} by <span class="vcard"><span class="fn n" rel="author">{{ page.author | escape }}</span></span>{% endif %}</p>
12
12
  </header>
13
13
  {{ content }}
14
- </article>
14
+ </article>
15
15
  {%- comment -%}
16
16
  Support basic read-only rendering of imported comments.
17
17
 
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  layout: wrapper
3
+ amethyst:
4
+ pagetype: navigation
3
5
  ---
4
6
 
5
7
  <div class="main main--columns wrapper">
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  layout: wrapper
3
+ amethyst:
4
+ pagetype: navigation
3
5
  ---
4
6
 
5
7
  <div class="main main--columns wrapper">
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  layout: wrapper
3
+ amethyst:
4
+ pagetype: navigation
3
5
  ---
4
6
 
5
7
  <div class="main main--columns wrapper">
@@ -1,5 +1,7 @@
1
1
  ---
2
2
  layout: wrapper
3
+ amethyst:
4
+ pagetype: navigation
3
5
  ---
4
6
 
5
7
  <div class="main main--columns wrapper">
data/_layouts/posts.html CHANGED
@@ -1,5 +1,8 @@
1
1
  ---
2
2
  layout: wrapper
3
+ amethyst:
4
+ pagetype: navigation
5
+ robots: index
3
6
  ---
4
7
 
5
8
  <div class="main main--columns wrapper">
@@ -15,9 +15,7 @@
15
15
  {{ site.title | escape }}
16
16
  {%- endif -%}
17
17
  </a>
18
- {%- if site.amethyst.algolia.search_only_api_key -%}
19
- {%- include search.html -%}
20
- {%- endif -%}
18
+ {%- include search.html -%}
21
19
  <nav class="site-nav"><ul class="site-nav-list">
22
20
  {%- for item in site.data.sitenav -%}
23
21
  <li class="site-nav-item{%- if item.sub %} has-sub-list{% endif %}">
@@ -35,8 +33,7 @@
35
33
  {%- endfor -%}
36
34
  </ul></nav>
37
35
  <div class="site-toggles">
38
- {%- if site.amethyst.algolia.search_only_api_key %}
39
- <button class="search-toggle toggle" data-opens=".site-search" aria-expanded="false">
36
+ <button class="search-toggle toggle" aria-expanded="false">
40
37
  <span class="screen-reader-text">Search</span>
41
38
  <svg class="icon aa-input-icon" aria-hidden="true" viewBox="654 -372 1664 1664" height="20">
42
39
  <path d="M1806,332c0-123.3-43.8-228.8-131.5-316.5C1586.8-72.2,1481.3-116,1358-116s-228.8,43.8-316.5,131.5 C953.8,103.2,910,208.7,910,332s43.8,228.8,131.5,316.5C1129.2,736.2,1234.7,780,1358,780s228.8-43.8,316.5-131.5 C1762.2,560.8,1806,455.3,1806,332z M2318,1164c0,34.7-12.7,64.7-38,90s-55.3,38-90,38c-36,0-66-12.7-90-38l-343-342 c-119.3,82.7-252.3,124-399,124c-95.3,0-186.5-18.5-273.5-55.5s-162-87-225-150s-113-138-150-225S654,427.3,654,332 s18.5-186.5,55.5-273.5s87-162,150-225s138-113,225-150S1262.7-372,1358-372s186.5,18.5,273.5,55.5s162,87,225,150s113,138,150,225 S2062,236.7,2062,332c0,146.7-41.3,279.7-124,399l343,343C2305.7,1098.7,2318,1128.7,2318,1164z"/>
@@ -44,16 +41,17 @@
44
41
  </button>
45
42
  <script type="module">
46
43
  const searchToggle = document.querySelector('.search-toggle');
47
- const searchToggleOpens = document.querySelector(searchToggle.dataset.opens);
44
+ const searchForm = document.querySelector('form[role=search]');
45
+ const searchInput = searchForm.querySelector('input[type=search]');
48
46
  searchToggle.addEventListener('click', () => {
49
- const state = searchToggle.classList.contains('opened');
50
- searchToggle.classList.toggle('opened', !state);
51
- searchToggle.setAttribute('aria-expanded', !state);
52
- searchToggleOpens.classList.toggle('opened', !state);
53
- searchToggleOpens.setAttribute('aria-expanded', !state);
47
+ const newState = searchToggle.getAttribute('aria-expanded') !== 'true';
48
+ searchToggle.setAttribute('aria-expanded', String(newState));
49
+ searchForm.style.display = newState ? 'block' : '';
50
+ if (newState) {
51
+ searchInput.focus();
52
+ }
54
53
  });
55
54
  </script>
56
- {%- endif %}
57
55
  <button class="nav-toggle toggle" data-opens=".site-nav" aria-expanded="false">
58
56
  <span class="screen-reader-text">Menu</span>
59
57
  <svg class="icon icon-nav-toggle" aria-hidden="true" viewBox="0 0 100 100" height="20">
@@ -103,8 +101,18 @@
103
101
  </p>
104
102
  </div>
105
103
  </footer>
106
- {%- if site.amethyst.algolia.search_only_api_key -%}
107
- {%- include search-js.html -%}
104
+ {%- comment -%}
105
+
106
+ We use type="module" as a natural way to cut the mustard,
107
+ executing the script only on modern browsers with ES6 support,
108
+ and causing no errors on older browsers.
109
+
110
+ <https://responsivenews.tumblr.com/post/18948466399/cutting-the-mustard>
111
+ <http://web.archive.org/web/20150305005331/http://responsivenews.co.uk/post/18948466399/cutting-the-mustard>
112
+
113
+ {%- endcomment -%}
114
+ {%- if site.amethyst.typesense.search_only_api_key -%}
115
+ <script defer type="module" src="{{ '/assets/typesense-minibar.js' | file_version_query | relative_url }}"></script>
108
116
  {%- endif -%}
109
117
  </body>
110
118
  </html>