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

What about a Set Date to Now option? #37

Closed
jackbaty opened this issue Mar 1, 2018 · 4 comments
Closed

What about a Set Date to Now option? #37

jackbaty opened this issue Mar 1, 2018 · 4 comments

Comments

@jackbaty
Copy link

jackbaty commented Mar 1, 2018

Sometimes it takes a while between starting a post and publishing it and I forget to fix the date so that it reflects the actual publish time.

I would love an easy way to set a post's date to now. Something similar to the way easy-hugo-undraft works but it would update the date: (and probably lastmod:) in the frontmatter to the current date/time.

@masasam
Copy link
Owner

masasam commented Mar 1, 2018

Hi @jackbaty.
Thank you for comment.

The hugo undraft command has been removed with hugo 0.35 (gohugoio/hugo#4353).

According to bep who is hugo developer, it is easier to undraft content by
editing manually the frontmatter of said content by
setting the draft flag to false, or removing it completely,
than to rely on the undraft command which is a source of many bugs.

Updating timestamp has also been removed. (gohugoio/hugo@2fa70c9)

So I will remove the easy-hugo-undraft and try to implement the command to get the current time.
This works as follows

title: "About"
date: 2018-02-15T14:51:09+09:00
draft: false

You delete 2018-02-15T14:51:09+09:00 manually,
You execute M-x easy-hugo-current-time,
It will display 2018-03-01T02:06:09+09:00.

@jackbaty
Copy link
Author

jackbaty commented Mar 1, 2018

I hadn't seen that they removed Undraft, thanks for the link. A timestamping command would be handy, so thanks for considering it!

@masasam
Copy link
Owner

masasam commented Mar 6, 2018

Hi @jackbaty .
I've implemented easy-hugo-current-time.
Please use it.

According to github support, it seems that your email address is incorrect so it is not appear on easy-hugo contributors.

Below is the message of github support.

Thanks for reaching out to GitHub Support!It looks like that user used an email address for their commit that isn't actually associated with their GitHub account, which would explain why it's not being counted.https://github.com/masasam/emacs-easy-hugo/commit/7b6cbee24760ac283ee5393ca666eb3df04c11f3.patch
Could you ask them to add that email address to their account. Alternatively, you can ask them to write into us directly about this.Cheers,John GitHub Support

@jackbaty
Copy link
Author

jackbaty commented Mar 6, 2018

easy-hugo-current-time works for me, nice!

Thanks for the note about my commit email address. I've fixed it in my account.

Easy-hugo really makes working with Hugo easier. Thanks for this!

@masasam masasam closed this as completed Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants