diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..894571b --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k=" + +use devenv diff --git a/.gitignore b/.gitignore index 9735508..087e02e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,14 @@ node_modules *.tar.gz gmi/api/commit .env.keys -*.decrypted \ No newline at end of file +*.decrypted + +# Devenv +.devenv* +devenv.local.nix + +# direnv +.direnv + +# pre-commit +.pre-commit-config.yaml diff --git a/Pipfile.lock b/Pipfile.lock index 33a385a..3de50fa 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -464,12 +464,12 @@ }, "mkdocs-material": { "hashes": [ - "sha256:1125622067e26940806701219303b27c0933e04533560725d97ec26fd16a39cf", - "sha256:c87f7d1c39ce6326da5e10e232aed51bae46252e646755900f4b0fc9192fa832" + "sha256:414e8376551def6d644b8e6f77226022868532a792eb2c9accf52199009f568f", + "sha256:4d1d35e1c1d3e15294cb7fa5d02e0abaee70d408f75027dc7be6e30fb32e6867" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==9.6.3" + "version": "==9.6.4" }, "mkdocs-material-extensions": { "hashes": [ diff --git a/bin/build.sh b/bin/build.sh index 6e36186..61467eb 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash set -ex -SOURCE_DIR="${PWD}/markdown" TARGET_DIR="${PWD}/public" pipenv run build cp "$TARGET_DIR/assets/images/favicon.png" "$TARGET_DIR/favicon.ico" -v -cp "$SOURCE_DIR/.well-known" "$TARGET_DIR/" -rv +#cp "$SOURCE_DIR/.well-known" "$TARGET_DIR/" -rv diff --git a/bin/deploy.sh b/bin/deploy.sh index 0b9c9bb..622eedb 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -5,6 +5,9 @@ if [[ $DEBUG != "" ]]; then fi _root_directory_git=$(git rev-parse --show-toplevel) +_git_current_branch=$(git rev-parse --abbrev-ref HEAD) +CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH:-$_git_current_branch} +CI_DEFAULT_BRANCH="main" warn() { echo "warning: $*" @@ -18,7 +21,9 @@ info() { echo "info: $*" } -if [[ $CI == "true" ]] && [[ $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web" ]] && [[ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ]]; then - npx wrangler pages publish ${_root_directory_git}/public --project-name ${CF_PAGES_PROJECT_NAME:-"ajhalili2006"} --branch main - scp -i "$PWD/.secretskit/passwordless" -o "StrictHostKeyChecking=no" -rv public ajhalili@iapetus.uberspace.de:html +if [[ $CI == "true" ]]; then + info "Deploying to Cloudflare Pages" + if [[ $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web" ]] && [[ $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ]]; then + npx wrangler pages publish ${_root_directory_git}/public --project-name ${CF_PAGES_PROJECT_NAME:-"ajhalili2006"} --branch main + fi fi \ No newline at end of file diff --git a/devenv.lock b/devenv.lock new file mode 100644 index 0000000..97ee183 --- /dev/null +++ b/devenv.lock @@ -0,0 +1,139 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1739444039, + "owner": "cachix", + "repo": "devenv", + "rev": "1235cd13f47df6ad19c8a183c6eabc1facb7c399", + "type": "github" + }, + "original": { + "dir": "src/modules", + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737465171, + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1739451785, + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1128e89fd5e11bb25aedbfc287733c6502202ea9", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-python": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733319315, + "owner": "cachix", + "repo": "nixpkgs-python", + "rev": "01263eeb28c09f143d59cd6b0b7c4cc8478efd48", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "nixpkgs-python", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "git-hooks": "git-hooks", + "nixpkgs": "nixpkgs", + "nixpkgs-python": "nixpkgs-python", + "pre-commit-hooks": [ + "git-hooks" + ] + } + } + }, + "root": "root", + "version": 7 +} diff --git a/devenv.nix b/devenv.nix new file mode 100644 index 0000000..a5adca9 --- /dev/null +++ b/devenv.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: { + + packages = with pkgs; [ + gitFull + pipenv + python313 # this is a hack to use nixpkgs one instead of compiling from source + ]; + + enterShell = '' + pipenv install + ''; +} diff --git a/devenv.yaml b/devenv.yaml new file mode 100644 index 0000000..a4e3588 --- /dev/null +++ b/devenv.yaml @@ -0,0 +1,8 @@ +inputs: + nixpkgs-python: + url: github:cachix/nixpkgs-python + inputs: + nixpkgs: + follows: nixpkgs + nixpkgs: + url: github:NixOS/nixpkgs/nixpkgs-unstable diff --git a/overrides/base.html b/overrides/base.html index 4185853..62ce79a 100644 --- a/overrides/base.html +++ b/overrides/base.html @@ -32,8 +32,7 @@ {% endif %} - - + {% endblock %} {% block htmltitle %} {% if page.meta and page.meta.title %} @@ -45,7 +44,7 @@ {% endif %} {% endblock %} {% block styles %} - + {% if config.theme.palette %} {% set palette = config.theme.palette %} @@ -219,7 +218,7 @@ "base": base_url, "features": features, "translations": {}, - "search": "assets/javascripts/workers/search.6ce7567c.min.js" | url + "search": "assets/javascripts/workers/search.f8cc74c7.min.js" | url } -%} {%- if config.extra.version -%} {%- set mike = config.plugins.get("mike") -%} @@ -250,7 +249,7 @@ {% endblock %} {% block scripts %} - + {% for script in config.extra_javascript %} {{ script | script_tag }} {% endfor %}