Skip to content

Conversation

@MoritzWeber0
Copy link
Member

@MoritzWeber0 MoritzWeber0 commented May 3, 2025

Description

Use fontsource to install the fonts via npm instead of manually redistributing the fonts and icons. The benefit is that fonts can receive updates and icons don't have to be uploaded manually.

To use icons, you have to find out the name of the icon (https://fonts.google.com/icons). Then, there are two different ways:

  • As partial in html templates:
    {{ partial "icon" "<icon-name>" }}
  • As shortcode in markdown templates:
    {{< icon <icon-name> >}}

The only disadvantage is the size of 270kB, but it's lazy-loaded and we have all icons.

It might be good to add the shortcut to the contribution wiki after the PR has been merged.

For the Roboto font, the improvement is even more significant (esp. for Chrome users). It recognizes the font as actual Roboto font and loads it from chrome resources, reducing the size of ~300kB to ~200 bytes.

TODO:

  • Change outlined to rounded icons

@MoritzWeber0 MoritzWeber0 added the technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc. label May 3, 2025
@netlify
Copy link

netlify bot commented May 3, 2025

Deploy Preview for fipguide ready!

Name Link
🔨 Latest commit 7237b48
🔍 Latest deploy log https://app.netlify.com/sites/fipguide/deploys/6819b62e8f5ce8000871b2c6
😎 Deploy Preview https://deploy-preview-96--fipguide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@MoritzWeber0 MoritzWeber0 force-pushed the use-fontsource branch 3 times, most recently from 549a6ab to 62d9c9d Compare May 3, 2025 10:28
@MoritzWeber0 MoritzWeber0 marked this pull request as ready for review May 3, 2025 10:34
@MoritzWeber0 MoritzWeber0 requested a review from therobrob May 3, 2025 10:34
@MoritzWeber0 MoritzWeber0 marked this pull request as draft May 3, 2025 18:25
@therobrob
Copy link
Member

We've already used this way of icon and font integration in an earlier development stage. So we should discuss it with @lenderom.

@MoritzWeber0
Copy link
Member Author

We've already used this way of icon and font integration in an earlier development stage. So we should discuss it with @lenderom.

@lenderom already wrote to me and I changed the PR to a draft for now. Let's discuss it in person 👍

@MoritzWeber0 MoritzWeber0 marked this pull request as ready for review May 5, 2025 19:28
@MoritzWeber0
Copy link
Member Author

@therobrob I changed it to rounded symbols 👍

@therobrob therobrob merged commit 310596a into main May 6, 2025
7 checks passed
@therobrob therobrob deleted the use-fontsource branch May 6, 2025 07:15
lenderom pushed a commit that referenced this pull request May 7, 2025
## Description

Add a link to report issues directly in the sidemenu. Corresponding
labels are auto-added to the report.

Depends on #96. Do
not merge before #96
is merged!

The content was modified in the following languages: <!-- Der Inhalt
wurde für die folgenden Sprachen angepasst -->
- [x] English
- [x] German
MoritzWeber0 added a commit that referenced this pull request May 18, 2025
The icon usage was replaced by fontsource in #96. The remaining icon
infrastructure was only used for the logos of operators.

This commit simplifies the code by replacing the "ico" partial with a
"logo" partial.
MoritzWeber0 added a commit that referenced this pull request May 18, 2025
The icon usage was replaced by fontsource in #96. The remaining icon
infrastructure was only used for the logos of operators.

This commit simplifies the code by replacing the "ico" partial with a
"logo" partial.
MoritzWeber0 added a commit that referenced this pull request May 18, 2025
The icon usage was replaced by fontsource in #96. The remaining icon
infrastructure was only used for the logos of operators.

This commit simplifies the code by replacing the "ico" partial with a
"logo" partial.
lenderom added a commit that referenced this pull request May 27, 2025
The icon usage was replaced by fontsource in #96. The remaining icon
infrastructure was only used for the logos of operators.

This PR simplifies the code by replacing the "ico" partial with a "logo"
partial.

In addition to the high complexity of the old "_ico.html", it had some
issues:
- Multiple return statements were used in one partial. This is not
allowed as per docs ("Only one return statement is allowed per partial
file."): https://gohugo.io/templates/partial/#example-getimage
- The whole build process broke when an operator was added without
related logo.

---------

Signed-off-by: lennartrommeiss <[email protected]>
Co-authored-by: Lennart Rommeiss <[email protected]>
Co-authored-by: lennartrommeiss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants