From 7d89f5b86e20024351a4b53b94824d96aa228554 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Tue, 10 May 2022 21:36:54 -0700 Subject: [PATCH 1/6] whitespace Why is `list.html` identical to `index.html`? --- .editorconfig | 11 +++++++++++ layouts/_default/baseof.html | 6 +----- layouts/_default/list.html | 20 ++++++++++---------- layouts/_default/single.html | 10 ++++++---- layouts/index.html | 20 ++++++++++---------- layouts/partials/head.html | 4 ++-- layouts/post/single.html | 13 ++++++------- layouts/section/replies.html | 4 ++-- 8 files changed, 48 insertions(+), 40 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8a3acc9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 + +trim_trailing_whitespace = true +insert_final_newline = true + +[*.css] +indent_style = tab diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 660734d..126d0fd 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,21 +1,17 @@ - {{ partial "head.html" . }} - {{ partial "header.html" . }}
- {{ block "main" . }}{{ end }} + {{ block "main" . }}{{ end }}
{{ partial "footer.html" . }} {{ partial "custom_footer.html" . }} - - diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 7af7288..accac61 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,24 +1,24 @@ -{{ define "main" }} +{{ define "main" -}}

subscribe via RSS

-{{ end }} +{{- end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d24d6b4..3f0dd16 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,13 +1,15 @@ -{{ define "main" }} +{{ define "main" -}}
-

{{ .Title }}

+ {{- with .Title -}} +

{{ . }}

+ {{- end -}}
- {{ .Content }} + {{- .Content -}}
-{{ end }} \ No newline at end of file +{{- end }} diff --git a/layouts/index.html b/layouts/index.html index 3434cf8..accac61 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,24 +1,24 @@ -{{ define "main" }} +{{ define "main" -}}

subscribe via RSS

-{{ end }} +{{- end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 6ddc6f7..ae30d51 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -4,9 +4,9 @@ - {{ block "title" . }} + {{- block "title" . -}} {{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Site.Title }} - {{ .Title }}{{ end }} - {{ end }} + {{- end -}} diff --git a/layouts/post/single.html b/layouts/post/single.html index c6da9c8..1394b23 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -1,15 +1,14 @@ -{{ define "main" }} +{{ define "main" -}}
-
- {{ if .Title }} -

{{ .Title }}

- {{ end }} + {{ with .Title }} +

{{ . }}

+ {{ end }}
- {{ .Content }} + {{- .Content -}}
@@ -18,4 +17,4 @@

{{ .Title }}

{{ end }} -{{ end }} \ No newline at end of file +{{- end }} diff --git a/layouts/section/replies.html b/layouts/section/replies.html index 453cdd5..939c23e 100644 --- a/layouts/section/replies.html +++ b/layouts/section/replies.html @@ -1,4 +1,4 @@ -{{ define "main" }} +{{ define "main" -}}
-{{ end }} \ No newline at end of file +{{- end }} From 5b842a0e1ebf8dff7e8ff030531ef9b1e223aff6 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Tue, 10 May 2022 21:36:20 -0700 Subject: [PATCH 2/6] main --- layouts/_default/baseof.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 126d0fd..d9d4461 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,17 +1,20 @@ - + {{ partial "head.html" . }} {{ partial "header.html" . }} -
+
{{ block "main" . }}{{ end }}
-
+ {{ partial "footer.html" . }} {{ partial "custom_footer.html" . }} + {{ range .Site.Params.plugins_js -}} + + {{- end }} From 32ccad1965275762ab7c500a056bd6615e9e9023 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Tue, 10 May 2022 21:49:05 -0700 Subject: [PATCH 3/6] Simplify `.wrapper` --- layouts/_default/baseof.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index d9d4461..27a125d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -5,10 +5,8 @@ {{ partial "header.html" . }} -
-
- {{ block "main" . }}{{ end }} -
+
+ {{- block "main" . -}}{{- end -}}
{{ partial "footer.html" . }} From 840957fb33a019f0a932d434d3d5bcfb34d0885a Mon Sep 17 00:00:00 2001 From: John D Pell Date: Tue, 10 May 2022 21:56:29 -0700 Subject: [PATCH 4/6] Improve semantic markup for `single.html` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alsö, microformats! --- layouts/_default/single.html | 15 +++++++-------- layouts/post/single.html | 14 +++++++------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3f0dd16..a5366bc 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,15 +1,14 @@ {{ define "main" -}} -
- +
- {{- with .Title -}} -

{{ . }}

- {{- end -}} + {{ with .Title -}} +

{{ . }}

+ {{- end }}
-
+
{{- .Content -}} -
+ -
+ {{- end }} diff --git a/layouts/post/single.html b/layouts/post/single.html index 1394b23..269bcb1 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html @@ -1,17 +1,17 @@ {{ define "main" -}} -
+
- {{ with .Title }} -

{{ . }}

- {{ end }} + {{ with .Title -}} +

{{ . }}

+ {{- end }}
-
+
{{- .Content -}} -
+ -
+ {{ if .Site.Params.include_conversation }} From 10ab8d7510a7c4a25268a8226296d8737a034388 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Tue, 10 May 2022 22:03:05 -0700 Subject: [PATCH 5/6] More whitespace --- layouts/_default/baseof.html | 7 ++--- layouts/_default/list.html | 11 ++++--- layouts/_default/single.html | 2 -- layouts/partials/head.html | 50 ++++++++++++++++++-------------- layouts/partials/header.html | 14 ++++----- layouts/partials/pagination.html | 8 ++--- 6 files changed, 46 insertions(+), 46 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 27a125d..fb627a3 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,18 +1,15 @@ {{ partial "head.html" . }} - {{ partial "header.html" . }} -
- {{- block "main" . -}}{{- end -}} + {{- block "main" . -}}{{- end -}}
- {{ partial "footer.html" . }} {{ partial "custom_footer.html" . }} {{ range .Site.Params.plugins_js -}} - + {{- end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index accac61..27d9e7d 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,18 +1,17 @@ {{ define "main" -}}
- +{{ $paginator := .Paginate (where .Site.Pages.ByDate.Reverse "Type" "post") (index .Site.Params "archive-paginate" | default 25) }}
    - {{ $paginator := .Paginate (where .Site.Pages.ByDate.Reverse "Type" "post") (index .Site.Params "archive-paginate" | default 25) }} {{ range $paginator.Pages -}}
  • - {{ with .Title }} -

    {{ . }}

    - {{ end }} + {{ with .Title -}} +

    {{ . }}

    + {{- end }}
    - {{- .Content -}} + {{- .Content -}}
  • {{- end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a5366bc..fcafc02 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -5,10 +5,8 @@

    {{ . }}

    {{- end }} -
    {{- .Content -}}
    - {{- end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ae30d51..cdc0688 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -16,28 +16,34 @@ - {{ if .RSSLink -}} - - - - - {{ end -}} + {{ if .RSSLink -}} + + + + + {{- end }} - - {{ with .Site.Params.twitter_username }} - - {{ end }} - {{ with .Site.Params.github_username }} - - {{ end }} - {{ with .Site.Params.instagram_username }} - - {{ end }} - - - - - - + + {{ with .Site.Params.twitter_username -}} + + {{- end }} + {{ with .Site.Params.github_username -}} + + {{- end }} + {{ with .Site.Params.instagram_username -}} + + {{- end }} + + + + + + + {{ range .Site.Params.plugins_css -}} + + {{ end }} + {{ range $filename := .Site.Params.plugins_html -}} + {{ partial $filename $ }} + {{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 992ff3a..94bb74c 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -14,13 +14,13 @@
    - {{ range .Site.Menus.main }} - {{ if .Page.Params.redirect }} - {{ .Name }} - {{ else }} - {{ .Name }} - {{ end }} - {{ end }} + {{ range .Site.Menus.main }} + {{ if .Page.Params.redirect }} + {{ .Name }} + {{ else }} + {{ .Name }} + {{ end }} + {{ end }}
    diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html index a6a5f49..0b6e2f3 100644 --- a/layouts/partials/pagination.html +++ b/layouts/partials/pagination.html @@ -3,9 +3,9 @@ \ No newline at end of file + From 804e96048ef82f49d26d30aedcc8688c6d651a13 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Tue, 10 May 2022 22:40:37 -0700 Subject: [PATCH 6/6] Move plugins javascript to `` with `async` --- layouts/_default/baseof.html | 3 --- layouts/partials/head.html | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index fb627a3..2685816 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -8,8 +8,5 @@
{{ partial "footer.html" . }} {{ partial "custom_footer.html" . }} - {{ range .Site.Params.plugins_js -}} - - {{- end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index cdc0688..76e121e 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -46,4 +46,7 @@ {{ range $filename := .Site.Params.plugins_html -}} {{ partial $filename $ }} {{ end }} + {{ range .Site.Params.plugins_js -}} + + {{ end }}