Skip to content

Commit

Permalink
Clean up some HTML things, rename fa shortcode to icon
Browse files Browse the repository at this point in the history
  • Loading branch information
brianreumere committed Jan 25, 2024
1 parent 83fac95 commit 110bf68
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ menu:

### SVG icon

If you download an SVG icon (e.g., from Font Awesome) and place it in the `icons` directory at the root of your Hugo site repo (**not** in the `content` or `static` directories), you can use it inline with your Markdown content by using the `fa` shortcode. The parameter is the name of the icon file (without the `.svg` file extension). The SVG will have the `aria-hidden="true"` attribute added so it [isn't included in the accessibility tree](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-hidden_attribute), so do not use it for any interactive functionality; it should be purely decorative.
If you download an SVG icon (e.g., from Font Awesome) and place it in the `icons` directory at the root of your Hugo site repo (**not** in the `content` or `static` directories), you can use it inline with your Markdown content by using the `icon` shortcode. The parameter is the name of the icon file (without the `.svg` file extension). The SVG will have the `aria-hidden="true"` attribute added so it [isn't included in the accessibility tree](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-hidden_attribute), so do not use it for any interactive functionality; it should be purely decorative.

```
{{< fa "github" >}}
{{< icon "github" >}}
```

### Callout
Expand Down
1 change: 0 additions & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@
<div class="h-card social">
{{ partial "social.html" . -}}
</div>
</div>
2 changes: 1 addition & 1 deletion layouts/partials/hcard.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Default h-card -->
<p>
<a class="u-url" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
created by {{ with .Site.Params.Hcard.Avatar }}<img class="u-photo" alt="" src="{{ . | absURL }}" /> {{ end }}<span class="p-name" rel="me">{{ .Site.Params.Hcard.FullName }}</span>
created by {{ with .Site.Params.Hcard.Avatar }}<img class="u-photo" alt="" src="{{ . | absURL }}"> {{ end }}<span class="p-name" rel="me">{{ .Site.Params.Hcard.FullName }}</span>
{{- with .Site.Params.Hcard.Pronouns -}}
{{- $len_pronouns := (len .) }}
({{ range $index, $element := . }}<span class="u-pronoun">{{ $element }}</span>
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<a class="site-header" href="{{ .Site.BaseURL }}">{{ .Site.Params.siteHeaderText }}</a>
</div>
<div class="site-nav">
<nav role="navigation" aria-label="Site menu" class="site-nav">
<nav aria-label="Site menu" class="site-nav">
{{- $currentPage := . -}}
{{- range $index, $element := .Site.Menus.main -}}
{{- $len_nav_items := (len $.Site.Menus.main) -}}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/social.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{- range .Site.Params.Hcard.Social -}}
<a class="u-url" rel="me" aria-label="{{ .platform }}" href="{{ (printf .url_pattern .identity) }}"><span class="social-icon" >{{ partial "fa-svg-icon.html" .platform }}</span></a>
{{ end -}}
<a class="u-url" rel="me" aria-label="{{ .platform }}" href="{{ (printf .url_pattern .identity) }}"><span class="social-icon" >{{ partial "svg-icon.html" .platform }}</span></a>
{{ end -}}
File renamed without changes.
1 change: 0 additions & 1 deletion layouts/shortcodes/fa.html

This file was deleted.

1 change: 1 addition & 0 deletions layouts/shortcodes/icon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<span class="inline-icon">{{ partial "svg-icon.html" (.Get 0) }}</span>

0 comments on commit 110bf68

Please sign in to comment.