const th = require('./template-helper');
+function hAppSection(pageTitle, logoUrl) {
+ return ` <section hidden class="h-app">
+ <h2>h-app Information for IndieAuth Logins</h2>
+ <img src="${logoUrl}" class="u-logo">
+ <a href="" class="u-url p-name">${pageTitle}</a>
+ <p class="p-summary">
+ This is a WebSub Hub service, facilitating content distribution.
+ Authenticated users may view details of any syndications related to their profile.
+ </p>
+ </section>`;
+}
+
function aboutSection() {
return ` <section class="about">
<h2>What</h2>
</code>
</figure>
</li>
+ <li>
+ Ideally, these should be combined in one header.
+ <figure>
+ <figcaption>Example:</figcaption>
+ <code>
+ Link: <${hubURL}>; rel="hub", <https://example.com/feed/>; rel="self"
+ </code>
+ </figure>
+ </li>
</ul>
</div>
<div>
</div>
<div>
<h3>Publishing Updates</h3>
- Send a <code>POST</code> request to this hub with Form Data:
+ To notify the Hub either of a new topic to syndicate, or that a topic's content has been updated and should be distributed to subscribers, send a <code>POST</code> request with Form Data (<code>application/x-www-form-urlencoded</code>):
<ul>
<li>
<code>hub.mode</code> set to <code>publish</code>
</li>
<li>
- <code>hub.url</code> set to the <code>self</code> link relation of the content
+ <code>hub.url</code> set to the <code>self</code> link relation of the content (this value may be set multiple times, to update more than one topic)
</li>
</ul>
+ <figure>
+ <figcaption>Example:</figcaption>
+ <code>
+ curl ${hubURL} -d'hub.mode=publish' -d'hub.url=https://example.com/blog_one/feed' -d'hub.url=https://example.com/blog_two/feed'
+ </code>
+ </figure>
</div>`
- : `
+ : `
<h2>Private Hub</h2>
<p>
This hub only serves specific topics.
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 navLinks = [{
+ href: 'admin/',
+ text: 'Admin',
+ }];
+ const htmlOptions = {
+ pageTitle,
+ logoUrl: options.manager.logoUrl,
+ footerEntries,
+ navLinks,
+ };
+ const content = [
aboutSection(),
usageSection(isPublicHub, hubURL),
contactSection(contactHTML),
- ]);
+ hAppSection(pageTitle, options.manager.logoUrl),
+ ];
+ return th.htmlPage(0, ctx, htmlOptions, content);
};
\ No newline at end of file