weblog.sh icon indicating copy to clipboard operation
weblog.sh copied to clipboard

Set publish date

Open marksteve opened this issue 9 years ago • 4 comments

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).

marksteve avatar Nov 24 '15 07:11 marksteve

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.

pscollins avatar Nov 24 '15 07:11 pscollins

@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.

hmngwy avatar Nov 24 '15 10:11 hmngwy

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.

GSI avatar Nov 24 '15 16:11 GSI

@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.

pscollins avatar Nov 25 '15 05:11 pscollins