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

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

View File

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

View File

@ -14,7 +14,7 @@ $page-bg-color: #dfdfdf;
$page-bg-image: "/images/bg.jpg"; $page-bg-image: "/images/bg.jpg";
$post-bg-color: white; $post-bg-color: white;
$image-wrappper-bg-color: #fcfcfc; $image-wrapper-bg-color: #fcfcfc;
$image-wrappper-border-color: #d6d6d6; $image-wrapper-border-color: #d6d6d6;
$table-border-color: #d6d6d6; $table-border-color: #d6d6d6;

View File

@ -53,8 +53,8 @@ nav.navbar {
text-align: center; text-align: center;
margin: 0; margin: 0;
padding: 16px; padding: 16px;
background-color: $image-wrappper-bg-color; background-color: $image-wrapper-bg-color;
border: 1px solid $image-wrappper-border-color; border: 1px solid $image-wrapper-border-color;
} }
img { img {

View File

@ -1,25 +1,31 @@
{{ if .IsBlock }}
<figure class="image-wrapper"> <figure class="image-wrapper">
{{ end }}
{{/* Remote image */ -}} {{/* Remote image */ -}}
{{ if or (hasPrefix .Destination "https://") (hasPrefix .Destination "http://") }} {{ if or (hasPrefix .Destination "https://") (hasPrefix .Destination "http://") }}
<a class="spotlight" data-title="{{ .Title | default "false" }}" href="{{ .Destination | safeURL }}" > <a class="spotlight" data-title="{{ .Title | default "false" }}" href="{{ .Destination | safeURL }}" >
<img src="{{ .Destination | safeURL }}" alt="{{.Text}}" /> <img src="{{ .Destination | safeURL }}" alt="{{.Text}}">
</a> </a>
{{/* Local image */ -}} {{/* Local image */ -}}
{{ else }} {{ else }}
{{- $img := .Page.Resources.GetMatch .Destination -}} {{- $img := .Page.Resources.GetMatch .Destination -}}
{{- $resizeMimes := slice "image/png" "image/jpeg" -}} {{- $resizeMimes := slice "image/png" "image/jpeg" -}}
{{ if $img -}} {{ 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 -}} {{ 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 -}} {{- else -}}
<img src="{{ $img.RelPermalink | safeURL }}" alt="{{.Text}}" /> <img src="{{ $img.RelPermalink | safeURL }}" alt="{{.Text}}">
{{- end -}} {{- end -}}
</a> </a>
{{- else -}} {{- else -}}
<img src="/images/image-error.png" alt="{{.Text}}" /> <img src="/images/image-error.png" alt="{{.Text}}">
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{ if .Title }}<figcaption>{{ .Title }}</figcaption>{{ end }} {{ if and (.IsBlock) (.Title) }}<figcaption>{{ .Title }}</figcaption>{{ end }}
{{ if .IsBlock }}
</figure> </figure>
{{ end }}

View File

@ -2,9 +2,9 @@
<html lang="{{ site.LanguageCode }}"> <html lang="{{ site.LanguageCode }}">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta property="og:locale" content="{{ site.LanguageCode }}" /> <meta property="og:locale" content="{{ site.LanguageCode }}">
<meta property="og:site_name" content="{{ .Site.Title }}" /> <meta property="og:site_name" content="{{ .Site.Title }}">
<link rel="icon" href="/images/favicon.png" type="image/png"> <link rel="icon" href="/images/favicon.png" type="image/png">
{{ block "head_meta" . }}{{ end }} {{ block "head_meta" . }}{{ end }}

View File

@ -1,13 +1,13 @@
{{ define "head_meta" }} {{ define "head_meta" }}
<meta property="og:type" content="article" /> <meta property="og:type" content="article">
<meta property="og:title" content="{{ .Title }}" /> <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 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:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
<meta property="og:url" content="{{ .Permalink }}" /> <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 .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 }} {{ 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 -}} {{ $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}} {{end}}
{{ define "main" }} {{ define "main" }}