jlelse
/
Indieroad
Archived
1
Fork 0

Fix meta description and make theme more mobile friendly

This commit is contained in:
Jan-Lukas Else 2020-05-02 09:33:38 +02:00
parent de9866362e
commit a544ec9a40
8 changed files with 73 additions and 18 deletions

View File

@ -581,6 +581,29 @@ select {
}
}
.actions {
@extend .clearfix;
margin-top: 15px;
margin-bottom: 15px;
font-size: .75rem;
line-height: 1;
@include color(color, contrast-text);
.action-item {
float: left;
margin: 0 6px 6px 0;
text-transform: uppercase;
@include color(background, contrast-background);
&:hover {
@include color(background, main-color);
}
.action-link {
@extend .btn;
display: block;
padding: 10px 15px;
}
}
}
@mixin subarticle-element {
padding-top: 10px;
padding-bottom: 10px;

View File

@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ block "title" . }}{{ if not .IsHome }}{{ with .Title }}{{ . }} - {{end}}{{ end }}{{ .Site.Title }}{{ end }}</title>
<meta name="theme-color" content="{{ .Param "colors.main" | default "#0275D8" }}">
<meta name="description" content="{{ if .IsHome }}{{ .Site.Params.description }}{{else}}{{ .Params.Description }}{{end}}">
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/schema.html" . }}
{{ template "_internal/twitter_cards.html" . }}

View File

@ -8,13 +8,8 @@
{{ if not .Params.nometa }}
<div class="post-meta">
{{ partial "post_meta" . }}
{{ if (.Param "speak") }}
<div id="speakBtn" class="item" style="display: none;"></div>
{{ $speakScript := resources.Get "js/speak.js" | minify | fingerprint }}
<script>const speakText = "{{ T "speak" }}";const stopSpeakText = "{{ T "stopspeak" }}";</script>
<script defer src="{{ $speakScript.RelPermalink }}" integrity="{{ $speakScript.Data.Integrity }}"></script>
{{ end }}
</div>
{{ partial "post_actions" . }}
{{ end }}
</header>
{{ partial "oldcontentwarning" . }}

View File

@ -13,7 +13,7 @@
{{ end }}
{{ end }}
{{ if not .Params.nometa }}
{{ with partialCached "post_meta" . .RelPermalink }}
{{ with partialCached "summary_meta" . .RelPermalink }}
<div class="list-meta">{{ . }}</div>
{{ end }}
{{ end }}

View File

@ -1,8 +1,3 @@
{{ if .Param "shareLink" }}
<div class="item">
<a href="https://www.addtoany.com/share#url={{ .Permalink }}{{ with .Title }}&title={{ . }}{{ end }}" target="_blank" rel="nofollow noopener noreferrer">{{ T "share" }}</a>
</div>
{{ end }}
{{ if .IsTranslated }}
<div class="item">
{{ i18n "translations" }}: {{ $delimiter := "" }}{{ range .Translations }}{{ $delimiter }}<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>{{ $delimiter = ", " }}{{ end }}

View File

@ -0,0 +1,13 @@
{{ if or (.Param "shareLink") (.Param "speak") }}
<div class="actions">
{{ if (.Param "shareLink") }}
<div class="action-item"><a class="action-link" href="https://www.addtoany.com/share#url={{ .Permalink }}{{ with .Title }}&title={{ . }}{{ end }}" target="_blank" rel="nofollow noopener noreferrer">{{ T "share" }}</a></div>
{{ end }}
{{ if (.Param "speak") }}
<div class="action-item"><div id="speakBtn" class="action-link" style="display: none;"></div></div>
{{ $speakScript := resources.Get "js/speak.js" | minify | fingerprint }}
<script>const speakText = "{{ T "speak" }}";const stopSpeakText = "{{ T "stopspeak" }}";</script>
<script defer src="{{ $speakScript.RelPermalink }}" integrity="{{ $speakScript.Data.Integrity }}"></script>
{{ end }}
</div>
{{ end }}

View File

@ -27,11 +27,6 @@
</div>
{{ end }}
{{ end }}
{{ if .Param "shareLink" }}
<div class="item">
<a href="https://www.addtoany.com/share#url={{ .Permalink }}{{ with .Title }}&title={{ . }}{{ end }}" target="_blank" rel="nofollow noopener noreferrer">{{ T "share" }}</a>
</div>
{{ end }}
{{ with .Param "syndicate" }}
<div class="item">
{{ T "also_on" }}:{{ $delimiter := "" }}{{ range $index, $link := . }}{{ $delimiter }} <a class="u-syndication" href="{{ $link }}" target="_blank" rel="nofollow noopener noreferrer">{{ (urls.Parse $link).Host }}</a>{{ $delimiter = "," }}{{ end }}

View File

@ -0,0 +1,34 @@
{{ if not (eq .FirstSection.RelPermalink .RelPermalink) }}
<div class="item">
<a href="{{ .FirstSection.RelPermalink }}">{{ .FirstSection.Title }}</a>
</div>
{{ end }}
{{ if not .Date.IsZero }}
<div class="item">
<time class="dt-published" datetime="{{.Date.Format "2006-01-02T15:04:05Z07:00"}}">{{.Date.Format ( .Site.Params.dateformat | default "January 02, 2006")}}</time>
</div>
{{ end }}
{{ if ne .Date .Lastmod }}
<div class="item">
<time class="dt-updated" datetime="{{.Lastmod.Format "2006-01-02T15:04:05Z07:00"}}">{{ T "meta_lastmod" }}: {{.Lastmod.Format ( .Site.Params.dateformat | default "January 02, 2006")}}</time>
</div>
{{ end }}
{{ with .Param "indieweb.reply" }}
{{ if .link }}
<div class="item">
{{ T "meta_reply_to" }}: <a class="u-in-reply-to" href="{{ .link }}" target="_blank" rel="noopener">{{ .title | default .link }}</a>
</div>
{{ end }}
{{ end }}
{{ with .Param "indieweb.like" }}
{{ if .link }}
<div class="item">
{{ T "meta_like_of" }}: <a class="u-like-of" href="{{ .link }}" target="_blank" rel="noopener">{{ .title | default .link }}</a>
</div>
{{ end }}
{{ end }}
{{ if .IsTranslated }}
<div class="item">
{{ i18n "translations" }}: {{ $delimiter := "" }}{{ range .Translations }}{{ $delimiter }}<a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>{{ $delimiter = ", " }}{{ end }}
</div>
{{ end }}