Merge branch 'v1.3-dev'
[websub-hub] / src / template / root-html.js
index d035bb8c342da6ca94b3f93fd4f25cfcb1398a4d..aa5cebab6ae64da5c3d3d37a2faf954154f39be3 100644 (file)
@@ -1,6 +1,7 @@
 'use strict';
 
 const th = require('./template-helper');
+const { sessionNavLinks } = require('@squeep/authentication-module');
 
 /**
  *
@@ -30,7 +31,7 @@ function aboutSection() {
           This is a <a class="external" href="https://www.w3.org/TR/websub/">WebSub</a> Hub service.
         </p>
         <p>
-          It facilitates the timely distribution of new content from publishers to subscribers.  
+          It facilitates the timely distribution of new content from publishers to subscribers.
         </p>
         <aside>
           The typical use-case is where the content is a blog or news feed, but any type of content may be syndicated.
@@ -105,7 +106,7 @@ function usageSection(isPublicHub, hubURL) {
               </code>
             </figure>
           </li>
-        <ul>
+        </ul>
       </div>
       <div>
         <h3>Publishing Updates</h3>
@@ -164,26 +165,26 @@ ${contactHTML}
  * @returns {string} html
  */
 module.exports = (ctx, options) => {
+  const pagePathLevel = 0;
   const pageTitle = options.manager.pageTitle;
   const isPublicHub = options.manager.publicHub;
   const contactHTML = options.adminContactHTML;
   const footerEntries = options.manager.footerEntries;
   const hubURL = options.dingus.selfBaseUrl || '<s>https://hub.example.com/</s>';
-  const navLinks = [{
-    href: 'admin/',
-    text: 'Admin',
-  }];
   const htmlOptions = {
+    pageIdentifier: 'root',
     pageTitle,
     logoUrl: options.manager.logoUrl,
     footerEntries,
-    navLinks,
+    navLinks: [],
   };
+  th.navLinks(pagePathLevel, ctx, htmlOptions);
+  sessionNavLinks(pagePathLevel, ctx, htmlOptions);
   const content = [
     aboutSection(),
     usageSection(isPublicHub, hubURL),
     contactSection(contactHTML),
     hAppSection(pageTitle, options.manager.logoUrl),
   ];
-  return th.htmlPage(0, ctx, htmlOptions, content);
+  return th.htmlPage(pagePathLevel, ctx, htmlOptions, content);
 };
\ No newline at end of file