From 1c2a9d93cf53539a1eed17551c141748967580b7 Mon Sep 17 00:00:00 2001 From: lovasoa Date: Mon, 12 Aug 2024 06:59:58 +0200 Subject: [PATCH] fix download instruction links --- .../your-first-sql-website/index.sql | 21 +++++++++++-------- .../tutorial-install-any.md | 2 +- .../tutorial-install-macos.md | 2 +- .../tutorial-install-windows.md | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/examples/official-site/your-first-sql-website/index.sql b/examples/official-site/your-first-sql-website/index.sql index 8d3ceb65..5953d501 100644 --- a/examples/official-site/your-first-sql-website/index.sql +++ b/examples/official-site/your-first-sql-website/index.sql @@ -3,22 +3,25 @@ select 'http_header' as component, select 'dynamic' as component, properties FROM example WHERE component = 'shell' LIMIT 1; -set is_windows = COALESCE($is_windows, sqlpage.header('user-agent') like '%windows%'); -set is_linux = COALESCE($is_linux, sqlpage.header('user-agent') like '%x11; linux%'); -set is_macos = COALESCE($is_macos, sqlpage.header('user-agent') like '%macintosh%'); +set os = COALESCE($os, case + when sqlpage.header('user-agent') like '%windows%' then 'windows' + when sqlpage.header('user-agent') like '%x11; linux%' then 'linux' + when sqlpage.header('user-agent') like '%macintosh%' then 'macos' + else 'any' +end); SELECT 'hero' as component, 'Your first SQL Website' as title, 'Let''s create your first website in SQL together, from downloading SQLPage to connecting it to your database, to making a web app' as description, 'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c4/Backlit_keyboard.jpg/1024px-Backlit_keyboard.jpg' as image, 'https://github.com/lovasoa/SQLpage/releases'|| case - when $is_windows then '/latest/download/sqlpage-windows.zip' - when $is_linux then '/latest/download/sqlpage-linux.tgz' + when $os = 'windows' then '/latest/download/sqlpage-windows.zip' + when $os = 'linux' then '/latest/download/sqlpage-linux.tgz' else '' end as link, 'Download SQLPage' || case - when $is_windows then ' for Windows' - when $is_linux then ' for Linux' + when $os = 'windows' then ' for Windows' + when $os = 'linux' then ' for Linux' else '' end as link_text; @@ -41,8 +44,8 @@ SELECT 'alert' as component, select 'text' as component, sqlpage.read_file_as_text(printf('your-first-sql-website/tutorial-install-%s.md', case - when $is_windows then 'windows' - when $is_macos then 'macos' + when $os = 'windows' then 'windows' + when $os = 'macos' then 'macos' else 'any' end )) as contents_md, 'download' as id; diff --git a/examples/official-site/your-first-sql-website/tutorial-install-any.md b/examples/official-site/your-first-sql-website/tutorial-install-any.md index 6085a609..bbd47ba1 100644 --- a/examples/official-site/your-first-sql-website/tutorial-install-any.md +++ b/examples/official-site/your-first-sql-website/tutorial-install-any.md @@ -18,4 +18,4 @@ Download the one that corresponds to your operating system, and extract the exec You can also find the source code of SQLPage on [GitHub](https://github.com/lovasoa/SQLpage), [install rust](https://www.rust-lang.org/tools/install) on your computer, and compile it yourself with `cargo install sqlpage`. -See the instructions for [MacOS](?is_macos=1#download), or for [Windows](?is_windows=1#download). +See the instructions for [MacOS](?os=macos#download), or for [Windows](?os=windows#download). diff --git a/examples/official-site/your-first-sql-website/tutorial-install-macos.md b/examples/official-site/your-first-sql-website/tutorial-install-macos.md index bbabf5e8..2bb68df3 100644 --- a/examples/official-site/your-first-sql-website/tutorial-install-macos.md +++ b/examples/official-site/your-first-sql-website/tutorial-install-macos.md @@ -14,4 +14,4 @@ sqlpage > [nix](https://search.nixos.org/packages?channel=unstable&show=sqlpage), > or [cargo](https://crates.io/crates/sqlpage). -> **Not on Mac OS?** See the instructions for [Windows](?is_windows=1#download), or for [Other Systems](?is_macos=0#download). \ No newline at end of file +> **Not on Mac OS?** See the instructions for [Windows](?os=windows#download), or for [Other Systems](?os=any#download). \ No newline at end of file diff --git a/examples/official-site/your-first-sql-website/tutorial-install-windows.md b/examples/official-site/your-first-sql-website/tutorial-install-windows.md index 8285d202..992b8672 100644 --- a/examples/official-site/your-first-sql-website/tutorial-install-windows.md +++ b/examples/official-site/your-first-sql-website/tutorial-install-windows.md @@ -11,4 +11,4 @@ Download the file, and extract the executable file from the zip archive. > [scoop](https://scoop.sh/#/apps?q=sqlpage&id=305b3437817cd197058954a2f76ac1cf0e444116), > or [cargo](https://crates.io/crates/sqlpage). -> **Not on Windows?** See the instructions for [Mac OS](?is_macos=1#download), or for [Other Systems](?is_windows=0#download). \ No newline at end of file +> **Not on Windows?** See the instructions for [Mac OS](?os=macos#download), or for [Other Systems](?os=any#download). \ No newline at end of file