From 6be9da45ab606f508023a5b43d39a9afcaa8c803 Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Sun, 23 Aug 2020 18:19:41 +0530 Subject: [PATCH] profileMode : init usaage, in config add params: profileMode: title: "PaperMod" // or default will be site.title imageUrl: "" --- assets/css/profileMode.css | 29 +++++++++++++++++++++++++++++ layouts/_default/index.html | 16 +++++++++++++++- layouts/partials/head.html | 5 +++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 assets/css/profileMode.css diff --git a/assets/css/profileMode.css b/assets/css/profileMode.css new file mode 100644 index 0000000..04cf698 --- /dev/null +++ b/assets/css/profileMode.css @@ -0,0 +1,29 @@ +.main { + text-align: center; + display: table; +} + +.main>.profile { + display: table-cell; + vertical-align: middle; + +} + +.main>.profile>.profile_inner { + transform: translate(0, -20%); +} + +img { + display: inline-block; + width: 200px; + border-radius: 50%; + pointer-events: none; + margin: 5px; +} + +@media screen and (max-width: 600px) { + img { + width: 150px; + } + +} diff --git a/layouts/_default/index.html b/layouts/_default/index.html index 8909051..2a1c64f 100644 --- a/layouts/_default/index.html +++ b/layouts/_default/index.html @@ -1,4 +1,18 @@ {{ define "main" }} + +{{ if .Site.Params.profileMode }} +
+
+ {{if .Site.Params.profileMode.imageUrl}} +
+ {{ .Site.Params.profileMode.imageTitle}} +
+ {{end}} +

{{ if .Site.Params.profileMode.title }}{{.Site.Params.profileMode.title}}{{ else }}{{ .Site.Title }}{{end}}

+
+
+{{else}} {{/* if not profileMode */}} + {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} @@ -52,5 +66,5 @@ {{- end }} - +{{end}}{{/* end profileMode */}} {{ end }}{{/* end main */}} \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index fbc6ee6..60d66eb 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -30,6 +30,11 @@ {{ $stylesheet := slice $anoldhope $style | resources.Concat "css/stylesheet.css" | minify | fingerprint }} +{{ if (and (.Site.Params.profileMode) (.IsHome)) }} +{{ $profileMode := resources.Get "css/profileMode.css" | minify | fingerprint }} + +{{end}}