From 41cc64ab6ecb73629f906ffd709cc5a18116cd7f Mon Sep 17 00:00:00 2001
From: Tamas Gal <tgal@km3net.de>
Date: Tue, 27 Oct 2020 17:35:19 +0100
Subject: [PATCH] Restyle

---
 portal/config.toml                |  26 ++++++-
 portal/layouts/index.html         | 114 +++++++++++++++---------------
 portal/layouts/partials/foot.html |   1 +
 portal/layouts/partials/head.html |  54 ++++++++------
 4 files changed, 115 insertions(+), 80 deletions(-)

diff --git a/portal/config.toml b/portal/config.toml
index 51e5f5d..41537a6 100644
--- a/portal/config.toml
+++ b/portal/config.toml
@@ -2,7 +2,7 @@ baseURL = "https://open-data.pages.km3net.de/openscienceportal"
 languageCode = "en-us"
 title = "KM3NeT Open Science Portal"
 
-relativeURLs = true
+# relativeURLs = true
 contentdir = "content"
 layoutdir = "layouts"
 publishdir = "public"
@@ -11,3 +11,27 @@ DefaultContentLanguage = "en"
 metaDataFormat = "yaml"
 pygmentsUseClasses = true
 pygmentCodeFences = true
+
+[[menu.main]]
+    name = "Getting Started"
+    url = "/articles/getting-started"
+    weight = 1
+[[menu.main]]
+    name = "Science"
+    url = "/articles/science"
+    weight = 2
+
+[[menu.main]]
+    name = "Data"
+    url = "/articles/data"
+    weight = 3
+
+[[menu.main]]
+    name = "Software"
+    url = "/articles/software"
+    weight = 4
+
+[[menu.main]]
+    name = "Experts Corner"
+    url = "/articles/experts"
+    weight = 5
diff --git a/portal/layouts/index.html b/portal/layouts/index.html
index 4bc2097..32a9cf1 100644
--- a/portal/layouts/index.html
+++ b/portal/layouts/index.html
@@ -1,65 +1,65 @@
 {{ partial "head.html" . }}
 
-<main>
-<section>
-    <!-- this section is populated from content/_index.md -->
-    <header>
-    <h1>{{.Title}}</h1>
-    </header>
+<!-- <main> -->
+<!-- <section> -->
+<!--     <\!-- this section is populated from content/_index.md -\-> -->
+<!--     <header> -->
+<!--     <h1>{{.Title}}</h1> -->
+<!--     </header> -->
 
-    <article>
-    {{.Content}}
-    </article>
+<!--     <article> -->
+<!--     {{.Content}} -->
+<!--     </article> -->
 
-    <footer>
-    <!-- Note that .Pages is the same as .Site.RegularPages on the homepage template. -->
-    {{ range first 10 .Pages }}
-        {{ .Render "summary"}}
-    {{ end }}
-    </footer>
-</section>
+<!--     <footer> -->
+<!--     <\!-- Note that .Pages is the same as .Site.RegularPages on the homepage template. -\-> -->
+<!--     {{ range first 10 .Pages }} -->
+<!--         {{ .Render "summary"}} -->
+<!--     {{ end }} -->
+<!--     </footer> -->
+<!-- </section> -->
 
-<section>
-    <!-- this section is populated by pulling posts from the site -->
-    {{ range first 1 (where .Pages.ByPublishDate.Reverse "Section" "posts") }}
-        <article>
-            <header>
-            <h2>{{ .Title }}</h2>
-            <p><time datetime="{{.Date}}">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></p>
-            </header>
-            {{ .Summary }}
-            <nav>
-            <ul>
-                <li><a href="{{ .RelPermalink }}">Read More &raquo;</a></li>
-            </ul>
-            </nav>
-        </article>
-    {{ end }}
-    <footer>
-    <a href="{{ "posts/" | absURL }}">All posts...</a>
-    </footer>
-</section>
+<!-- <section> -->
+<!--     <\!-- this section is populated by pulling posts from the site -\-> -->
+<!--     {{ range first 1 (where .Pages.ByPublishDate.Reverse "Section" "posts") }} -->
+<!--         <article> -->
+<!--             <header> -->
+<!--             <h2>{{ .Title }}</h2> -->
+<!--             <p><time datetime="{{.Date}}">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></p> -->
+<!--             </header> -->
+<!--             {{ .Summary }} -->
+<!--             <nav> -->
+<!--             <ul> -->
+<!--                 <li><a href="{{ .RelPermalink }}">Read More &raquo;</a></li> -->
+<!--             </ul> -->
+<!--             </nav> -->
+<!--         </article> -->
+<!--     {{ end }} -->
+<!--     <footer> -->
+<!--     <a href="{{ "posts/" | absURL }}">All posts...</a> -->
+<!--     </footer> -->
+<!-- </section> -->
 
-<section>
-    <!-- this section is populated by pulling articles from the site -->
-    {{ range first 1 (where .Pages.ByPublishDate.Reverse "Section" "articles") }}
-        <article>
-            <header>
-            <h2>{{ .Title }}</h2>
-            <p><time datetime="{{.Date}}">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></p>
-            </header>
-            {{ .Summary }}
-            <nav>
-            <ul>
-                <li><a href="{{ .RelPermalink }}">Read More &raquo;</a></li>
-            </ul>
-            </nav>
-        </article>
-    {{ end }}
-    <footer>
-    <a href="{{ "articles/" | absURL }}">All articles...</a>
-    </footer>
-</section>
-</main>
+<!-- <section> -->
+<!--     <\!-- this section is populated by pulling articles from the site -\-> -->
+<!--     {{ range first 1 (where .Pages.ByPublishDate.Reverse "Section" "articles") }} -->
+<!--         <article> -->
+<!--             <header> -->
+<!--             <h2>{{ .Title }}</h2> -->
+<!--             <p><time datetime="{{.Date}}">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></p> -->
+<!--             </header> -->
+<!--             {{ .Summary }} -->
+<!--             <nav> -->
+<!--             <ul> -->
+<!--                 <li><a href="{{ .RelPermalink }}">Read More &raquo;</a></li> -->
+<!--             </ul> -->
+<!--             </nav> -->
+<!--         </article> -->
+<!--     {{ end }} -->
+<!--     <footer> -->
+<!--     <a href="{{ "articles/" | absURL }}">All articles...</a> -->
+<!--     </footer> -->
+<!-- </section> -->
+<!-- </main> -->
 
 {{ partial "foot.html" .}}
diff --git a/portal/layouts/partials/foot.html b/portal/layouts/partials/foot.html
index 976ece1..76dbbdf 100644
--- a/portal/layouts/partials/foot.html
+++ b/portal/layouts/partials/foot.html
@@ -1,6 +1,7 @@
 <footer>
     <ul>
         <li><a href="https://www.km3net.org">KM3NeT.org</a></li>
+        <li><a href="https://www.github.com/KM3NeT">GitHub Organization</a></li>
     </ul>
 </footer>
 
diff --git a/portal/layouts/partials/head.html b/portal/layouts/partials/head.html
index 32fe8be..62079af 100644
--- a/portal/layouts/partials/head.html
+++ b/portal/layouts/partials/head.html
@@ -9,34 +9,44 @@
 <body class="bg-light">
 
     <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
-      <a class="navbar-brand" href="#">KM3NeT Science Portal</a>
+      <a class="navbar-brand" href="/">KM3NeT Science Portal</a>
       <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
         <span class="navbar-toggler-icon"></span>
       </button>
 
       <div class="collapse navbar-collapse" id="navbarsExampleDefault">
+
         <ul class="navbar-nav mr-auto">
-          <li class="nav-item active">
-            <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
-          </li>
-          <li class="nav-item">
-            <a class="nav-link" href="#">Link</a>
-          </li>
-          <li class="nav-item">
-            <a class="nav-link disabled" href="#">Disabled</a>
-          </li>
-          <li class="nav-item dropdown">
-            <a class="nav-link dropdown-toggle" href="http://example.com" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
-            <div class="dropdown-menu" aria-labelledby="dropdown01">
-              <a class="dropdown-item" href="#">Action</a>
-              <a class="dropdown-item" href="#">Another action</a>
-              <a class="dropdown-item" href="#">Something else here</a>
-            </div>
-          </li>
+
+          {{ $currentPage := . }}
+          {{ range .Site.Menus.main }}
+            {{ if .HasChildren }}
+              <li class="nav-item dropdown">
+                <a class="nav-link dropdown-toggle" href="http://example.com" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
+                <div class="dropdown-menu" aria-labelledby="dropdown01">
+                  <a class="dropdown-item" href="#">Action</a>
+                  <a class="dropdown-item" href="#">Another action</a>
+                  <a class="dropdown-item" href="#">Something else here</a>
+                </div>
+              </li>
+            {{ else }}
+
+              <li class="nav-item active">
+                <a class="nav-link" href="{{ .URL }}">{{ .Pre }} {{ .Name }}</a>
+              </li>
+              <!-- <li class="nav-item"> -->
+              <!--   <a class="nav-link disabled" href="#">Disabled</a> -->
+              <!-- </li> -->
+            {{ end }}
+
+          {{ end }}
+
         </ul>
-        <form class="form-inline my-2 my-lg-0">
-          <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
-          <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
-        </form>
+       
+        <!-- <form class="form-inline my-2 my-lg-0"> -->
+        <!--   <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search"> -->
+        <!--   <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button> -->
+        <!-- </form> -->
+
       </div>
     </nav>
-- 
GitLab