Tip 28 - this time
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