Radish alpha
r
rad:z371PVmDHdjJucejRoRYJcDEvD5pp
Radicle website including documentation and guides
Radicle
Git
deployment: Vercel → Cloudflare Workers
Lorenz Leutgeb committed 10 months ago
commit 62cdaf6d0ef616ff0e319097be4809d17ebb97e4
parent 26179ee
7 files changed +76 -56
modified Makefile
@@ -1,20 +1,22 @@
-
default: _site
-
	$(eval TMP := $(shell mktemp))
-
	cp _site/vercel.json $(TMP)
+
default:
	bundle exec jekyll build
-
	mv $(TMP) _site/vercel.json

serve:
-
	bundle exec jekyll serve --port 3000
+
	bundle exec jekyll serve --port 3000 --livereload

dependencies:
	gem install jekyll

+
cloudflare:
+
	sudo gem install bundler
+
	bundle config path vendor/bundle
+
	bundle install
+
	bundle exec jekyll build
+

svgs:
	scripts/cleanup-svgs.sh assets/images/*.svg

-
publish:
-
	bundle exec jekyll build
-
	vercel --prod
+
publish: default
+
	wrangler deploy

-
.PHONY: publish
+
.PHONY: default publish
modified _config.yml
@@ -24,3 +24,5 @@ exclude:
  - LICENSE
  - flake.*
  - README.md
+
include:
+
  - _redirects
added _redirects
@@ -0,0 +1,5 @@
+
/apt https://files.radicle.xyz/apt
+
/apt/* https://files.radicle.xyz/apt/:splat
+

+
/desktop https://desktop.radicle.xyz
+
/desktop/* https://desktop.radicle.xyz/:splat
deleted _site/vercel.json
@@ -1,25 +0,0 @@
-
{
-
  "$schema": "https://openapi.vercel.sh/vercel.json",
-
  "redirects": [
-
    {
-
      "source": "/desktop/:path*",
-
      "destination": "https://desktop.radicle.xyz/:path*",
-
      "permanent": false
-
    },
-
    {
-
      "source": "/desktop/",
-
      "destination": "https://desktop.radicle.xyz",
-
      "permanent": false
-
    },
-
    {
-
      "source": "/debian/:path*",
-
      "destination": "https://files.radicle.xyz/debian/:path*",
-
      "permanent": false
-
    },
-
    {
-
      "source": "/apt/:path*",
-
      "destination": "https://files.radicle.xyz/apt/:path*",
-
      "permanent": false
-
    }
-
  ]
-
}
modified flake.nix
@@ -25,39 +25,42 @@
    flake-utils.lib.eachDefaultSystem (system: let
      pkgs = import nixpkgs {
        inherit system;
-
        overlays = [ ruby-nix.overlays.ruby ];
+
        overlays = [ruby-nix.overlays.ruby];
      };
      rubyNix = ruby-nix.lib pkgs;
-
		  bundixcli = bundix.packages.${system}.default;
+
      bundixcli = bundix.packages.${system}.default;

-
      deps = with pkgs; [ env ruby bundixcli nodePackages.vercel ];
+
      deps = with pkgs; [env ruby bundixcli wrangler];

-
      inherit (rubyNix {
-
        name = "seroperson.gitlab.io";
-
        gemset = ./gemset.nix;
-
        gemConfig = pkgs.defaultGemConfig;
-
      })
-
        env ruby;
+
      inherit
+
        (rubyNix {
+
          name = "seroperson.gitlab.io";
+
          gemset = ./gemset.nix;
+
          gemConfig = pkgs.defaultGemConfig;
+
        })
+
        env
+
        ruby
+
        ;
    in {
      packages = let
        bundlecli = pkgs.writeShellApplication {
          name = "bundle";
          runtimeInputs = deps;
          text = ''
-
          export BUNDLE_PATH=vendor/bundle
-
          bundle "$@"
-
        '';
+
            export BUNDLE_PATH=vendor/bundle
+
            bundle "$@"
+
          '';
        };
        jekyll = pkgs.writeShellApplication {
          name = "jekyll";
          runtimeInputs = deps;
          text = ''
-
          if [ $# -eq 0 ]; then
-
            jekyll build
-
          else
-
            jekyll "$@"
-
          fi
-
        '';
+
            if [ $# -eq 0 ]; then
+
              jekyll build
+
            else
+
              jekyll "$@"
+
            fi
+
          '';
        };
      in {
        jekyll = jekyll;
@@ -68,9 +71,9 @@

      devShells.default = pkgs.mkShell {
        shellHook = ''
-
        export BUNDLE_PATH=vendor/bundle
-
      '';
+
          export BUNDLE_PATH=vendor/bundle
+
        '';
        buildInputs = deps;
-
    };
-
  });
+
      };
+
    });
}
added vercel.json
@@ -0,0 +1,25 @@
+
{
+
  "$schema": "https://openapi.vercel.sh/vercel.json",
+
  "redirects": [
+
    {
+
      "source": "/desktop/:path*",
+
      "destination": "https://desktop.radicle.xyz/:path*",
+
      "permanent": false
+
    },
+
    {
+
      "source": "/desktop/",
+
      "destination": "https://desktop.radicle.xyz",
+
      "permanent": false
+
    },
+
    {
+
      "source": "/debian/:path*",
+
      "destination": "https://files.radicle.xyz/debian/:path*",
+
      "permanent": false
+
    },
+
    {
+
      "source": "/apt/:path*",
+
      "destination": "https://files.radicle.xyz/apt/:path*",
+
      "permanent": false
+
    }
+
  ]
+
}
added wrangler.toml
@@ -0,0 +1,8 @@
+
name = "website"
+
compatibility_date = "2025-01-01"
+
account_id = "dcd58b4607e42dafa1592d13077a60bc"
+

+
[assets]
+
directory = "_site"
+
html_handling = "drop-trailing-slash"
+
not_found_handling = "404-page"