X Tutup
Skip to content

[Feature] Static pages rendering 🤩#274

Merged
nikmel2803 merged 10 commits intov2from
experimental-feature
Oct 17, 2022
Merged

[Feature] Static pages rendering 🤩#274
nikmel2803 merged 10 commits intov2from
experimental-feature

Conversation

@nikmel2803
Copy link
Member

With this feature we can render all pages as HTML documents and publish them to static file hosting (GitHub pages, s3 buckets and any others)

This approach has the following benefits:

  • no backend required
  • more secure (because there is no backend)
  • faster, because we don't need to render page on each request

So, this feature can be extremely useful for public docs such as editorjs.io or docs.hawk.so.

Bonus feature: you can now put docs database and uploads to git repo and allow other people to contribute (there are some issues, that can be resolved in the future). Demo: https://github.com/nikmel2803/editorjs-docs (see README).

  • default config renamed (now it's docs-config.yaml)
  • codex.docs now can be published and used as npm package (for running server locally from npm package)
  • codex.docs now have it's own CLI interface

Future possible upgrades

  • run docs server with npx codex.docs
  • more options for static files generation
  • more CLI functions (like DB migration) or project initialization

@nikmel2803
Copy link
Member Author

how to test

Put the following lines to your docs-config.local.yaml

staticBuild:
  outputDir: static-build
  indexPageUri: codex

Run yarn build-static, then view into static-build folder

nikmel2803 and others added 2 commits October 16, 2022 11:47
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
@nikmel2803 nikmel2803 merged commit 4ad37ab into v2 Oct 17, 2022
@nikmel2803 nikmel2803 deleted the experimental-feature branch December 1, 2022 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup