Rushing Labs

How blog posts are built

List of functions

  • getAllFiles(dirPath, arrayOfFiles)

  • getAllFilesWithYearInfo = function(dirPath)

    • calls getAllFiles()
  • getAllCategories()

  • getPostsFromDocsSubdir(directory)

    • calls getAllFiles()
  • getCategoryPosts(category)

    • getAllFilesWithYearInfo()
  • getAllPostIds()

    • calls getAllFiles()

This is the main logic used

  • getSortedPostsData()
    • calls getAllFiles()

Get a specific post's data

  • getPostData(year, id)
    • reads
    • frontMatter