apache / openserverless

Apache OpenServerless (incubating)
https://openserverless.apache.org
Apache License 2.0
421 stars 14 forks source link

Manage site "maintenance" / "coming soon" page from env #49

Closed d4rkstar closed 3 months ago

d4rkstar commented 3 months ago

Hello, i would introduce inside the openserverless-site templates the parsing of an env variable called HUGO_SITE_MAINT (or something like..).

When this is set to true, all the routes are disabled and only the homepage with the "Coming Soon" message is displayed. When unset (or set to false), the full website is displayed.

This can be useful to start the merge of the code on the main repository, allowing other members to work on it without searching the "latest code" on forks.

francescotimperi commented 3 months ago

+1

This would ease the introduction of new documentation steps, so I strongly support this type of feature.

d4rkstar commented 3 months ago

Hello, i've implemented the feature.

If you look at the Taskfile.yml in the branch issue_49 inside my fork, i've added an env variable called HUGO_SITE_MAINT. When set to true a "COMING SOON" page is displayed.

You can see the live preview here: https://openserverless-demo.netlify.app/

However, to make available this code, i need to do a first big PR from my fork/branch to openserverless-site/main.

Let me know if I can proceed. I'm available to a full code review.

AntonioPiga commented 3 months ago

+1

A great feature that speeds up and simplifies development