diff --git a/assets/js/application.js b/assets/js/application.js index ed83e31d31..259973fb11 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(); }); @@ -60,27 +61,27 @@ var DownloadBox = { var os = window.session.browser.os; // Mac, Win, Linux if(os == "Mac") { $(".monitor").addClass("mac"); - $("#download-link").text("Download for Mac").attr("href", `${baseURLPrefix}downloads/mac`); + $("#download-link").text("Download for Mac").attr("href", `${baseURLPrefix}install/mac`); $("#gui-link").removeClass('mac').addClass('gui'); $("#gui-link").text("Mac GUIs").attr("href", `${baseURLPrefix}downloads/guis?os=mac`); $("#gui-os-filter").attr('data-os', 'mac'); $("#gui-os-filter").text("Only show GUIs for my OS (Mac)") } else if (os == "Windows") { $(".monitor").addClass("windows"); - $("#download-link").text("Download for Windows").attr("href", `${baseURLPrefix}downloads/win`); + $("#download-link").text("Download for Windows").attr("href", `${baseURLPrefix}install/windows`); $("#gui-link").removeClass('mac').addClass('gui'); $("#gui-link").text("Windows GUIs").attr("href", `${baseURLPrefix}downloads/guis?os=windows`); $("#alt-link").removeClass("windows").addClass("mac"); - $("#alt-link").text("Mac Build").attr("href", `${baseURLPrefix}downloads/mac`); + $("#alt-link").text("Mac Build").attr("href", `${baseURLPrefix}install/mac`); $("#gui-os-filter").attr('data-os', 'windows'); $("#gui-os-filter").text("Only show GUIs for my OS (Windows)") } else if (os == "Linux") { $(".monitor").addClass("linux"); - $("#download-link").text("Download for Linux").attr("href", `${baseURLPrefix}downloads/linux`); + $("#download-link").text("Download for Linux").attr("href", `${baseURLPrefix}install/linux`); $("#gui-link").removeClass('mac').addClass('gui'); $("#gui-link").text("Linux GUIs").attr("href", `${baseURLPrefix}downloads/guis?os=linux`); $("#alt-link").removeClass("windows").addClass("mac"); - $("#alt-link").text("Mac Build").attr("href", `${baseURLPrefix}downloads/mac`); + $("#alt-link").text("Mac Build").attr("href", `${baseURLPrefix}install/mac`); $("#gui-os-filter").attr('data-os', 'linux'); $("#gui-os-filter").text("Only show GUIs for my OS (Linux)") } else { @@ -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/application.scss b/assets/sass/application.scss index a1d8d2481e..470a4d7ad0 100644 --- a/assets/sass/application.scss +++ b/assets/sass/application.scss @@ -16,7 +16,7 @@ $baseurl: "{{ .Site.BaseURL }}{{ if (and (ne .Site.BaseURL "/") (ne .Site.BaseUR @import 'variables'; @import 'layout'; @import 'typography'; -@import 'downloads'; +@import 'install'; @import 'search'; @import 'front-page'; @import 'sidebar'; diff --git a/assets/sass/downloads.scss b/assets/sass/downloads.scss deleted file mode 100644 index 14ddc6784e..0000000000 --- a/assets/sass/downloads.scss +++ /dev/null @@ -1,107 +0,0 @@ -@import "variables"; -@import "mixins"; - -#logo-license { - @extend .callout; - padding: 20px !important; - margin-top: 2em; - - p { - font-size: 12px; - line-height: 1.4; - color: var(--light-font-color); - } - - p + p { - margin-top: 14px; - } - - img { - float: left; - margin-right: 20px; - } -} - -.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; - padding-top: 24px; - - li { - display: block; - float: left; - width: 200px; - margin-bottom: 20px; - } - - li + li { - margin-left: 20px; - } - - a { - display: block; - color: var(--font-color); - text-align: center; - background-repeat: no-repeat; - background-position: 0 0; - transition-duration: 0.3s; - transition-property: color; - - img { - display: block; - margin: 0 auto 10px; - opacity: 0.9; - transition-duration: 0.3s; - transition-property: opacity; - image-rendering: -webkit-optimize-contrast; - } - - h3 { - font-size: 18px; - font-weight: bold; - color: var(--orange); - } - - p { - font-size: 13px; - line-height: $base-line-height * 0.8; - } - } - - a:hover { - img { - opacity: 1; - } - - h3 { - color: var(--orange-darker-5); - } - } -} - -#os-filter-count { - position: relative; - top: 8px; - left: 12px; - display: none; - color: var(--orange); -} - -.downloading .hide { - display: none; -} diff --git a/assets/sass/install.scss b/assets/sass/install.scss new file mode 100644 index 0000000000..51cb15f65e --- /dev/null +++ b/assets/sass/install.scss @@ -0,0 +1,184 @@ +@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 { + color: var(--link-color); + } + + &[aria-selected="true"] { + color: var(--font-color); + background: var(--main-bg); + border-bottom: 2px solid var(--main-bg); + margin-bottom: -2px; + } + + // 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; + } + } + + @media (max-width: $mobile-m) { + a[role="tab"] { + padding: .5rem; + line-height: 1.2em; + display: flex; + + span { + margin: auto; + } + } + } +} + +.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); + border-radius: 6px; + font-size: 0.75rem; + font-weight: bold; + @media (max-width: $mobile-m) { + max-width: 150px; + } + + a { + color: var(--link-color); + text-decoration: none; + + &:hover { + color: var(--link-hover-color); + text-decoration: underline; + } + } +} + +#logo-license { + @extend .callout; + padding: 20px !important; + margin-top: 2em; + + p { + font-size: 12px; + line-height: 1.4; + color: var(--light-font-color); + } + + p+p { + margin-top: 14px; + } + + img { + float: left; + margin-right: 20px; + } +} + +#download-next-steps { + @include clearfix; + @extend .unstyled !optional; + padding-top: 24px; + + li { + display: block; + float: left; + width: 200px; + margin-bottom: 20px; + } + + li+li { + margin-left: 20px; + } + + a { + display: block; + color: var(--font-color); + text-align: center; + background-repeat: no-repeat; + background-position: 0 0; + transition-duration: 0.3s; + transition-property: color; + + img { + display: block; + margin: 0 auto 10px; + opacity: 0.9; + transition-duration: 0.3s; + transition-property: opacity; + image-rendering: -webkit-optimize-contrast; + } + + h3 { + font-size: 18px; + font-weight: bold; + color: var(--orange); + } + + p { + font-size: 13px; + line-height: $base-line-height * 0.8; + } + } + + a:hover { + img { + opacity: 1; + } + + h3 { + color: var(--orange-darker-5); + } + } +} + +.downloading .hide { + display: none; +} diff --git a/content/about/free-and-open-source.html b/content/about/free-and-open-source.html index d9b8d31bc7..a9037ab47c 100644 --- a/content/about/free-and-open-source.html +++ b/content/about/free-and-open-source.html @@ -17,7 +17,7 @@

Free and Open Source

free for all its users.

However, we do restrict the use of the term "Git" and the - }}">logos to avoid confusion. Please + }}">logos to avoid confusion. Please see our }}">trademark policy for details.

diff --git a/content/about/trademark.html b/content/about/trademark.html index 589c968513..30c807ee1f 100644 --- a/content/about/trademark.html +++ b/content/about/trademark.html @@ -38,7 +38,7 @@

1 Purpose

diff --git a/content/community/_index.html b/content/community/_index.html index f52134243b..9ce7909a97 100644 --- a/content/community/_index.html +++ b/content/community/_index.html @@ -92,6 +92,12 @@

Discord Server

The Git Community Discord Server also has many knowledgeable and helpful people. Additionally, it provides a space to be able to voice chat about patches, designs, or anything else Git related.

+

Logos

+ +

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

+

Newsletter

diff --git a/content/downloads/logos/_index.html b/content/community/logos.html similarity index 98% rename from content/downloads/logos/_index.html rename to content/community/logos.html index db2ab7d1d5..d93ca0cc7e 100644 --- a/content/downloads/logos/_index.html +++ b/content/community/logos.html @@ -1,10 +1,12 @@ --- -section: "downloads" +section: "community" subsection: "logos" title: "Git - Logo Downloads" -url: /downloads/logos.html +url: /community/logos.html aliases: +- /community/logos/index.html - /downloads/logos/index.html +- /downloads/logos.html ---

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/windows.html similarity index 94% rename from content/downloads/win.html rename to content/install/windows.html index 46fd4c98b2..d8b070a98b 100644 --- a/content/downloads/win.html +++ b/content/install/windows.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 "windows" >}} + +

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..512839a656 100644 --- a/layouts/partials/sidebar.html +++ b/layouts/partials/sidebar.html @@ -54,15 +54,17 @@ Reference
  • - Downloads - + Install
  • Community + + {{ if (eq $section "community") }} +
  • + Logos +
  • + {{ end }} + diff --git a/layouts/partials/site-root.html b/layouts/partials/site-root.html index b853cbe0b8..a6390cd241 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.

  • @@ -64,7 +64,7 @@

    Community

    Tarballs - Windows Build + Windows Build Source Code diff --git a/layouts/shortcodes/install-header.html b/layouts/shortcodes/install-header.html new file mode 100644 index 0000000000..1b9d3f62fb --- /dev/null +++ b/layouts/shortcodes/install-header.html @@ -0,0 +1,32 @@ +{{- $active := .Get 0 -}} +
    +
    +

    Install

    +
    + Latest version: {{ site.Params.latest_version }} + (Release Notes) +
    +
    + + diff --git a/tests/git-scm.spec.js b/tests/git-scm.spec.js index aad3cbec0e..b8de0ebf2a 100644 --- a/tests/git-scm.spec.js +++ b/tests/git-scm.spec.js @@ -64,7 +64,7 @@ test.describe('Windows', () => { await expect(windowsButton).toBeVisible() await expect(windowsButton).toHaveClass(/selected/) - const allButton = page.getByRole('link', { name: 'All' }) + const allButton = page.getByRole('link', { name: 'All', exact: true }) await expect(allButton).not.toHaveClass(/selected/) const thumbnails = page.locator('.gui-thumbnails li:visible')