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

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


The following commit(s) were added to refs/heads/master by this push:
     new ed8f016  add target=_blank to apache links
     new f18d48e  Merge pull request #55 from hansva/master
ed8f016 is described below

commit ed8f016725f2fe99f66e2f0941a2bb4181e7dc33
Author: Hans Van Akelyen <[email protected]>
AuthorDate: Fri May 28 17:21:17 2021 +0200

    add target=_blank to apache links
---
 .yarnrc                                       | 2 +-
 antora-ui-hop/src/helpers/withMenuData.js     | 2 ++
 antora-ui-hop/src/partials/header-content.hbs | 6 +++++-
 config.toml                                   | 5 +++++
 layouts/partials/header.html                  | 6 +++++-
 menu.js                                       | 1 +
 6 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/.yarnrc b/.yarnrc
index 6864a3a..7c57551 100644
--- a/.yarnrc
+++ b/.yarnrc
@@ -3,7 +3,7 @@
 
 
 env:
-  HUGO_VERSION "0.58.2"
+  HUGO_VERSION "0.83.1"
 
 lastUpdateCheck 1602702014527
 yarn-path ".yarn/releases/yarn-1.22.10.js"
diff --git a/antora-ui-hop/src/helpers/withMenuData.js 
b/antora-ui-hop/src/helpers/withMenuData.js
index a0381d6..07dbbd9 100644
--- a/antora-ui-hop/src/helpers/withMenuData.js
+++ b/antora-ui-hop/src/helpers/withMenuData.js
@@ -22,6 +22,7 @@ const createMenu = (item) => {
     url: item.url || '#',
     name: item.name,
     pre: item.pre,
+    target: item.pre,
     children: mainMenu.filter((child) => child.parent === 
item.identifier).map(createMenu),
   }
 }
@@ -43,6 +44,7 @@ const mapItem = (item, siteRootPath) => {
   return {
     url,
     name: item.name,
+    target: item.pre,
     pre: item.pre,
     children: item.children.map((child) => mapItem(child, siteRootPath)),
   }
diff --git a/antora-ui-hop/src/partials/header-content.hbs 
b/antora-ui-hop/src/partials/header-content.hbs
index bfc85bb..d3e1aa1 100644
--- a/antora-ui-hop/src/partials/header-content.hbs
+++ b/antora-ui-hop/src/partials/header-content.hbs
@@ -15,7 +15,11 @@
                 {{#if children}}
                 <div class="navbar-dropdown">
                 {{#each children}}
-                  <a class="navbar-item" href="{{url}}">{{name}}</a>
+                  {{#if target }}
+                    <a class="navbar-item" href="{{url}}" 
target="{{target}}">{{name}}</a>
+                  {{else}}
+                    <a class="navbar-item" href="{{url}}">{{name}}</a>
+                  {{/if}} 
                 {{/each}}
                 </div>
                 {{/if}}
diff --git a/config.toml b/config.toml
index 2818cf2..642c56e 100644
--- a/config.toml
+++ b/config.toml
@@ -146,6 +146,7 @@ enableRobotsTXT = true
     weight = 1
     identifier = "about-events"
     url = "https://www.apache.org/events/current-event";
+    pre = "_blank"
 
 [[menu.main]]
     name = "License"
@@ -153,6 +154,7 @@ enableRobotsTXT = true
     weight = 2
     identifier = "about-license"
     url = "https://www.apache.org/licenses/";
+    pre = "_blank"
 
 [[menu.main]]
     name = "Thanks to our sponsors"
@@ -160,6 +162,7 @@ enableRobotsTXT = true
     weight = 3
     identifier = "about-thanks"
     url = "https://www.apache.org/foundation/thanks.html";
+    pre = "_blank"
 
 [[menu.main]]
     name = "Apache Security"
@@ -167,6 +170,7 @@ enableRobotsTXT = true
     weight = 4
     identifier = "about-security"
     url = "https://www.apache.org/security/";
+    pre = "_blank"
 
 [[menu.main]]
     name = "Become a sponsor"
@@ -174,6 +178,7 @@ enableRobotsTXT = true
     weight = 5
     identifier = "about-sponsor"
     url = "https://www.apache.org/foundation/sponsorship.html";
+    pre = "_blank"
 
 
 [module]
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index fc9189d..8cbb73e 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -43,7 +43,11 @@
                             <a class="navbar-link mobile-heading" href="#">{{ 
.Name }}</a>
                             <div class="navbar-dropdown">
                                 {{ range .Children }}
-                                <a class="navbar-item" href="{{ .URL | relURL 
}}">{{ .Name }}</a>
+                                {{ if .Pre }}
+                                    <a class="navbar-item" href="{{ .URL | 
relURL }}" target="{{ .Pre }}">{{ .Name }}</a>
+                                {{ else }}
+                                    <a class="navbar-item" href="{{ .URL | 
relURL }}">{{ .Name }}</a>
+                                {{ end }}
                                 {{ end }}
                             </div>
                         </div>
diff --git a/menu.js b/menu.js
index 84c8903..a453c0f 100644
--- a/menu.js
+++ b/menu.js
@@ -11,6 +11,7 @@ const createMenu = item => {
   return {
     url: item.url || '#',
     name: item.name,
+    target: item.pre,
     children: mainMenu.filter(child => child.parent === 
item.identifier).map(createMenu)
   }
 };

Reply via email to