Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

download: Updating layout of download pages #427

Open
wants to merge 8 commits into
base: preview
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions content/download/docker.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ For a list of GRASS GIS versions, see the [docker tag list](https://hub.docker.c
* {{< donateDialog isToggle=true isMarkdown=true >}}[<i class="fa fa-download"></i> Ubuntu 22.04 based with GUI support](https://hub.docker.com/r/osgeo/grass-gis/tags?page=1&name=ubuntu_wxgui){{< /donateDialog >}} (<small>1.3 GB, with wxPython, Python 3 and PDAL</small>)
<pre><code class="dockerfile">docker pull osgeo/grass-gis:releasebranch_{{< currentVersion.inline >}}{{- .Site.Data.grass.current_version_underscore -}}{{</currentVersion.inline >}}-ubuntu_wxgui</code></pre>

```bash
docker pull osgeo/grass-gis:releasebranch_{{< currentVersion.inline >}}{{- .Site.Data.grass.current_version_underscore -}}{{</currentVersion.inline >}}-ubuntu
```
<hr>


Expand Down
5 changes: 3 additions & 2 deletions content/download/linux.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ layout: "os"

[ [**GRASS GIS {{< grassVersion version="current" type="short">}} (current)**](#GRASS-GIS-current) | [**GRASS {{< grassVersion version="legacy" type="short">}} (legacy)**](#GRASS-GIS-old) | [**GRASS {{< grassVersion version="preview" type="short">}} (preview)**](#GRASS-GIS-devel) ]

<i class="fa fa-arrow-right"></i> Install <tt>grass</tt> package on your Linux distribution. Have a look at
The packaging status does not work
<!-- <i class="fa fa-arrow-right"></i> Install <tt>grass</tt> package on your Linux distribution. Have a look at
{{< donateDialog isToggle=true isMarkdown=true >}}[Repology](https://repology.org/project/grass/versions){{< /donateDialog >}} for an extended
list of GRASS GIS packages or directly check the
<a href="https://repology.org/badge/vertical-allrepos/grass.svg?exclude_unsupported=1&exclude_sources=modules,site&minversion={{< grassVersion version="current" >}}&columns=3" class="btn btn-primary">Packaging Status</a>
to quickly know which GRASS GIS version is currently available for your distro.
to quickly know which GRASS GIS version is currently available for your distro. -->

* {{< donateDialog isToggle=true isMarkdown=true >}}[Arch Linux](https://aur.archlinux.org/packages/grass/){{< /donateDialog >}}
* {{< donateDialog isToggle=true isMarkdown=true >}}[Debian](https://packages.debian.org/grass){{< /donateDialog >}}
Expand Down
4 changes: 2 additions & 2 deletions content/learn/download.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Download"
date: 2022-08-15T11:02:05+02:00
date: 2024-04-22T11:02:05+02:00
description: "Download GRASS GIS"
weight: 1
layout: "os"
layout: "download"
---
88 changes: 87 additions & 1 deletion data/grass.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,91 @@
"preview_version":"8.4.0",
"preview_version_short":"8.4",
"preview_version_underscore": "8_4",
"preview_version_nodots":"84"
"preview_version_nodots":"84",
"install": {
"mac": {
"mac_ports": {
"id": "mac_ports",
"title": "MacPorts",
"code": "sudo port install grass",
"url": "https://ports.macports.org/port/grass/"
}
},
"linux":{
"arch_linux": {
"id": "arch_linux",
"title": "Arch Linux",
"code": "sudo pacman -S grass",
"url": "https://aur.archlinux.org/packages/grass"
},
"debian": {
"id": "debian",
"title": "Debian",
"code": "sudo apt-get install grass",
"url": "https://packages.debian.org/search?keywords=grass"
},
"generic_64_bit":{
"id": "generic_64_bit",
"title": "Generic 64-bit",
"code": "add me",
"url": "https://grass.osgeo.org/grass84/binary/linux/snapshot/"
},
"EPEL": {
"id": "EPEL",
"title": "EPEL",
"code": "sudo yum install grass",
"url": "https://src.fedoraproject.org/rpms/grass"
},
"fedora":{
"id": "fedora",
"title": "Fedora",
"code": "sudo dnf install grass",
"url": "https://apps.fedoraproject.org/packages/grass"
},
"gentoo": {
"id": "gentoo",
"title": "Gentoo",
"code": "sudo emerge grass",
"url": "https://packages.gentoo.org/packages/sci-geosciences/grass"
},
"openSUSE": {
"id": "openSUSE",
"title": "openSUSE",
"code": "sudo zypper install grass",
"url": "https://build.opensuse.org/package/show/Application:Geo/grass"
},
"ubuntu": {
"id": "ubuntu",
"title": "Ubuntu",
"code": "sudo apt-get install grass",
"url": "https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-unstable"
}
},
"docker": {
"alpine": {
"id": "alpine",
"title": "Alpine based (233 MB, with Python 3 and PDAL)",
"code": "docker pull osgeo/grass-gis:releasebranch_8_4-alpine"
},
"debian": {
"id": "debian",
"title": "Debian based (1.2 GB, with Python 3 and PDAL)",
"code": "docker pull osgeo/grass-gis:releasebranch_8_4-debian"
},
"ubuntu": {
"id": "ubuntu",
"title": "Ubuntu based (1.2 GB, with Python 3 and PDAL)",
"code": "docker pull osgeo/grass-gis:releasebranch_8_4-ubuntu"
},
"wxPython": {
"id": "wxPython",
"title": "Ubuntu based (1.3 GB, with wxPython, Python 3 and PDAL)",
"code": "docker pull osgeo/grass-gis:releasebranch_8_4-ubuntu_wxgui"
}

}

}

}

48 changes: 48 additions & 0 deletions themes/grass/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1431,3 +1431,51 @@ code{
object-fit: cover;
/* border: 4px solid var(--grass-color-dark); */
}

.download-card {
max-width: 600px; /* Sets a max-width for the card */
box-shadow: 0 4px 6px rgba(0,0,0,.1); /* Adds a subtle shadow to the card */
border: none; /* Removes the default card border */
}
.download-btn {
background-color: var(--grass-color);
border: none; /* Removes the border */
padding: .75rem 1.5rem; /* Larger padding for the button */
font-size: 1rem; /* Larger font size */
color: var(--white-color); /* White text color */
}
.download-btn:hover {
color: var(--white-color) !important;
background-color: var(--grass-color-alt); /* Darker blue on hover */
}

.support-btn {
background-color: hsl(334, 89%, 59%);
border: none; /* Removes the border */
padding: .75rem 1.5rem; /* Larger padding for the button */
font-size: 1rem; /* Larger font size */
color: var(--white-color); /* White text color */
}
.support-btn:hover, .support-btn:focus {
color: var(--white-color) !important;
background-color: hsla(334, 89%, 59%, 0.5); /* Darker blue on hover */
}

.code-container {
position: relative;
background-color: #777;
}
.btn-clipboard {
position: absolute;
top: .5rem;
right: .5rem;
z-index: 10;
display: block;
padding: .25rem .5rem;
font-size: 75%;
color: #ffffff;
cursor: pointer;
background-color: transparent;
border: 0;
border-radius: .25rem;
}
57 changes: 57 additions & 0 deletions themes/grass/assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,61 @@
$(this).html($(this).html() == 'View more' ? 'View less' : 'View more');
e.preventDefault();
});

function detectOSFromUserAgent() {
return new Promise((resolve) => {
const userAgent = window.navigator.userAgent;

if (userAgent.includes("Win")) resolve("Windows");
else if (userAgent.includes("Mac")) resolve("macOS");
else if (userAgent.includes("Linux")) resolve("Linux");
else if (userAgent.includes("Android")) resolve("Android");
else if (userAgent.includes("like Mac") && /iPhone|iPad|iPod/.test(userAgent)) resolve("iOS");
else resolve("Unknown OS");
});
}

$(document).ready(function() {
// Detect the user's OS and update the download button text
(async () => {
const os = await detectOSFromUserAgent();
const button = $(".grass-os-download-button");

// Add text and data based on the user's OS
switch (os) {
case "Windows":
button.text("Download for Windows");
button.data("os", "windows");
// TODO: This doesn't work
// $('a[data-toggle="tab"]').on("shown.bs.tab", (e) => {
// history.replaceState(null, null, "#windows");
// window.location.hash = "#windows";
// });
if (window.location.pathname === "/learn/download/") {
history.replaceState(null, null, "#windows");
}
break;
case "macOS":
button.text("Download for macOS");
button.data("os", "mac");
$('#downloadTab a[href="#mac"]').tab('show');
if (window.location.pathname === "/learn/download/") {
history.replaceState(null, null, "#mac");
}
break;
case "Linux":
button.text("Download for Linux");
button.data("os", "linux");
if (window.location.pathname === "/learn/download/") {
history.replaceState(null, null, "#linux");
}
break;
default:
button.text("Download");
button.data("os", "unknown");
break;
}
})(jQuery);
});

})(jQuery);
Loading