mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Added customization guide for languages
This commit is contained in:
parent
8443720155
commit
c0e8d062b9
@ -64,9 +64,9 @@ theme:
|
|||||||
|
|
||||||
This will prevent typefaces from being loaded from Google Fonts. As a fallback,
|
This will prevent typefaces from being loaded from Google Fonts. As a fallback,
|
||||||
common system fonts will be used automatically. Additionally, if you want to
|
common system fonts will be used automatically. Additionally, if you want to
|
||||||
load a font from another destination, you can either [override the `fonts`
|
load a font from another destination, you may either follow the guide on [theme
|
||||||
block][6] with a `style` tag, or use an [additional stylesheet][7] to add the
|
extension][6] and [override the `fonts` block][7] with a `style` tag, or use an
|
||||||
necessary `@font-face` definition:
|
[additional stylesheet][8] to add the necessary `@font-face` definition:
|
||||||
|
|
||||||
``` css
|
``` css
|
||||||
@font-face {
|
@font-face {
|
||||||
@ -94,5 +94,6 @@ The font can then be configured to be used as the regular or proportional font:
|
|||||||
```
|
```
|
||||||
|
|
||||||
[5]: ../data-privacy.md
|
[5]: ../data-privacy.md
|
||||||
[6]: ../customization.md#overriding-blocks
|
[6]: ../customization.md#setup-and-theme-structure
|
||||||
[7]: ../customization.md#additional-stylesheets
|
[7]: ../customization.md#overriding-blocks
|
||||||
|
[8]: ../customization.md#additional-stylesheets
|
||||||
|
@ -150,3 +150,26 @@ directionality:
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
[5]: https://github.com/squidfunk/mkdocs-material/blob/master/src/base.html#L168
|
[5]: https://github.com/squidfunk/mkdocs-material/blob/master/src/base.html#L168
|
||||||
|
|
||||||
|
## Customization
|
||||||
|
|
||||||
|
If you want to customize some (or all) of the translations for your language,
|
||||||
|
you may follow the guide on [theme extension][6] and create a new partial in
|
||||||
|
`partials/language`, e.g. `en-custom.html`. Next, look up the translation you
|
||||||
|
want to change in the [base translation][1] and add it to the partial you just
|
||||||
|
created. Say, you want to change "__Table of contents__" to "__On this page__":
|
||||||
|
|
||||||
|
``` jinja
|
||||||
|
{% macro t(key) %}{{ {
|
||||||
|
"toc.title": "On this page"
|
||||||
|
}[key] }}{% endmacro %}
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, add the following lines to `mkdocs.yml`:
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
theme:
|
||||||
|
language: en-custom
|
||||||
|
```
|
||||||
|
|
||||||
|
[6]: ../customization.md#setup-and-theme-structure
|
||||||
|
@ -93,13 +93,13 @@ used to render these pages.
|
|||||||
|
|
||||||
[:octicons-file-code-24: Source][5] · [:octicons-workflow-24: Extension][6]
|
[:octicons-file-code-24: Source][5] · [:octicons-workflow-24: Extension][6]
|
||||||
|
|
||||||
The [Table of Contents][7] extension, which is part of the standard Markdown
|
The [table of contents][7] extension, which is part of the standard Markdown
|
||||||
library, provides some options that are supported by Material for MkDocs to
|
library, provides some options that are supported by Material for MkDocs to
|
||||||
customize its appearance.
|
customize its appearance:
|
||||||
|
|
||||||
`permalink`
|
`permalink`
|
||||||
|
|
||||||
: This options adds an anchor link containing the paragraph symbol `¶` or
|
: This option adds an anchor link containing the paragraph symbol `¶` or
|
||||||
another custom symbol at the end of each headline, exactly like on the page
|
another custom symbol at the end of each headline, exactly like on the page
|
||||||
you're currently viewing, which Material for MkDocs will make appear on
|
you're currently viewing, which Material for MkDocs will make appear on
|
||||||
hover:
|
hover:
|
||||||
@ -120,14 +120,6 @@ customize its appearance.
|
|||||||
permalink: ⚓︎
|
permalink: ⚓︎
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "Link"
|
|
||||||
|
|
||||||
``` yaml
|
|
||||||
markdown_extensions:
|
|
||||||
- toc:
|
|
||||||
permalink: Link
|
|
||||||
```
|
|
||||||
|
|
||||||
`slugify`
|
`slugify`
|
||||||
|
|
||||||
: This option allows for customization of the slug function. For some
|
: This option allows for customization of the slug function. For some
|
||||||
@ -143,7 +135,7 @@ customize its appearance.
|
|||||||
slugify: pymdownx.slugs.uslugify
|
slugify: pymdownx.slugs.uslugify
|
||||||
```
|
```
|
||||||
|
|
||||||
=== "Casing"
|
=== "Unicode, case-sensitive"
|
||||||
|
|
||||||
``` yaml
|
``` yaml
|
||||||
markdown_extensions:
|
markdown_extensions:
|
||||||
|
Loading…
Reference in New Issue
Block a user