X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftemplate%2Froot-html.js;h=aa5cebab6ae64da5c3d3d37a2faf954154f39be3;hb=e23bda592175ae5ed772f366069ccfd2f60e1f70;hp=14b9d4773c7e8dfcb5e5659a1b6b2cf6ef471b73;hpb=3bc885c4b6ef8e5ced2ee9708194523a41ebfe7a;p=websub-hub
diff --git a/src/template/root-html.js b/src/template/root-html.js
index 14b9d47..aa5ceba 100644
--- a/src/template/root-html.js
+++ b/src/template/root-html.js
@@ -1,9 +1,16 @@
'use strict';
const th = require('./template-helper');
+const { sessionNavLinks } = require('@squeep/authentication-module');
+/**
+ *
+ * @param {string} pageTitle page title
+ * @param {string} logoUrl logo url
+ * @returns {string} element
+ */
function hAppSection(pageTitle, logoUrl) {
- return `
+ return `
h-app Information for IndieAuth Logins
${pageTitle}
@@ -14,6 +21,9 @@ function hAppSection(pageTitle, logoUrl) {
`;
}
+/**
+ * @returns {string} element
+ */
function aboutSection() {
return `
What
@@ -21,7 +31,7 @@ function aboutSection() {
This is a WebSub Hub service.
- It facilitates the timely distribution of new content from publishers to subscribers.
+ It facilitates the timely distribution of new content from publishers to subscribers.
The typical use-case is where the content is a blog or news feed, but any type of content may be syndicated.
@@ -29,6 +39,12 @@ function aboutSection() {
`;
}
+/**
+ *
+ * @param {boolean} isPublicHub is public hub
+ * @param {string} hubURL hub url
+ * @returns {string} html
+ */
function usageSection(isPublicHub, hubURL) {
const usageContent = isPublicHub ? ` Public Hub
@@ -90,7 +106,7 @@ function usageSection(isPublicHub, hubURL) {
-
Publishing Updates
@@ -121,6 +137,11 @@ ${usageContent}
`;
}
+/**
+ *
+ * @param {string} contactHTML html
+ * @returns {string} html
+ */
function contactSection(contactHTML) {
let section = '';
if (contactHTML) {
@@ -133,38 +154,37 @@ ${contactHTML}
/**
*
- * @param {Object} ctx
- * @param {Object} options
- * @param {Object} options.manager
- * @param {String} options.adminContactHTML
- * @param {String} options.manager.pageTitle
- * @param {String} options.manager.publicHub
- * @param {Object} options.dingus
- * @param {String} options.dingus.selfBaseUrl
- * @returns {String}
+ * @param {object} ctx context
+ * @param {object} options options
+ * @param {object} options.manager manager options
+ * @param {string} options.adminContactHTML html
+ * @param {string} options.manager.pageTitle title
+ * @param {string} options.manager.publicHub is public
+ * @param {object} options.dingus dingus options
+ * @param {string} options.dingus.selfBaseUrl url
+ * @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 || 'https://hub.example.com/ ';
- 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 = [
- '', // This fixes a layout rendering flash on load in FF; do not know why this works but it does.
aboutSection(),
usageSection(isPublicHub, hubURL),
contactSection(contactHTML),
hAppSection(pageTitle, options.manager.logoUrl),
];
- return th.htmlPage(1, ctx, htmlOptions, content);
+ return th.htmlPage(pagePathLevel, ctx, htmlOptions, content);
};
\ No newline at end of file