diff --git a/README.md b/README.md index 10d2a78..d477afe 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ summaryLength = 70 # number of words for article summaries posts = "posts" # content directory where to find home page posts; default searches in "posts" and "post" showPostsLink = true # show or hide the link to the simple post list extraContentDirs = [] # other content directories to render similarly to the home page + showcaseDir = "showcase" # create a content directory that shows a special showcase section in the home page # It's best to put these icons in the "static" folder of your site logo = "/logo.svg" diff --git a/assets/scss/style.scss b/assets/scss/style.scss index 31f26de..3118623 100644 --- a/assets/scss/style.scss +++ b/assets/scss/style.scss @@ -868,3 +868,28 @@ header.jumbotronContainer { } } {{ end }} + +.showcaseCard { + @extend article; + @extend .card; + margin-bottom: 24px; + display: flex; + flex-direction: row-reverse; + flex-wrap: wrap; + justify-content: center; + padding: 12px !important; + + > img { + flex-basis: 30%; + width: 300px; + height: 250px; + object-fit: cover; + margin: 12px; + {{ if eq .Site.Params.navtype "circles" }} + border-radius: $border_radius; + {{ end }} + } + > div { + flex-basis: 60%; + } +} diff --git a/layouts/index.html b/layouts/index.html index 6fc1b2b..c51291a 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -3,6 +3,7 @@ {{/* get all the pages that are regular posts and not pages */}} {{ $postsDir := .Site.Params.Posts | default (slice "posts" "post") }} {{ $allPostsList := where site.RegularPages "Section" "in" $postsDir }} + {{- partial "showcase.html" . -}} {{- partial "home_post_list.html" (dict "Ctx" . "AllPostsList" $allPostsList) -}} {{ end }} diff --git a/layouts/partials/showcase.html b/layouts/partials/showcase.html new file mode 100644 index 0000000..afca8f0 --- /dev/null +++ b/layouts/partials/showcase.html @@ -0,0 +1,17 @@ +{{ if .Site.Params.showcaseDir }} +{{ $showcasePosts := where site.RegularPages "Section" "in" .Site.Params.showcaseDir }} + {{ range (sort $showcasePosts "File.LogicalName") }} + {{ if in .Dir .Site.Params.showcaseDir }} +
+
+

{{ .Title }}

+
{{ .Content }}
+
+ {{ if .Params.image }} + + {{ end }} +
+ {{ end }} + {{ end }} +
+{{ end }}