From dd76a16223388ba8cde67124ec7719b44b9903b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20S=C3=A9chet?= Date: Mon, 20 May 2024 15:56:04 +0200 Subject: [PATCH] chore: use jean-website to generate site (#6) --- .gitignore | 2 + {css => assets/css}/content.css | 0 {css => assets/css}/nav.css | 0 {css => assets/css}/typo.css | 0 {css => assets/css}/variables.css | 0 {img => assets/img}/adrien.png | Bin {img => assets/img}/aurel.png | Bin {img => assets/img}/background-black-red.jpg | Bin {img => assets/img}/background.jpg | Bin {img => assets/img}/frog-cwak.png | Bin {img => assets/img}/game-footer.png | Bin {img => assets/img}/nav-logo.png | Bin .../img}/section-collective-hover.png | Bin {img => assets/img}/section-collective.png | Bin {img => assets/img}/section-contact-hover.png | Bin {img => assets/img}/section-contact.png | Bin {img => assets/img}/section-games.png | Bin {img => assets/img}/section-news.png | Bin {img => assets/img}/the-guild.png | Bin index.js => assets/js/index.js | 0 noxfile.py | 35 ++++++++++++++++++ site.py | 1 + index.html => src/index.html.j2 | 1 + 23 files changed, 39 insertions(+) create mode 100644 .gitignore rename {css => assets/css}/content.css (100%) rename {css => assets/css}/nav.css (100%) rename {css => assets/css}/typo.css (100%) rename {css => assets/css}/variables.css (100%) rename {img => assets/img}/adrien.png (100%) rename {img => assets/img}/aurel.png (100%) rename {img => assets/img}/background-black-red.jpg (100%) rename {img => assets/img}/background.jpg (100%) rename {img => assets/img}/frog-cwak.png (100%) rename {img => assets/img}/game-footer.png (100%) rename {img => assets/img}/nav-logo.png (100%) rename {img => assets/img}/section-collective-hover.png (100%) rename {img => assets/img}/section-collective.png (100%) rename {img => assets/img}/section-contact-hover.png (100%) rename {img => assets/img}/section-contact.png (100%) rename {img => assets/img}/section-games.png (100%) rename {img => assets/img}/section-news.png (100%) rename {img => assets/img}/the-guild.png (100%) rename index.js => assets/js/index.js (100%) create mode 100644 noxfile.py create mode 100644 site.py rename index.html => src/index.html.j2 (99%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d75298 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build +__pycache__ diff --git a/css/content.css b/assets/css/content.css similarity index 100% rename from css/content.css rename to assets/css/content.css diff --git a/css/nav.css b/assets/css/nav.css similarity index 100% rename from css/nav.css rename to assets/css/nav.css diff --git a/css/typo.css b/assets/css/typo.css similarity index 100% rename from css/typo.css rename to assets/css/typo.css diff --git a/css/variables.css b/assets/css/variables.css similarity index 100% rename from css/variables.css rename to assets/css/variables.css diff --git a/img/adrien.png b/assets/img/adrien.png similarity index 100% rename from img/adrien.png rename to assets/img/adrien.png diff --git a/img/aurel.png b/assets/img/aurel.png similarity index 100% rename from img/aurel.png rename to assets/img/aurel.png diff --git a/img/background-black-red.jpg b/assets/img/background-black-red.jpg similarity index 100% rename from img/background-black-red.jpg rename to assets/img/background-black-red.jpg diff --git a/img/background.jpg b/assets/img/background.jpg similarity index 100% rename from img/background.jpg rename to assets/img/background.jpg diff --git a/img/frog-cwak.png b/assets/img/frog-cwak.png similarity index 100% rename from img/frog-cwak.png rename to assets/img/frog-cwak.png diff --git a/img/game-footer.png b/assets/img/game-footer.png similarity index 100% rename from img/game-footer.png rename to assets/img/game-footer.png diff --git a/img/nav-logo.png b/assets/img/nav-logo.png similarity index 100% rename from img/nav-logo.png rename to assets/img/nav-logo.png diff --git a/img/section-collective-hover.png b/assets/img/section-collective-hover.png similarity index 100% rename from img/section-collective-hover.png rename to assets/img/section-collective-hover.png diff --git a/img/section-collective.png b/assets/img/section-collective.png similarity index 100% rename from img/section-collective.png rename to assets/img/section-collective.png diff --git a/img/section-contact-hover.png b/assets/img/section-contact-hover.png similarity index 100% rename from img/section-contact-hover.png rename to assets/img/section-contact-hover.png diff --git a/img/section-contact.png b/assets/img/section-contact.png similarity index 100% rename from img/section-contact.png rename to assets/img/section-contact.png diff --git a/img/section-games.png b/assets/img/section-games.png similarity index 100% rename from img/section-games.png rename to assets/img/section-games.png diff --git a/img/section-news.png b/assets/img/section-news.png similarity index 100% rename from img/section-news.png rename to assets/img/section-news.png diff --git a/img/the-guild.png b/assets/img/the-guild.png similarity index 100% rename from img/the-guild.png rename to assets/img/the-guild.png diff --git a/index.js b/assets/js/index.js similarity index 100% rename from index.js rename to assets/js/index.js diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 0000000..e321bce --- /dev/null +++ b/noxfile.py @@ -0,0 +1,35 @@ +"""Nox configuration file.""" +from shutil import copytree + +from nox import Session, session + + +@session() +def lint(session: Session) -> None: + session.install("ruff") + session.run("ruff", "check", "--fix") + session.run("ruff", "format") + + +@session() +def mypy(session: Session) -> None: + session.install("-e", ".[dev]", "mypy", "types-PyYAML", "types-Markdown") + session.run("mypy") + + +@session +def build(session: Session) -> None: + """Run unit tests.""" + session.install("nodeenv", "git+https://git.collectivit.org/collectivit/jean-website") + session.run_install("nodeenv", "-p") + + session.log("Building website...") + session.run("jwebsite", "build") + + session.log("Copying static files to build directory...") + copytree("assets", "build", dirs_exist_ok=True) + + +@session() +def devenv(session: Session) -> None: + session.install("-e", ".[dev]") diff --git a/site.py b/site.py new file mode 100644 index 0000000..9c899c1 --- /dev/null +++ b/site.py @@ -0,0 +1 @@ +site.render('index.html.j2', 'index.html') diff --git a/index.html b/src/index.html.j2 similarity index 99% rename from index.html rename to src/index.html.j2 index 64a2035..29d2437 100644 --- a/index.html +++ b/src/index.html.j2 @@ -198,3 +198,4 @@ +