feat: Add WSGI server and build config for Clever Cloud
parent
eda2645bd0
commit
12e7e763ac
|
@ -1,5 +1,10 @@
|
|||
mkdocs-material
|
||||
# For building the site
|
||||
mkdocs
|
||||
mkdocs-material
|
||||
mkdocs-awesome-pages-plugin
|
||||
mkdocs-git-revision-date-plugin
|
||||
requests
|
||||
|
||||
# For serving the site via WSGI on Clever Cloud
|
||||
gunicorn
|
||||
whitenoise
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
# server.py
|
||||
from whitenoise import WhiteNoise
|
||||
|
||||
def not_found(environ, start_response):
|
||||
start_response('404 NOT FOUND', [('Content-Type', 'text/plain')])
|
||||
return [b'Not Found']
|
||||
|
||||
application = WhiteNoise(not_found, root='site/', index_file=True)
|
|
@ -0,0 +1,20 @@
|
|||
# setup.py
|
||||
import os
|
||||
from setuptools import setup
|
||||
from setuptools.command.install import install
|
||||
|
||||
class BuildMkDocsCommand(install):
|
||||
"""Custom command to build the MkDocs site."""
|
||||
def run(self):
|
||||
print("--> Running custom build command: mkdocs build")
|
||||
os.system("mkdocs build")
|
||||
print("--> MkDocs build complete.")
|
||||
|
||||
setup(
|
||||
name='smartup-zero-timeline',
|
||||
version='1.0.0',
|
||||
description='A wrapper to build and serve the MkDocs site on Clever Cloud.',
|
||||
cmdclass={
|
||||
'build_mkdocs': BuildMkDocsCommand,
|
||||
}
|
||||
)
|
Loading…
Reference in New Issue