Reorganize partials
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{{ partial "image/index.html" (dict
|
||||
"path" .Destination
|
||||
{{ partial "components/image/index.html" (dict
|
||||
"src" .Destination
|
||||
"caption" .Text
|
||||
"alt" .Title
|
||||
)
|
||||
|
@@ -1,41 +1,14 @@
|
||||
<!doctype html>
|
||||
<html lang="{{- .Site.LanguageCode -}}">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
{{ partial "components/head/index.html" . }}
|
||||
|
||||
<title>
|
||||
{{- if .IsHome -}}
|
||||
{{ .Site.Title }}
|
||||
{{- else -}}
|
||||
{{ .Site.Title }} ·
|
||||
{{ .Title }}
|
||||
{{- end -}}
|
||||
</title>
|
||||
|
||||
{{ with .Site.Params.description }}
|
||||
<meta name="description" content="{{- . -}}" />
|
||||
{{ end }}
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
{{ partial "head/bots.html" . }}
|
||||
{{ partial "head/rss.html" . }}
|
||||
|
||||
{{ partial "head/opengraph.html" . }}
|
||||
{{ partial "head/twitter.html" . }}
|
||||
|
||||
{{ partial "head/js.html" . }}
|
||||
{{ partial "head/css.html" . }}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{{ partial "header.html" . }}
|
||||
{{ partial "components/header.html" . }}
|
||||
|
||||
{{ block "main" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "footer.html" . }}
|
||||
{{ partial "components/footer.html" . }}
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
{{ $withMeta := default true .Params.withMeta }}
|
||||
<main class="{{- if $withMeta -}}with-meta{{- end -}}">
|
||||
{{ if $withMeta }}
|
||||
{{ partial "list/meta.html" . }}
|
||||
{{ partial "components/list/meta.html" . }}
|
||||
{{ end }}
|
||||
<div class="content">
|
||||
{{ partial "posts/list.html" . }}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
{{ partial "posts/hero.html" . }}
|
||||
{{ partial "components/hero/default.html" . }}
|
||||
<div class="content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
@@ -2,7 +2,7 @@
|
||||
{{ $withMeta := default true .Params.withMeta }}
|
||||
<main class="{{- if $withMeta -}}with-meta{{- end -}}">
|
||||
{{ if $withMeta }}
|
||||
{{ partial "list/meta.html" . }}
|
||||
{{ partial "components/list/meta.html" . }}
|
||||
{{ end }}
|
||||
<div class="{{- if $withMeta -}}content{{- else -}}content wide{{- end -}}">
|
||||
{{ partial "gallery/list.html" . }}
|
||||
|
29
layouts/partials/components/head/index.html
Normal file
29
layouts/partials/components/head/index.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
|
||||
<title>
|
||||
{{- if .IsHome -}}
|
||||
{{ .Site.Title }}
|
||||
{{- else -}}
|
||||
{{ .Site.Title }} ·
|
||||
{{ .Title }}
|
||||
{{- end -}}
|
||||
</title>
|
||||
|
||||
{{ with .Site.Params.description }}
|
||||
<meta name="description" content="{{- . -}}" />
|
||||
{{ end }}
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
|
||||
{{ partial "components/head/bots.html" . }}
|
||||
{{ partial "components/head/rss.html" . }}
|
||||
|
||||
{{ partial "components/head/opengraph.html" . }}
|
||||
{{ partial "components/head/twitter.html" . }}
|
||||
|
||||
{{ partial "components/head/js.html" . }}
|
||||
{{ partial "components/head/css.html" . }}
|
||||
</head>
|
8
layouts/partials/components/head/rss.html
Normal file
8
layouts/partials/components/head/rss.html
Normal file
@@ -0,0 +1,8 @@
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
<link
|
||||
href="{{- .Permalink -}}"
|
||||
rel="{{- .Rel -}}"
|
||||
type="{{- .MediaType.Type -}}"
|
||||
title="{{- $.Site.Title -}}"
|
||||
/>
|
||||
{{ end }}
|
@@ -5,5 +5,5 @@
|
||||
·
|
||||
<span class="duration">{{ printf "%d MIN READ" .ReadingTime }}</span>
|
||||
</div>
|
||||
{{ partial "image/index.html" .Params.hero }}
|
||||
{{ partial "components/image/index.html" .Params.hero }}
|
||||
</section>
|
@@ -1,4 +1,4 @@
|
||||
{{ $imageData := partial "image/reflect.html" . }}
|
||||
{{ $imageData := partial "components/image/reflect.html" . }}
|
||||
{{- with $imageData.image -}}
|
||||
<figure class="captioned-image lightbox">
|
||||
<a
|
||||
@@ -15,7 +15,7 @@
|
||||
{{ with $imageData.alt }}alt="{{- . -}}"{{ end }}
|
||||
/>
|
||||
</a>
|
||||
{{ with $imageData.title }}
|
||||
{{ with $imageData.caption }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
{{ end }}
|
||||
</figure>
|
@@ -1,16 +1,18 @@
|
||||
{{- $input := . -}}
|
||||
|
||||
{{- $src := $input -}}
|
||||
{{- $caption := "" -}}
|
||||
{{- $title := "" -}}
|
||||
{{- $alt := "" -}}
|
||||
|
||||
{{- if reflect.IsMap $input -}}
|
||||
{{- $src = $input.src | default $input.path | default "" -}}
|
||||
{{- $title = $input.title | default $input.caption | default "" -}}
|
||||
{{- $alt = $input.alt | default $title -}}
|
||||
{{- $src = $input.src | default "" -}}
|
||||
{{- $caption = $input.caption | default "" -}}
|
||||
{{- $title = $input.title | default $caption | default "" -}}
|
||||
{{- $alt = $input.alt | default $title | default "" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ $result := dict "image" nil "title" $title "alt" $alt }}
|
||||
{{ $result := dict "image" nil "caption" $caption "title" $title "alt" $alt }}
|
||||
|
||||
{{- if $src -}}
|
||||
{{- $isRemote := strings.HasPrefix $src "http" -}}
|
||||
@@ -23,7 +25,7 @@
|
||||
{{- $image = resources.Get $src -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $result = (dict "image" $image "title" $title "alt" $alt) -}}
|
||||
{{- $result = (dict "image" $image "caption" $caption "title" $title "alt" $alt) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return $result -}}
|
@@ -2,7 +2,7 @@
|
||||
<div class="grid-sizer"></div>
|
||||
{{ range sort .Pages "Date" "desc" }}
|
||||
{{ if not .Params.private }}
|
||||
{{ $imageData := partial "image/reflect.html" .Params.hero }}
|
||||
{{ $imageData := partial "components/image/reflect.html" .Params.hero }}
|
||||
{{ with $imageData.image }}
|
||||
<div class="image grid-item">
|
||||
<a
|
||||
|
@@ -1,3 +0,0 @@
|
||||
{{ with .OutputFormats.Get "RSS" }}
|
||||
<link href="{{- .Permalink -}}" rel="{{- .Rel -}}" type="{{- .MediaType.Type -}}" title="{{- $.Site.Title -}}" />
|
||||
{{ end }}
|
Reference in New Issue
Block a user