From 48159c6b4d5be773e0958ca6708b9f686d4e2029 Mon Sep 17 00:00:00 2001 From: Crt Mori Date: Sat, 20 Mar 2021 11:52:23 +0100 Subject: [PATCH] Add option to display project_timeframe to the project pages and home page (#289) * Add project_timeline to the project template Project timeline is sometimes very important aspect of your project as it shows that you have been working on it for some time. This adds the feature to the template, but only uses it when it is defined. * Add description of a new feature to README * Apply suggestions from code review Co-authored-by: Victoria Drake <24644237+victoriadrake@users.noreply.github.com> --- README.md | 3 +++ layouts/partials/home/projects.html | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ad528e..e048001 100644 --- a/README.md +++ b/README.md @@ -138,8 +138,11 @@ resources: - src: NameOfYourImage.jpg params: weight: -100 +project_timeframe: "June-December" ``` +You can add a `project_timeframe` parameter to the frontmatter of your project to optionally display an arbitrary string on the homepage and modal. + ## Blog section Create an index file for the blog: diff --git a/layouts/partials/home/projects.html b/layouts/partials/home/projects.html index c62c40d..ea85a4d 100644 --- a/layouts/partials/home/projects.html +++ b/layouts/partials/home/projects.html @@ -34,6 +34,9 @@ {{ .Title | markdownify }} + {{ if .Params.project_timeframe }} +

{{ .Params.project_timeframe }}

+ {{ end }} @@ -58,7 +61,9 @@ {{ end }} - + {{ if .Params.project_timeframe }} +

{{ .Params.project_timeframe }}

+ {{ end }} {{ with .Resources.ByType "image" }} {{ $moreThenOneImage := gt (len .) 1 }} {{ if $moreThenOneImage }}