Skip to content

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

@AndyIbanez

Description

@AndyIbanez

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions