diff --git a/requirements.txt b/requirements.txt index 95bbdca..d44f9b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/server.py b/server.py new file mode 100644 index 0000000..aba793d --- /dev/null +++ b/server.py @@ -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) diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..c91260f --- /dev/null +++ b/setup.py @@ -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, + } +)