From f79392054b3c915fb0d3527aee34ef661477d23d Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 22 Jul 2025 01:08:30 -0700 Subject: [PATCH] version docs pages --- default.nix | 6 +- flake.lock | 51 +---- flake.nix | 12 +- redirects.caddyfile | 3 + src/components/featurelist/FeatureList.astro | 4 +- src/components/navigation/Search.astro | 4 +- .../navigation/sidebars/nav/RootNav.astro | 103 ++++++---- .../sidebars/nav/VersionSelector.astro | 48 ----- src/components/type/Functions.astro | 5 +- src/components/type/Properties.astro | 7 +- src/components/type/Signals.astro | 5 +- src/components/type/TypeDetails.astro | 3 +- src/config/io/generateTypeData.ts | 4 +- src/config/io/helpers.ts | 4 +- src/config/io/markdown.ts | 182 ++++++++++-------- src/content.config.ts | 9 +- src/guide/{faq.mdx => faq.md} | 0 .../{install-setup.mdx => install-setup.md} | 0 .../{introduction.mdx => introduction.md} | 28 ++- .../{qml-language.mdx => qml-language.md} | 37 +--- .../{size-position.mdx => size-position.md} | 0 src/layouts/DocsLayout.astro | 52 +++-- src/pages/docs/[version]/guide/[...id].astro | 27 +++ src/pages/docs/[version]/index.astro | 20 ++ .../types/[module]/[type].astro | 27 +-- .../types/[module]/index.astro | 19 +- .../docs/{ => [version]}/types/index.astro | 15 +- src/pages/docs/guide/[...id].astro | 20 -- src/pages/docs/index.astro | 10 - src/pages/index.astro | 6 +- versions.json | 6 +- 31 files changed, 329 insertions(+), 388 deletions(-) delete mode 100644 src/components/navigation/sidebars/nav/VersionSelector.astro rename src/guide/{faq.mdx => faq.md} (100%) rename src/guide/{install-setup.mdx => install-setup.md} (100%) rename src/guide/{introduction.mdx => introduction.md} (94%) rename src/guide/{qml-language.mdx => qml-language.md} (95%) rename src/guide/{size-position.mdx => size-position.md} (100%) create mode 100644 src/pages/docs/[version]/guide/[...id].astro create mode 100644 src/pages/docs/[version]/index.astro rename src/pages/docs/{ => [version]}/types/[module]/[type].astro (73%) rename src/pages/docs/{ => [version]}/types/[module]/index.astro (64%) rename src/pages/docs/{ => [version]}/types/index.astro (58%) delete mode 100644 src/pages/docs/guide/[...id].astro delete mode 100644 src/pages/docs/index.astro diff --git a/default.nix b/default.nix index b46718b..f683245 100644 --- a/default.nix +++ b/default.nix @@ -6,8 +6,7 @@ yarn-berry, nodejs, cacert, - quickshell-types ? null, - masterBranch ? false, + versions, }: stdenv.mkDerivation (final: let nodeModules = stdenv.mkDerivation { pname = "${final.pname}-node_modules"; @@ -70,8 +69,7 @@ in { ''; PRODUCTION = true; - MASTER_BRANCH = masterBranch; - SECRET_MODULES_PATH = if quickshell-types == null then "" else quickshell-types; + VERSION_FILE_PATH = versions; buildPhase = '' HOME=$(pwd)/garbage-tooling yarn build diff --git a/flake.lock b/flake.lock index 379392d..be0ea5b 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1730785428, - "narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=", + "lastModified": 1752950548, + "narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7", + "rev": "c87b95e25065c028d31a94f06a62927d18763fdf", "type": "github" }, "original": { @@ -15,52 +15,9 @@ "type": "indirect" } }, - "quickshell": { - "inputs": { - "nixpkgs": [ - "quickshell-docs", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1747564942, - "narHash": "sha256-XBs7dhqsY3vdrtukt9Qwcqz8CSixMnm/XvpqD+kn+TA=", - "ref": "refs/heads/master", - "rev": "823456b58e83880e8f6bfaa785ac949975817d2a", - "revCount": 529, - "type": "git", - "url": "https://git.outfoxxed.me/quickshell/quickshell" - }, - "original": { - "type": "git", - "url": "https://git.outfoxxed.me/quickshell/quickshell" - } - }, - "quickshell-docs": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "quickshell": "quickshell" - }, - "locked": { - "lastModified": 1747388043, - "narHash": "sha256-/iJ+Q2Z4rvwWCMHhUXeuGD86NqYLwEVrA+WRlIPTJnA=", - "ref": "refs/heads/master", - "rev": "82a47eae2403c54909cf0249deaddbbba29ba661", - "revCount": 100, - "type": "git", - "url": "https://git.outfoxxed.me/quickshell/quickshell-docs" - }, - "original": { - "type": "git", - "url": "https://git.outfoxxed.me/quickshell/quickshell-docs" - } - }, "root": { "inputs": { - "nixpkgs": "nixpkgs", - "quickshell-docs": "quickshell-docs" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index b6e915c..2bb8982 100644 --- a/flake.nix +++ b/flake.nix @@ -1,23 +1,15 @@ { inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; - - quickshell-docs = { - url = "git+https://git.outfoxxed.me/quickshell/quickshell-docs"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; - outputs = { self, nixpkgs, quickshell-docs }: let + outputs = { self, nixpkgs }: let forEachSystem = fn: nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: fn system nixpkgs.legacyPackages.${system}); in { packages = forEachSystem (system: pkgs: rec { - quickshell-web = pkgs.callPackage ./default.nix { - quickshell-types = quickshell-docs.packages.${system}.quickshell-types; - }; - + quickshell-web = pkgs.callPackage ./default.nix {}; default = quickshell-web; }); }; diff --git a/redirects.caddyfile b/redirects.caddyfile index 3c4e286..8184d7a 100644 --- a/redirects.caddyfile +++ b/redirects.caddyfile @@ -3,3 +3,6 @@ redir /docs/configuration/intro* /docs/guide/introduction permanent redir /docs/configuration/positioning* /docs/guide/size-position permanent redir /docs/configuration/qml-overview* /docs/guide/qml-language permanent redir /docs/configuration* /docs/guide permanent + +@unversioned_docs path_regexp ^/docs/((guide|types).*)$ +redir @unversioned_docs /docs/v0.1.0/{re.1} diff --git a/src/components/featurelist/FeatureList.astro b/src/components/featurelist/FeatureList.astro index 8456cf4..f1bda6d 100644 --- a/src/components/featurelist/FeatureList.astro +++ b/src/components/featurelist/FeatureList.astro @@ -1,7 +1,7 @@ --- import { processMarkdown } from "@config/io/markdown"; -const codeDesktop = await processMarkdown(`\`\`\`qml +const codeDesktop = await processMarkdown("N/A", `\`\`\`qml // a standard desktop window FloatingWindow { Timer { @@ -21,7 +21,7 @@ FloatingWindow { } \`\`\``); -const codeMobile = await processMarkdown(`\`\`\`qml +const codeMobile = await processMarkdown("N/A", `\`\`\`qml // a standard desktop window FloatingWindow { Timer { diff --git a/src/components/navigation/Search.astro b/src/components/navigation/Search.astro index c04ee15..bb3453e 100644 --- a/src/components/navigation/Search.astro +++ b/src/components/navigation/Search.astro @@ -2,7 +2,6 @@ import "@pagefind/default-ui/css/ui.css"; import magnifierIcon from "@icons/magnifier.svg?raw" --- -