We went a completely different route though. Instead of using getServerSideProps, we do the following:
On build, use a script called scripts/generate_feed.bs.js to generate a public/blog/feed.xml file (done by yarn run update-index in the deploy chain)
The feed will then be served at reasonml.org/blog/feed.xml
Trickier mechanics involved:
We need the esm package to be able to run the generate_feed.bs.js file, since it's using es6 output, instead of cjs. At least we now have a way to write our scripts as Reason files, which is great!
Implements feature requested in #174
We went a completely different route though. Instead of using
getServerSideProps
, we do the following:scripts/generate_feed.bs.js
to generate apublic/blog/feed.xml
file (done byyarn run update-index
in the deploy chain)reasonml.org/blog/feed.xml
Trickier mechanics involved: We need the
esm
package to be able to run thegenerate_feed.bs.js
file, since it's using es6 output, instead of cjs. At least we now have a way to write our scripts as Reason files, which is great!Another big change:
static
folder to/public