Comments (4)
Hi @damonlynch, I see you are making good progress on your website ππ». Let me reply in two parts:
1. Using external icon sets (e.g. Academicons)
You simply need to include the respective stylesheet; in your case, that would be
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css">
in the <head>
-tag of your site.
To achieve this, you may create a layouts/partials/custom_head.html
in your site's root directory containing this line:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css">
With the stylesheet available you can then use the icons as it is described on their website, i.e., using <i>
-tags like
<i class="ai ai-google-scholar-square"></i>
in your .html
-content.
If you want to use icons in .md
-files, you could enable HTML-rendering
via adding
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true
to your config.toml
.
2. What's built-in?
You are correct, this is a little bit of a hidden feature at the moment πΈ, but as you already saw, there is an icon on the header of the start page. This theme currently includes font-awesome v4.0.3
for that purpose. You can check out https://fontawesome.com/v4.7.0/cheatsheet/ for a list of all icons.
You can use all those icons in .html
via <i>
-tags <i class="fa fa-envelope"></i>
. Again, if you want to use theme in .md
-files, you need to enable unsafe
-rendering for markdown
, see above.
2.5 π Future Work
To make using icons in .md
-files a lot nicer / user-friendly, we could introduce a shortcode. Then, you would not need to enable unsafe
-rendering and could write something like
{{< i class="fa fa-envelope">}} Mail me!
in your usual .md
-file.
You can add this functionality locally by creating a layouts/shortcodes/i.html
-file with the following content:
{{ with .Get "class" }}<i class="{{ . }}"></i>{{ end }}
I hope that helps π . Let me know if this works for you.
Kind regards,
Jan
from hugo-scroll.
Hi @damonlynch, I saw that you added icons to the Β»contactΒ«-section of https://damonlynch.net/, so I suppose we can close this issue.
By the way, I really like what you did with the theme. https://damonlynch.net/ looks very nice ππ» .
from hugo-scroll.
Thanks Jan for the detailed instructions, and for your kind words! Do you want the theme's README.md updated to include some of this information? Of course you probably don't want to overwhelm that page with extraneous information, but I suppose a hint that it's possible to add these features easily might provide enough encouragement for others to also use your theme.
If you do like this idea, I can try to figure out how to do it in git and make a pull request. I'm very new to git but I need to figure git basics out at some point.
from hugo-scroll.
Hi @damonlynch, I took the time
- to update the included
font-awesome
-icons tov4.7.0
(edc1493) - add an
icon
-shortcode and add an"Using icons"
-section to theREADME.md
(bde8291).
What do you think? Is that good enough?
PS:
I'm very new to git but I need to figure git basics out at some point.
If it's just about editing some .md
-files for documentation, you might also want to try to use the Github-UI directly to make up a pull request.
from hugo-scroll.
Related Issues (20)
- Provide option to show GitInfo in footer HOT 2
- Changelog and semantic versioning to keep track of changes HOT 1
- Left menu visual guard HOT 1
- Top menu is not diplayed HOT 3
- Trying to get content to display in columns HOT 3
- git push to netlify uses exampleSite theme colours HOT 2
- I can't Deploy my website due to theme HOT 1
- Link de-activation glitch on Safari iOS HOT 5
- Creating a Page on Github Using Hugo Themes HOT 1
- List icon configurable HOT 4
- scale images on small and large screens HOT 18
- Add start item to navigation menu to go back to top cover image HOT 10
- link to internal page from cover image HOT 1
- Smooth transition sections not working in Edge HOT 6
- "Return to top" link in menu does not work HOT 3
- Error render of page failed. HOT 1
- Allow baseURL with subdirectory and multilang support HOT 2
- Contact icons are not centered in the footer HOT 4
- BUG: `tel:` link is broken with the new dynamic contacts system HOT 2
- Use RelPermalink instead of Permalink to address upstream multihost bug
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-scroll.