Skip to content

Commit

Permalink
fix home
Browse files Browse the repository at this point in the history
  • Loading branch information
sebousan committed Feb 14, 2023
1 parent 45e085e commit 6f7fd9a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 10 deletions.
7 changes: 2 additions & 5 deletions layouts/partials/commons/heading.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{{ if or
(not (isset .Params "hero"))
(eq .Params.hero.title "")
}}
{{ if not (partial "func/HasHero" .) }}
{{ with .Title }}
<header class="heading">
<h1>{{ partial "func/PrepareHTML" . }}</h1>
</header>
{{ end }}
{{ end }}
{{ end }}
10 changes: 10 additions & 0 deletions layouts/partials/func/HasHero
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ $hasHero := false }}
{{ if isset .Params "hero" }}
{{ if isset .Params.hero "title" }}
{{ if ne .Params.hero.title "" }}
{{ $hasHero = true }}
{{ end }}
{{ end }}
{{ end }}

{{ return $hasHero }}
24 changes: 20 additions & 4 deletions layouts/partials/home/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,26 @@

<div class="container">
{{ partial "commons/heading" . }}
{{ partial "posts/latest" . }}
{{ partial "projects/latest" . }}
{{ partial "casestudies/latest" . }}
{{ partial "publications/latest" . }}

{{ $posts := "posts/latest.html" }}
{{ if templates.Exists ( printf "partials/%s" $posts ) }}
{{ partial $posts . }}
{{ end }}

{{ $projects := "projects/latest.html" }}
{{ if templates.Exists ( printf "partials/%s" $projects ) }}
{{ partial $projects . }}
{{ end }}

{{ $casestudies := "casestudies/latest.html" }}
{{ if templates.Exists ( printf "partials/%s" $casestudies ) }}
{{ partial $casestudies . }}
{{ end }}

{{ $publications := "publications/latest.html" }}
{{ if templates.Exists ( printf "partials/%s" $publications ) }}
{{ partial $publications . }}
{{ end }}
</div>

{{ end }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hugolify-theme",
"version": "1.2.14",
"version": "1.2.15",
"homepage": "https://www.hugolify.com",
"repository": "https://github.com/hugolify/hugolify-theme",
"bugs": {
Expand Down

0 comments on commit 6f7fd9a

Please sign in to comment.