Skip to content

Commit

Permalink
Merged features tied to Carolina Reaper funding goal
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Dec 7, 2022
1 parent e0dce6c commit b550b1a
Show file tree
Hide file tree
Showing 118 changed files with 2,549 additions and 1,047 deletions.
1 change: 1 addition & 0 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"dppx",
"deg",
"em",
"fr",
"mm",
"ms",
"px",
Expand Down
14 changes: 0 additions & 14 deletions docs/schema/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -834,20 +834,6 @@
}
}
]
},
"include_search_page": {
"title": "Only necessary when installing from git",
"markdownDescription": "Must be set to `false`",
"enum": [
false
]
},
"search_index_only": {
"title": "Only necessary when installing from git",
"markdownDescription": "Must be set to `false`",
"enum": [
true
]
}
},
"additionalProperties": false,
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/.overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{ 'assets/javascripts/custom.83b17dfb.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/custom.147554b9.min.js' | url }}"></script>
{% endblock %}
29 changes: 29 additions & 0 deletions material/assets/javascripts/bundle.43982a0d.min.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions material/assets/javascripts/bundle.43982a0d.min.js.map

Large diffs are not rendered by default.

29 changes: 0 additions & 29 deletions material/assets/javascripts/bundle.cef3dc0e.min.js

This file was deleted.

8 changes: 0 additions & 8 deletions material/assets/javascripts/bundle.cef3dc0e.min.js.map

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions material/assets/stylesheets/extra.52c02453.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions material/assets/stylesheets/extra.52c02453.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion material/assets/stylesheets/extra.c2715e54.min.css

This file was deleted.

1 change: 0 additions & 1 deletion material/assets/stylesheets/extra.c2715e54.min.css.map

This file was deleted.

1 change: 0 additions & 1 deletion material/assets/stylesheets/main.47fa6176.min.css

This file was deleted.

1 change: 0 additions & 1 deletion material/assets/stylesheets/main.47fa6176.min.css.map

This file was deleted.

1 change: 1 addition & 0 deletions material/assets/stylesheets/main.91872f81.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions material/assets/stylesheets/main.91872f81.min.css.map

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions material/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{% endif %}
{% endblock %}
{% block styles %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.47fa6176.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.91872f81.min.css' | url }}">
{% if config.theme.palette %}
{% set palette = config.theme.palette %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.2505c338.min.css' | url }}">
Expand Down Expand Up @@ -211,7 +211,7 @@
"base": base_url,
"features": features,
"translations": {},
"search": "assets/javascripts/workers/search.16e2a7d4.min.js" | url
"search": "assets/javascripts/workers/search.cd82efe4.min.js" | url
} -%}
{%- if config.extra.version -%}
{%- set _ = app.update({ "version": config.extra.version }) -%}
Expand All @@ -223,10 +223,6 @@
{%- for key in [
"clipboard.copy",
"clipboard.copied",
"search.config.lang",
"search.config.pipeline",
"search.config.separator",
"search.placeholder",
"search.result.placeholder",
"search.result.none",
"search.result.one",
Expand All @@ -243,13 +239,13 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.cef3dc0e.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.43982a0d.min.js' | url }}"></script>
{% for path in config.extra_javascript %}
<script src="{{ path | url }}"></script>
{% endfor %}
{% endblock %}
{% if page.meta and page.meta.ᴴₒᴴₒᴴₒ %}
<link rel="stylesheet" href="{{ 'assets/stylesheets/extra.c2715e54.min.css' | url }}">
<link rel="stylesheet" href="{{ 'assets/stylesheets/extra.52c02453.min.css' | url }}">
<script src="{{ 'assets/javascripts/extra/bundle.f719a234.min.js' | url }}" defer></script>
{% endif %}
</body>
Expand Down
1 change: 0 additions & 1 deletion material/partials/languages/el.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"meta.source": "Πηγή",
"nav": "Πλοήγηση",
"search": "Αναζήτηση",
"search.config.pipeline": "stopWordFilter",
"search.placeholder": "Αναζήτηση",
"search.share": "Διαμοίραση",
"search.reset": "Καθαρισμός",
Expand Down
2 changes: 1 addition & 1 deletion material/partials/languages/en.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"nav": "Navigation",
"search": "Search",
"search.config.lang": "en",
"search.config.pipeline": "trimmer, stopWordFilter",
"search.config.pipeline": "stopWordFilter",
"search.config.separator": "[\\s\\-]+",
"search.placeholder": "Search",
"search.share": "Share",
Expand Down
2 changes: 1 addition & 1 deletion material/partials/languages/ja.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"meta.source": "ソース",
"nav": "ナビゲーション",
"search.config.lang": "ja",
"search.config.pipeline": "trimmer, stemmer",
"search.config.pipeline": "stemmer",
"search.config.separator": "[\\s\\- 、。,.]+",
"search.placeholder": "検索",
"search.reset": "クリア",
Expand Down
2 changes: 1 addition & 1 deletion material/partials/languages/zh-Hant.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"meta.comments": "評論",
"meta.source": "來源",
"search.config.lang": "ja",
"search.config.pipeline": "trimmer, stemmer",
"search.config.pipeline": "stemmer",
"search.config.separator": "[\\s\\-,。]+",
"search.placeholder": "搜尋",
"search.result.initializer": "正在初始化搜尋引擎",
Expand Down
2 changes: 1 addition & 1 deletion material/partials/languages/zh-TW.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"meta.comments": "留言",
"meta.source": "來源",
"search.config.lang": "ja",
"search.config.pipeline": "trimmer, stemmer",
"search.config.pipeline": "stemmer",
"search.config.separator": "[\\s\\- 、。,.?;]+",
"search.placeholder": "搜尋",
"search.result.initializer": "正在初始化搜尋引擎",
Expand Down
2 changes: 1 addition & 1 deletion material/partials/languages/zh.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"nav": "导航栏",
"search": "查找",
"search.config.lang": "ja",
"search.config.pipeline": "trimmer, stemmer",
"search.config.pipeline": "stemmer",
"search.config.separator": "[\\s\\-,。]+",
"search.placeholder": "搜索",
"search.share": "分享",
Expand Down
Empty file.
69 changes: 69 additions & 0 deletions material/plugins/offline/plugin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright (c) 2016-2022 Martin Donath <[email protected]>

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

import os

from mkdocs import utils
from mkdocs.config import config_options as opt
from mkdocs.config.base import Config
from mkdocs.plugins import BasePlugin, event_priority

# -----------------------------------------------------------------------------
# Class
# -----------------------------------------------------------------------------

# Offline plugin configuration scheme
class OfflinePluginConfig(Config):
enabled = opt.Type(bool, default = True)

# -----------------------------------------------------------------------------

# Offline plugin
class OfflinePlugin(BasePlugin[OfflinePluginConfig]):

# Initialize plugin
def on_config(self, config):
if not self.config.enabled:
return

# Ensure correct resolution of links
config.use_directory_urls = False

# Support offline search (run latest)
@event_priority(-100)
def on_post_build(self, *, config):
if not self.config.enabled:
return

# Check for existence of search index
base = os.path.join(config.site_dir, "search")
path = os.path.join(base, "search_index.json")
if not os.path.exists(path):
return

# Retrieve search index
with open(path, "r") as data:
index = data.read()

# Inline search index into script
utils.write_file(
f"var __index = {index}".encode("utf-8"),
os.path.join(base, "search_index.js")
)
Loading

0 comments on commit b550b1a

Please sign in to comment.