seagl.github.io icon indicating copy to clipboard operation
seagl.github.io copied to clipboard

Automated publishing of future-dated posts

Open altsalt opened this issue 5 years ago • 9 comments

Looks like #169 went live despite being future dated. Isn't a big deal, but might be nice to fix for queuing when we get closer to the event.

altsalt avatar Mar 12 '20 18:03 altsalt

Running the site in Docker did not exhibit this issue. Is it possible this is due to some datetime issue on the actual seagl.org site rather than in the code?

nhandler avatar Mar 12 '20 19:03 nhandler

Jekyll is a static site generator. It runs after every commit and the results are published to the site. The dates on the posts are really for sorting, not for holding on to until a specific date. There's no system in place to re-run the Jekyll build process to publish pending posts automatically.

kormoc avatar Mar 12 '20 19:03 kormoc

So wouldn't the expected behavior be that the future doesn't get included when jekyll runs since we haven't hit that date? That is what happens when running with Docker.

This also feels like a change/regression. There is a large note in the README from @vmbrasseur (https://github.com/SeaGL/seagl.github.io/commit/21ea91d5bb0ddda06f1ce9edacf17421fe8c3f36) specifically calling out the ability to use future dating to schedule posts. If this no longer works, we should remove the note at the very least. However, ideally, we would be able to support this workflow (potentially using GitHub Actions, which also support running on a schedule).

nhandler avatar Mar 12 '20 19:03 nhandler

I don't know exactly the command line GitHub renders Jekyll with, but there is a argument you can pass in called --future that will render future pages.

https://jekyllrb.com/docs/configuration/options/

When you are calling it via docker, it's not set in our config file or being set in the command line, so it's not rendering then. I can only assume that GitHub has this enabled by default. We could open a ticket with them to see if they know why this changed or why it's happening.

kormoc avatar Mar 12 '20 19:03 kormoc

So wouldn't the expected behavior be that the future doesn't get included when jekyll runs since we haven't hit that date?

Yes.

I can only assume that GitHub has [--future] enabled by default.

Odd. I don't see anything about that in the GitHub Pages documentation, but at least one other person has noticed a discrepancy:

However, your future posts will be shown in GitHub Pages. I couldn’t check the detail but it seemed the default Jekyll setting is different between a local and GitHub Pages. So, please don’t forget to set false to hide future posts correctly.

future: false

AndrewKvalheim avatar Mar 12 '20 20:03 AndrewKvalheim

Seems to have worked.

AndrewKvalheim avatar Mar 12 '20 20:03 AndrewKvalheim

This still seems to be broken. The post has yet to appear. I'm not sure if we need to force some other change to the site to cause it to be regenerated/redeployed or if something else is broken.

nhandler avatar Mar 17 '20 21:03 nhandler

I just pushed an unrelated commit ( ab89c6144ac4fd59e48866e4171cbe4a23e2321c ). That forced a site rebuild/deploy and now the videos post shows up.

Also: https://stackoverflow.com/questions/24098792/how-to-force-github-pages-build/24099328#24099328

meonkeys avatar Mar 18 '20 03:03 meonkeys

Cool. I'll update the docs about scheduling posts for future publication to call this out. I still wonder though if we could utilize something like GitHub Actions and have them force a daily rebuild to facilitate truly automated scheduled posts again.

nhandler avatar Mar 18 '20 03:03 nhandler