Git Product home page Git Product logo

Comments (3)

yuqingc avatar yuqingc commented on June 17, 2024 1

@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>

from yuqingc.github.io.

yuqingc avatar yuqingc commented on June 17, 2024

@LovelyBuggies https://www.iconfont.cn/

from yuqingc.github.io.

LovelyBuggies avatar LovelyBuggies commented on June 17, 2024

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)?

from yuqingc.github.io.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.