diff --git a/.prettierrc b/.prettierrc index 8c6cd7a..4c3e10d 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,5 @@ { - "parser": "babylon", + "parser": "babel", "printWidth": 100, "trailingComma": "all" } diff --git a/README.md b/README.md index 7943d13..aedc31d 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ This theme is pretty basic and covers all of the essentials. All you have to do - [How to start](#how-to-start) - [How to configure](#how-to-configure) - [How to add a cover image to your posts](#how-to-add-a-cover-image-to-your-posts) + - [How to display the Last Modified Date in your posts](#how-to-display-the-last-modified-date-in-your-posts) - [Add-ons](#add-ons) - [How to run your site](#how-to-run-your-site) - [How to edit the theme](#how-to-edit-the-theme) @@ -106,6 +107,8 @@ paginate = 5 minuteReadingTime = "min read" dateFormatSingle = "2006-01-02" dateFormatList = "2006-01-02" + # leave empty to disable, enter display text to enable + # lastModDisplay = "" [languages.en.params.logo] logoText = "hello friend" @@ -139,6 +142,14 @@ Adding a cover image to your post is simple and there are two options when you e * Use `cover = "img.jpg"` and `useRelativeCover = true` to link the image relative to the blog post folder * Resulting in `https://www.yourpage.com/posts/blog-entry-xy/img.jpg` +## How to display the Last Modified Date in your posts + +Add `lastModDisplay = "[your display text]"` to `config.toml` to enable last modified date on your posts. Note - an empty string value `""` does not display anything. + +Example: `lastModDisplay = "Modified:"` --> "Modified: Jan 01, 0001" + +:octocat: Hugo's `enableGitInfo` option is a nice complement to this feature. + ## Add-ons - **Archive** — Theme has built-in `archive` page for main content (see `contentTypeName` variable in config). If you need archive on your blog just copy https://github.com/panr/hugo-theme-hello-friend/blob/master/exampleSite/content/archive.md to your `content` dir. If you need multilangual archives, duplicate `content/archive.md` and add `.Lang` variable, eg: `content/archive.pl.md` (remember to change `url` in duplicated file). diff --git a/USERS.md b/USERS.md index 79f9b48..0ff5da8 100644 --- a/USERS.md +++ b/USERS.md @@ -21,3 +21,6 @@ TEMPLATE: - https://felixleger.com/ - **Félix Léger** (Sofware Developer and DevOps) - https://cobalto.net/ - **Daniel Pessoa** (Sofware Developer and BI Analyst) - https://www.imgalone.com/ - **Iancu makes games alone** (Indie Game Dev) +- https://jonathan.rico.live/ - **Jonathan Rico** (Electronics Engineer) +- https://mritd.com/ - **漠然** (Software Engineer and DevOps) +- https://ilya-lesikov.com - **Ilya Lesikov** (DevOps, SRE) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 4eec511..2f76a56 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,14 +1,14 @@ {{ define "main" }} + {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} + {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} + + {{ $PageContext := . }} + {{ if .IsHome }} + {{ $PageContext = .Site }} + {{ end }} + {{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }} +