Skip to content

Commit b978bba

Browse files
committed
Updated documentation
1 parent adafd84 commit b978bba

File tree

3 files changed

+37
-10
lines changed

3 files changed

+37
-10
lines changed

Diff for: CHANGELOG

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
mkdocs-material-7.2.2+insiders-2.13.0 (2021-08-07)
2+
3+
* Added support for custom colors in social cards
4+
15
mkdocs-material-7.2.2+insiders-2.12.2 (2021-08-04)
26

37
* Fixed #2891: Division by zero error in social plugin

Diff for: docs/insiders/changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ template: overrides/main.html
66

77
## Material for MkDocs Insiders
88

9+
### 2.13.0 <small>_ August 7, 2021</small>
10+
11+
- Added support for custom colors in social cards
12+
913
### 2.12.2 <small>_ August 4, 2021</small>
1014

1115
- Fixed #2891: Division by zero error in social plugin

Diff for: docs/setup/setting-up-social-cards.md

+29-10
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@ This is a built-in plugin, which means that no third-party plugin needs to be
5555
installed, as Material for MkDocs already bundles it. The following options
5656
are available:
5757
58+
`cards_color`{ #cards_color } :material-new-box:
59+
60+
: :octicons-milestone-24: Default: _automatically set based on [primary
61+
color][8]_ – This option specifies which colors to use for the background
62+
`fill` and foreground `text` when generating the social card.
63+
64+
``` yaml
65+
plugins:
66+
- social:
67+
cards_color:
68+
fill: "#0FF1CE"
69+
text: "#FFFFFF"
70+
```
71+
72+
Note that the values for `fill` and `text` can either be HEX color values
73+
(e.g. `#0FF1CE`, must be enclosed in quotes) or CSS color keywords (e.g.
74+
`red`, `green`, etc.).
75+
5876
`cards_directory`{ #cards_directory }
5977

6078
: :octicons-milestone-24: Default: `assets/images/social` – This option
@@ -71,10 +89,11 @@ are available:
7189
[5]: setting-up-site-analytics.md
7290
[6]: ../assets/screenshots/social-cards.png
7391
[7]: https://cards-dev.twitter.com/validator
92+
[8]: changing-the-colors.md#primary-color
7493

7594
#### Caching
7695

77-
When enabled, the [social cards plugin][8] automatically fetches the fonts you
96+
When enabled, the [social cards plugin][9] automatically fetches the fonts you
7897
define in `mkdocs.yml` from Google Fonts, and uses them to render the text that
7998
is displayed on the social card. The font files and generated cards are both
8099
written to the `.cache` directory, which is used in subsequent builds to detect
@@ -83,7 +102,7 @@ whether the social cards need to be regenerated. You might want to:
83102
1. Ignore the `.cache` directory in your project, by adding it to `.gitignore`.
84103
2. When building your site for publishing, use a build cache to save the
85104
`.cache` directory in between builds. Taking the example from the
86-
[publishing guide][9], add the following lines:
105+
[publishing guide][10], add the following lines:
87106

88107
``` yaml hl_lines="15-18"
89108
name: ci
@@ -108,18 +127,18 @@ whether the social cards need to be regenerated. You might want to:
108127
- run: mkdocs gh-deploy --force
109128
```
110129

111-
[8]: #built-in-social-cards
112-
[9]: ../publishing-your-site.md#with-github-actions
130+
[9]: #built-in-social-cards
131+
[10]: ../publishing-your-site.md#with-github-actions
113132

114133
## Usage
115134

116135
If you want to adjust the title or set a custom description for the social card,
117-
you can use the [Metadata][10] extension, which takes precedence over the
136+
you can use the [Metadata][11] extension, which takes precedence over the
118137
default values.
119138

120-
- [Changing the title][11]
121-
- [Changing the description][12]
139+
- [Changing the title][12]
140+
- [Changing the description][13]
122141

123-
[10]: ../reference/meta-tags.md#metadata
124-
[11]: ../reference/meta-tags.md#setting-the-page-title
125-
[12]: ../reference/meta-tags.md#setting-the-page-description
142+
[11]: ../reference/meta-tags.md#metadata
143+
[12]: ../reference/meta-tags.md#setting-the-page-title
144+
[13]: ../reference/meta-tags.md#setting-the-page-description

0 commit comments

Comments
 (0)