Prefixed tabs and instant feature flags with 'navigation.*'

This commit is contained in:
squidfunk 2020-09-27 10:13:41 +02:00
parent ce802a4913
commit 085117ef82
10 changed files with 18 additions and 15 deletions

View File

@ -23,7 +23,7 @@ can be enabled via `mkdocs.yml` with:
``` yaml
theme:
features:
- instant
- navigation.instant
```
The resulting page is parsed and injected and all event handlers and components
@ -65,7 +65,7 @@ enabled via `mkdocs.yml` with:
``` yaml
theme:
features:
- tabs
- navigation.tabs
```
Note that all __top-level pages__ (i.e. all top-level entries that directly

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"assets/javascripts/bundle.js": "assets/javascripts/bundle.97a86bda.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.97a86bda.min.js.map",
"assets/javascripts/bundle.js": "assets/javascripts/bundle.75f65488.min.js",
"assets/javascripts/bundle.js.map": "assets/javascripts/bundle.75f65488.min.js.map",
"assets/javascripts/vendor.js": "assets/javascripts/vendor.141042ad.min.js",
"assets/javascripts/vendor.js.map": "assets/javascripts/vendor.141042ad.min.js.map",
"assets/javascripts/worker/search.js": "assets/javascripts/worker/search.cbc634e2.min.js",

View File

@ -114,7 +114,7 @@
<div class="md-container" data-md-component="container">
{% block hero %}{% endblock %}
{% block tabs %}
{% if "tabs" in config.theme.features %}
{% if "navigation.tabs" in config.theme.features %}
{% include "partials/tabs.html" %}
{% endif %}
{% endblock %}
@ -173,7 +173,7 @@
</div>
{% block scripts %}
<script src="{{ 'assets/javascripts/vendor.141042ad.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.97a86bda.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.75f65488.min.js' | url }}"></script>
{%- set translations = {} -%}
{%- for key in [
"clipboard.copy",

View File

@ -51,8 +51,8 @@ theme:
# Default values, taken from mkdocs_theme.yml
language: en
features:
- tabs
#- instant
- navigation.tabs
#- navigation.instant
palette:
scheme: default
primary: indigo

View File

@ -400,7 +400,10 @@ export function initialize(config: unknown) {
})
/* Enable instant loading, if not on file:// protocol */
if (config.features.includes("instant") && location.protocol !== "file:") {
if (
config.features.includes("navigation.instant") &&
location.protocol !== "file:"
) {
/* Fetch sitemap and extract URL whitelist */
base$

View File

@ -30,8 +30,8 @@ import { SearchIndex, SearchTransformFn } from "integrations"
* Feature flags
*/
export type Feature =
| "tabs" /* Tabs navigation */
| "instant" /* Instant loading
| "navigation.tabs" /* Tabs navigation */
| "navigation.instant" /* Instant loading
/* ------------------------------------------------------------------------- */

View File

@ -234,7 +234,7 @@
<!-- Tabs navigation -->
{% block tabs %}
{% if "tabs" in config.theme.features %}
{% if "navigation.tabs" in config.theme.features %}
{% include "partials/tabs.html" %}
{% endif %}
{% endblock %}