diff --git a/assets/js/application.js b/assets/js/application.js index ed83e31d31..b661f4c908 100644 --- a/assets/js/application.js +++ b/assets/js/application.js @@ -36,6 +36,7 @@ $(document).ready(function() { Forms.init(); Downloads.init(); DownloadBox.init(); + InstallPageLink.init(); PostelizeAnchor.init(); Print.init(); }); @@ -809,6 +810,22 @@ var Graphviz = { } } +var InstallPageLink = { + init: function() { + const installLink = document.querySelector('.install-link'); + if (!installLink) return; + + const os = window.session?.browser?.os; + if (os === "Mac") { + installLink.href = installLink.href.replace('/install', '/install/mac'); + } else if (os === "Windows") { + installLink.href = installLink.href.replace('/install', '/install/win'); + } else if (os === "Linux") { + installLink.href = installLink.href.replace('/install', '/install/linux'); + } + } +} + var Print = { init: function() { Print.tagline = $("#tagline"); diff --git a/assets/sass/downloads.scss b/assets/sass/downloads.scss index 14ddc6784e..525ca229a8 100644 --- a/assets/sass/downloads.scss +++ b/assets/sass/downloads.scss @@ -1,6 +1,95 @@ @import "variables"; @import "mixins"; +.install-tabs { + display: flex; + border-bottom: 2px solid var(--callout-color); + role: tablist; + + a[role="tab"] { + padding: 0.75rem 1rem; + + background: var(--callout-color); + border: 2px solid var(--callout-color); + border-bottom: none; + margin-right: -2px; + font-weight: 600; + text-decoration: none; + color: var(--font-color); + text-align: center; + + &:hover { + background: var(--main-bg); + color: var(--link-color); + } + + &[aria-selected="true"] { + background: var(--main-bg); + color: var(--font-color); + border-bottom: 2px solid var(--main-bg); + margin-bottom: -2px; + z-index: 1; + position: relative; + } + + // Border radius for first and last tabs + &:first-of-type { + border-top-left-radius: 8px; + } + + &:last-of-type { + border-top-right-radius: 8px; + margin-right: 0; + } + } +} + +.install-content { + padding: 1rem; + border: 2px solid var(--callout-color); + border-top: none; + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; +} + +.install-overview { + margin: 2rem; + color: var(--light-font-color); + font-size: 1.1rem; + line-height: 1.8rem; +} + +.install-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 1.5rem; + + h1 { + margin: 0; + } + + .version-badge { + display: inline-block; + padding: 0.25rem 0.75rem; + background: var(--sidebar-toc-bg-color); + color: var(--light-font-color-darker-35); + border-radius: 6px; + font-size: 0.75rem; + font-weight: 600; + + a { + color: var(--link-color); + text-decoration: none; + + &:hover { + color: var(--link-hover-color); + text-decoration: underline; + } + } + } +} + #logo-license { @extend .callout; padding: 20px !important; @@ -22,21 +111,6 @@ } } -.callout#more-downloads { - .column-left { - width: 47%; - } - - .column-right { - width: 45%; - } - - p { - padding-bottom: 1em; - line-height: 1.4; - } -} - #download-next-steps { @include clearfix; @extend .unstyled !optional; @@ -94,14 +168,6 @@ } } -#os-filter-count { - position: relative; - top: 8px; - left: 12px; - display: none; - color: var(--orange); -} - .downloading .hide { display: none; } diff --git a/content/download/_index.html b/content/download/_index.html deleted file mode 100644 index 1d4b056bf4..0000000000 --- a/content/download/_index.html +++ /dev/null @@ -1,3 +0,0 @@ ---- -redirect_to: downloads ---- diff --git a/content/downloads/_index.html b/content/downloads/_index.html deleted file mode 100644 index 33c02ccae9..0000000000 --- a/content/downloads/_index.html +++ /dev/null @@ -1,59 +0,0 @@ ---- -section: "downloads" -title: "Git - Downloads" -url: /downloads.html -aliases: -- /downloads/index.html -- /download/index.html -- /download.html ---- - -
-
-
-

Downloads

- -

- Older releases are available and the Git source repository is on GitHub. -

-
-
- {{< monitor >}} -
-
-
-

Logos

-

Various Git logos in PNG (bitmap) and EPS (vector) formats are available for use in online and print projects.

-

- - }}">View Logos → - -

-
-

Git via Git

-

- If you already have Git installed, you can get the latest development version via Git itself: -

- - git clone https://github.com/git/git - -

- You can also always browse the current contents of the git repository using the web interface. -

-
diff --git a/content/install/_index.html b/content/install/_index.html new file mode 100644 index 0000000000..dd11c49be6 --- /dev/null +++ b/content/install/_index.html @@ -0,0 +1,21 @@ +--- +section: "install" +title: "Git - Install" +url: /install +aliases: +- /downloads/index.html +- /download/index.html +- /download.html +- /install.html +--- + +
+ {{< install-header >}} + +
+

+ Choose your operating system above. +

+
+
+ diff --git a/content/downloads/linux.html b/content/install/linux.html similarity index 77% rename from content/downloads/linux.html rename to content/install/linux.html index d40347b0c9..b7d5914402 100644 --- a/content/downloads/linux.html +++ b/content/install/linux.html @@ -1,18 +1,19 @@ --- -section: "downloads" +section: "install" +title: "Git - Install for Linux" aliases: - /download/linux +- /downloads/linux ---
-

Download for Linux and Unix

-

It is easiest to install Git on Linux using the preferred package - manager of your Linux distribution. If you prefer to build from - source, you can find tarballs - on kernel.org. - The latest version is - {{< site-param latest_version >}} + {{< install-header "linux" >}} +

+

+ It is easiest to install Git on Linux with your distribution's package + manager. +

Debian/Ubuntu

For the latest stable version for your release of Debian/Ubuntu

# apt-get install git @@ -60,4 +61,6 @@

Red Hat Enterprise Linux, Oracle Linux, CentOS, Scientific Linux, et al.

Slitaz $ tazpkg get-install git +
+
diff --git a/content/downloads/mac.html b/content/install/mac.html similarity index 67% rename from content/downloads/mac.html rename to content/install/mac.html index ac3354ddda..c026fe5f2b 100644 --- a/content/downloads/mac.html +++ b/content/install/mac.html @@ -1,14 +1,16 @@ --- -section: "downloads" -title: "Git - Downloading Package" +section: "install" +title: "Git - Install for macOS" aliases: - /download/mac +- /downloads/mac ---
-

Download for macOS

+ {{< install-header "mac" >}} -

There are several options for installing Git on macOS. Note that +

+

There are several options for installing Git on macOS. Note that any non-source distributions are provided by third parties, and may not be up to date with the latest source release.

@@ -24,12 +26,6 @@

MacPorts

Xcode

Apple ships a binary package of Git with Xcode.

- -

Building from Source

-

If you prefer to build from source, you can find tarballs - on kernel.org. - The latest version is - {{< site-param latest_version >}}.

Installing git-gui

If you would like to install git-gui and gitk, @@ -37,4 +33,6 @@

Installing git-gui

$ brew install git-gui

+
+
diff --git a/content/install/source.html b/content/install/source.html new file mode 100644 index 0000000000..42c31f83b2 --- /dev/null +++ b/content/install/source.html @@ -0,0 +1,20 @@ +--- +section: "install" +title: "Git - Build from Source" +--- + +
+ {{< install-header "source" >}} + +
+ +

If you prefer to build from source, you can find tarballs + on kernel.org. + The latest version is + }}.tar.gz">{{< site-param "latest_version" >}}. +

+

There's also an official GitHub mirror.

+ +
+
+ diff --git a/content/downloads/win.html b/content/install/win.html similarity index 94% rename from content/downloads/win.html rename to content/install/win.html index 46fd4c98b2..6800200a9d 100644 --- a/content/downloads/win.html +++ b/content/install/win.html @@ -1,12 +1,15 @@ --- -section: "downloads" -title: "Git - Downloading Package" +section: "install" +title: "Git - Install for Windows" aliases: - /download/win +- /downloads/win ---
-

Download for Windows

+ {{< install-header "win" >}} + +

Click here to download the latest ({{< site-param windows_installer.installer_x64.version >}}) @@ -66,4 +69,7 @@

Get Involved

+ +
+
diff --git a/layouts/partials/sidebar.html b/layouts/partials/sidebar.html index 90c3783752..2f5295e43e 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -54,12 +54,7 @@ Reference
  • - Downloads - + Install
  • Community diff --git a/layouts/partials/site-root.html b/layouts/partials/site-root.html index b853cbe0b8..17ff1c445f 100644 --- a/layouts/partials/site-root.html +++ b/layouts/partials/site-root.html @@ -31,9 +31,9 @@

    Reference

  • - + -

    Downloads

    +

    Install

    Binary releases for all major platforms.

  • diff --git a/layouts/shortcodes/install-header.html b/layouts/shortcodes/install-header.html new file mode 100644 index 0000000000..44c27488e5 --- /dev/null +++ b/layouts/shortcodes/install-header.html @@ -0,0 +1,32 @@ +{{- $active := .Get 0 -}} +
    +
    +

    Install

    +
    + Latest version: {{ site.Params.latest_version }} + (Release Notes) +
    +
    + + \ No newline at end of file