diff options
author | uPagge <upagge@mail.ru> | 2021-01-10 20:10:52 +0300 |
---|---|---|
committer | uPagge <upagge@mail.ru> | 2021-01-10 20:10:52 +0300 |
commit | be49f3c8ccc9581395a205357d414d64430815a1 (patch) | |
tree | 72307ce3565c2a70e4e77ee58147e196b60e66be /layouts | |
parent | 2bd29ba67dd072b3aa60d11659a701b4859f64b1 (diff) |
new profile theme
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/home/profile.html | 129 | ||||
-rw-r--r-- | layouts/shortcodes/split-post.html | 4 |
2 files changed, 70 insertions, 63 deletions
diff --git a/layouts/partials/home/profile.html b/layouts/partials/home/profile.html index 25b191a..8b1c49e 100644 --- a/layouts/partials/home/profile.html +++ b/layouts/partials/home/profile.html @@ -21,75 +21,78 @@ </div> {{- end -}} - {{- with $profile.title -}} - <h1 class="home-title"> - {{- . | safeHTML -}} - </h1> - {{- end -}} + <div class="home-meta"> - {{- with $profile.subtitle -}} - <div class="home-subtitle"> - {{- if $profile.typeit -}} - {{- $id := dict "Content" . "Scratch" $.Scratch | partial "function/id.html" -}} - <div id="{{ $id }}" class="typeit"></div> - {{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}} - {{- else -}} + {{- with $profile.title -}} + <h1 class="home-title"> {{- . | safeHTML -}} - {{- end -}} - </div> - {{- end -}} + </h1> + {{- end -}} - {{- with $profile.disclaimer -}} - <div class="home-disclaimer"> - {{- . | safeHTML -}} - </div> - {{- end -}} + {{- with $profile.subtitle -}} + <div class="home-subtitle"> + {{- if $profile.typeit -}} + {{- $id := dict "Content" . "Scratch" $.Scratch | partial "function/id.html" -}} + <div id="{{ $id }}" class="typeit"></div> + {{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}} + {{- else -}} + {{- . | safeHTML -}} + {{- end -}} + </div> + {{- end -}} - {{- if $profile.social -}} - <div class="links"> - {{- $socialMap := resources.Get "data/social.yml" | transform.Unmarshal -}} - {{- $socialArr := slice -}} - {{- range $key, $value := .Site.Params.social -}} - {{- $social := $key | lower | index $socialMap | default dict -}} - {{- if $value -}} - {{- if reflect.IsMap $value -}} - {{- with $value.weight -}} - {{- $social = dict "Weight" . | merge $social -}} - {{- end -}} - {{- with $value.prefix -}} - {{- $social = dict "Prefix" . | merge $social -}} - {{- end -}} - {{- with $value.template -}} - {{- $social = dict "Template" . | merge $social -}} - {{- end -}} - {{- with $value.id -}} - {{- $social = dict "Id" . | merge $social -}} - {{- end -}} - {{- with $value.url -}} - {{- $social = dict "Url" . | merge $social -}} - {{- end -}} - {{- with $value.title -}} - {{- $social = dict "Title" . | merge $social -}} - {{- end -}} - {{- with $value.newtab -}} - {{- $social = dict "Newtab" . | merge $social -}} + {{- with $profile.disclaimer -}} + <div class="home-disclaimer"> + {{- . | safeHTML -}} + </div> + {{- end -}} + + {{- if $profile.social -}} + <div class="links"> + {{- $socialMap := resources.Get "data/social.yml" | transform.Unmarshal -}} + {{- $socialArr := slice -}} + {{- range $key, $value := .Site.Params.social -}} + {{- $social := $key | lower | index $socialMap | default dict -}} + {{- if $value -}} + {{- if reflect.IsMap $value -}} + {{- with $value.weight -}} + {{- $social = dict "Weight" . | merge $social -}} + {{- end -}} + {{- with $value.prefix -}} + {{- $social = dict "Prefix" . | merge $social -}} + {{- end -}} + {{- with $value.template -}} + {{- $social = dict "Template" . | merge $social -}} + {{- end -}} + {{- with $value.id -}} + {{- $social = dict "Id" . | merge $social -}} + {{- end -}} + {{- with $value.url -}} + {{- $social = dict "Url" . | merge $social -}} + {{- end -}} + {{- with $value.title -}} + {{- $social = dict "Title" . | merge $social -}} + {{- end -}} + {{- with $value.newtab -}} + {{- $social = dict "Newtab" . | merge $social -}} + {{- end -}} + {{- with $value.icon -}} + {{- $social = dict "Icon" . | merge $social -}} + {{- end -}} + {{- else if ne $value true -}} + {{- $social = dict "Id" $value | merge $social -}} {{- end -}} - {{- with $value.icon -}} - {{- $social = dict "Icon" . | merge $social -}} + {{- if $social.Icon.Simpleicons -}} + {{- $prefix := ($.Scratch.Get "cdn" | default dict).simpleIconsPrefix -}} + {{- $social = dict "Prefix" $prefix | dict "Icon" | merge $social -}} {{- end -}} - {{- else if ne $value true -}} - {{- $social = dict "Id" $value | merge $social -}} - {{- end -}} - {{- if $social.Icon.Simpleicons -}} - {{- $prefix := ($.Scratch.Get "cdn" | default dict).simpleIconsPrefix -}} - {{- $social = dict "Prefix" $prefix | dict "Icon" | merge $social -}} + {{- $socialArr = $socialArr | append $social -}} {{- end -}} - {{- $socialArr = $socialArr | append $social -}} {{- end -}} - {{- end -}} - {{- range sort $socialArr "Weight" -}} - {{- partial "plugin/social.html" . -}} - {{- end -}} - </div> - {{- end -}} + {{- range sort $socialArr "Weight" -}} + {{- partial "plugin/social.html" . -}} + {{- end -}} + </div> + {{- end -}} + </div> </div> diff --git a/layouts/shortcodes/split-post.html b/layouts/shortcodes/split-post.html new file mode 100644 index 0000000..4b0c4e5 --- /dev/null +++ b/layouts/shortcodes/split-post.html @@ -0,0 +1,4 @@ +</div> +<div class="split-post"> + {{ .Inner | $.Page.RenderString }} +</div><div class="post">
\ No newline at end of file |