diff options
author | rmaguiar <rmaguiar@tuta.io> | 2020-07-22 04:07:16 +0300 |
---|---|---|
committer | rmaguiar <rmaguiar@tuta.io> | 2020-07-22 04:07:16 +0300 |
commit | a50277a49583a47000e5aff8ac207acce219144f (patch) | |
tree | ce90e7ffc9156fc87ab230e451b691207cc379c6 /layouts | |
parent | 54b21900897539aacfa05b1923d19a56a19651c2 (diff) |
Add checking to font preloading
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/head.html | 6 | ||||
-rw-r--r-- | layouts/partials/search-form.html | 2 | ||||
-rw-r--r-- | layouts/shortcodes/contact-form.html | 16 | ||||
-rw-r--r-- | layouts/shortcodes/social.html | 4 |
4 files changed, 15 insertions, 13 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 2d334f8..d6b53cc 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -375,8 +375,10 @@ <!-- Preload fonts --> -{{ range (readDir "/public/fonts") }} - <link rel="preload" href="{{ printf "/fonts/%s" .Name | relURL }}" as="font" crossorigin="anonymous"> +{{ with (readDir "/public/fonts") }} + {{ range . }} + <link rel="preload" href="{{ printf "/fonts/%s" .Name | relURL }}" as="font" crossorigin="anonymous"> + {{ end }} {{ end }} <!-- Should be loaded even if browser has native lazy load support --> diff --git a/layouts/partials/search-form.html b/layouts/partials/search-form.html index 8f3813d..84d67e6 100644 --- a/layouts/partials/search-form.html +++ b/layouts/partials/search-form.html @@ -13,7 +13,7 @@ {{ else }} <form role="search" action="{{ $searchPage.RelPermalink }}"> {{ end }} - <label for="search-input">{{ T "search_label" }}</label><input type="search" id="search-input" title='{{ T "search_input_title" (dict "minLength" $minLength "maxLength" $maxLength) }}' name="q" {{ with .Site.Params.Search.placeholder }}placeholder="{{ . }}"{{ end }} minlength="{{ $minLength }}" maxlength="{{ $maxLength }}" pattern="^[\S].*" required><button aria-label='{{ T "search_button_aria_label" }}' type="submit"><svg aria-hidden="true"><use xlink:href="#search"/></svg></button> + <label class="label-form" for="search-input">{{ T "search_label" }}</label><input class="input-text" type="search" id="search-input" title='{{ T "search_input_title" (dict "minLength" $minLength "maxLength" $maxLength) }}' name="q" {{ with .Site.Params.Search.placeholder }}placeholder="{{ . }}"{{ end }} minlength="{{ $minLength }}" maxlength="{{ $maxLength }}" pattern="^[\S].*" required><button aria-label="{{ T "search_button_aria_label" }}" class="btn" type="submit"><svg aria-hidden="true"><use xlink:href="#search"/></svg></button> </form> <hr> </section> diff --git a/layouts/shortcodes/contact-form.html b/layouts/shortcodes/contact-form.html index 8dd4401..43f165e 100644 --- a/layouts/shortcodes/contact-form.html +++ b/layouts/shortcodes/contact-form.html @@ -6,16 +6,16 @@ <form id="contact" action="https://formspree.io/{{ or .Page.Params.Contact.formspreeFormId .Site.Params.Contact.formspreeFormId }}" method="post" accept-charset="utf-8"> - <label>{{ T "name" }} - <input aria-label="{{ T "name" }}" type="text" name="name" minlength="3" {{ with or .Page.Params.Contact.Placeholder.name .Site.Params.Contact.Placeholder.name }}placeholder="{{ . }}"{{ end }} autocomplete="{{ $autoComplete }}" required> + <label class="label-form">{{ T "name" }} + <input aria-label="{{ T "name" }}" class="input-text" type="text" name="name" minlength="3" {{ with or .Page.Params.Contact.Placeholder.name .Site.Params.Contact.Placeholder.name }}placeholder="{{ . }}"{{ end }} autocomplete="{{ $autoComplete }}" required> </label> - <label>Email<input aria-label="Email" type="email" name="_replyto" {{ with or .Page.Params.Contact.Placeholder.email .Site.Params.Contact.Placeholder.email }}placeholder="{{ . }}"{{ end }} autocomplete="{{ $autoComplete }}" required></label> + <label class="label-form">Email<input aria-label="Email" class="input-text" type="email" name="_replyto" {{ with or .Page.Params.Contact.Placeholder.email .Site.Params.Contact.Placeholder.email }}placeholder="{{ . }}"{{ end }} autocomplete="{{ $autoComplete }}" required></label> {{ with or .Page.Params.Contact.subject .Site.Params.Contact.subject }} {{ if gt (len .) 1 }} - <label>{{ T "subject" }} - <select aria-label="{{ T "subject" }}" name="_subject"> + <label class="label-form">{{ T "subject" }} + <select aria-label="{{ T "subject" }}" class="input-text" name="_subject"> {{ range . }} <option>{{ . }}</option> @@ -29,15 +29,15 @@ {{ else }} {{ with or .Page.Params.Contact.Placeholder.subject .Site.Params.Contact.Placeholder.subject }} - <label>{{ T "subject" }} - <input aria-label="{{ T "subject" }}" type="text" name="_subject" minlength="6" placeholder="{{ . }}" autocomplete="{{ $autoComplete }}" required> + <label class="label-form">{{ T "subject" }} + <input aria-label="{{ T "subject" }}" class="input-text" type="text" name="_subject" minlength="6" placeholder="{{ . }}" autocomplete="{{ $autoComplete }}" required> </label> {{ end }} {{ end }} - <label>{{ T "message" }}<textarea id="message" aria-label="{{ T "message" }}" rows="6" name="message" {{ with or .Page.Params.Contact.messageMinLength .Site.Params.Contact.messageMinLength | default 140 }}minlength="{{ . }}"{{ end }} {{ with or .Page.Params.Contact.Placeholder.message .Site.Params.Contact.Placeholder.message }}placeholder="{{ . }}"{{ end }} required></textarea></label> + <label class="label-form">{{ T "message" }}<textarea id="message" aria-label="{{ T "message" }}" class="input-text" rows="6" name="message" {{ with or .Page.Params.Contact.messageMinLength .Site.Params.Contact.messageMinLength | default 140 }}minlength="{{ . }}"{{ end }} {{ with or .Page.Params.Contact.Placeholder.message .Site.Params.Contact.Placeholder.message }}placeholder="{{ . }}"{{ end }} required></textarea></label> <input type="text" name="_gotcha" style="display:none"> diff --git a/layouts/shortcodes/social.html b/layouts/shortcodes/social.html index 6add002..508ece0 100644 --- a/layouts/shortcodes/social.html +++ b/layouts/shortcodes/social.html @@ -24,7 +24,7 @@ {{ $label = . }} {{ end }} - <a rel="me nofollow" href="{{ $url }}" title="{{ $label }}"> + <a class="btn" href="{{ $url }}" rel="me nofollow" title="{{ $label }}"> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> <use xlink:href="#{{ $currentIcon }}"/> </svg> @@ -39,7 +39,7 @@ {{ if (index (or $decentralizedOnPage $decentralizedOnSite) $currentEntry) }} {{ range (index (or $decentralizedOnPage $decentralizedOnSite) $currentEntry) }} - <a rel="me nofollow" href="{{ index . 0 }}" title="{{ printf "%s (%s)" (index . 1) $currentLabel }}"> + <a class="btn" href="{{ index . 0 }}" rel="me nofollow" title="{{ printf "%s (%s)" (index . 1) $currentLabel }}"> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> <use xlink:href="#{{ $currentIcon }}"/> </svg> |