@profullstack/waitlist 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +3 -2
- package/src/plugins.js +16 -1
package/README.md
CHANGED
|
@@ -116,6 +116,7 @@ Every page showcases all plugins by default. Pick per site in `sites.json`:
|
|
|
116
116
|
| `board` | WWWThreads-style posts and replies, plus a compact thread on every resource and FAQ answer ([@profullstack/comments](https://www.npmjs.com/package/@profullstack/comments)); reading is open, posting needs **Sign in with CoinPay**; RSS of the posts |
|
|
117
117
|
| `share` | a Share button on the board, also behind CoinPay sign-in |
|
|
118
118
|
| `feed` | `feed.xml` (RSS) and `feed.json` (JSON Feed) of the page and its resources, for syndication |
|
|
119
|
+
| `buyaday` | `<pf-buy-a-day>` from [@profullstack/marketing-widgets](https://github.com/profullstack/marketing-widgets): the next free doors on [holi.days](https://holi.days.pit.world/calendars) calendars (ones matching the site's keywords first), baked in and refreshed live, every sale credited to this site with `?ref=<host>`. Nothing shows when the feed is down. `buyadayKeywords` / `buyadayLimit` in `sites.json` override the keywords and count (default 3) |
|
|
119
120
|
|
|
120
121
|
`keywords` (also the `<meta name="keywords">`) default to the name's labels plus the tagline's
|
|
121
122
|
meaningful words; set `keywords` or `resourcesQuery` per site to steer the resources.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@profullstack/waitlist",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Email waitlist for any launch page: a <waitlist-form> web component, a live signup chart, and a static-site builder on @profullstack/css + @profullstack/charts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"@profullstack/css": "^0.6.0",
|
|
50
50
|
"@profullstack/footer": "^0.7.3",
|
|
51
51
|
"@resvg/resvg-js": "^2.6.2",
|
|
52
|
-
"@profullstack/comments": "^0.2.0"
|
|
52
|
+
"@profullstack/comments": "^0.2.0",
|
|
53
|
+
"@profullstack/marketing-widgets": "^0.1.0"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"@profullstack/abtest": "^0.1.0"
|
package/src/plugins.js
CHANGED
|
@@ -16,7 +16,7 @@ import { esc } from './seo.js';
|
|
|
16
16
|
|
|
17
17
|
const require = createRequire(import.meta.url);
|
|
18
18
|
|
|
19
|
-
export const PLUGINS = ['form', 'stats', 'ab', 'faq', 'resources', 'board', 'share', 'feed'];
|
|
19
|
+
export const PLUGINS = ['form', 'stats', 'ab', 'faq', 'resources', 'board', 'share', 'feed', 'buyaday'];
|
|
20
20
|
|
|
21
21
|
/** Resolve a site's `plugins` setting to a Set (default: all of them). */
|
|
22
22
|
export function pluginSet(setting) {
|
|
@@ -126,6 +126,21 @@ export async function runPlugins(s, out, { fetchImpl, cacheDir, maxAgeMs } = {})
|
|
|
126
126
|
slot.scripts.push('<script type="module" src="assets/comments.js"></script>');
|
|
127
127
|
slot.head.push(`<link rel="alternate" type="application/rss+xml" title="${esc(s.title)} discussion" href="${esc(s.api)}/api/comments/feed?dn=${encodeURIComponent(s.dn)}">`);
|
|
128
128
|
}
|
|
129
|
+
if (on.has('buyaday')) {
|
|
130
|
+
// @profullstack/marketing-widgets: sell holi.days doors, credited to this site.
|
|
131
|
+
// Offers are baked in (no script needed, crawlers read them); the copied script
|
|
132
|
+
// refreshes them live so taken doors drop off. An empty feed renders nothing.
|
|
133
|
+
const mw = await import('@profullstack/marketing-widgets');
|
|
134
|
+
const html = await mw.buyADayHtml({ ref: s.host, keywords: s.buyadayKeywords || keywordsFor(s), limit: s.buyadayLimit || 3, fetchImpl });
|
|
135
|
+
if (html.includes('pf-mw-offer')) {
|
|
136
|
+
const core = await readFile(mw.assetPath.core, 'utf8');
|
|
137
|
+
const widgets = (await readFile(mw.assetPath.widgets, 'utf8')).replace(/from '\.\/core\.js'/, "from './mw-core.js'");
|
|
138
|
+
await writeFile(join(out, 'assets', 'mw-core.js'), core);
|
|
139
|
+
await writeFile(join(out, 'assets', 'mw-widgets.js'), widgets);
|
|
140
|
+
slot.sections.push(`<section class="stack" aria-label="Buy a day">${html}</section>`);
|
|
141
|
+
slot.scripts.push('<script type="module" src="assets/mw-widgets.js"></script>');
|
|
142
|
+
}
|
|
143
|
+
}
|
|
129
144
|
if (on.has('feed')) {
|
|
130
145
|
const f = feeds(s, res);
|
|
131
146
|
await writeFile(join(out, 'feed.xml'), f.rss);
|