You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2023/01/06 11:42:46 UTC

[airflow-site] 01/01: Fix "Call to action" button to show "Install"

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch fix-install-button-replaced-with-ecosystem
in repository https://gitbox.apache.org/repos/asf/airflow-site.git

commit 6c21537ac0c1a29bf7c58ea57e33735900add8bb
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Fri Jan 6 12:35:11 2023 +0100

    Fix "Call to action" button to show "Install"
    
    The change #678 removed unused "Install" page which had been
    indexed in Google but not used anywhere. However the presence of
    that install page was accounted for in the "landing" page where
    it was skipped by the code that prepared navigation bar.
    
    Instead the "Ecosystem" was skipped rather than Install and the
    "Install" button was named "Ecosystem".
    
    This change brings it back to normal by expecting the exact
    number of pages and by rendering the install link unconditionally
    
    Fixes: #720
---
 landing-pages/site/layouts/partials/navbar.html | 44 +++++++++----------------
 1 file changed, 16 insertions(+), 28 deletions(-)

diff --git a/landing-pages/site/layouts/partials/navbar.html b/landing-pages/site/layouts/partials/navbar.html
index 65be4dd208..ced70b84e4 100644
--- a/landing-pages/site/layouts/partials/navbar.html
+++ b/landing-pages/site/layouts/partials/navbar.html
@@ -50,37 +50,25 @@
         {{ $menusLen := len .Site.Menus.main }}
         <div class="navbar__links-container">
             {{ range $index, $el := .Site.Menus.main }}
-                {{ if ne (add $index 1) $menusLen }}
-                    {{ $active := or ($p.IsMenuCurrent "main" $el) ($p.HasMenuCurrent "main" $el) }}
-                    {{ with $el.Page }}
-                        {{ $active = or $active ( $.IsDescendant .)  }}
-                    {{ end }}
-                    {{ $url := urls.Parse $el.URL }}
-                    {{ $baseurl := urls.Parse $.Site.Params.Baseurl }}
-                    <a class="navbar__text-link {{if $active }}active{{end}}"
-                       href="{{ with $el.Page }}{{ .RelPermalink }}{{ else }}{{ $el.URL | relLangURL }}{{ end }}"
-                       {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>
-                        {{ $el.Name }}
-                    </a>
+                {{ $active := or ($p.IsMenuCurrent "main" $el) ($p.HasMenuCurrent "main" $el) }}
+                {{ with $el.Page }}
+                    {{ $active = or $active ( $.IsDescendant .)  }}
                 {{ end }}
+                {{ $url := urls.Parse $el.URL }}
+                {{ $baseurl := urls.Parse $.Site.Params.Baseurl }}
+                <a class="navbar__text-link {{if $active }}active{{end}}"
+                   href="{{ with $el.Page }}{{ .RelPermalink }}{{ else }}{{ $el.URL | relLangURL }}{{ end }}"
+                   {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>
+                    {{ $el.Name }}
+                </a>
             {{ end }}
         </div>
-        {{ with index .Site.Menus.main (sub $menusLen 1) }}
-            {{ $url := urls.Parse .URL }}
-            {{ $baseurl := urls.Parse $.Site.Params.Baseurl }}
+        {{ $url := urls.Parse .URL }}
+        {{ $baseurl := urls.Parse $.Site.Params.Baseurl }}
 
-            {{/*
-            TODO: Temporary solution. Replace the link to docs with commented code when texts on install page are ready.
-
-            <a href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}"
-               {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>
-                {{ partial "buttons/button-filled" (dict "text" .Name) }}
-            </a>
-            */}}
-            <a href="{{ $baseurl }}/docs/stable/start.html"
-               {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>
-                {{ partial "buttons/button-filled" (dict "text" .Name) }}
-            </a>
-        {{ end }}
+        <a href="{{ $baseurl }}/docs/stable/start.html"
+           {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}>
+            {{ partial "buttons/button-filled" (dict "text" .Name) }}
+        </a>
     </div>
 {{ end }}