[fastpages] Hide not working / updating Fastpages fork?

Dear @hamelsmu et al,

I was pleased to see the “hide” option for the YAML front matter, because I had a post-in-progress that I wanted to look at a draft of without having it listed on my main page yet.

…But despite setting “hide: true” in the front matter of my notebook
(https://github.com/drscotthawley/blog/blob/master/_notebooks/2020-03-01-Data-Are-Measurements.ipynb),
I see that this page is still being listed on my main blog after the Actions are complete and the new page loads (even after I wait a while to make sure GitHub is serving the newest build).

This makes me wonder, if perhaps my fork of Fastpages is again too old, and maybe comes from a version that didn’t support “hide” yet.

So…Is there any new-improved way to update our forks with the main (upstream) FastPages repo? Previously, when we used your easy "Click here " setup system, it seemed like the only way to update was to just delete our old blog and re-start a new blog (as per your instructions in this earlier thread).

If that’s still the case, then I’ll do so, just thought I’d ask first.

Thanks.

PS: I tried the usual

git remote add upstream https://github.com/fastai/fastpages.git
git fetch upstream
git merge upstream/master

and got

fatal: refusing to merge unrelated histories

for the merge command. I hadn’t made any noteworthy changes ‘under the hood’ for this blog, just added notebooks & posts, & changed things like title & name in the config.yaml file.

Have you tried upgrading via these directions?

https://forums.fast.ai/t/a-new-automated-way-to-upgrade-fastpages/64513/11

1 Like

Yeah - copy your files over to a new repo , but this should be the last time you will have to do that, per what @muellerzr linked to above

2 Likes

Sweet, thanks guys!

@hamelsmu One related question… And I can gladly start a new post for this question if you prefer (but I’m nervous to do so, because every time I ask about a ‘hide’ function it turns out it’s been answered elsewhere, even though I search the forums before posting)! :

If we want to collapse-hide non-code sections, should we just use the details construct in Markdown? Or is there a better way you’d recommend?

(Proof that details does in fact work with Fastpages, in the section marked ‘Solution’ :slight_smile:: https://drscotthawley.github.io/blog/physics/coronavirus/2020/03/26/Sliding-Off-A-Hill.html)
…I do notice, however, that the font size inside the “details” is quite a bit smaller than the font size elsewhere in the post. Hmmm.

@drscotthawley in the short term you can customize the CSS in _sass/minima/custom-styles.scss

There are scenarios I haven’t considered, yet

  1. Collapsing output from code only
  2. Collapsing BOTH the output AND the code
  3. Collapsing things that are not code all together

Before I go off researching these topics, etc. I should ask @sgugger if these might be possible through nbdev, or any thoughts on these things for guidance if I am to implement this. It looks like these are possible with the nbconvert template, and I would probably have to do something here: https://github.com/fastai/fastpages/blob/master/_action_files/hide.tpl

For the use case of number 3 that you are asking about, I’m thinking we would have to send metadata through the jupyter interface instead of a flag through nbdev.

Just writing all of this down in case for discussion

1 Like

That sounds like a good plan. I notice that within the details section, my other Markdown formatting codes (e.g. **...** for bold text) are working fine as I edit my notebook in Jupyter, but are not being rendered in the output on the blog; I suspect nbdev is not handling these properly.

I actually suspect this has nothing to do with nbdev and more to do with nbconvert once you decide to use HTML everything inside the tags also needs to be HTML

You can certainly have a more custom template. We only have basic things in here (and it’s not something I know to program super well).