Skip to content

Commit

Permalink
Merge pull request #129 from ottlinger/patch-5
Browse files Browse the repository at this point in the history
Add ability to reference icons in external links
  • Loading branch information
zjedi authored Mar 30, 2023
2 parents 85b56d3 + ef8fe58 commit dd85215
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ You can also use `extlink` shortcode to create a link opening in a new tab:
```markdown
Visit as at {{<extlink text="Instagram" href="https://www.instagram.com/yourInstagramName/">}}
```
Referencing and showing icons in front of the link text is possible with a new parameter `icon`:
```markdown
Visit as at {{<extlink icon="fa fa-instagram" text="Instagram" href="https://www.instagram.com/yourInstagramName/">}}
```

### Customizing CSS
Add a `custom_head.html`-file to your `layouts/partials`-directory. In there you may add a `<style>`-tag _or_ you may add a `<link>`-tag referencing your own `custom.css` (in case you prefer to have a separate `.css`-file). Checkout the [`custom_head.html`](https://github.com/zjedi/hugo-scroll/blob/master/exampleSite/layouts/partials/custom_head.html)-file from the `exampleSite`-directory to get started and to find more detailed instructions.
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/homepage/credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ header_menu: true
---
In this section we give thanks to authors of resources used on this demo page.
![Nice picture to make you pay me ;-)](images/chef-hat.png)
{{<extlink text="Chef-hat icons created by Cuputo - Flaticon" href="https://www.flaticon.com/free-icons/chef-hat">}}
{{<extlink text="Chef-hat icons created by Cuputo - Flaticon" href="https://www.flaticon.com/free-icons/chef-hat" icon="fa fa-external-link">}}
2 changes: 1 addition & 1 deletion layouts/shortcodes/extlink.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ with .Get "href" }}<a href="{{ . }}" target="_blank">{{ end }}{{ with .Get "text" }}{{ . }}</a>{{ end }}
{{ with .Get "href" }}<a href="{{ . }}" target="_blank">{{ end }}{{ with .Get "icon" }}<i class="{{ . }}"></i> {{ end }}{{ with .Get "text" }}{{ . }}</a>{{ end }}

0 comments on commit dd85215

Please sign in to comment.