Comments (4)
I believe I understand that CSS a bit more.
Looks like the content of the whole icon-github
class div
block is replaced with \e607
glyph in the Icon
font family, and you have those fonts here.
If the gitlab icon is in that font file, how do I know the glyph code? If the icon is not in there, what would be an alternative?
Thanks.
from hugo-material-docs.
Hello @kaushalmodi,
since this theme is a port I didn't created the original ressources. However, I looked at the upstream project.
The glyph code corresponds with an SVG icon font that you can find here. Search for Github and you should see the glyph code as another attribute of the icon. But, as you can see, the current version of the icon font doesn't have a GitLab icon.
Currently, the upstream project get a complete overhaul. In the draft of the release notes I read that GitLab and Bitbucket icons will be added once the original theme is released.
I will port the new version as well once the overhaul is finished and released. You can find the GitLab icon that I mentioned here. Adding it to the theme and a few lines of template code and CSS should allow you to display it on your website.
from hugo-material-docs.
Thanks! I tried the below but it did not work ..
- I downloaded the
gitlab-white.svg
to/static/images/.
(also tried copying it to/images/.
) - Put the below in
partials/header.html
:
{{ with .Site.Social.gitlab }}
<div class="button button-gitlab" role="button" aria-label="Gitlab">
<a href="https://gitlab.com/u/{{ . }}" title="@{{ . }} on Gitlab" target="_blank" class="toggle-button icon icon-gitlab"><img src="/images/gitlab-white.svg"></a>
</div>
{{ end }}
from hugo-material-docs.
OK, I finally got this working.. need to added the below to config.toml
:
canonifyurls = true
Can you please explain what that option means? I copied it from an example hugo blog config.
How can I not set that option and still have the below work (which now works! with the above setting):
{{ with .Site.Social.gitlab }}
<div class="button button-gitlab" role="button" aria-label="Gitlab">
<a href="https://gitlab.com/u/{{ . }}" title="@{{ . }} on Gitlab" target="_blank" class="toggle-button icon icon-gitlab"><img src="/images/gitlab-white.svg" height="28" width="28"></a>
</div>
I have copied the .svg file to /static/images/
directory.
Caveat: Had to hard-code the image size to 28 to get the below:
Would you recommend a better way?
Thanks!
from hugo-material-docs.
Related Issues (20)
- .Now throws an error HOT 1
- The weight in menu item doesn't work as expected in example HOT 3
- Bottom navigation doesn't work as expected HOT 3
- Is it possible to remove the footer?
- Primary and secondary menus ?
- Calling for contributors
- example site fails to run - here is the fix HOT 2
- Hamburger menus render as hollow squares
- No CSS styles rendering when run in server HOT 4
- exampleSite broken on Hugo v0.32-0.34 HOT 8
- Dynamic table of contents
- Admonition more?
- Errors on site without expected parameters set HOT 2
- Code blocks show different grey levels HOT 1
- Loading failed for the <script> with source “http://localhost:1313/javascripts/modernizr.js”.
- no demo HOT 2
- Menu and folders HOT 1
- failed on hugo 0.48 win64 HOT 3
- Page's .Prev and .Next will be deprecated in a future Hugo release
- Broken on 0.50? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-material-docs.