Rename icon name to title
This commit is contained in:
@@ -591,7 +591,7 @@ The `paige/icon` shortcode provides a web font icon.
|
||||
```
|
||||
{{< paige/icon
|
||||
class=""
|
||||
name=""
|
||||
title=""
|
||||
url="" >}}
|
||||
```
|
||||
|
||||
@@ -602,8 +602,8 @@ Parameters:
|
||||
<dl>
|
||||
<dt><code>class</code></dt>
|
||||
<dd>Required. Position 0. String. <code><i></code> class. Example is <code>bi bi-github</code>.</dd>
|
||||
<dt><code>name</code></dt>
|
||||
<dd>Optional. String. The screen reader description. Example is <code>GitHub</code>.</dd>
|
||||
<dt><code>title</code></dt>
|
||||
<dd>Optional. String. The screen reader description and anchor title. Example is <code>GitHub</code>.</dd>
|
||||
<dt><code>url</code></dt>
|
||||
<dd>Optional. String. URL. Example is <code>https://github.com/willfaught/paige</code>. E-mails in URLs with a <code>mailto:</code> scheme are protected from web crawlers.</dd>
|
||||
</dl>
|
||||
|
@@ -32,5 +32,5 @@ title: "Paige"
|
||||
</p>
|
||||
|
||||
<div class="column-gap-3 d-flex display-6 justify-content-center mb-3">
|
||||
{{< paige/icon class="bi bi-github" name="GitHub" url="https://github.com/willfaught/paige" >}}
|
||||
{{< paige/icon class="bi bi-github" title="GitHub" url="https://github.com/willfaught/paige" >}}
|
||||
</div>
|
||||
|
@@ -23,17 +23,17 @@ Result:
|
||||
|
||||
<p class="display-1">Icon: {{< paige/icon class="bi bi-github" >}}</p>
|
||||
|
||||
## Name parameter
|
||||
## Title parameter
|
||||
|
||||
Code:
|
||||
|
||||
```go-html-template
|
||||
<p class="display-1">Icon: {{</* paige/icon class="bi bi-github" name="GitHub" */>}}</p>
|
||||
<p class="display-1">Icon: {{</* paige/icon class="bi bi-github" title="GitHub" */>}}</p>
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
<p class="display-1">Icon: {{< paige/icon class="bi bi-github" name="GitHub" >}}</p>
|
||||
<p class="display-1">Icon: {{< paige/icon class="bi bi-github" title="GitHub" >}}</p>
|
||||
|
||||
## Url parameter
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{{ $class := .Get 0 | default (.Get "class") }}
|
||||
{{ $name := .Get "name" }}
|
||||
{{ $title := .Get "title" }}
|
||||
{{ $url := .Get "url" }}
|
||||
|
||||
{{ if not $class }}
|
||||
@@ -8,10 +8,10 @@
|
||||
|
||||
<span class="paige-icon">
|
||||
{{ with $url }}
|
||||
<a href="{{ . }}" {{ with $name }} title="{{ . }}" {{ end }}>
|
||||
<a href="{{ . }}" {{ with $title }} title="{{ . }}" {{ end }}>
|
||||
{{ end }}
|
||||
|
||||
<i class="{{ $class }}">{{ with $name }}<span class="visually-hidden">{{ . }}</span>{{ end }}</i>
|
||||
<i class="{{ $class }}">{{ with $title }}<span class="visually-hidden">{{ . }}</span>{{ end }}</i>
|
||||
|
||||
{{ if $url }}
|
||||
</a>
|
||||
|
Reference in New Issue
Block a user