-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Change size of front page image to fit lower screen resolutions (#…
…73) Change size of front page image to fit lower screen resolutions - Adds new files site-header.html and index.html to layouts/ directory, which are duplicated from the theme in order to change some CSS classes - Updates the image file with a different size and crop - Moves (and modifies) the "Welcome" text on the front page to above the title in order to make the posts more visible - Sets text-alignment of the welcome and title text to centered to make it look better in mobile resolutions. --------- Co-authored-by: Marcus Stigelid <marcuss@stacc.com>
- Loading branch information
1 parent
2aaec4d
commit ff3f09a
Showing
5 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
resources | ||
.idea | ||
.DS_STORE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,3 @@ cascade: | |
featured_image: '/sparvagn.jpg' | ||
|
||
--- | ||
|
||
Welcome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{{ define "main" }} | ||
<article class="cf ph3 ph5-l pv3 pv2-l f4 tc-l center measure-wide lh-copy {{ $.Param "text_color" | default "mid-gray" }}"> | ||
{{ .Content }} | ||
</article> | ||
{{/* Define a section to pull recent posts from. For Hugo 0.20 this will default to the section with the most number of pages. */}} | ||
{{ $mainSections := .Site.Params.mainSections | default (slice "post") }} | ||
{{/* Create a variable with that section to use in multiple places. */}} | ||
{{ $section := where .Site.RegularPages "Section" "in" $mainSections }} | ||
{{/* Check to see if the section is defined for ranging through it */}} | ||
{{ $section_count := len $section }} | ||
{{ if ge $section_count 1 }} | ||
{{/* Derive the section name */}} | ||
{{ $section_name := index (.Site.Params.mainSections) 0 }} | ||
|
||
<div class="pa3 pa4-ns w-100 w-70-ns center"> | ||
{{/* Use $section_name to get the section title. Use "with" to only show it if it exists */}} | ||
{{ with .Site.GetPage "section" $section_name }} | ||
<h1 class="flex-none"> | ||
{{ $.Param "recent_copy" | default (i18n "recentTitle" .) }} | ||
</h1> | ||
{{ end }} | ||
|
||
{{ $n_posts := $.Param "recent_posts_number" | default 3 }} | ||
|
||
<section class="w-100 mw8"> | ||
{{/* Range through the first $n_posts items of the section */}} | ||
{{ range (first $n_posts $section) }} | ||
<div class="relative w-100 mb4"> | ||
{{ .Render "summary-with-image" }} | ||
</div> | ||
{{ end }} | ||
</section> | ||
|
||
{{ if ge $section_count (add $n_posts 1) }} | ||
<section class="w-100"> | ||
<h1 class="f3">{{ i18n "more" }}</h1> | ||
{{/* Now, range through the next four after the initial $n_posts items. Nest the requirements, "after" then "first" on the outside */}} | ||
{{ range (first 4 (after $n_posts $section)) }} | ||
<h2 class="f5 fw4 mb4 dib {{ cond (eq $.Site.Language.LanguageDirection "rtl") "ml3" "mr3" }}"> | ||
<a href="{{ .RelPermalink }}" class="link black dim"> | ||
{{ .Title }} | ||
</a> | ||
</h2> | ||
{{ end }} | ||
|
||
{{/* As above, Use $section_name to get the section title, and URL. Use "with" to only show it if it exists */}} | ||
{{ with .Site.GetPage "section" $section_name }} | ||
<a href="{{ .RelPermalink }}" class="link db f6 pa2 br3 bg-mid-gray white dim w4 tc">{{ i18n "allTitle" . }}</a> | ||
{{ end }} | ||
</section> | ||
{{ end }} | ||
|
||
</div> | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{{ $featured_image := partial "func/GetFeaturedImage.html" . }} | ||
{{ if $featured_image }} | ||
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} | ||
<header class="cover bg-top" style="background-image: url('{{ $featured_image }}');"> | ||
<div class="{{ .Site.Params.cover_dimming_class | default "bg-black-60" }}"> | ||
{{ partial "site-navigation.html" .}} | ||
<div class="tc-l pv4 pv5-l ph3 ph4-ns tc"> | ||
<span class="f2 white-90 fw2">Welcome to our communal</span> | ||
<h1 class="f2 f-subheadline-l fw2 white-90 mb0 lh-title pa0 ma0"> | ||
{{ .Title | default .Site.Title }} | ||
</h1> | ||
{{ with .Params.description }} | ||
<h2 class="fw1 f5 f3-l white-80 measure-wide-l center mt3"> | ||
{{ . }} | ||
</h2> | ||
{{ end }} | ||
</div> | ||
</div> | ||
</header> | ||
{{ else }} | ||
<header> | ||
<div class="pb3-m pb6-l {{ .Site.Params.background_color_class | default "bg-black" }}"> | ||
{{ partial "site-navigation.html" . }} | ||
<div class="tc-l pv3 ph3 ph4-ns"> | ||
<h1 class="f2 f-subheadline-l fw2 light-silver mb0 lh-title"> | ||
{{ .Title | default .Site.Title }} | ||
</h1> | ||
{{ with .Params.description }} | ||
<h2 class="fw1 f5 f3-l white-80 measure-wide-l center lh-copy mt3 mb4"> | ||
{{ . }} | ||
</h2> | ||
{{ end }} | ||
</div> | ||
</div> | ||
</header> | ||
{{ end }} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.