Skip to content

Commit fdf8362

Browse files
committed
Merge remote-tracking branch 'upstream/master'
# Conflicts: # src/plugins/social/plugin.py
2 parents 7a77935 + facfa5c commit fdf8362

File tree

119 files changed

+3327
-1592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+3327
-1592
lines changed

.devcontainer/devcontainer.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "Material for MkDocs - VS Code dev container",
3+
"image": "mcr.microsoft.com/devcontainers/typescript-node:0-18",
4+
"features": {
5+
"ghcr.io/devcontainers/features/python:1": {
6+
"installTools": true,
7+
"version": "3.11"
8+
}
9+
},
10+
"postCreateCommand": "pip install -e . && pip install mkdocs-minify-plugin mkdocs-redirects && npm install && npm run build"
11+
}

.github/workflows/build.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929
- published
3030

3131
env:
32-
NODE_VERSION: 14.x
32+
NODE_VERSION: 18.x
3333
PYTHON_VERSION: 3.x
3434

3535
permissions:
@@ -144,9 +144,11 @@ jobs:
144144

145145
- name: Check Docker image
146146
working-directory: /tmp
147+
env:
148+
REPO_FULL_NAME: '${{ github.event.repository.full_name }}'
147149
run: |
148-
docker run --rm -i -v ${PWD}:/docs ${{ github.event.repository.full_name }}:${{ steps.meta.outputs.version }} new .
149-
docker run --rm -i -v ${PWD}:/docs ${{ github.event.repository.full_name }}:${{ steps.meta.outputs.version }} build
150+
docker run --rm -i -v ${PWD}:/docs ${REPO_FULL_NAME,,}:${{ steps.meta.outputs.version }} new .
151+
docker run --rm -i -v ${PWD}:/docs ${REPO_FULL_NAME,,}:${{ steps.meta.outputs.version }} build
150152
151153
- name: Set platforms
152154
if: github.event_name == 'release'

.github/workflows/documentation.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,17 @@ jobs:
4646
with:
4747
python-version: ${{ env.PYTHON_VERSION }}
4848

49+
- name: Set the date environmental variable
50+
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
51+
4952
- name: Set up build cache
5053
uses: actions/cache@v3
5154
id: cache
5255
with:
53-
key: ${{ runner.os }}-${{ hashFiles('.cache/**') }}
56+
key: mkdocs-material-${{ env.cache_id }}
5457
path: .cache
58+
restore-keys: |
59+
mkdocs-material-
5560
5661
- name: Install dependencies
5762
run: sudo apt-get install pngquant

.vscode/settings.json

-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,5 @@
1717
"tag:yaml.org,2002:python/name:materialx.emoji.to_svg",
1818
"tag:yaml.org,2002:python/name:materialx.emoji.twemoji",
1919
"tag:yaml.org,2002:python/name:pymdownx.superfences.fence_code_format"
20-
],
21-
"cSpell.words": [
22-
"mkdocs"
2320
]
2421
}

CHANGELOG

+57-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,68 @@
1+
mkdocs-material-9.1.12+insiders-4.34.0 (2023-05-14)
2+
3+
* Added support for new overflow mode to auto-fit text in social plugin
4+
* Reduced subtle rendering bugs in (code) annotations due to subpixel rounding
5+
* Improved print styles for (code) annotation lists
6+
* Improved performance of social plugin, now 3x as fast
7+
* Improved interop of typeset plugin with MkDocstrings
8+
* Fixed logo location for variants of default template in social plugin
9+
* Fixed #5446: Built-in typeset plugin picks up headings in code blocks
10+
11+
mkdocs-material-9.1.12+insiders-4.33.2 (2023-05-12)
12+
13+
* Fixed #5508: Social plugin crashes trying to copy cards on Docker/Windows
14+
* Fixed #5507: Social plugin crashes on serve when layouts folder doesn't exist
15+
* Fixed #5505: Social plugin trying to resolve logo in wrong location
16+
* Fixed #5496: Annotations with nested lists incorrectly mounted
17+
* Fixed #5493: Social plugin crashes on Python 3.8
18+
19+
mkdocs-material-9.1.12 (2023-05-12)
20+
21+
* Updated Bengali (Bangla) translations
22+
* Fixed #5503: Docker image publish errors on uppercase characters
23+
* Fixed #5407: Auto-pause media when in hidden content tabs
24+
25+
mkdocs-material-9.1.11+insiders-4.33.1 (2023-05-09)
26+
27+
* Added support for SVG background images in social plugin
28+
29+
mkdocs-material-9.1.11 (2023-05-08)
30+
31+
* Fixed #5487: Social plugin crashes without options (9.1.10 regression)
32+
33+
mkdocs-material-9.1.10+insiders-4.33.0 (2023-05-08)
34+
35+
* Added support for custom layouts for social plugin
36+
* Added support for background images for social cards
37+
38+
mkdocs-material-9.1.10 (2023-05-08)
39+
40+
* Added cards_layout_options setting for social cards
41+
* Deprecated cards_color and cards_font setting for social cards
42+
43+
mkdocs-material-9.1.9 (2023-05-02)
44+
45+
* Added Telugu, Kannada and Sanskrit translations
46+
* Fixed #5428: Fixed margins for light/dark mode images in figures
47+
* Fixed #5420: Social plugin crashing for some specific Google Fonts
48+
* Fixed #5160: Instant loading makes code annotations jump (9.1.1 regression)
49+
* Fixed #4920: Social plugin not loading logo from custom icon set
50+
* Fixed social plugin crashing when only code font is specified
51+
152
mkdocs-material-9.1.8 (2023-04-24)
253

3-
- Fixed #5417: Theme breaks when palette is not defined (9.1.7 regression)
54+
* Fixed #5417: Theme breaks when palette is not defined (9.1.7 regression)
455

556
mkdocs-material-9.1.7+insiders-4.32.6 (2023-04-22)
657

7-
- Fixed #5336: Interplay of blog plugin with git-revision-date-localized
58+
* Fixed #5336: Interplay of blog plugin with git-revision-date-localized
859

960
mkdocs-material-9.1.7 (2023-04-22)
1061

11-
- Updated Persian (Farsi) and Turkish translations
12-
- Fixed #5401: Added missing flag to disable built-in tags plugin
13-
- Fixed #5206: Ensure defaults are set for primary and accent colors
14-
- Fixed unnecessary inclusion of palette CSS when unused
62+
* Updated Persian (Farsi) and Turkish translations
63+
* Fixed #5401: Added missing flag to disable built-in tags plugin
64+
* Fixed #5206: Ensure defaults are set for primary and accent colors
65+
* Fixed unnecessary inclusion of palette CSS when unused
1566

1667
mkdocs-material-9.1.6+insiders-4.32.5 (2023-04-07)
1768

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ it is:
4242

4343
### Missing translations?
4444

45-
Material for MkDocs supports 50+ languages with the help of community
45+
Material for MkDocs supports 60+ languages with the help of community
4646
contributions. When new features are added, sometimes, new translations are
4747
necessary as well. It's impossible for the maintainers of the project to update
48-
all translations (we just don't speak 50+ languages), so we have to rely on
48+
all translations (we just don't speak 60+ languages), so we have to rely on
4949
our contributors to update translations incrementally. This process is pretty
5050
simple, so if you find a translation missing in your language, follow these
5151
guidelines:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<p align="center">
4040
Write your documentation in Markdown and create a professional static site for
4141
your Open Source or commercial project in minutes – searchable, customizable,
42-
more than 50 languages, for all devices.
42+
more than 60 languages, for all devices.
4343
</p>
4444

4545
<p align="center">
28.4 KB
Loading
39.9 KB
Loading
32.4 KB
Loading
Loading
5.79 KB
Loading
3.87 KB
Loading
6.85 KB
Loading
7.38 KB
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
32.8 KB
Loading
-13.8 KB
Loading

docs/changelog/index.md

+24
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22

33
## Material for MkDocs
44

5+
### 9.1.12 <small>May 12, 2023</small> { id="9.1.12" }
6+
7+
- Updated Bengali (Bangla) translations
8+
- Fixed #5503: Docker image publish errors on uppercase characters
9+
- Fixed #5407: Auto-pause media when in hidden content tabs
10+
11+
### 9.1.11 <small>May 8, 2023</small> { id="9.1.11" }
12+
13+
- Fixed #5487: Social plugin crashes without options (9.1.10 regression)
14+
15+
### 9.1.10 <small>May 8, 2023</small> { id="9.1.10" }
16+
17+
- Added `cards_layout_options` setting for social cards
18+
- Deprecated `cards_color` and `cards_font` setting for social cards
19+
20+
### 9.1.9 <small>May 2, 2023</small> { id="9.1.9" }
21+
22+
- Added Telugu, Kannada and Sanskrit translations
23+
- Fixed #5428: Fixed margins for light/dark mode images in figures
24+
- Fixed #5420: Social plugin crashing for some specific Google Fonts
25+
- Fixed #5160: Instant loading makes code annotations jump (9.1.1 regression)
26+
- Fixed #4920: Social plugin not loading logo from custom icon set
27+
- Fixed social plugin crashing when only code font is specified
28+
529
### 9.1.8 <small>April 24, 2023</small> { id="9.1.8" }
630

731
- Fixed #5417: Theme breaks when `palette` is not defined (9.1.7 regression)

docs/getting-started.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ install those packages separately.
6161

6262
:fontawesome-brands-youtube:{ style="color: #EE0F0F" }
6363
__[How to set up Material for MkDocs]__ by @james-willett – :octicons-clock-24:
64-
15m – Learn how to create and host a documentation site using Material for Docs
65-
on GitHub Pages in a step-by-step guide.
64+
15m – Learn how to create and host a documentation site using Material for
65+
MkDocs on GitHub Pages in a step-by-step guide.
6666

6767
[How to set up Material for MkDocs]: https://www.youtube.com/watch?v=Q-YA_dA8C20
6868

docs/insiders/changelog.md

+27
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,33 @@
22

33
## Material for MkDocs Insiders
44

5+
### 4.34.0 <small>May 14, 2023</small> { id="4.34.0" }
6+
7+
- Added support for new overflow mode to auto-fit text in social plugin
8+
- Reduced subtle rendering bugs in (code) annotations due to subpixel rounding
9+
- Improved print styles for (code) annotation lists
10+
- Improved performance of social plugin, now 3x as fast
11+
- Improved interop of typeset plugin with MkDocstrings
12+
- Fixed logo location for variants of default template in social plugin
13+
- Fixed #5446: Built-in typeset plugin picks up headings in code blocks
14+
15+
### 4.33.2 <small>May 12, 2023</small> { id="4.33.2" }
16+
17+
- Fixed #5508: Social plugin crashes trying to copy cards on Docker/Windows
18+
- Fixed #5507: Social plugin crashes on serve when layouts folder doesn't exist
19+
- Fixed #5505: Social plugin trying to resolve logo in wrong location
20+
- Fixed #5496: Annotations with nested lists incorrectly mounted
21+
- Fixed #5493: Social plugin crashes on Python 3.8
22+
23+
### 4.33.1 <small>May 9, 2023</small> { id="4.33.1" }
24+
25+
- Added support for SVG background images in social plugin
26+
27+
### 4.33.0 <small>May 8, 2023</small> { id="4.33.0" }
28+
29+
- Added support for custom layouts for social plugin
30+
- Added support for background images for social cards
31+
532
### 4.32.6 <small>April 22, 2023</small> { id="4.32.6" }
633

734
- Fixed #5336: Interplay of blog plugin with git-revision-date-localized

docs/insiders/index.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,16 @@ a handful of them, [thanks to our awesome sponsors]!
8888
## What's in it for me?
8989

9090
The moment you [become a sponsor][how to become a sponsor], you'll get __immediate
91-
access to 25 additional features__ that you can start using right away, and
91+
access to 27 additional features__ that you can start using right away, and
9292
which are currently exclusively available to sponsors:
9393

9494
<div class="mdx-columns" markdown>
9595

96+
- [x] [Social plugin: custom layouts] :material-alert-decagram:{ .mdx-pulse title="Added on May 8, 2023" }
97+
- [x] [Social plugin: background images] :material-alert-decagram:{ .mdx-pulse title="Added on May 8, 2023" }
9698
- [x] [Code range selection] :material-alert-decagram:{ .mdx-pulse title="Added on February 19, 2023" }
97-
- [x] [Code annotations: custom selectors] :material-alert-decagram:{ .mdx-pulse title="Added on February 19, 2023" }
98-
- [x] [Privacy plugin: optimization support] :material-alert-decagram:{ .mdx-pulse title="Added on February 6, 2023" }
99+
- [x] [Code annotations: custom selectors]
100+
- [x] [Privacy plugin: optimization support]
99101
- [x] [Optimize plugin]
100102
- [x] [Navigation path] (Breadcrumbs)
101103
- [x] [Typeset plugin]
@@ -256,10 +258,6 @@ features prefixed with a checkmark symbol, denoting whether a feature is
256258
:octicons-check-circle-fill-24:{ style="color: var(--md-default-fg-color--lightest)" } planned, but not yet implemented. When the funding goal is hit, the features
257259
are released for general availability.
258260

259-
> [In February, we lost $1,3k in monthly funding because GitHub removed PayPal support][Twitter]
260-
261-
[Twitter]: https://twitter.com/squidfunk/status/1643539228574269443
262-
263261
#### $ 12,000 – Piri Piri
264262

265263
- [x] [Blog plugin]
@@ -320,17 +318,21 @@ are released for general availability.
320318

321319
[Optimize plugin]: ../setup/building-an-optimized-site.md#built-in-optimize-plugin
322320
[Typeset plugin]: ../reference/index.md#built-in-typeset-plugin
323-
[Privacy plugin: external links]: ../setup/ensuring-data-privacy.md#+privacy.external_links
324-
[Privacy plugin: optimization support]: ../setup/ensuring-data-privacy.md#+privacy.external_assets_include
321+
[Privacy plugin: external links]: ../setup/ensuring-data-privacy.md#+privacy.links
322+
[Privacy plugin: optimization support]: ../setup/ensuring-data-privacy.md#+privacy.assets_include
325323
[Navigation path]: ../setup/setting-up-navigation.md#navigation-path
326324
[Instant previews]: https://twitter.com/squidfunk/status/1466794654213492743
327325

328326
#### $ 24,000 – Blockpaprika
329327

328+
- [x] [Social plugin: custom layouts]
329+
- [x] [Social plugin: background images]
330330
- [x] [Code range selection]
331331
- [x] [Code annotations: custom selectors]
332332
- [ ] Code line wrap button
333333

334+
[Social plugin: custom layouts]: ../setup/setting-up-social-cards.md#customization
335+
[Social plugin: background images]: ../setup/setting-up-social-cards.md#+social.cards_layout_params.background_image
334336
[Code range selection]: ../reference/code-blocks.md#code-selection-button
335337
[Code annotations: custom selectors]: ../reference/code-blocks.md#custom-selectors
336338

docs/publishing-your-site.md

+22-6
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,14 @@ contents:
3838
- uses: actions/setup-python@v4
3939
with:
4040
python-version: 3.x
41-
- uses: actions/cache@v2
41+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV # (3)!
42+
- uses: actions/cache@v3
4243
with:
43-
key: ${{ github.ref }}
44+
key: mkdocs-material-${{ env.cache_id }}
4445
path: .cache
45-
- run: pip install mkdocs-material # (3)!
46+
restore-keys: |
47+
mkdocs-material-
48+
- run: pip install mkdocs-material # (4)!
4649
- run: mkdocs gh-deploy --force
4750
```
4851

@@ -51,7 +54,16 @@ contents:
5154
2. At some point, GitHub renamed `master` to `main`. If your default branch
5255
is named `master`, you can safely remove `main`, vice versa.
5356

54-
3. This is the place to install further [MkDocs plugins] or Markdown
57+
3. Store the `cache_id` environmental variable to access it later during cache
58+
`key` creation. The name is case-sensitive, so be sure to align it with `${{ env.cache_id }}`.
59+
60+
- The `--utc` option makes sure that each workflow runner uses the same time zone.
61+
- The `%V` format assures a cache update once a week.
62+
- You can change the format to `%F` to have daily cache updates.
63+
64+
You can read the [manual page] to learn more about the formatting options of the `date` command.
65+
66+
4. This is the place to install further [MkDocs plugins] or Markdown
5567
extensions with `pip` to be used during the build:
5668

5769
``` sh
@@ -81,10 +93,13 @@ contents:
8193
- uses: actions/setup-python@v4
8294
with:
8395
python-version: 3.x
84-
- uses: actions/cache@v2
96+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
97+
- uses: actions/cache@v3
8598
with:
86-
key: ${{ github.ref }}
99+
key: mkdocs-material-${{ env.cache_id }}
87100
path: .cache
101+
restore-keys: |
102+
mkdocs-material-
88103
- run: apt-get install pngquant # (1)!
89104
- run: pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
90105
- run: mkdocs gh-deploy --force
@@ -116,6 +131,7 @@ Your documentation should shortly appear at `<username>.github.io/<repository>`.
116131
[built-in optimize plugin]: setup/building-an-optimized-site.md#built-in-optimize-plugin
117132
[GitHub secrets]: https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets
118133
[publishing source branch]: https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site
134+
[manual page]: https://man7.org/linux/man-pages/man1/date.1.html
119135

120136
### with MkDocs
121137

docs/reference/images.md

+30
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,37 @@ hash fragment to the image URL:
172172

173173
</div>
174174

175+
!!! warning "Requirements when using [custom color schemes]"
176+
177+
The built-in [color schemes] define the aforementioned hash fragments, but
178+
if you're using [custom color schemes], you'll also have to add the
179+
following selectors to your scheme, depending on whether it's a light or
180+
dark scheme:
181+
182+
=== "Custom light scheme"
183+
184+
``` css
185+
[data-md-color-scheme="custom-light"] img[src$="#only-dark"]
186+
[data-md-color-scheme="custom-light"] img[src$="#gh-dark-mode-only"] {
187+
display: none; /* Hide dark images in light mode */
188+
}
189+
```
190+
191+
=== "Custom dark scheme"
192+
193+
``` css
194+
[data-md-color-scheme="custom-dark"] img[src$="#only-light"],
195+
[data-md-color-scheme="custom-dark"] img[src$="#gh-light-mode-only"] {
196+
display: none; /* Hide light images in dark mode */
197+
}
198+
```
199+
200+
Remember to change `#!css "custom-light"` and `#!css "custom-dark"` to the
201+
name of your scheme.
202+
175203
[Light and dark mode support]: https://github.com/squidfunk/mkdocs-material/releases/tag/8.1.1
176204
[color palette toggle]: ../setup/changing-the-colors.md#color-palette-toggle
177205
[Zelda light world]: ../assets/images/zelda-light-world.png#only-light
178206
[Zelda dark world]: ../assets/images/zelda-dark-world.png#only-dark
207+
[color schemes]: ../setup/changing-the-colors.md#color-scheme
208+
[custom color schemes]: ../setup/changing-the-colors.md#custom-color-schemes

0 commit comments

Comments
 (0)