Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to display the "publishDate" instead of the "date" in my pages? #101

Open
AndyIbanez opened this issue Nov 27, 2019 · 1 comment
Open

Comments

@AndyIbanez
Copy link

Hi.

Sorry if this is more of a Hugo issue instead of an issue with the theme. If I'm wrong posting this here, please point me to the right direction.

I just noticed that the published pages on my website are using the date of my articles instead of the publishDate.

---
title: "Understanding Property Wrappers in Swift"
date: 2019-11-23T16:26:13-04:00
draft: false
publishDate: 2019-11-27T07:00:00-04:00
highlightjslanguages:
 - swift
 - objectivec
tags:
 - swift
 - programming
 - apple
 - property wrappers
categories:
 - development
description: "Learn and understand what Property Wrappers are in Swift and how to use them."
keywords:
 - swift
 - programming
 - apple
 - property wrappers
---

That page is this one which, as you can see, says it was posted on November 23 Date instead of November 27 (publishDate)

I know that the workaround is as easy as replacing date with what I wrote in publishDate, but I want my markdown files to keep the original time in which a file was created. Is there any way I can make my websites show the publishDate by default, and only show the date when no publishDate is found?

I keep a weekly blog and I publish new articles every Wednesday, so I want the dates to reflect that. More often than not I start writing my articles well in advance so I just need to deploy the website when Wednesday comes around.

@htr3n
Copy link
Owner

htr3n commented Jan 23, 2021

@AndyIbanez That would need a bit of knowledge of Hugo/Go template and change the template accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants