Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Set publish date #17

Open
marksteve opened this issue Nov 24, 2015 · 4 comments
Open

Set publish date #17

marksteve opened this issue Nov 24, 2015 · 4 comments

Comments

@marksteve
Copy link

Maybe with the file modtime or a second arg to the publish command? Loving this btw. Been looking for an easy way to publish my TILs (https://github.com/marksteve/til).

@pscollins
Copy link
Contributor

Maybe this is a violation of minimalism, but a suggestion from prior art --- Pelican lets you set metadata in Markdown (among other formats) with the following syntax:

Title: Hello world!
Date: 2010-12-03 10:20
Modified: 2010-12-05 19:30

And now the body of my post goes here.

I'm not sure if allowing this would violate any assumptions on the backend. A brief look through suggests that it could be added with some small changes to lib/file.js.

This is an awesome project and I'd love to contribute to it. I'll hold off on writing a patch until the author chimes in, since s/he seems to be the only contributor so far, but I could try to take a crack at it tomorrow night.

@hmngwy
Copy link
Owner

hmngwy commented Nov 24, 2015

@marksteve ah I can see why you need that.

@pscollins I'm not sure I like metadata inside the files, it will need an additional parser, scp already feels slow for reasons I have yet to inspect, I don't want to impact it more with more parsing.

If we are to add this, it's likely going to be a new command or an addition to the existing publish command.

Also, will allow future dates for transparent scheduled posting.

@GSI
Copy link

GSI commented Nov 24, 2015

Static site generators usually just use a file name convention for this. A posts file name would be 2015-11-24-foo-bar.txt for todays publishing date.

mtime is an option, but would exclude all the people who are unaware on how to change that manually.

@pscollins
Copy link
Contributor

@hmngwy I'd be stunned if parsing text adds any measurable overhead. Surely it takes node.js a matter of nanoseconds to burn through a couple hundred bytes of ASCII.

I saw the HN remarks about SCP being slow --- my money is that it has something to do with either your hosting or the underlying SSH server (it's written in node, right?). Maybe some issue with a buffer size being set incorrectly, or the wrong type of buffering being used.

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

No branches or pull requests

4 participants