1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-12-21 03:45:57 +01:00
mkdocs-material/docs/setup/setting-up-the-footer.md

175 lines
6.2 KiB
Markdown
Raw Normal View History

2020-07-21 16:01:22 +02:00
---
template: overrides/main.html
---
2020-10-11 12:20:36 +02:00
# Setting up the footer
2020-07-21 16:01:22 +02:00
2020-07-26 14:46:09 +02:00
The footer of your project documentation is a great place to add links to
2020-07-21 16:01:22 +02:00
websites or platforms you or your company are using as additional marketing
channels, e.g. :fontawesome-brands-medium:{ style="color: #00AB6C" },
:fontawesome-brands-twitter:{ style="color: #1DA1F2" } or
:fontawesome-brands-facebook:{ style="color: #4267B2" }, which can be
configured via `mkdocs.yml`.
2020-07-21 16:01:22 +02:00
## Configuration
2020-07-22 09:54:17 +02:00
### Social links
2021-10-11 13:38:03 +02:00
[:octicons-tag-24: 1.0.0][social support] ·
2021-10-10 21:04:22 +02:00
:octicons-milestone-24: Default: _none_
2020-07-21 16:01:22 +02:00
2021-10-03 20:28:52 +02:00
Social links are rendered next to the copyright notice as part of the
2020-07-21 16:01:22 +02:00
footer of your project documentation. Add a list of social links in `mkdocs.yml`
with:
``` yaml
extra:
social:
- icon: fontawesome/brands/twitter # (1)!
2020-07-21 16:01:22 +02:00
link: https://twitter.com/squidfunk
```
1. Enter a few keywords to find the perfect icon using our [icon search] and
click on the shortcode to copy it to your clipboard:
<div class="mdx-iconsearch" data-mdx-component="iconsearch">
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="brands twitter" />
<div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file">
<div class="mdx-iconsearch-result__meta"></div>
<ol class="mdx-iconsearch-result__list"></ol>
</div>
</div>
The following properties must be set for each link:
2020-07-21 16:01:22 +02:00
2021-10-10 19:22:13 +02:00
`icon`{ #social-icon }
2020-07-21 16:01:22 +02:00
2021-10-11 13:38:03 +02:00
: [:octicons-tag-24: 5.0.0][social.icon support] · :octicons-milestone-24:
Default: _none_ · :octicons-alert-24: Required This property must contain
a valid path to any icon bundled with the theme, or the
build will not succeed. Some popular choices:
2020-10-31 17:15:33 +01:00
* :fontawesome-brands-behance: `fontawesome/brands/behance`
* :fontawesome-brands-docker: `fontawesome/brands/docker`
* :fontawesome-brands-github: `fontawesome/brands/github`
* :fontawesome-brands-instagram: `fontawesome/brands/instagram`
* :fontawesome-brands-linkedin: `fontawesome/brands/linkedin`
* :fontawesome-brands-medium: `fontawesome/brands/medium`
* :fontawesome-brands-pied-piper-alt: `fontawesome/brands/pied-piper-alt`
* :fontawesome-brands-product-hunt: `fontawesome/brands/product-hunt`
* :fontawesome-brands-slack: `fontawesome/brands/slack`
* :fontawesome-brands-twitter: `fontawesome/brands/twitter`
2020-07-21 16:01:22 +02:00
2021-10-10 19:22:13 +02:00
`link`{ #social-link }
2020-07-21 16:01:22 +02:00
: :octicons-milestone-24: Default: _none_ · :octicons-alert-24: Required
This property must be set to a relative or absolute URL including the URI
2020-07-21 16:01:22 +02:00
scheme. All URI schemes are supported, including `mailto` and `bitcoin`:
2021-10-10 21:04:22 +02:00
=== ":fontawesome-brands-twitter: Twitter"
2020-07-21 16:01:22 +02:00
``` yaml
extra:
social:
- icon: fontawesome/brands/twitter
link: https://twitter.com/squidfunk
```
2021-10-10 21:04:22 +02:00
=== ":octicons-mail-16: Email"
2020-07-21 16:01:22 +02:00
``` yaml
extra:
social:
- icon: fontawesome/solid/paper-plane
2020-07-21 18:42:19 +02:00
link: mailto:<email-address>
2020-07-21 16:01:22 +02:00
```
2021-10-10 19:22:13 +02:00
`name`{ #social-name }
2020-07-21 16:01:22 +02:00
2021-10-11 13:38:03 +02:00
: [:octicons-tag-24: 5.1.5][social.name support] · :octicons-milestone-24:
Default: _domain name from_ `link`_, if available_ This property is used
as the link's `title` attribute and can be set to a discernable name to
2021-10-11 13:38:03 +02:00
improve accessibility:
2020-07-21 16:01:22 +02:00
``` yaml
extra:
social:
- icon: fontawesome/brands/twitter
link: https://twitter.com/squidfunk
name: squidfunk on Twitter
```
2021-10-11 13:38:03 +02:00
[social support]: https://github.com/squidfunk/mkdocs-material/releases/tag/1.0.0
[social.icon support]: https://github.com/squidfunk/mkdocs-material/releases/tag/5.0.0
[social.name support]: https://github.com/squidfunk/mkdocs-material/releases/tag/5.1.5
2020-10-31 17:15:33 +01:00
### Copyright notice
2021-10-10 21:04:22 +02:00
[:octicons-tag-24: 0.1.0][Copyright notice support] ·
:octicons-milestone-24: Default: _none_
2020-10-31 17:15:33 +01:00
2021-10-03 20:28:52 +02:00
A custom copyright banner can be rendered as part of the footer, which is
2020-10-31 17:15:33 +01:00
displayed next to the social links. It can be defined as part of `mkdocs.yml`:
``` yaml
copyright: Copyright &copy; 2016 - 2020 Martin Donath
```
2021-10-03 20:28:52 +02:00
[Copyright notice support]: https://github.com/squidfunk/mkdocs-material/releases/tag/0.1.0
2020-12-21 17:38:58 +01:00
[3]: https://github.com/squidfunk/mkdocs-material/blob/master/src/partials/footer.html
2020-10-31 17:15:33 +01:00
2021-10-03 20:28:52 +02:00
### Generator notice
2020-10-11 12:20:36 +02:00
2021-10-10 21:04:22 +02:00
[:octicons-tag-24: 7.3.0][Generator notice support] ·
:octicons-milestone-24: Default: `true`
2020-10-11 12:20:36 +02:00
2020-10-31 17:15:33 +01:00
The footer displays a _Made with Material for MkDocs_ notice to denote how
the site was generated. The notice can be removed with the following option
2020-10-11 12:20:36 +02:00
via `mkdocs.yml`:
``` yaml
extra:
generator: false
```
2021-09-23 09:23:42 +02:00
!!! info "Please read this before removing the generator notice"
The subtle __Made with Material for MkDocs__ hint in the footer is one of
the reasons why this project is so popular, as it tells the user how the
site is generated, helping new users to discover this project. Before
2021-10-10 21:04:22 +02:00
removing please consider that you're enjoying the benefits of @squidfunk's
work for free, as this project is Open Source and has a permissive license.
Thousands of hours went into this project, most of them
without any financial return.
Thus, if you remove this notice, please consider [sponsoring][Insiders] the
project. __Thank you__ :octicons-heart-fill-24:{ .mdx-heart .mdx-insiders }
2021-09-23 09:23:42 +02:00
2021-10-03 20:28:52 +02:00
[Generator notice support]: https://github.com/squidfunk/mkdocs-material/releases/tag/7.3.0
2021-10-10 21:04:22 +02:00
[Insiders]: ../insiders/index.md
2020-10-11 12:20:36 +02:00
## Customization
2021-11-28 15:59:54 +01:00
### Custom copyright
2021-11-28 15:59:54 +01:00
[:octicons-tag-24: 8.0.0][Custom copyright support] ·
:octicons-file-symlink-file-24: Customization
2021-11-28 15:59:54 +01:00
In order to customize and override the [copyright notice], [extend the theme]
and [override the `copyright` block][overriding blocks], which is normally set
to the `copyright` property set in `mkdocs.yml`:
``` html
{% extends "base.html" %}
{% block copyright %}
<!-- Add copyright here, including arbitrary HTML -->
{% endblock %}
```
[Custom copyright support]: https://github.com/squidfunk/mkdocs-material/releases/tag/8.0.0
[copyright notice]: #copyright-notice
[generator notice]: #generator-notice
[extend the theme]: ../customization.md#extending-the-theme
[overriding blocks]: ../customization.md#overriding-blocks