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

Where's your SVG #2

Closed
LovelyBuggies opened this issue May 8, 2020 · 3 comments
Closed

Where's your SVG #2

LovelyBuggies opened this issue May 8, 2020 · 3 comments

Comments

@LovelyBuggies
Copy link

Hello, I am here from Mainroad Hugo theme repo. Ur blog is amazing. Actually, I am curious about where is your blibli svg and how you can get it. Thanks a lot!

@yuqingc
Copy link
Owner

yuqingc commented May 8, 2020

@LovelyBuggies
Copy link
Author

Thanks, but I mean do you have a folder named like svg in partials (I see you put your svg file directly into the index.html). By the way, how do you start your hugo server (I tried hugo server -D, but this doesn't work)?

@yuqingc
Copy link
Owner

yuqingc commented May 9, 2020

@LovelyBuggies This repo is the output dir after compiling. Settings for custom links with SVG icons can be referred here (https://github.com/Vimux/Mainroad#social-widget-custom-links)

Social Widget: custom links

Mainroad contains built-in social links in the social widget. In addition, you can also set custom social links by adding Params.widgets.social.custom to your config.toml. Here is an example.

[[Params.widgets.social.custom]]
  title = "Youtube"
  url = "https://youtube.com/user/username"
  icon = "youtube.svg"

Note: You need to put your icon file in layouts/partials directory under your project's root if you want to display an icon of your social link. The icon filed, which is optional, should be a path relative to layouts/partials.

Note: Only SVG files are supported to be used as custom social icons in the current version. If you use any files of another format, PNG for example, a compile error will be raised by Hugo.

Note: Not every SVG icon can be used. For better results, it should be one-color SVG file with a special class attribute {{ with .class }}{{ . }} {{ end }} and 24x24 size. At a minimum, custom SVG icon needs these attributes:

<svg class="{{ with .class }}{{ . }} {{ end }} icon" width="24" height="24">...</svg>

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

No branches or pull requests

2 participants