Pacharapol Withayasakpunt Pacharapol Withayasakpunt
Tue 2 June 2020

Only flat file CMS and serverless functions are enough for my needs

This also obliviate the need to monitor your own database or entrust a third party to do it for you.

Still, you might need some functions you cannot rely on clients' web browser, such as adding search. Downloading indexes to client's machine is expensive and bad for SEO.

Adding Search

Adding Search

See below for a list of guides in this section, or keep reading for an overview on adding search functionality to your site. Site search…

So, I use lunr.js instead.

olivernn/lunr.js

olivernn/lunr.js

A bit like Solr, but much smaller and not as bright - olivernn/lunr.js

I built two essential files on the fly, before starting up a Nuxt server.

  • db.json created by JSON.string(glob)
  • idx.json created by JSON.stringify(lunr)

See,

patarapolw/polv

patarapolw/polv

polv's homepage. -- /scripts/init.js

Do you know that you can rollup a temporary server, potentially needed by gatsby build or nuxt generate? Such solutions are

marmelab/json-graphql-server

marmelab/json-graphql-server

Get a full fake GraphQL API with zero coding in less than 30 seconds. - marmelab/json-graphql-server
typicode/json-server

typicode/json-server

Get a full fake REST API with zero coding in less than 30 seconds (seriously) - typicode/json-server

I still have an editor / CMS, though; but it specifically targets a flat file folder,

patarapolw/superflat

patarapolw/superflat

Flat file CMS generator and manager. Contribute to patarapolw/superflat development by creating an account on GitHub.

Did I mentioned that I think I was wrong in thinking that I need a CMS? The truth is I still need a CMS, but I don't want to monitor a database.

One more thing I need is commenting engine. Indeed, an option is just use Disqus, but in the end, I hosted by own using Remark42, with a little tweak to make it work with SPA.

umputun/remark42

umputun/remark42

comment engine. Contribute to umputun/remark42 development by creating an account on GitHub.