Closed donovanh closed 5 years ago
I think I could adapt this a bit to handle sections with multiple pages. We could set a front matter key for the section ID - and if we set it to the link that corresponds with the menu url (e.g. /buffers-and-streams/
then the button within the section regardless of sup-page, would mark the entire section done.
Then again maybe this isn't granular enough and each section needs it's own percent-completed amount. In which case we'd need to extend the topics
object in _data
to include sub-pages and then work that into the percentage completed.
This adds some logic to keep track (using localhost) of a user's progress. I don't know if we need to go as far as adding external database / user authentication. This is a simple approach that keeps track of which topics have been covered using their URL as identifier.
It's handled in the
post
template so won't need added to any posts, as long as they state thelayout: post.njk
in the front matter.(We should to not to change urls).
Future improvement might be to add a percentage progress bar on the home page or footer.