You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ya...@apache.org on 2023/01/16 07:41:21 UTC

[kyuubi-website] branch master updated: Determine download url by incubating pattern (#104)

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

yao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 0bc21e8  Determine download url by incubating pattern (#104)
0bc21e8 is described below

commit 0bc21e82b025a7576efdcb02ddce8ada839ffca7
Author: Kent Yao <ya...@apache.org>
AuthorDate: Mon Jan 16 15:41:16 2023 +0800

    Determine download url by incubating pattern (#104)
---
 config.toml                              |  2 +
 layouts/custompage/release.html          | 71 ++++++++++++++++----------------
 layouts/partials/release_table_head.html | 23 +++++++++++
 3 files changed, 61 insertions(+), 35 deletions(-)

diff --git a/config.toml b/config.toml
index 7965677..39fac8a 100644
--- a/config.toml
+++ b/config.toml
@@ -338,3 +338,5 @@ defaultContentLanguage = 'en'
 
 [params]
   releases = [ 'v1.6.1-incubating', 'v1.5.2-incubating', 'v1.4.1-incubating', 'v1.3.1-incubating' ]
+  downloadLink = 'https://www.apache.org/dyn/closer.lua/kyuubi'
+  downloadLinkIncubator = 'https://www.apache.org/dyn/closer.lua/incubator/kyuubi/'
diff --git a/layouts/custompage/release.html b/layouts/custompage/release.html
index a1c6fee..4141a4f 100644
--- a/layouts/custompage/release.html
+++ b/layouts/custompage/release.html
@@ -24,39 +24,39 @@
     <p>{{ i18n "check-hashes-and-signatures" }} <a href="https://www.apache.org/dyn/closer.cgi#verify">{{ i18n "verify-instructions" }}</a> {{i18n "page"}}.</p>
   </div>
 
-
   <h2>{{ i18n "the-latest-release" }}</h2>
   <table class="ui selectable celled table">
-    <thead>
-    <tr>
-      <th class="center aligned">{{ i18n "version" }}</th>
-      <th class="center aligned">{{ i18n "date" }}</th>
-      <th class="center aligned">{{ i18n "source" }}</th>
-      <th class="center aligned">{{ i18n "binary" }}</th>
-      <th class="center aligned">{{ i18n "release-notes" }}</th>
-    </tr>
-    </thead>
+    {{ partial "release_table_head.html" .}}
     {{ $langVar := "" }}
     {{ if ne .Site.Language.Lang "en" }}
     {{ $langVar = .Site.Language.Lang }}
     {{ end }}
     {{range first 1 (where (where .Site.Pages "Section" "release") ".Params.linked" true) }}
     <tr>
-      <td class="center aligned">{{.File.BaseFileName }}</td>
+      {{ $dir := print "kyuubi-" .File.BaseFileName "/" }}
+      {{ $source := print "apache-kyuubi-" .File.BaseFileName "-source.tgz" }}
+      {{ $bin := print "apache-kyuubi-" .File.BaseFileName "-bin.tgz"  }}
+      {{ $link_base := "" }}
+      {{ if strings.Contains .File.BaseFileName "incubating" }}
+      {{ $link_base = .Site.Params.downloadLinkIncubator }}
+      {{ else }}
+      {{ $link_base = .Site.Params.downloadLink }}
+      {{ end }}
+      <td class="center aligned">{{ .File.BaseFileName }}</td>
       {{ if eq $langVar "zh"}}
-      <td class="center aligned">{{dateFormat "2006年01月02日" .Date}}</td>
+      <td class="center aligned">{{ dateFormat "2006年01月02日" .Date }}</td>
       {{ else }}
-      <td class="center aligned">{{dateFormat "2006 Jan 2 " .Date}}</td>
+      <td class="center aligned">{{ dateFormat "2006 Jan 2 " .Date }}</td>
       {{ end }}
       <td class="center aligned">
-        <a href="https://www.apache.org/dyn/closer.lua/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-source.tgz">source</a>
-        (<a href="https://downloads.apache.org/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-source.tgz.sha512">sha512</a>,
-        <a href="https://downloads.apache.org/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-source.tgz.asc">signature</a>)
+        <a href="{{ $link_base }}{{ $dir }}{{ $source }}">source</a>
+        (<a href="{{ $link_base }}{{ $dir }}{{ $source }}.sha512">sha512</a>,
+        <a href="{{ $link_base }}{{ $dir }}{{ $source }}.asc">signature</a>)
       </td>
       <td class="center aligned">
-        <a href="https://www.apache.org/dyn/closer.lua/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-bin.tgz">binary</a>
-        (<a href="https://downloads.apache.org/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-bin.tgz.sha512">sha512</a>,
-        <a href="https://downloads.apache.org/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-bin.tgz.asc">signature</a>)
+        <a href="{{ $link_base }}{{ $dir }}{{ $bin }}">binary</a>
+        (<a href="{{ $link_base }}{{ $dir }}{{ $bin }}.sha512">sha512</a>,
+        <a href="{{ $link_base }}{{ $dir }}{{ $bin }}.asc">signature</a>)
       </td>
       <td class="center aligned">
         <a href="{{ $langVar }}/release/{{.File.BaseFileName }}.html">{{ lower (i18n "release-notes") }}</a>
@@ -74,17 +74,18 @@
     <p>{{ i18n "consider-use-the-latest-kyuubi" }}</p>
   </div>
   <table class="ui selectable celled table">
-    <thead>
-    <tr>
-      <th class="center aligned">{{ i18n "version" }}</th>
-      <th class="center aligned">{{ i18n "date" }}</th>
-      <th class="center aligned">{{ i18n "source" }}</th>
-      <th class="center aligned">{{ i18n "binary" }}</th>
-      <th class="center aligned">{{ i18n "release-notes" }}</th>
-    </tr>
-    </thead>
-    {{range (where (where .Site.Pages "Section" "release") ".Params.linked" true) }}
+    {{ partial "release_table_head.html" .}}
+    {{ range (where (where .Site.Pages "Section" "release") ".Params.linked" true) }}
     <tr>
+      {{ $dir := print "kyuubi-" .File.BaseFileName "/" }}
+      {{ $source := print "apache-kyuubi-" .File.BaseFileName "-source.tgz" }}
+      {{ $bin := print "apache-kyuubi-" .File.BaseFileName "-bin.tgz"  }}
+      {{ $link_base := "" }}
+      {{ if strings.Contains .File.BaseFileName "incubating" }}
+      {{ $link_base = .Site.Params.downloadLinkIncubator }}
+      {{ else }}
+      {{ $link_base = .Site.Params.downloadLink }}
+      {{ end }}
       <td class="center aligned">{{.File.BaseFileName }}</td>
       {{ if eq $langVar "zh"}}
       <td class="center aligned">{{dateFormat "2006年01月02日" .Date}}</td>
@@ -92,14 +93,14 @@
       <td class="center aligned">{{dateFormat "2006 Jan 2 " .Date}}</td>
       {{ end }}
       <td class="center aligned">
-        <a href="https://www.apache.org/dyn/closer.lua/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-source.tgz">source</a>
-        (<a href="https://downloads.apache.org/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-source.tgz.sha512">sha512</a>,
-        <a href="https://downloads.apache.org/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-source.tgz.asc">signature</a>)
+        <a href="{{ $link_base }}{{ $dir }}{{ $source }}">source</a>
+        (<a href="{{ $link_base }}{{ $dir }}{{ $source }}.sha512">sha512</a>,
+        <a href="{{ $link_base }}{{ $dir }}{{ $source }}.asc">signature</a>)
       </td>
       <td class="center aligned">
-        <a href="https://www.apache.org/dyn/closer.lua/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-bin.tgz">binary</a>
-        (<a href="https://downloads.apache.org/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-bin.tgz.sha512">sha512</a>,
-        <a href="https://downloads.apache.org/kyuubi/kyuubi-{{.File.BaseFileName}}/apache-kyuubi-{{.File.BaseFileName}}-bin.tgz.asc">signature</a>)
+        <a href="{{ $link_base }}{{ $dir }}{{ $bin }}">binary</a>
+        (<a href="{{ $link_base }}{{ $dir }}{{ $bin }}.sha512">sha512</a>,
+        <a href="{{ $link_base }}{{ $dir }}{{ $bin }}.asc">signature</a>)
       </td>
       <td class="center aligned">
         <a href="{{ $langVar }}/release/{{.File.BaseFileName }}.html">{{ lower (i18n "release-notes") }}</a>
diff --git a/layouts/partials/release_table_head.html b/layouts/partials/release_table_head.html
new file mode 100644
index 0000000..4c6c87c
--- /dev/null
+++ b/layouts/partials/release_table_head.html
@@ -0,0 +1,23 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. See accompanying LICENSE file.
+-->
+<thead>
+  <tr>
+    <th class="center aligned">{{ i18n "version" }}</th>
+    <th class="center aligned">{{ i18n "date" }}</th>
+    <th class="center aligned">{{ i18n "source" }}</th>
+    <th class="center aligned">{{ i18n "binary" }}</th>
+    <th class="center aligned">{{ i18n "release-notes" }}</th>
+  </tr>
+</thead>
+