Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

font instead of fonts in docs #28

Closed
Vegebutcher opened this issue Nov 29, 2021 · 4 comments · Fixed by #29
Closed

font instead of fonts in docs #28

Vegebutcher opened this issue Nov 29, 2021 · 4 comments · Fixed by #29

Comments

@Vegebutcher
Copy link

Found another bug in the theme docs: in the New blocks section there's a description of a block responsible for substituting the default font. But it should read fonts instead of font – I realised that only after reading the code of the default layout.html file here in the repo:

font instead of fonts

When you use the following font block in the /_template/layout.html file that overrides defaults, nothing happens (the text font is still Roboto):

{# Import the theme's layout. #}
{% extends '!layout.html' %}

{% block font %}
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
        <link
          rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Lato:300,400,400i,700%7CRoboto+Mono&display=fallback"
        />
        <style>
          :root {
            --md-text-font-family: "Lato";
            --md-code-font-family: "Roboto Mono";
          }
        </style>
{% endblock %}

But this code works when you use {% block fonts %}.

@jbms
Copy link
Owner

jbms commented Nov 29, 2021

You can actually change the fonts without overriding templates at all, just using:

"font": {"text": "Roboto", "code": "Roboto Mono"},

in your html_theme_options.

We should adapt the documentation based on this:
https://squidfunk.github.io/mkdocs-material/setup/changing-the-fonts/

@2bndy5
Copy link
Collaborator

2bndy5 commented Nov 30, 2021

Also I'm pretty sure fonticon won't work here.

@Vegebutcher
Copy link
Author

The trick with font in html_theme_options indeed works, thanks!

Didn't check fonticon at all, so can't tell.

@2bndy5
Copy link
Collaborator

2bndy5 commented Nov 30, 2021

I don't see anything in the templates that makes use of a fonticon block. I think this is a relic from sphinx-material theme's docs.

On the other hand, footerrel seems to have been inherited from the mkdocs-material upstream. See footer.html template

2bndy5 added a commit to 2bndy5/sphinx-immaterial that referenced this issue Dec 3, 2021
- resolves jbms#20
- fixes jbms#23
- implements suggestions from jbms#25 and removes some confusing config options
- addresses jbms#28 and removes artifacts from sphinx-material theme
@2bndy5 2bndy5 mentioned this issue Dec 3, 2021
@2bndy5 2bndy5 linked a pull request Dec 3, 2021 that will close this issue
@jbms jbms closed this as completed in #29 Dec 5, 2021
jbms pushed a commit that referenced this issue Dec 5, 2021
* litany of improvements

- resolves #20
- fixes #23
- implements suggestions from #25 and removes some confusing config options
- addresses #28 and removes artifacts from sphinx-material theme

* ran black

* more proofreading

* requested changes

* don't mention mike plugin CLI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants