#Disable download of Google fonts for mkdocs-techdocs

1 messages · Page 1 of 1 (latest)

lone tartan
#

Hi,

I currently have a problem with the generation of documentation with Techdocs. I have read your documentation (https://backstage.io/docs/features/techdocs/getting-started). I have:

  • Installed the plugins
  • changed the "app-config.yaml" configuration
  • changed necessary files like techdocs.tsx, etc as well

I also read following doc: https://squidfunk.github.io/mkdocs-material/setup/changing-the-fonts/

I want to build the documentation locally. Backstage tries to build the documentation locally. But the Python package mkdocs-techdocs-core causes problems.

Reason: Backstage runs in a closed environment without internet access and this should not be changed. When generating the documentation, techdocs tries to pull fonts from the internet, namely, "Roboto" from Google. But this leads to an error and the documentation is not generated.

Is there a way to disable this or change techdocs to access local fonts?
Do you have experience with this or a working configuration/instruction?

Thanks in advance 🙂
(Sorry for repost, I forgot to edit the title)

Write your documentation in Markdown and create a professional static site in minutes – searchable, customizable, in 60+ languages, for all devices

gilded glacier
#

To summarize you have two options: if you are using a custom theme for Backstage if you provide a font that should override the one in TechDocs or you can disable this in the mkdocs.yml file (down side is this would need to be done in all of them so might not scale well for you)

#

Hope that helps?

lone tartan
#

I had created a mkdocs.yaml. Unfortunately it had not worked.

I also went to (https://github.com/backstage/mkdocs-techdocs-core). There it is written:

"We only use material-mkdocs as a base style because Backstage also uses Material UI on the client side. We don't expect themes other than Material UI to be used to maintain consistency across all Backstage pages (in other words, documentation pages have the same look as all other Backstage pages), and so we use the BackstageTheme configured in the front-end application as the source of truth for all application design tokens such as colors, typography, etc."

and as I said, mkdocs.yaml did not work. Maybe I'm missing something? But I'll look at the link above for now. Thank you.
I will give you feedback 🙂

lone tartan
#

Hey @gilded glacier !

Thanks for your contribution. It was really helpful! I can now explain why it didn't work for me.

I followed the documentation from https://squidfunk.github.io/mkdocs-material/setup/changing-the-fonts/. The suggestion with:

theme:
font: false

is incomplete. In your post, I saw that the following lines were written:

theme:
name: material
font: false

Only with the addition "name: material", the plugin has taken over my configuration and no longer loads Google fonts.

I have one more question: Even if it was only a small thing, the problem kept me busy for a long time. I would like to add it to the documentation of Backstage or somewhere else. Can you tell me where and how best to do this?

Write your documentation in Markdown and create a professional static site in minutes – searchable, customizable, in 60+ languages, for all devices