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

Set explict width and height for SVGs in blog posts #609

Closed
baltpeter opened this issue May 31, 2021 · 3 comments
Closed

Set explict width and height for SVGs in blog posts #609

baltpeter opened this issue May 31, 2021 · 3 comments
Assignees
Labels
good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed optimization

Comments

@baltpeter
Copy link
Member

baltpeter commented May 31, 2021

As Hugo's imageConfig unfortunately doesn't support SVG this will have to be done manually.

An example of where this problem occurs is the sample letters overview page. Here's what PageSpeed says about that:

image


The same thing applies for the CC0 icon on company single pages:

image

@baltpeter baltpeter added help wanted Extra attention is needed good first issue Good for newcomers optimization hacktoberfest labels May 31, 2021
@thewindsofwinter
Copy link
Contributor

Hello! I'd be willing to try to set explicit width and height, but I'm not completely sure what that entails: do I just need to do it for elements that exist or would I be expected to create a solution that works for any arbitrary SVG that's added to a page? If you could give me a few pointers on how to start, I'd be glad to help out! Thanks~

(und ich weiß nicht, ob der Autor lieber auf Deutsch kommuniziert, aber ich kann ein bisschen Deutsch sprechen -- vielleicht hilft es mir besser Deutsch zu lernen 😄 )

@baltpeter
Copy link
Member Author

Hi @thewindsofwinter, thanks for wanting to work on this!

While we'd love to have an automated solution that works for all SVGs, that isn't possible with Hugo at the moment, so this issue is just for manually setting the width and height on the existing SVGs.

Here's an example of a change from a previous PR that already did this for one SVG: 29f2548 (#594)

As for the two instances I was talking about in the issue description:

There are probably other cases—so it would be great if you could check for those as well.

For setting up the project for developing locally, the instructions in the README should have you covered: https://github.com/datenanfragen/website#development

Let me know if you have any more questions, we'll be glad to help. I'll assign you to this issue, so no one else also starts working on it. :)


P.S.: Here on GitHub, we communicate exclusively in English, so that all our contributors can understand everything. But we also have a Matrix community that you are welcome to join: https://matrix.to/#/+datenanfragen:matrix.altpeter.me

@thewindsofwinter
Copy link
Contributor

Sounds good! Hopefully it won't take too long for me to finish this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed optimization
Development

No branches or pull requests

2 participants