Исправлена разметка
This commit is contained in:
parent
6628e132a7
commit
78a5782a4c
@ -12,6 +12,9 @@ enableRobotsTXT = true
|
||||
posts = "/:slugorfilename"
|
||||
other = "/:slugorfilename"
|
||||
|
||||
[markup]
|
||||
[markup.highlight]
|
||||
style = 'monokailight'
|
||||
|
||||
[markup.highlight]
|
||||
style = 'monokailight'
|
||||
|
||||
[markup.goldmark.parser]
|
||||
wrapStandAloneImageWithinParagraph = false
|
||||
|
@ -14,7 +14,7 @@ $page-bg-color: #dfdfdf;
|
||||
$page-bg-image: "/images/bg.jpg";
|
||||
$post-bg-color: white;
|
||||
|
||||
$image-wrappper-bg-color: #fcfcfc;
|
||||
$image-wrappper-border-color: #d6d6d6;
|
||||
$image-wrapper-bg-color: #fcfcfc;
|
||||
$image-wrapper-border-color: #d6d6d6;
|
||||
|
||||
$table-border-color: #d6d6d6;
|
@ -53,8 +53,8 @@ nav.navbar {
|
||||
text-align: center;
|
||||
margin: 0;
|
||||
padding: 16px;
|
||||
background-color: $image-wrappper-bg-color;
|
||||
border: 1px solid $image-wrappper-border-color;
|
||||
background-color: $image-wrapper-bg-color;
|
||||
border: 1px solid $image-wrapper-border-color;
|
||||
}
|
||||
|
||||
img {
|
||||
|
@ -1,25 +1,31 @@
|
||||
{{ if .IsBlock }}
|
||||
<figure class="image-wrapper">
|
||||
{{ end }}
|
||||
|
||||
{{/* Remote image */ -}}
|
||||
{{ if or (hasPrefix .Destination "https://") (hasPrefix .Destination "http://") }}
|
||||
<a class="spotlight" data-title="{{ .Title | default "false" }}" href="{{ .Destination | safeURL }}" >
|
||||
<img src="{{ .Destination | safeURL }}" alt="{{.Text}}" />
|
||||
<img src="{{ .Destination | safeURL }}" alt="{{.Text}}">
|
||||
</a>
|
||||
{{/* Local image */ -}}
|
||||
{{ else }}
|
||||
{{- $img := .Page.Resources.GetMatch .Destination -}}
|
||||
{{- $resizeMimes := slice "image/png" "image/jpeg" -}}
|
||||
{{ if $img -}}
|
||||
<a class="spotlight" data-title="{{ .Title | default "false" }}" href="{{ $img.RelPermalink | safeURL }}" >
|
||||
<a class="spotlight" data-title="{{ .Title | default "false" }}" href="{{ $img.RelPermalink | safeURL }}">
|
||||
{{ if in $resizeMimes $img.MediaType.Type -}}
|
||||
<img src="{{ ($img.Fit "1024x1024").RelPermalink | safeURL }}" alt="{{.Text}}" />
|
||||
<img src="{{ ($img.Fit "1024x1024").RelPermalink | safeURL }}" alt="{{.Text}}">
|
||||
{{- else -}}
|
||||
<img src="{{ $img.RelPermalink | safeURL }}" alt="{{.Text}}" />
|
||||
<img src="{{ $img.RelPermalink | safeURL }}" alt="{{.Text}}">
|
||||
{{- end -}}
|
||||
</a>
|
||||
{{- else -}}
|
||||
<img src="/images/image-error.png" alt="{{.Text}}" />
|
||||
<img src="/images/image-error.png" alt="{{.Text}}">
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ if .Title }}<figcaption>{{ .Title }}</figcaption>{{ end }}
|
||||
{{ if and (.IsBlock) (.Title) }}<figcaption>{{ .Title }}</figcaption>{{ end }}
|
||||
|
||||
{{ if .IsBlock }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
|
@ -2,9 +2,9 @@
|
||||
<html lang="{{ site.LanguageCode }}">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<meta property="og:locale" content="{{ site.LanguageCode }}" />
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta property="og:locale" content="{{ site.LanguageCode }}">
|
||||
<meta property="og:site_name" content="{{ .Site.Title }}">
|
||||
<link rel="icon" href="/images/favicon.png" type="image/png">
|
||||
|
||||
{{ block "head_meta" . }}{{ end }}
|
||||
|
@ -1,13 +1,13 @@
|
||||
{{ define "head_meta" }}
|
||||
<meta property="og:type" content="article" />
|
||||
<meta property="og:title" content="{{ .Title }}" />
|
||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"/>
|
||||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
|
||||
<meta property="og:url" content="{{ .Permalink }}" />
|
||||
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format "2006-01-02T15:04:05-07:00" | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
||||
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format "2006-01-02T15:04:05-07:00" | printf "content=%q" | safeHTMLAttr }} />{{ end }}
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:title" content="{{ .Title }}">
|
||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
||||
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
|
||||
<meta property="og:url" content="{{ .Permalink }}">
|
||||
{{ with .PublishDate }}<meta property="article:published_time" {{ .Format "2006-01-02T15:04:05-07:00" | printf "content=%q" | safeHTMLAttr }}>{{ end }}
|
||||
{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format "2006-01-02T15:04:05-07:00" | printf "content=%q" | safeHTMLAttr }}>{{ end }}
|
||||
{{ $thumb := $.Resources.Get $.Params.featured_image -}}
|
||||
{{ with $thumb }}<meta property="og:image" content="{{ (.Fit "1024x1024").Permalink }}" />{{end}}
|
||||
{{ with $thumb }}<meta property="og:image" content="{{ (.Fit "1024x1024").Permalink }}">{{end}}
|
||||
{{end}}
|
||||
|
||||
{{ define "main" }}
|
||||
|
Loading…
Reference in New Issue
Block a user