Is there a way to save a notebook or word doc that you are still working on without publishing it as a post?

Imagine you’re working on a blog post over the course of several days, but you want someone to preview it before it is publicly available to the world as a post.

Is that possible? Maybe by prefixing ipynb or word files with an underscore so they are processed?

Jekyll has a _drafts folder and a --drafts runtime option to show them. @hamelsmu would it make sense to have _word_drafts and _nb_drafts too, or something like that?

Alternatively, you could just put a future date in the filename, and use --future to display.

1 Like

Where does this get set? In the notebook?

I like the drafts option … but maybe as part of the front-matter to reduce the number of folders. Setting it to true would mean “don’t process this into a post” (default false).

It’s when you preview, you run bundle exec jekyll serve --future

Some initial thoughts on this, please forgive me if I missed something

  • For working on draft posts, perhaps the best way to to do that on a branch? That may make your life easier. That way you can keep that part of your blog seperated.

  • Regarding the below idea which is interesting. I could certainly do this, however since we don’t want to serve the draft posts on GitHub pages, perhaps this might not be necessary? I feel like I’m missing something though, so please let me know more about what you are thinking. If you are previewing blog posts locally is it reasonable to always show everything ( we only care when publishing on GitHub pages, right? ).

I turned all future date posts on by default by setting future: true in _config.yml as it was causing immense confusion with time zones and folks wondering why their posts weren’t showing up b/c of mismatch between the Actions timezone and their local timezone. So this approach will not work, unless of course you set future: false in _config.yml ! The future hack may be the best way to go if you want something dead simple but still want to check your files into GitHub

Let me know if that helps happy to work on ways to make it easier

Maybe my word choice in terms of “publicly available to the world” wasn’t the best …

I was thinking more along the lines of, I want to publish this post but I don’t want others to find it unless they have the exact URL to it (kinda like a gist). That’s why I suggested maybe just being able add some front-matter such as --draft:true … and if so, it can only get gotten too if you know the URL to it (e.g., you can’t find it via tags or search, doesn’t show up in latest posts, etc…).

1 Like

That sounds pretty handy actually. It would require some changes to the template though, to have some criteria in the list of articles it showed on the index.

3 Likes

@wgpubs Thank you for explaining this more. I really like this idea. Therefore, it is now a feature in fastpages!
:partying_face:

Added it via https://github.com/fastai/fastpages/pull/198, and also added documentation in the README.

enjoy

5 Likes

You are the man!

Btw, unrelated question, is there a reason why the URL for blog posts isn’t /posts/… regardless of whether its a notebook, or a word doc, or a markdown file? Is it not possible or was it a design decision? Curious minds want to know.

You can customize that. https://jekyllrb.com/docs/permalinks/

2 Likes