hugo-sid / hugo-blog-awesome

Fast, minimal blog with dark mode support.
https://hba.sid.one
MIT License
398 stars 154 forks source link

feat: add option for post date format #234

Open Laborratte5 opened 1 week ago

Laborratte5 commented 1 week ago

Add extra option to change the date format displayed at the beginning of the single.html

What problem does this PR solve?

The date format at the beginning of post did not follow the dateFormat config option.

Is this PR adding a new feature?

I added an extra option postDateFormat to set the date format at the beginning of a post. I added this option because I like the idea of being able to display the date more verbose at the start of the post. (Moreover this makes it possible to add this in a backwards compatible manner, by not changing the current behavior if the postDateFormat option is not defined)

Is this PR related to any issue or discussion?

See #177

PR Checklist

netlify[bot] commented 1 week ago

Deploy Preview for hugo-blog-awesome ready!

Name Link
Latest commit 7a4fcdd296d909f738abe6827dd14c156ca14b8d
Latest deploy log https://app.netlify.com/sites/hugo-blog-awesome/deploys/66dc31b3408ba70008c0f830
Deploy Preview https://deploy-preview-234--hugo-blog-awesome.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

hugo-sid commented 1 week ago

@Laborratte5 thanks for the improvement.

I don't like the idea of having 2 date formatting options in the config. It can be confusing.

Does it make sense to remove the dateFormat config option (which I suppose isn't used anywhere)?

Laborratte5 commented 1 week ago

The dateFormat is used to format the date in the post list (or rather postCard.html). So I would change my PR to use this option instead and remove the postDateFormat option.

hugo-sid commented 1 week ago

The dateFormat is used to format the date in the post list (or rather postCard.html). So I would change my PR to use this option instead and remove the postDateFormat option.

Sounds good 👍

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud