[gnomegr-web/hugo-deploy] Rework homepage layout
- From: Tom Tryfonidis <tomtryf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnomegr-web/hugo-deploy] Rework homepage layout
- Date: Thu, 27 Dec 2018 20:16:17 +0000 (UTC)
commit e3923a0ba0035b2a43e5a3007daf3f6d39eb87a3
Author: Tom Tryfonidis <tomtryf gmail com>
Date: Thu Dec 27 22:15:59 2018 +0200
Rework homepage layout
config.toml | 4 +-
content/_index.md | 1 -
static/css/gnomegr.css | 7 ++-
themes/deneb-hugo-theme/layouts/index.html | 59 ++++++++++++----------
.../deneb-hugo-theme/layouts/partials/header.html | 14 +++--
5 files changed, 49 insertions(+), 36 deletions(-)
---
diff --git a/config.toml b/config.toml
index ce6a4f6..b008094 100644
--- a/config.toml
+++ b/config.toml
@@ -11,9 +11,11 @@ paginate = 4
rss = true
socialShare = true
section_home = true
- homepage = "img/gnomegr_l10n_banner.png"
custom_css = ["css/gnomegr.css"]
+[[Params.homeimg]]
+ src = "img/gnomegr_l10n_banner.png"
+
[permalinks]
post = "/:year/:month/:day/:title/"
page = "/:title/"
diff --git a/static/css/gnomegr.css b/static/css/gnomegr.css
index eb4d753..fc95377 100644
--- a/static/css/gnomegr.css
+++ b/static/css/gnomegr.css
@@ -7,9 +7,12 @@
}
.home .intro-header {
- margin-top: 130px;
+ padding-top: 130px;
+ margin-bottom: 0;
+ background: #4a86cf;
+ color: white;
}
.intro-header .page-heading h1 {
font-size: 50px;
-}
\ No newline at end of file
+}
diff --git a/themes/deneb-hugo-theme/layouts/index.html b/themes/deneb-hugo-theme/layouts/index.html
index d0e0fc5..c68decd 100644
--- a/themes/deneb-hugo-theme/layouts/index.html
+++ b/themes/deneb-hugo-theme/layouts/index.html
@@ -46,12 +46,12 @@
<ul class="pager main-pager">
{{ if .Paginator.HasPrev }}
<li class="previous">
- <a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}">← {{ i18n "newerPosts" }}</a>
+ <a href="{{ .RelPermalink }}page/{{ .Paginator.Prev.PageNumber }}">← {{ i18n
"newerPosts" }}</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
<li class="next">
- <a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }} →</a>
+ <a href="{{ .RelPermalink }}page/{{ .Paginator.Next.PageNumber }}">{{ i18n "olderPosts" }}
→</a>
</li>
{{ end }}
</ul>
@@ -65,30 +65,33 @@
<div class="col-sm-12 text-center">
<p class="h3">{{ i18n "socialMedia" }}</p>
<div class="m-t-2">
- <ul class="list-inline text-center footer-links">
- {{ if .Site.Params.rss }}
- <li>
- <a href="{{ "index.xml" | absLangURL }}" title="RSS">
- <span class="fa-stack fa-lg">
- <i class="fa fa-stack-2x"></i>
- <i class="fa fa-rss fa-stack-2x"></i>
- </span>
- </a>
- </li>
- {{ end }}
- {{ range .Site.Data.beautifulhugo.social.social_icons }}
- {{- if isset $.Site.Author .id }}
- <li>
- <a href="{{ printf .url (index $.Site.Author .id) }}" title="{{ .title }}">
- <span class="fa-stack fa-lg">
- <i class="fa fa-stack-2x"></i>
- <i class="fa {{ .icon }} fa-stack-2x"></i>
- </span>
- </a>
- </li>
- {{- end -}}
- {{ end }}
- </ul>
-</div></div></div></div>
-</section>
+ <ul class="list-inline text-center footer-links">
+ {{ if .Site.Params.rss }}
+ <li>
+ <a href="{{ "index.xml" | absLangURL }}" title="RSS">
+ <span class="fa-stack fa-lg">
+ <i class="fa fa-stack-2x"></i>
+ <i class="fa fa-rss fa-stack-2x"></i>
+ </span>
+ </a>
+ </li>
+ {{ end }}
+ {{ range .Site.Data.beautifulhugo.social.social_icons }}
+ {{- if isset $.Site.Author .id }}
+ <li>
+ <a href="{{ printf .url (index $.Site.Author .id) }}" title="{{ .title }}">
+ <span class="fa-stack fa-lg">
+ <i class="fa fa-stack-2x"></i>
+ <i class="fa {{ .icon }} fa-stack-2x"></i>
+ </span>
+ </a>
+ </li>
+ {{- end -}}
+ {{ end }}
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
{{ end }}
diff --git a/themes/deneb-hugo-theme/layouts/partials/header.html
b/themes/deneb-hugo-theme/layouts/partials/header.html
index 0869a97..5e6b3d1 100644
--- a/themes/deneb-hugo-theme/layouts/partials/header.html
+++ b/themes/deneb-hugo-theme/layouts/partials/header.html
@@ -2,12 +2,15 @@
{{ $.Scratch.Set "title" .Site.Title }}
{{ if .Site.Params.subtitle }}{{ $.Scratch.Set "subtitle" .Site.Params.subtitle }}{{ end }}
{{ if .Site.Params.bigimg }}{{ $.Scratch.Set "bigimg" .Site.Params.bigimg }}{{ end }}
+ {{ if .Site.Params.homeimg }}{{ $.Scratch.Set "homeimg" .Site.Params.homeimg }}{{ end }}
{{ else }}
{{ $.Scratch.Set "title" .Title }}
{{ if .Params.subtitle }}{{ $.Scratch.Set "subtitle" .Params.subtitle }}{{ end }}
{{ if .Params.bigimg }}{{ $.Scratch.Set "bigimg" .Params.bigimg }}{{ end }}
+ {{ if .Params.homeimg }}{{ $.Scratch.Set "homeimg" .Params.homeimg }}{{ end }}
{{ end }}
{{ $bigimg := $.Scratch.Get "bigimg" }}
+{{ $homeimg := $.Scratch.Get "homeimg" }}
{{ if or $bigimg ($.Scratch.Get "title") }}
{{ if $bigimg }}
@@ -54,6 +57,9 @@
<h2 class="{{ .Type }}-subheading">{{ $subtitle }}</h2>
{{ end }}
{{ end }}
+ {{ if $homeimg }}
+ {{range $i, $img := $homeimg}}<img src="{{$img.src | absURL }}">{{ end }}
+ {{ end }}
{{ if eq .Type "post" }}
{{ partial "post_meta.html" . }}
{{ end }}
@@ -64,17 +70,17 @@
</div>
</header>
{{ else if .Site.Params.section_home }}
- {{ with .Content }}
<section id="social_media" class="bg-primary">
<div class="container">
<div class="row">
- <div class="col-sm-12 text-center">
- {{.}}
+ <div class="col-sm-12 text-center">
+ {{ if $homeimg }}
+ {{range $i, $img := $homeimg}}<img src="{{$img.src | absURL }}">{{ end }}
+ {{ end }}
</div>
</div>
</div>
</section>
- {{ end }}
{{ else }}
<div class="intro-header"></div>
{{ end }}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]