diff --git a/CHANGELOG b/CHANGELOG index a249b68f7..d44e31e45 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,13 @@ +mkdocs-material-9.1.12+insiders-4.34.0 (2023-05-14) + + * Added support for new overflow mode to auto-fit text in social plugin + * Reduced subtle rendering bugs in (code) annotations due to subpixel rounding + * Improved print styles for (code) annotation lists + * Improved performance of social plugin, now 3x as fast + * Improved interop of typeset plugin with MkDocstrings + * Fixed logo location for variants of default template in social plugin + * Fixed #5446: Built-in typeset plugin picks up headings in code blocks + mkdocs-material-9.1.12+insiders-4.33.2 (2023-05-12) * Fixed #5508: Social plugin crashes trying to copy cards on Docker/Windows diff --git a/docs/assets/screenshots/social-cards-layer-typography-shrink.png b/docs/assets/screenshots/social-cards-layer-typography-shrink.png new file mode 100644 index 000000000..82670c3b5 Binary files /dev/null and b/docs/assets/screenshots/social-cards-layer-typography-shrink.png differ diff --git a/docs/insiders/changelog.md b/docs/insiders/changelog.md index ae828e173..ea1c7f3a6 100644 --- a/docs/insiders/changelog.md +++ b/docs/insiders/changelog.md @@ -2,6 +2,16 @@ ## Material for MkDocs Insiders +### 4.34.0 May 14, 2023 { id="4.34.0" } + +- Added support for new overflow mode to auto-fit text in social plugin +- Reduced subtle rendering bugs in (code) annotations due to subpixel rounding +- Improved print styles for (code) annotation lists +- Improved performance of social plugin, now 3x as fast +- Improved interop of typeset plugin with MkDocstrings +- Fixed logo location for variants of default template in social plugin +- Fixed #5446: Built-in typeset plugin picks up headings in code blocks + ### 4.33.2 May 12, 2023 { id="4.33.2" } - Fixed #5508: Social plugin crashes trying to copy cards on Docker/Windows diff --git a/docs/setup/setting-up-social-cards.md b/docs/setup/setting-up-social-cards.md index d48ada88d..21c7b21b8 100644 --- a/docs/setup/setting-up-social-cards.md +++ b/docs/setup/setting-up-social-cards.md @@ -691,16 +691,45 @@ descender.[^2] This renders: #### Overflow -If the text overflows the layer, it is automatically truncated and an ellipsis -is appended, e.g.: +If the text overflows the layer, there are two possible behaviors: either the +text is automatically truncated and shortened with an ellipsis, or the text is +automatically scaled down to fit the layer: ``` { .markdown .no-copy } # If we use a very long headline, we can see how the text will be truncated ``` -![Layer typography ellipsis] +=== ":octicons-ellipsis-16: Ellipsis" + + ![Layer typography ellipsis] + +=== ":material-arrow-collapse: Shrink" + + ![Layer typography shrink] + +While truncating with an ellipsis is the default, auto-shrinking can be enabled +by setting `overflow` to `shrink`: + +``` yaml hl_lines="7" +size: { width: 1200, height: 630 } +layers: + - size: { width: 832, height: 310 } + offset: { x: 62, y: 160 } + typography: + content: "{{ page.title }}" + overflow: shrink + align: start + color: white + line: + amount: 3 + height: 1.25 + font: + family: Roboto + style: Bold +``` [Layer typography ellipsis]: ../assets/screenshots/social-cards-layer-typography-ellipsis.png + [Layer typography shrink]: ../assets/screenshots/social-cards-layer-typography-shrink.png #### Alignment