Исправлена разметка

This commit is contained in:
MultiMote 2023-01-07 11:53:48 +03:00
parent 6628e132a7
commit 78a5782a4c
6 changed files with 33 additions and 24 deletions

View File

@ -12,6 +12,9 @@ enableRobotsTXT = true
posts = "/:slugorfilename"
other = "/:slugorfilename"
[markup]
[markup.highlight]
style = 'monokailight'
[markup.goldmark.parser]
wrapStandAloneImageWithinParagraph = false

View File

@ -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;

View File

@ -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 {

View File

@ -1,8 +1,11 @@
{{ 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 }}
@ -11,15 +14,18 @@
{{ if $img -}}
<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 }}

View File

@ -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 }}

View File

@ -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" }}