- Prevent task processor from being re-invoked if it is already running.
+### Added
+
+- Allow more configuration of html page content.
+
## [v1.1.3] - 2021-08-13
### Fixed
manager: {
pageTitle: packageName, // title on html pages
+ footerEntries: [ // common footers on all html pages
+ '<a href="https://git.squeep.com/?p=websub-hub;a=tree">Development Repository</a> / <a href="https://github.com/thylacine/websub-hub/">GitHub mirror</a>',
+ '©<time datetime="2021">ⅯⅯⅩⅩⅠ</time>',
+ ],
strictSecrets: false, // If true, reject requests with secrets but not over https
publicHub: true, // Accept publish requests as new topics.
processImmediately: true, // If true, immediately attempt to process requests when accepted.
const pageTitle = `${options.manager.pageTitle} - Topics`;
const headElements = [];
const navLinks = [];
+ const footerEntries = options.manager.footerEntries;
if (!ctx.topics) {
ctx.topics = [];
}
` </tbody>
</table>
</section>`,
- ]);
+ ], footerEntries);
};
\ No newline at end of file
text: '↑ All Topics',
},
];
+ const footerEntries = options.manager.footerEntries;
if (!ctx.subscriptions) {
ctx.subscriptions = [];
}
` </tbody>
</table>
</section>`,
- ]);
+ ], footerEntries);
};
\ No newline at end of file
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 headElements = [];
const navLinks = [];
- return th.htmlTemplate(1, pageTitle, headElements, navLinks, [
+ const mainContent = [
aboutSection(),
usageSection(isPublicHub, hubURL),
contactSection(contactHTML),
- ]);
+ ];
+ return th.htmlTemplate(1, pageTitle, headElements, navLinks, mainContent, footerEntries,
+ );
};
\ No newline at end of file
/**
* Close the main section and finish off with boilerplate.
+ * @param {String[]} footerEntries
* @returns {String}
*/
-function htmlFooter() {
+function htmlFooter(footerEntries = []) {
return ` </main>
- <footer>
- <ol>
- <li>
- <a href="https://git.squeep.com/?p=websub-hub;a=tree">Development Repository</a> / <a href="https://github.com/thylacine/websub-hub/">GitHub mirror</a>
- </li>
- <li>
- <a href="https://squeep.com/">A Squeep Infrastructure Component</a>
- </li>
- <li>
- ©<time datetime="2021">ⅯⅯⅩⅩⅠ</time>
- </li>
- </ol>
+ <footer>` +
+ (footerEntries.length ? `
+ <ol>` + footerEntries.map((f) => ` <li>${f}</li>`).join('\n') + `
+ </ol>`
+ : '') + `
</footer>`;
}
* @param {String[]} headElements
* @param {Object[]} navLinks
* @param {String[]} main
+ * @param {String[]} footerEntries
* @returns {String}
*/
-function htmlTemplate(pagePathLevel, pageTitle, headElements = [], navLinks = [], main = []) {
+function htmlTemplate(pagePathLevel, pageTitle, headElements = [], navLinks = [], main = [], footerEntries = []) {
return [
htmlHead(pagePathLevel, pageTitle, headElements),
htmlHeader(pageTitle, navLinks),
...main,
- htmlFooter(),
+ htmlFooter(footerEntries),
htmlTail(),
].join('\n');
}