@@ -55,6 +55,24 @@ This is a built-in plugin, which means that no third-party plugin needs to be
55
55
installed, as Material for MkDocs already bundles it. The following options
56
56
are available:
57
57
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
+
58
76
` cards_directory` { # cards_directory }
59
77
60
78
: :octicons-milestone-24 : Default: `assets/images/social` – This option
@@ -71,10 +89,11 @@ are available:
71
89
[5] : setting-up-site-analytics.md
72
90
[6] : ../assets/screenshots/social-cards.png
73
91
[7] : https://cards-dev.twitter.com/validator
92
+ [8] : changing-the-colors.md#primary-color
74
93
75
94
# ### Caching
76
95
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
78
97
define in `mkdocs.yml` from Google Fonts, and uses them to render the text that
79
98
is displayed on the social card. The font files and generated cards are both
80
99
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:
83
102
1. Ignore the `.cache` directory in your project, by adding it to `.gitignore`.
84
103
2. When building your site for publishing, use a build cache to save the
85
104
` .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 :
87
106
88
107
` ` ` yaml hl_lines="15-18"
89
108
name: ci
@@ -108,18 +127,18 @@ whether the social cards need to be regenerated. You might want to:
108
127
- run: mkdocs gh-deploy --force
109
128
` ` `
110
129
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
113
132
114
133
# # Usage
115
134
116
135
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
118
137
default values.
119
138
120
- - [Changing the title][11 ]
121
- - [Changing the description][12 ]
139
+ - [Changing the title][12 ]
140
+ - [Changing the description][13 ]
122
141
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