stencila/website

Enable block level links

Closed this issue · 5 comments

Just like they are available through Discuss
image

I suggest that we perhaps generalise this into a related posts item in the YAML front matter which generates these 'cards' with link, images and abstract at the end, or in the side bar, of each post. Is that what you envisaged @apawlik

Precisely! I didn't know what to google out (related!) Will try it out and see what happens.

I don't think that googling will help much here - just because we're implementing our own font matter handling in our templates. So we can add whatever tag we want related or suggested or whatever. Just as long as we have something in the templates that handle it. Sounds complicated but it's not - I'll quickly create a PR to illustrate - I think it will be a useful exercise to illustrate how we can extend and use the front matter for other places in the site.

I see! OK. I get it (I think). I'll give it a short go.

I did a quick iteration on this mainly just to illustrate how how this sort of extension can be acheived:

In a blog post YAML header you can now add a suggested item:

suggested:
    - ../introducing-sheets
    - ../underneath-sheets

which gets rendered as:

image

by this bit of Nunjucks template

Note that the suggested list is getting pre-processed here to get image and title etc. Sometime we could add defaults for suggested - the last 3 posts for example.