diff --git a/.env b/.env deleted file mode 100755 index fd5271d4b..000000000 --- a/.env +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2016-2020 Martin Donath - -# 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. - -# Setup virtual environment -if [ ! -d venv ]; then - echo "Setting up virtual environment" - virtualenv venv -fi - -# Activate virtual environment -if [ -f venv/bin/activate ]; then - echo "Activating virtual environment" - source venv/bin/activate -fi diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..205021e49 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Enforce Unix newlines +* text=auto eol=lf diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index f69a5303a..c46b04f27 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -1,10 +1,9 @@ --- name: Bug about: Report a bug -title: -labels: -assignees: - +title: '' +labels: '' +assignees: '' --- , <-->), trademark and copyright symbols ((c), (tm), (r)) and fractions (1/2, 1/4, ...). - [22]: https://facelessuser.github.io/pymdown-extensions/extensions/smartsymbols/ + [26]: https://facelessuser.github.io/pymdown-extensions/extensions/smartsymbols/ ### SuperFences -[SuperFences][23] provides the ability to nest code blocks under blockquotes, -lists and other block elements, which the [Fenced Code Blocks][24] extension +[SuperFences][27] provides the ability to nest code blocks under blockquotes, +lists and other block elements, which the [Fenced Code Blocks][28] extension from the standard Markdown library doesn't parse correctly. -SuperFences does also allow [grouping code blocks with tabs][25]. +SuperFences does also allow [grouping code blocks with tabs][29]. - [23]: https://facelessuser.github.io/pymdown-extensions/extensions/superfences/ - [24]: https://python-markdown.github.io/extensions/fenced_code_blocks/ - [25]: codehilite.md#grouping-code-blocks + [27]: https://facelessuser.github.io/pymdown-extensions/extensions/superfences/ + [28]: https://python-markdown.github.io/extensions/fenced_code_blocks/ + [29]: codehilite.md#grouping-code-blocks ### Tabbed -[Tabbed][26] adds support for creating tabbed groups of Markdown content. +[Tabbed][30] adds support for creating tabbed groups of Markdown content. Example: @@ -290,11 +327,11 @@ Result: :banana: Banana | Yellow :kiwi: Kiwi | Green -[26]: https://facelessuser.github.io/pymdown-extensions/extensions/superfences/ +[30]: https://facelessuser.github.io/pymdown-extensions/extensions/superfences/ ### Tasklist -[Tasklist][27] adds support for styled checkbox lists. This is useful for +[Tasklist][31] adds support for styled checkbox lists. This is useful for keeping track of tasks and showing what has been done and has yet to be done. Checkbox lists are like regular lists, but prefixed with `[ ]` for empty or `[x]` for filled checkboxes. @@ -327,12 +364,12 @@ Result: * [ ] Aenean pretium efficitur erat, donec pharetra, ligula non scelerisque * [ ] Nulla vel eros venenatis, imperdiet enim id, faucibus nisi -[27]: https://facelessuser.github.io/pymdown-extensions/extensions/tasklist/ +[31]: https://facelessuser.github.io/pymdown-extensions/extensions/tasklist/ ### Tilde -[Tilde][28] provides an easy way to ~~strike through~~ cross out text. +[Tilde][32] provides an easy way to ~~strike through~~ cross out text. The portion of text that should be erased must be enclosed in two tildes `~~...~~` and the extension will take care of the rest. -[28]: https://facelessuser.github.io/pymdown-extensions/extensions/tilde/ +[32]: https://facelessuser.github.io/pymdown-extensions/extensions/tilde/ diff --git a/docs/getting-started.md b/docs/getting-started.md index 9f1293428..853eb639f 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -1,3 +1,7 @@ +--- +template: overrides/main.html +--- + # Getting started ## Installation @@ -10,8 +14,6 @@ the [official Docker image][1]. ### with pip recommended -> All operating systems - Material for MkDocs can be installed with `pip`: ``` sh @@ -26,8 +28,8 @@ those packages separately. !!! tip "Installation in a virtual environment" The best way to make sure that you end up with the correct versions and - without any incompatibility problems between packages it to use a __virtual - environment__. Don't know what this is or how to set it up? We recommend + without any incompatibility problems between packages it to use a **virtual + environment**. Don't know what this is or how to set it up? We recommend to start by reading a [tutorial on virtual environments][6] for Python. !!! warning "Installation on macOS" @@ -59,8 +61,6 @@ those packages separately. ### with docker recommended -> All operating systems - The official [Docker image][7] is a great way to get up and running in a few minutes, as it comes with all dependencies pre-installed. Pull the image for the `latest` version with: @@ -69,7 +69,7 @@ minutes, as it comes with all dependencies pre-installed. Pull the image for the docker pull squidfunk/mkdocs-material ``` -The `mkdocs` executable is provided as an entrypoint and `serve` is the default +The `mkdocs` executable is provided as an entry point and `serve` is the default command. Start the development server in your project root – the folder where `mkdocs.yml` resides — with: @@ -89,8 +89,6 @@ command. Start the development server in your project root – the folder where ### with git -> All operating systems - Material for MkDocs can be directly used from [GitHub][8] by cloning the repository into a subfolder of your project root which might be useful if you want to use the very latest version: @@ -103,28 +101,11 @@ The theme will reside in the folder `mkdocs-material/material`. [8]: https://github.com/squidfunk/mkdocs-material -### with choco - -> Windows only - -Material for MkDocs can be installed with [Chocolatey][9]: - -``` dos -choco install mkdocs-material -``` - -Note that this is an [unofficial package][10] of Material for MkDocs, so please -understand that the maintainers cannot provide any support for when using this -method. - - [9]: https://chocolatey.org - [10]: https://chocolatey.org/packages/mkdocs-material - ## Configuration Depending on your installation method, you can now add the following lines to `mkdocs.yml` in your project root. If you installed Material for MkDocs using -a package manager add: +a package manager, add: ``` yaml theme: @@ -147,12 +128,14 @@ following command: mkdocs serve ``` -Point your browser to [http://localhost:8000][11] and your documentation should -great you in a new look. If you're starting from scratch, the following -configuration can be used as a starting point: +Point your browser to http://localhost:8000 and your documentation should greet +you in a new look. If you're starting from scratch, the following configuration +can be used as a starting point: ??? summary "Example configuration" + This is an excerpt from the [`mkdocs.yml`][9] used to render these pages: + ``` yaml # Project information site_name: Material for MkDocs @@ -202,7 +185,7 @@ configuration can be used as a starting point: permalink: true ``` -[11]: http://localhost:8000 +[9]: https://github.com/squidfunk/mkdocs-material/blob/master/mkdocs.yml ### Feature flags @@ -243,6 +226,15 @@ Note that all *top-level pages* (i.e. all top-level entries that directly refer to an `*.md` file) defined inside the `nav` entry of `mkdocs.yml` will be grouped under the first tab which will receive the title of the first page. +This means that there will effectively be no collapsible subsections for the +first tab, as each subsection is rendered as another tab. If you want more +fine-grained control, i.e., collapsible subsections for the first tab, you can +move all *top-level pages into a subsection*, so that the top-level is entirely +made up of subsections. Note that tabs are only shown for larger screens, so +make sure that navigation is plausible on mobile devices. + +As an example, see the [`mkdocs.yml`][9] used to render these pages. + ### Language > Default: `en` @@ -299,7 +291,7 @@ The following language codes are supported:
  • nn / Norwegian (Nynorsk)
  • fa / Persian
  • pl / Polish
  • -
  • pt / Portugese
  • +
  • pt / Portuguese
  • ro / Romanian
  • ru / Russian
  • sr / Serbian
  • @@ -320,8 +312,8 @@ The following language codes are supported: While many languages are read `ltr` (left-to-right), Material for MkDocs also -supports `rtl` (right-to-left) directionality which is deduced from the selected -language, but can also be set with: +supports `rtl` (right-to-left) directionality which is inferred from the +selected language, but can also be set with: ``` yaml theme: @@ -330,7 +322,7 @@ theme: ### Color palette -The Material Design [color palette][12] comes with 20 hues, all of which are +The Material Design [color palette][10] comes with 20 hues, all of which are included with Material for MkDocs. Primary and accent colors can be set from the project root's `mkdocs.yml`: @@ -349,7 +341,7 @@ from the template. Material for MkDocs defines all colors as CSS variables. If you want to customize the colors beyond the palette (e.g. to use your brand's colors), - you can add an [additional stylesheet][13] and override the defaults: + you can add an [additional stylesheet][11] and override the defaults: ``` css :root { @@ -383,8 +375,8 @@ from the template. } ``` - [12]: http://www.materialui.co/colors - [13]: customization.md/#additional-stylesheets + [10]: http://www.materialui.co/colors + [11]: customization.md#additional-stylesheets #### Primary color @@ -404,9 +396,6 @@ Click on a color name to change the primary color of the theme: display: block; color: var(--md-primary-bg-color); background-color: var(--md-primary-fg-color); - box-shadow: - 0.2941176471em 0 0 var(--md-primary-fg-color), - -0.2941176471em 0 0 var(--md-primary-fg-color); } @@ -493,10 +482,10 @@ Click on a color name to change the accent color of the theme: > Default: `Roboto` and `Roboto Mono` -The [Roboto font family][14] is the default font included with the theme, +The [Roboto font family][12] is the default font included with the theme, specifically the regular sans-serif type for text and the `monospaced` type for -code. Both fonts are loaded from [Google Fonts][15] and can be changed to any -valid webfont, like for example the [Ubuntu font family][16]: +code. Both fonts are loaded from [Google Fonts][13] and can be changed to any +valid webfont, like for example the [Ubuntu font family][14]: ``` yaml theme: @@ -514,9 +503,9 @@ theme: font: false ``` - [14]: https://fonts.google.com/specimen/Roboto - [15]: https://fonts.google.com - [16]: https://fonts.google.com/specimen/Ubuntu + [12]: https://fonts.google.com/specimen/Roboto + [13]: https://fonts.google.com + [14]: https://fonts.google.com/specimen/Ubuntu ### Icons @@ -524,7 +513,7 @@ theme: Material for MkDocs uses icons in several places. Currently, the following icons can be changed from `mkdocs.yml`: the logo icon, the repository icon and the -[social link icons][17]. While the social link icons are tied to the respective +[social link icons][15]. While the social link icons are tied to the respective entries, the other icons can be changed by referencing a valid path (without the trailing `.svg`) relative to the `.icons` folder which comes with the theme: @@ -538,14 +527,18 @@ theme: All icons are directly inlined as `*.svg` files, so no further requests will be made. Icon sets which are bundled with Material for MkDocs: -* [Material Design icons][18]: 3.8k icons -* [FontAwesome icons][19]: 1.5k icons -* [GitHub octicons][20]: 200 icons +* [Material Design icons][16] (`material`): 3.8k icons +* [FontAwesome icons][17] (`fontawesome`): 1.5k icons +* [GitHub's Octicons][18] (`octicons`): 200 icons - [17]: #adding-social-links - [18]: https://material.io/resources/icons/ - [19]: https://fontawesome.com/icons?d=gallery&m=free - [20]: https://octicons.github.com/ +__You can use all those icons [directly from :fontawesome-brands-markdown: +Markdown][19]!__ + + [15]: #adding-social-links + [16]: https://material.io/resources/icons/ + [17]: https://fontawesome.com/icons?d=gallery&m=free + [18]: https://octicons.github.com/ + [19]: extensions/pymdown.md#icons ### Logo @@ -597,16 +590,16 @@ Note that the repository icon can be explicitly set through `theme.icon.repo`. If the `repo_url` is set to a GitHub or BitBucket repository, and the `repo_name` is set to *GitHub* or *BitBucket* (implied by default), an edit button will appear at the top of every article. This is the automatic - behavior that MkDocs implements. See the [MkDocs documentation][21] on more + behavior that MkDocs implements. See the [MkDocs documentation][20] on more guidance regarding the `edit_uri` attribute, which defines whether the edit button is shown or not. - [21]: https://www.mkdocs.org/user-guide/configuration/#edit_uri + [20]: https://www.mkdocs.org/user-guide/configuration/#edit_uri ### Adding social links Social accounts can be linked in the footer of the documentation using the -[icons][22] which are bundled with the theme. Note that each `icon` must point +[icons][21] which are bundled with the theme. Note that each `icon` must point to a valid path (without the trailing `.svg`) relative to the `.icons` folder which comes with the theme: @@ -621,11 +614,11 @@ extra: link: https://linkedin.com/in/squidfunk ``` - [22]: #icons + [21]: #icons ### Adding a Web App Manifest -A [Web App Manifest][23] is a simple JSON file that tells the browser about your +A [Web App Manifest][22] is a simple JSON file that tells the browser about your web application and how it should behave when installed on the user's mobile device or desktop. You can specify such a manifest in `mkdocs.yml`: @@ -634,15 +627,15 @@ extra: manifest: manifest.webmanifest ``` - [23]: https://developers.google.com/web/fundamentals/web-app-manifest/ + [22]: https://developers.google.com/web/fundamentals/web-app-manifest/ ## Integrations ### Google Analytics -MkDocs makes it easy to integrate site tracking with Google Analytics. Besides -basic page views, site search is tracked to better understand how people use -your documentation. Google Analytics can be activated with: +MkDocs makes it easy to integrate site tracking with Google Analytics. To enable +tracking, which is disabled by default, you must add your tracking identifier +to `mkdocs.yml`: ``` yaml google_analytics: @@ -650,11 +643,21 @@ google_analytics: - auto ``` +Besides basic page views, *site search* can also be tracked to better understand +how people use your documentation and what they expect to find. To enable +search tracking: + +1. Go to your Google Analytics **admin settings** +2. Select the property for the respective tracking code +3. Go to the **view settings** tab. +4. Scroll down and enable **site search settings** +5. Set the **query parameter** to `q`. + ### Disqus -Material for MkDocs is integrated with [Disqus][24], so if you want to add a -comments section to your documentation set the shortname of your Disqus project -in `mkdocs.yml`: +Material for MkDocs is integrated with [Disqus][23], so if you want to add a +comments section to your documentation set the *shortname* of your Disqus +project in `mkdocs.yml`: ``` yaml extra: @@ -669,10 +672,10 @@ necessary JavaScript is automatically included. Note that `site_url` must be set in `mkdocs.yml` for the Disqus integration to load properly. -Disqus can also be enabled or disabled for specific pages using [Metadata][25]. +Disqus can also be enabled or disabled for specific pages using [Metadata][24]. - [24]: https://disqus.com - [25]: extensions/metadata.md#disqus + [23]: https://disqus.com + [24]: extensions/metadata.md#disqus ## Extensions @@ -692,19 +695,19 @@ markdown_extensions: See the following list of extensions supported by Material for MkDocs including some more information on configuration and usage: -* [Admonition][26] -* [Codehilite][27] -* [Footnotes][28] -* [Metadata][29] -* [Permalinks][30] -* [PyMdown Extensions][31] +* [Admonition][25] +* [Codehilite][26] +* [Footnotes][27] +* [Metadata][28] +* [Permalinks][29] +* [PyMdown Extensions][30] - [26]: extensions/admonition.md - [27]: extensions/codehilite.md - [28]: extensions/footnotes.md - [29]: extensions/metadata.md - [30]: extensions/permalinks.md - [31]: extensions/pymdown.md + [25]: extensions/admonition.md + [26]: extensions/codehilite.md + [27]: extensions/footnotes.md + [28]: extensions/metadata.md + [29]: extensions/permalinks.md + [30]: extensions/pymdown.md ## Plugins @@ -713,14 +716,16 @@ steps that sit between the theme and your documentation. For more information, see the following list of plugins tested and supported by Material for MkDocs including more information regarding installation and usage: -* [Search][32] (enabled by default) -* [Minification][33] -* [Revision date][34] +* [Search][31] (enabled by default) +* [Minification][32] +* [Revision date][33] +* [Awesome pages][34] For further reference, the MkDocs wiki contains a list of all [available plugins][35]. - [32]: plugins/search.md - [33]: plugins/minification.md - [34]: plugins/revision-date.md + [31]: plugins/search.md + [32]: plugins/minification.md + [33]: plugins/revision-date.md + [34]: plugins/awesome-pages.md [35]: https://github.com/mkdocs/mkdocs/wiki/MkDocs-Plugins diff --git a/docs/index.md b/docs/index.md index a363caef9..ad49ab437 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,49 +1,4 @@ --- template: overrides/home.html +title: Material for MkDocs --- - -# Material for MkDocs - -## Create beautiful project documentation - -Material is a theme for [MkDocs][1], an excellent static site generator geared -towards project documentation. It is built using Google's [Material Design][2] -guidelines. - -[![Material for MkDocs](assets/images/material.png)](assets/images/material.png) - - [1]: https://www.mkdocs.org - [2]: https://material.io/design/ - -## Quick start - -Install the latest version of Material with `pip`: - -``` sh -pip install mkdocs-material -``` - -Add the following line to `mkdocs.yml`: - -``` yaml -theme: - name: material -``` - -## What to expect - -* Responsive design and fluid layout for all kinds of screens and devices, - designed to serve your project documentation in a user-friendly way in 41 - languages with optimal readability. - -* Easily customizable primary and accent color, fonts, favicon and logo; - straight forward localization through theme extension; integrated with Google - Analytics, Disqus and GitHub. - -* Well-designed search interface accessible through hotkeys (F or - S), intelligent grouping of search results, search term - highlighting and lazy loading. - -For detailed instructions see the [getting started guide][3]. - - [3]: getting-started.md diff --git a/docs/plugins/awesome-pages.md b/docs/plugins/awesome-pages.md index 4d6ae3969..297468e4b 100644 --- a/docs/plugins/awesome-pages.md +++ b/docs/plugins/awesome-pages.md @@ -1,3 +1,7 @@ +--- +template: overrides/main.html +--- + # Awesome pages The [mkdocs-awesome-pages-plugin][1] omits the need to specify all pages in the diff --git a/docs/plugins/minification.md b/docs/plugins/minification.md index 89c50aae1..37d16d57f 100644 --- a/docs/plugins/minification.md +++ b/docs/plugins/minification.md @@ -1,3 +1,7 @@ +--- +template: overrides/main.html +--- + # Minification The [mkdocs-minify-plugin][1] will minify all `*.html` files generated by diff --git a/docs/plugins/revision-date.md b/docs/plugins/revision-date.md index 84a60c84c..88cc5443b 100644 --- a/docs/plugins/revision-date.md +++ b/docs/plugins/revision-date.md @@ -1,3 +1,7 @@ +--- +template: overrides/main.html +--- + # Revision date The [mkdocs-git-revision-date-localized-plugin][1] will add the date on which a diff --git a/docs/plugins/search.md b/docs/plugins/search.md index fa5733f0c..1dd903162 100644 --- a/docs/plugins/search.md +++ b/docs/plugins/search.md @@ -1,3 +1,7 @@ +--- +template: overrides/main.html +--- + # Search The [built-in search plugin][1] provides client-side search inside the browser @@ -5,9 +9,19 @@ and is implemented using [lunr.js][2] which includes stemmers for the English language by default, while stemmers for other languages are included with [lunr-languages][3], both of which are integrated with this theme. +!!! tip "Make search work offline" + + While search will not work for the `file://` protocol, as web workers and + the use of `XMLHTTPRequest` are both blocked by modern browsers for security + reasons, the [localsearch][4] plugin and @squidfunk's [iframe-worker][5] + polyfill add support for cases where this is a mandatory requirement, e.g., + for offline use. + [1]: https://www.mkdocs.org/user-guide/configuration/#search [2]: https://lunrjs.com [3]: https://github.com/MihaiValentin/lunr-languages + [4]: https://github.com/wilhelmer/mkdocs-localsearch + [5]: https://github.com/squidfunk/iframe-worker ## Installation @@ -65,7 +79,7 @@ The following language codes are supported:
  • it / Italian
  • ja / Japanese
  • no / Norwegian
  • -
  • pt / Portugese
  • +
  • pt / Portuguese
  • ro / Romanian
  • ru / Russian
  • es / Spanish
  • @@ -91,14 +105,14 @@ index parts of words that are separated by `-` or `.`: ``` yaml plugins: - search: - separator: [\s\-\.]+ + separator: '[\s\-\.]+' ``` ### Prebuilding :hatching_chick: > Default: `false` -MkDocs can generate a [prebuilt index][4] of all pages during build time, which +MkDocs can generate a [prebuilt index][6] of all pages during build time, which provides performance improvements at the cost of more bandwidth. This may be beneficial for large documentation projects that are served with appropriate HTTP headers (e.g. `Content-Encoding: gzip`). @@ -112,7 +126,7 @@ plugins: prebuild_index: true ``` - [4]: https://www.mkdocs.org/user-guide/configuration/#prebuild_index + [6]: https://www.mkdocs.org/user-guide/configuration/#prebuild_index ## Usage diff --git a/docs/releases/4.md b/docs/releases/4.md index 16b156671..69a8aaa26 100644 --- a/docs/releases/4.md +++ b/docs/releases/4.md @@ -1,4 +1,8 @@ -# Material for MkDocs 4 +--- +template: overrides/main.html +--- + +# Upgrading to 4.x ## Highlights diff --git a/docs/releases/5.md b/docs/releases/5.md index c5d2f3774..720ff5c51 100644 --- a/docs/releases/5.md +++ b/docs/releases/5.md @@ -1,8 +1,12 @@ -# Material for MkDocs 5 +--- +template: overrides/main.html +--- + +# Upgrading to 5.x ## Highlights -* Reactive architecture – try `__material.dialog$.next("Hi!")` in the console +* Reactive architecture – try `app.dialog$.next("Hi!")` in the console * [Instant loading][5] – make Material behave like a Single Page Application * Improved CSS customization with [CSS variables][1] – set your brand's colors * Improved CSS resilience, e.g. proper sidebar locking for customized headers @@ -50,8 +54,8 @@ flags and can be enabled by listing them in `mkdocs.yml` under `theme.features`: tabs: true ``` - [4]: ../../../getting-started/#tabs - [5]: ../../../getting-started/#instant-loading + [4]: ../../getting-started/#tabs + [5]: ../../getting-started/#instant-loading #### `theme.logo.icon` @@ -66,7 +70,7 @@ be set to any of the [icons bundled with the theme][6]: logo: material/cloud ``` - [6]: ../../../getting-started/#icons + [6]: ../../getting-started/#icons === "4.x" @@ -107,7 +111,7 @@ was renamed to `separator`: ``` yaml plugins: - search: - separator: [\s\-\.]+ + separator: '[\s\-\.]+' lang: - en - de @@ -123,7 +127,7 @@ was renamed to `separator`: tokenizer: [\s\-\.]+ ``` - [7]: ../../../plugins/search/#configuration + [7]: ../../plugins/search/#configuration #### `extra.social.*` @@ -187,7 +191,7 @@ matches the new structure: - - {% endfor %} - + {% endblock %} @@ -56,9 +42,9 @@ {% endif %} @@ -221,7 +225,7 @@ matches the new structure: {% if config.extra.manifest %} {% endif %} -@@ -95,47 +78,46 @@ +@@ -95,47 +77,50 @@ {% endblock %} {% block extrahead %}{% endblock %} @@ -251,20 +255,23 @@ matches the new structure: - + - {% if page.toc | first is defined %} -- -+ {% set skip = page.toc | first %} -+ - {{ lang.t('skip.link.title') }} - - {% endif %} -+ {% if self.announce() %} -+ -+ {% endif %} ++
    ++ {% if page.toc | first is defined %} ++ {% set skip = page.toc | first %} ++ ++ {{ lang.t('skip.link.title') }} ++ ++ {% endif %} ++
    ++
    ++ {% if self.announce() %} ++ ++ {% endif %} ++
    {% block header %} {% include "partials/header.html" %} {% endblock %} @@ -290,7 +297,7 @@ matches the new structure: {% block site_nav %} {% if nav %}
    -@@ -160,41 +142,25 @@ +@@ -160,41 +141,25 @@
    {% block content %} {% if page.edit_url %} @@ -345,15 +352,12 @@ matches the new structure: {% endif %} {% endblock %} {% block disqus %} -@@ -208,29 +174,40 @@ +@@ -208,29 +174,35 @@ {% include "partials/footer.html" %} {% endblock %}
    -+ {% block config %} -+ -+ {% endblock %} {% block scripts %} -- +- - {% if lang.t("search.language") != "en" %} - {% set languages = lang.t("search.language").split(",") %} - {% if languages | length and languages[0] != "" %} @@ -375,8 +379,8 @@ matches the new structure: - {% endif %} - {% endif %} - -+ -+ ++ ++ + {%- set translations = {} -%} + {%- for key in [ + "clipboard.copy", @@ -392,18 +396,17 @@ matches the new structure: + {%- set _ = translations.update({ key: lang.t(key) }) -%} + {%- endfor -%} + ++ {% block config %}{% endblock %} + {% for path in config["extra_javascript"] %} @@ -464,7 +467,7 @@ matches the new structure: #### `partials/header.html` ``` diff -@@ -2,51 +2,46 @@ +@@ -2,51 +2,43 @@ This file was automatically generated - do not edit -#}
    @@ -485,24 +488,7 @@ matches the new structure: -
    -
    - {% if config.site_name == page.title %} -+
    - {% block config %} - - {% endblock %} {% block scripts %} - - + + {%- set translations = {} -%} {%- for key in [ "clipboard.copy", @@ -194,18 +195,17 @@ {%- set _ = translations.update({ key: lang.t(key) }) -%} {%- endfor -%} + {% block config %}{% endblock %} {% for path in config["extra_javascript"] %} diff --git a/material/overrides/home.html b/material/overrides/home.html index 9a7929d9f..b2e4cb1ff 100644 --- a/material/overrides/home.html +++ b/material/overrides/home.html @@ -1,7 +1,29 @@ {#- This file was automatically generated - do not edit -#} -{% extends "base.html" %} -{% block announce %} - Material for MkDocs 5.0.0rc3 +{% extends "overrides/main.html" %} +{% block tabs %} + {{ super() }} + +
    +
    +
    +
    + +
    +
    +

    Technical documentation that just works

    +

    {{ config.site_description }}. Set up in 5 minutes.

    + + Get started + + + Go to GitHub + +
    +
    +
    +
    {% endblock %} +{% block content %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/material/overrides/main.html b/material/overrides/main.html new file mode 100644 index 000000000..4e9fbe620 --- /dev/null +++ b/material/overrides/main.html @@ -0,0 +1,37 @@ +{#- + This file was automatically generated - do not edit +-#} +{% extends "base.html" %} +{% block extrahead %} + {% set title = config.site_name %} + {% if page and page.title and not page.is_homepage %} + {% set title = config.site_name ~ " - " ~ page.title | striptags %} + {% endif %} + {% set image = config.site_url ~ 'assets/images/banner.png' %} + + + + + + + + + + + + + + +{% endblock %} +{% block announce %} + + + For updates follow @squidfunk on + + Twitter + +{% endblock %} diff --git a/material/partials/footer.html b/material/partials/footer.html index 6ad9de799..728ccec9b 100644 --- a/material/partials/footer.html +++ b/material/partials/footer.html @@ -47,11 +47,7 @@ {{ config.copyright }}
    {% endif %} - powered by - - MkDocs - - and + Made with Material for MkDocs diff --git a/material/partials/header.html b/material/partials/header.html index 25d5553d7..cbf782e47 100644 --- a/material/partials/header.html +++ b/material/partials/header.html @@ -4,38 +4,31 @@