Merge pull request #129 from ottlinger/patch-5

Add ability to reference icons in external links
This commit is contained in:
zjedi 2023-03-30 12:36:54 +02:00 committed by GitHub
commit dd852157f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -49,6 +49,10 @@ You can also use `extlink` shortcode to create a link opening in a new tab:
```markdown ```markdown
Visit as at {{<extlink text="Instagram" href="https://www.instagram.com/yourInstagramName/">}} 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 ### 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. 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.

View file

@ -5,4 +5,4 @@ header_menu: true
--- ---
In this section we give thanks to authors of resources used on this demo page. 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) ![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">}}

View file

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