Skip to content

Commit

Permalink
fix download instruction links
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Aug 12, 2024
1 parent c5392c7 commit 1c2a9d9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
21 changes: 12 additions & 9 deletions examples/official-site/your-first-sql-website/index.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Original file line number Diff line number Diff line change
Expand Up @@ -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).
> **Not on Mac OS?** See the instructions for [Windows](?os=windows#download), or for [Other Systems](?os=any#download).
Original file line number Diff line number Diff line change
Expand Up @@ -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).
> **Not on Windows?** See the instructions for [Mac OS](?os=macos#download), or for [Other Systems](?os=any#download).

0 comments on commit 1c2a9d9

Please sign in to comment.