Tip 28 - this time
Acknowledge the similarities to and differences from earlier instructions.
Because docs has to be written for everyone, we often can’t know our readers’ prior actions and experiences. But, with guided walkthroughs, it’s safe to assume they’ve followed any and all previous steps. In my books, that’s fair game for an assumed frame of reference!
One PR suggestion I often make is to point out when a similar or identical step has already been performed. This can assure your reader that yes, they’ve seen this before. It can also helpfully call attention to subtle differences.
Use the same method to fetch data your data from Contentful as above, but this time, on a page that will create a unique page route for each blog post.
Create a new file named
[slug].astro
insrc/pages/posts/
.As you previously did in
src/pages/index.astro
, import theBlogPost
interface andcontentfulClient
fromsrc/lib/contentful.ts
.This time, fetch your data inside a
getStaticPaths()
function.
Most of the time, I don’t want to presume that my reader has read anything else earlier on the page… and certainly not on any other page! One disadvantage of using precise headings as anchor links is sending your reader to a part of the page where even the preceeding line (and often helpful context!) is scrolled out of view.
However, your reader is working through a set of instructions from top to bottom. It is helpful to point out when they should find a task familiar (“Are we just going to pretend that we haven’t done this before?”) as well as when (and how) they should not mindlessly repeat it.
Toggle Comments
© 2021 - 2024 Sarah Rainsberger. Except where otherwise noted, and/or quoting external sources, the content of this site is licensed under CC BY-NC-SA 4.0