Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: squidfunk/mkdocs-material
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9.4.1
Choose a base ref
...
head repository: squidfunk/mkdocs-material
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9.4.2
Choose a head ref

Commits on Jul 22, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    405dfce View commit details

Commits on Aug 1, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5e64e92 View commit details

Commits on Sep 22, 2023

  1. 1
    Copy the full SHA
    50c273c View commit details
  2. 1
    Copy the full SHA
    7d0f759 View commit details
  3. 1
    Copy the full SHA
    433c137 View commit details
  4. Copy the full SHA
    a3b619f View commit details
  5. 1
    Copy the full SHA
    c23fbdf View commit details
  6. 1
    Copy the full SHA
    74d4b3b View commit details
  7. 1
    Copy the full SHA
    76a995e View commit details
  8. 1
    Copy the full SHA
    b367f40 View commit details
  9. 1
    Copy the full SHA
    7bde9e7 View commit details
  10. 1
    Copy the full SHA
    4840c2d View commit details
  11. 1
    Copy the full SHA
    acb803f View commit details
  12. 1
    Copy the full SHA
    96ccea5 View commit details
  13. 1
    Copy the full SHA
    ade1fe9 View commit details
  14. 1
    Copy the full SHA
    188d395 View commit details
  15. 1
    Copy the full SHA
    159b28c View commit details
  16. 1
    Copy the full SHA
    97e2e84 View commit details
  17. 1
    Copy the full SHA
    8fa269b View commit details
  18. 1
    Copy the full SHA
    64827f4 View commit details
  19. Test caching of deps in CI

    squidfunk committed Sep 22, 2023
    1
    Copy the full SHA
    adc59ca View commit details
  20. 1
    Copy the full SHA
    466b386 View commit details
  21. 1
    Copy the full SHA
    d3d8964 View commit details
  22. 1
    Copy the full SHA
    b276146 View commit details
  23. Documentation

    squidfunk committed Sep 22, 2023
    1
    Copy the full SHA
    950d1e4 View commit details

Commits on Sep 23, 2023

  1. 1
    Copy the full SHA
    b1ee79b View commit details
  2. 1
    Copy the full SHA
    11b1c55 View commit details
  3. 1
    Copy the full SHA
    62bd70a View commit details
  4. 1
    Copy the full SHA
    208ac1a View commit details
  5. 1
    Copy the full SHA
    8e019d2 View commit details
  6. Updated distribution files

    squidfunk committed Sep 23, 2023
    1
    Copy the full SHA
    e6f9b0f View commit details
  7. Copy the full SHA
    3baf74f View commit details
  8. Fixed linter errors

    squidfunk committed Sep 23, 2023
    1
    Copy the full SHA
    9dd7511 View commit details
  9. 1
    Copy the full SHA
    521f727 View commit details
  10. 1
    Copy the full SHA
    3fbcb3e View commit details
  11. 1
    Copy the full SHA
    8a1244e View commit details
  12. 1
    Copy the full SHA
    e08d047 View commit details
  13. Added Slovenian translations

    Co-authored-by: dkalsan <25985498+dkalsan@users.noreply.github.com>
    squidfunk and dkalsan committed Sep 23, 2023
    1
    Copy the full SHA
    ef30cfe View commit details
  14. 1
    Copy the full SHA
    7e6f15b View commit details
  15. Copy the full SHA
    15538b0 View commit details

Commits on Sep 24, 2023

  1. Copy the full SHA
    639dbac View commit details
  2. Merge pull request #5743 from squidfunk/fix/instant-loading

    Improve support for instant loading with keyboard navigation
    squidfunk authored Sep 24, 2023
    Copy the full SHA
    da57083 View commit details
  3. 1
    Copy the full SHA
    43b5baf View commit details
  4. Copy the full SHA
    59d3b33 View commit details

Commits on Sep 25, 2023

  1. Updated dependencies

    squidfunk committed Sep 25, 2023
    Copy the full SHA
    0e104c1 View commit details
  2. Prepare 9.4.2 release

    squidfunk committed Sep 25, 2023
    Copy the full SHA
    0e27596 View commit details
Showing with 864 additions and 502 deletions.
  1. +32 −5 .github/workflows/build.yml
  2. +37 −17 .github/workflows/documentation.yml
  3. +21 −0 CHANGELOG
  4. +100 −0 docs/blog/posts/git-sparse-checkout.md
  5. +21 −0 docs/changelog/index.md
  6. +6 −0 docs/schema/assets/icons.json
  7. +1 −1 material/__init__.py
  8. +2 −0 material/extensions/emoji.py
  9. +3 −3 material/overrides/assets/javascripts/{custom.4eda089e.min.js → custom.a4bbca43.min.js}
  10. +4 −4 material/overrides/assets/javascripts/{custom.4eda089e.min.js.map → custom.a4bbca43.min.js.map}
  11. +1 −1 material/overrides/assets/javascripts/iconsearch_index.json
  12. +2 −2 material/overrides/hooks/translations.py
  13. +1 −1 material/overrides/main.html
  14. +24 −35 material/plugins/blog/plugin.py
  15. +1 −0 material/templates/.icons/octicons/filter-remove-16.svg
  16. +1 −0 material/templates/.icons/octicons/filter-remove-24.svg
  17. +1 −1 material/templates/.icons/simple/aboutdotme.svg
  18. +1 −0 material/templates/.icons/simple/adventofcode.svg
  19. +1 −0 material/templates/.icons/simple/autodeskrevit.svg
  20. +1 −0 material/templates/.icons/simple/dependencycheck.svg
  21. +1 −1 material/templates/.icons/simple/homeassistant.svg
  22. +1 −0 material/templates/.icons/simple/mockserviceworker.svg
  23. +1 −1 material/templates/.icons/simple/paypal.svg
  24. +0 −29 material/templates/assets/javascripts/bundle.4e0fa4ba.min.js
  25. +0 −8 material/templates/assets/javascripts/bundle.4e0fa4ba.min.js.map
  26. +29 −0 material/templates/assets/javascripts/bundle.726fbb30.min.js
  27. +8 −0 material/templates/assets/javascripts/bundle.726fbb30.min.js.map
  28. +0 −1 material/templates/assets/stylesheets/main.72749a73.min.css.map
  29. +1 −1 material/templates/assets/stylesheets/{main.72749a73.min.css → main.d451bc0e.min.css}
  30. +1 −0 material/templates/assets/stylesheets/main.d451bc0e.min.css.map
  31. +3 −3 material/templates/base.html
  32. +56 −52 material/templates/blog-post.html
  33. +2 −2 material/templates/partials/footer.html
  34. +1 −0 material/templates/partials/languages/sl.html
  35. +12 −10 material/templates/partials/nav-item.html
  36. +83 −83 package-lock.json
  37. +9 −9 package.json
  38. +1 −1 requirements.txt
  39. +2 −0 src/extensions/emoji.py
  40. +2 −2 src/overrides/hooks/translations.py
  41. +24 −35 src/plugins/blog/plugin.py
  42. +1 −1 src/templates/assets/javascripts/_/index.ts
  43. +27 −3 src/templates/assets/javascripts/browser/location/_/index.ts
  44. +3 −3 src/templates/assets/javascripts/bundle.ts
  45. +1 −1 src/templates/assets/javascripts/components/announce/index.ts
  46. +1 −1 src/templates/assets/javascripts/components/search/query/index.ts
  47. +3 −0 src/templates/assets/javascripts/components/sidebar/index.ts
  48. +101 −30 src/templates/assets/javascripts/integrations/instant/index.ts
  49. +1 −1 src/templates/assets/javascripts/integrations/sitemap/index.ts
  50. +4 −4 src/templates/assets/javascripts/integrations/version/index.ts
  51. +125 −71 src/templates/assets/stylesheets/main/components/_nav.scss
  52. +8 −3 src/templates/assets/stylesheets/main/components/_post.scss
  53. +0 −1 src/templates/assets/stylesheets/main/components/_status.scss
  54. +72 −62 src/templates/blog-post.html
  55. +0 −2 src/templates/partials/footer.html
  56. +1 −0 src/templates/partials/languages/sl.html
  57. +18 −11 src/templates/partials/nav-item.html
37 changes: 32 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ permissions:
contents: read

jobs:
npm:
npm-build:
runs-on: ubuntu-latest
steps:

@@ -59,15 +59,38 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: npm install

- name: Check project
run: npm run check

- name: Build project
run: |
npm run build
git diff --name-only
pypi:
npm-check:
runs-on: ubuntu-latest
steps:

- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js runtime
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Set up Node.js dependency cache
uses: actions/cache@v3
id: cache
with:
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
path: node_modules

- name: Set up Node.js dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm install

- name: Check project
run: npm run check

python:
runs-on: ubuntu-latest
steps:

@@ -78,6 +101,10 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.txt
- name: Set up Python dependencies
run: pip install --upgrade build twine
54 changes: 37 additions & 17 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@ env:

permissions:
contents: write
id-token: write
pages: write

jobs:
documentation:
@@ -40,20 +42,25 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
docs
includes
material/overrides
src/templates/partials/languages
- name: Set up Python runtime
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set the date environmental variable
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
cache: pip
cache-dependency-path: |
pyproject.toml
requirements.txt
- name: Set up build cache
uses: actions/cache@v3
id: cache
uses: actions/cache/restore@v3
with:
key: mkdocs-material-${{ env.cache_id }}
key: mkdocs-material-${{ hashfiles('.cache/**') }}
path: .cache
restore-keys: |
mkdocs-material-
@@ -63,15 +70,8 @@ jobs:

- name: Install Python dependencies
run: |
pip install \
"cairosvg>=2.5" \
"mkdocs-git-committers-plugin-2>=1.1.1" \
"mkdocs-git-revision-date-localized-plugin>=1.0" \
"mkdocs-minify-plugin>=0.3" \
"mkdocs-rss-plugin>=1.2" \
"mkdocs-redirects>=1.0" \
"lxml" \
"pillow<10"
pip install mkdocs-material
pip install mkdocs-material[recommended,git,imaging]
- name: Install Insiders build
if: github.event.repository.fork == false
@@ -88,10 +88,30 @@ jobs:
rm -rf material
cp -r mkdocs-material-insiders/material material
- name: Deploy documentation
- name: Build documentation
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
run: |
mkdocs gh-deploy --force
mkdocs build --clean
mkdocs --version
- name: Adjust permissions
run: |
chmod -c -R +rX site/ | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload to GitHub Pages
uses: actions/upload-pages-artifact@v2
with:
path: site

- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2

- name: Save build cache
uses: actions/cache/save@v3
with:
key: mkdocs-material-${{ hashfiles('.cache/**') }}
path: .cache
21 changes: 21 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
mkdocs-material-9.4.2 (2023-09-25)

* Updated Slovenian translations
* Added animation to sidebar navigation expansion and collapse
* Added support for auto-replacement of document head for instant navigation
* Improved compatibility of new emoji extension with Python < 3.10
* Switched regex dependency to use minimal version
* Refactored alignment and spacing of sidebar navigation
* Fixed expansion button not focusable via keyboard in sidebar navigation
* Fixed viewport offset restoration on first load when using instant navigation
* Fixed accidental highlight of non-clickable elements in blog plugin sidebar
* Fixed #6041: Blog plugin crashes when nav is defined and blog not included
* Fixed #5972: Blog plugin ignores section index pages in paginated views
* Fixed #5954: Repeated click on anchor ignored when using instant navigation
* Fixed #5742: Keyboard navigation broken when using instant navigation

Updated templates

* partials/nav-item.html
* blog-post.html

mkdocs-material-9.4.1 (2023-09-22)

* Improved colors and contrast in dark mode
100 changes: 100 additions & 0 deletions docs/blog/posts/git-sparse-checkout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
date: 2023-09-22
authors: [squidfunk]
categories:
- Build
- Performance
links:
- publishing-your-site.md#with-github-actions
- creating-your-site.md#building-your-site
---

# Using `git sparse-checkout` for faster documentation builds

__Leveraging `git sparse-checkout` in GitHub Actions enabled us to speed up
documentation builds in our repository, cutting checkout times from 20 to 30
seconds to just 2 seconds.__

Developing an efficient approach to build documentation in CI workflows is
essential, especially when working in large repositories with thousands of
commits, like ours. Of course, we want to build documentation quickly and
efficiently, ensuring fast and productive workflows. When using both the
wonderful [`git-committers`][git-committers] and [`git-revision-date-localized`]
[git-revision-date-localized] plugins to display [document contributors] and
[dates] at the bottom of each page, we are required to set `fetch-depth: 0`,
which resulted in checkout times of 20 to 30 seconds on our repository. By
leveraging [`git sparse-checkout`][git sparse-checkout] within [GitHub Actions],
check out time was brought down to 2 seconds.

[git sparse-checkout]: https://git-scm.com/docs/git-sparse-checkout
[GitHub Actions]: ../../publishing-your-site.md#with-github-actions
[git-revision-date-localized]: https://github.com/timvink/mkdocs-git-revision-date-localized-plugin
[git-committers]: https://github.com/ojacques/mkdocs-git-committers-plugin-2
[document contributors]: ../../setup/adding-a-git-repository.md#document-contributors
[dates]: ../../setup/adding-a-git-repository.md#document-dates

<!-- more -->

## A Primer

[`git sparse-checkout`][git sparse-checkout] allows you to check out only a
subset of the files in a repository, making it incredibly useful for large
repositories where a full checkout takes long and includes many files that are
not relevant when building documentation.

## GitHub Actions

To enable [`git sparse-checkout`][git sparse-checkout] within [GitHub Actions]
and ensure that you are only building the documentation that you need, add the
following lines to your workflow file:

``` yaml
- uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
docs
includes
```
[`git sparse-checkout`][git sparse-checkout] always checks out all files
residing in the repository’s root. This means that regardless of the specified
paths or directories for sparse checkout, the files located in the root of the
repository will always be included in the checkout process.

Thus, you only need to specify the directories that are necessary for building
documentation. In our case, we only need the `docs` and `includes` folders,
but if you need additional directories, you can just add them to the end of the
list. A complete example workflow for [GitHub Actions]:

``` yaml hl_lines="13-18"
name: documentation
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: |
docs
includes
- uses: actions/setup-python@v4
with:
python-version: 3.x
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
```

## Conclusion

That's all there is! We're super happy with the results and hope that this will
help you to speed up your documentation builds in [GitHub Actions] as well. As
always, feel free to share your thoughts and experiences in the comments below.
21 changes: 21 additions & 0 deletions docs/changelog/index.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,27 @@

## Material for MkDocs

### 9.4.2 <small>September 25, 2023</small> { id="9.4.2" }

- Updated Slovenian translations
- Added animation to sidebar navigation expansion and collapse
- Added support for auto-replacement of document head for instant navigation
- Improved compatibility of new emoji extension with Python < 3.10
- Switched regex dependency to use minimal version
- Refactored alignment and spacing of sidebar navigation
- Fixed expansion button not focusable via keyboard in sidebar navigation
- Fixed viewport offset restoration on first load when using instant navigation
- Fixed accidental highlight of non-clickable elements in blog plugin sidebar
- Fixed #6041: Blog plugin crashes when `nav` is defined and blog not included
- Fixed #5972: Blog plugin ignores section index pages in paginated views
- Fixed #5954: Repeated click on anchor ignored when using instant navigation
- Fixed #5742: Keyboard navigation broken when using instant navigation

__Updated templates__ ([diff](https://github.com/squidfunk/mkdocs-material/compare/9.4.1...master))

- `partials/nav-item.html`
- `blog-post.html`

### 9.4.1 <small>September 22, 2023</small> { id="9.4.1" }

- Improved colors and contrast in dark mode
6 changes: 6 additions & 0 deletions docs/schema/assets/icons.json
Original file line number Diff line number Diff line change
@@ -9552,6 +9552,8 @@
"octicons/file-zip-24",
"octicons/filter-16",
"octicons/filter-24",
"octicons/filter-remove-16",
"octicons/filter-remove-24",
"octicons/fiscal-host-16",
"octicons/flame-16",
"octicons/flame-24",
@@ -9974,6 +9976,7 @@
"simple/adonisjs",
"simple/adp",
"simple/adroll",
"simple/adventofcode",
"simple/adyen",
"simple/aerlingus",
"simple/aeroflot",
@@ -10173,6 +10176,7 @@
"simple/authelia",
"simple/authy",
"simple/autodesk",
"simple/autodeskrevit",
"simple/autohotkey",
"simple/automattic",
"simple/autoprefixer",
@@ -10540,6 +10544,7 @@
"simple/deno",
"simple/denon",
"simple/dependabot",
"simple/dependencycheck",
"simple/derspiegel",
"simple/designernews",
"simple/deutschebahn",
@@ -11434,6 +11439,7 @@
"simple/mobx",
"simple/mobxstatetree",
"simple/mocha",
"simple/mockserviceworker",
"simple/modin",
"simple/modrinth",
"simple/modx",
2 changes: 1 addition & 1 deletion material/__init__.py
Original file line number Diff line number Diff line change
@@ -18,4 +18,4 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

__version__ = "9.4.1"
__version__ = "9.4.2"
2 changes: 2 additions & 0 deletions material/extensions/emoji.py
Original file line number Diff line number Diff line change
@@ -18,6 +18,8 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

from __future__ import annotations

import codecs
import functools
import material
Loading