wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.63k stars 1.18k forks source link

[Blog] Page with a list of all blog posts (/blog) depends on Docusaurus' internal structure #1184

Open matijaSos opened 1 year ago

matijaSos commented 1 year ago

BlogLayout component is used as a wrapper for both the list of blog posts and the individual blog post. Since we customize the looks of the blog post list, we need to differentiate between these two cases. Currently we are depending on the Docusaurus' internal structure of blog post data: https://github.com/wasp-lang/wasp/blob/216828247362ad5c4792f6a6d0a7569217ee547b/web/src/theme/BlogLayout/index.js#L31

Seems like this could be the fix: https://github.com/facebook/docusaurus/blob/main/packages/docusaurus-theme-classic/src/theme/BlogPostItem/index.tsx#L19

matijaSos commented 1 year ago

note: tried using useBlogPost() hook from above, but it throws an error that it needs to be used within BlogPostProvider context. Out of ideas for now.