diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 8e24eea..afb1736 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -7,7 +7,7 @@ {{ if eq "Posts" $.Title }} {{partial "list-item-post.html" .}} {{else}} - {{ partial "list-item-project" . }} + {{ partial "list-item-project.html" . }} {{end}} {{end}} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 1367c9d..f35e4e5 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,38 +1,11 @@ {{ partial "header" . }}
- - {{ partial "list-item" . }} - -
{{ .Content }}
- - - {{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "post") ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }} - - {{ if $related }} - - - - {{ range $related }} {{ partial "list-item" . }} {{ end }} - - {{ end }} - - {{ if and .Site.DisqusShortname (not .Params.disableComments) }} - - - - {{ template "_internal/disqus.html" . }} - - {{ end }} - - {{ if .Site.Params.talkHost }} - {{ partial "talk.html" . }} - {{ end }} - - {{ if .Site.Params.coralHost }} - {{ partial "coral.html" . }} - {{ end }} - + {{ if eq "Posts" $.Title }} + {{partial "post.html" .}} + {{else}} + {{ partial "project" . }} + {{end}}
{{ partial "footer.html" . }} diff --git a/layouts/partials/header-post.html b/layouts/partials/header-post.html new file mode 100644 index 0000000..43bd02a --- /dev/null +++ b/layouts/partials/header-post.html @@ -0,0 +1,22 @@ +
+ {{ .Date.Format (.Site.Params.dateFormat | default "") | $.Scratch.Set "pub_date" }} + {{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }} + {{ with .ReadingTime }} {{ $.Scratch.Set "read_time" . }} {{ end }} + + +

{{ .Title }}

+
{{ $.Scratch.Get "pub_date" }} - {{ $.Scratch.Get "read_time" }} minutes
+
{{ $.Scratch.Get "subtitle" }}
+ + {{ range.Params.categories }} + + + {{ . }} + + {{ end }} + {{ range .Params.tags }} + + {{ . }} + + {{ end }} +
diff --git a/layouts/partials/header-project.html b/layouts/partials/header-project.html new file mode 100644 index 0000000..f525625 --- /dev/null +++ b/layouts/partials/header-project.html @@ -0,0 +1,29 @@ +
+ {{ $.Scratch.Set "link" .RelPermalink }} + {{ with .Params.repo }} + {{ $repoHost := default "gitlab" $.Params.repoHost }} + {{ if eq "github" $repoHost }} + {{ printf "https://github.com/%s/%s/" $.Site.Params.githubUsername . | $.Scratch.Set "link" }} + {{ else if eq "gitlab" $repoHost }} + {{ printf "https://gitlab.com/%s/%s/" $.Site.Params.gitlabUsername . | $.Scratch.Set "link" }} + {{ end }} + {{ end }} + {{ with .Params.link }} {{ $.Scratch.Set "link" . }} {{ end }} + {{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }} + + +

{{ .Title }}

+
{{ $.Scratch.Get "subtitle" }}
+ + {{ range.Params.categories }} + + + {{ . }} + + {{ end }} + {{ range .Params.tags }} + + {{ . }} + + {{ end }} +
diff --git a/layouts/partials/list-item-post.html b/layouts/partials/list-item-post.html index 75c2186..53f344a 100644 --- a/layouts/partials/list-item-post.html +++ b/layouts/partials/list-item-post.html @@ -1,18 +1,4 @@ -
- - {{ $.Scratch.Set "link" .RelPermalink }} - {{ with .Params.repo }} - {{ $repoHost := default "github" $.Params.repoHost }} - {{ if eq "github" $repoHost }} - {{ printf "https://github.com/%s/%s/" $.Site.Params.githubUsername . | $.Scratch.Set "link" }} - {{ else if eq "gitlab" $repoHost }} - {{ printf "https://gitlab.com/%s/%s/" $.Site.Params.gitlabUsername . | $.Scratch.Set "link" }} - {{ else if eq "bitbucket" $repoHost }} - {{ printf "https://bitbucket.org/%s/%s/" $.Site.Params.bitbucketUsername . | $.Scratch.Set "link" }} - {{ end }} - {{ end }} - {{ with .Params.link }} {{ $.Scratch.Set "link" . }} {{ end }} - +
{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006") | $.Scratch.Set "pub_date" }} {{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }} {{ with .ReadingTime }} {{ $.Scratch.Set "read_time" . }} {{ end }} diff --git a/layouts/partials/list-item-project.html b/layouts/partials/list-item-project.html index 41b6717..749b8d2 100644 --- a/layouts/partials/list-item-project.html +++ b/layouts/partials/list-item-project.html @@ -1,32 +1,21 @@ -
+
+ {{ with .Permalink }} {{ $.Scratch.Set "link" . }} {{ end }} + + {{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }} + {{ with .ReadingTime }} {{ $.Scratch.Set "read_time" . }} {{ end }} -{{ $.Scratch.Set "link" .RelPermalink }} -{{ with .Params.repo }} -{{ $repoHost := default "github" $.Params.repoHost }} -{{ if eq "github" $repoHost }} -{{ printf "https://github.com/%s/%s/" $.Site.Params.githubUsername . | $.Scratch.Set "link" }} -{{ else if eq "gitlab" $repoHost }} -{{ printf "https://gitlab.com/%s/%s/" $.Site.Params.gitlabUsername . | $.Scratch.Set "link" }} -{{ else if eq "bitbucket" $repoHost }} -{{ printf "https://bitbucket.org/%s/%s/" $.Site.Params.bitbucketUsername . | $.Scratch.Set "link" }} -{{ end }} -{{ end }} -{{ with .Params.link }} {{ $.Scratch.Set "link" . }} {{ end }} -{{ with .Description }} {{ $.Scratch.Set "subtitle" . }} {{ end }} -{{ with .ReadingTime }} {{ $.Scratch.Set "read_time" . }} {{ end }} - - -

{{ .Title }}

+

{{ .Title }}

{{ $.Scratch.Get "subtitle" }}
{{ range.Params.categories }} - - {{ . }} - - {{ end }} + + {{ . }} + + {{ end }} {{ range .Params.tags }} {{ . }} - + {{ end }} -
\ No newline at end of file + +
diff --git a/layouts/partials/post.html b/layouts/partials/post.html new file mode 100644 index 0000000..db08407 --- /dev/null +++ b/layouts/partials/post.html @@ -0,0 +1,23 @@ +{{ partial "header-post" .}} +
+
{{ .Content }}
+ + + {{ $related := first 3 (where (where (where .Site.Pages.ByDate.Reverse ".Type" "==" "post") ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }} + + {{ if $related }} + + + + {{ range $related }} {{ partial "list-item" . }} {{ end }} + + {{ end }} + + {{ if and .Site.DisqusShortname (not .Params.disableComments) }} + + + + {{ template "_internal/disqus.html" . }} + + {{ end }} +
\ No newline at end of file diff --git a/layouts/partials/project.html b/layouts/partials/project.html new file mode 100644 index 0000000..3825680 --- /dev/null +++ b/layouts/partials/project.html @@ -0,0 +1,4 @@ +{{ partial "header-project" .}} +
+
{{ .Content }}
+
\ No newline at end of file diff --git a/static/css/main.css b/static/css/main.css index 2c6284b..0766f41 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -202,3 +202,7 @@ img { background-color: var(--accent) !important; color: #f8f8f8 !important; } +.list-item { + padding-top: 5px; + margin-top: 10px; +}