Yea, I like having a directory for each tutorial, and keeping those all in a content
or tutorials
directory. That’s how I do it for my own blog, basically a structure like this:
content/
├─ how_to_create_a_log/
│ ├─ index.md
│ ├─ screenshot1.jpg
└─ how_to_create_an_asset/
├─ index.md
└─ assetpage.jpg
Then from within content/how_to_create_a_log/index.md
you would just reference the image like this:
![Title text](screenshot1.jpg)
For that to work, all I need to do is install the plugins gatsby-plugin-sharp and gatsby-remark-images and add them to gatsby-config.js
with the proper settings. I was planning to do that eventually and it should be pretty straightforward.
We’ve already got support for Front Matter, which is the type of header you see in that Gatsby tutorial on tags. I think title
, date
and path
(or slug
) are good variables to start with. I would probably hold off implementing anything to display or use a tags
variable, at least while we’re still prototyping this, but you could still add tags
to the Front Matter of any post for the time being and it wouldn’t hurt anything (basically they’ll just be ignored). Other useful variables could be something like post-type
to indicate if it’s a tutorial, blog post, news item, etc; a thumbnail
var that can be set to the filename of an image in the post’s subdirectory; a projects
var that could look something like this:
projects:
- name: farmOS
versions:
- 2.0.0
- 2.1.0
- name: Field Kit
versions:
- 0.8.2
- 2.0.0-alpha.1
Really no limit to the custom vars we could use, but it will be important to settle on some kind of conventions.
We don’t have a repository set up for this yet, but if you want to start playing around with it, feel free to start your own! If other folks are on-board with it, we can discuss making it an official repo, or figure out where else we want it to live long-term. Once you have some content to test out, I can create a branch in the Gatsby repo, add your repo as a source, and set up a preview deployment for testing it out.