mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-19 04:35:31 -04:00
swap native emojis for Twemojis 🎉 (#92)
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
{{ block "main" . }}{{ end }}
|
||||
</div>
|
||||
{{ partialCached "page/footer" . }}
|
||||
{{ partial "scripts/twemoji" . }}
|
||||
{{ partial "scripts/shortcodes" . }}
|
||||
{{ if eq hugo.Environment "production" }}
|
||||
{{ partialCached "scripts/simple_analytics" . }}
|
||||
|
@@ -10,6 +10,10 @@
|
||||
/fonts/*
|
||||
Cache-Control: max-age=31536000, public, immutable, no-transform
|
||||
|
||||
# Super long cache for Twemojis (one year)
|
||||
/twemoji/*
|
||||
Cache-Control: max-age=31536000, public, immutable, no-transform
|
||||
|
||||
# Recommended MIME type for PWA manifests
|
||||
# https://github.com/w3c/manifest/issues/689
|
||||
/manifest.json
|
||||
|
@@ -6,7 +6,7 @@
|
||||
</a>
|
||||
<ul>
|
||||
{{- range .Site.Menus.main }}
|
||||
<li><a class="no-underline" {{ printf "href=%q" .URL | safeHTMLAttr }} aria-label="{{ .Name }}"{{ if strings.HasPrefix .URL "http" }} target="_blank" rel="me noopener"{{ end }}><span class="emoji">{{ .Pre }}</span><span class="text">{{ .Name }}</span></a></li>
|
||||
<li><a class="no-underline" {{ printf "href=%q" .URL | safeHTMLAttr }} aria-label="{{ .Name }}"{{ if strings.HasPrefix .URL "http" }} target="_blank" rel="me noopener"{{ end }}><span class="icon">{{ .Pre }}</span><span class="text">{{ .Name }}</span></a></li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</nav>
|
||||
|
2
layouts/partials/scripts/twemoji.html
Normal file
2
layouts/partials/scripts/twemoji.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<script src="{{ "/twemoji/twemoji.min.js" | absURL }}"></script>
|
||||
<script>twemoji.parse(document.body,{base:'{{ "/" | absURL }}',folder:'twemoji/svg',ext:'.svg'})</script>
|
@@ -9,6 +9,6 @@
|
||||
<figcaption>{{ . | $.Page.RenderString | safeHTML }}</figcaption>
|
||||
</figure>
|
||||
{{- else -}}
|
||||
<p><img src="{{ $optimized.Permalink }}" width="{{ $optimized.Width }}" height="{{ $optimized.Height }}"
|
||||
{{- with .Get "alt" }} alt="{{ . | safeHTML }}" title="{{ . | safeHTML }}"{{ end }}></p>
|
||||
<p class="image"><img src="{{ $optimized.Permalink }}" width="{{ $optimized.Width }}" height="{{ $optimized.Height }}"
|
||||
{{- with .Get "alt" }} alt="{{ . | safeHTML }}" title="{{ . | safeHTML }}"{{ end }}></p>
|
||||
{{- end }}
|
||||
|
Reference in New Issue
Block a user