@softure-ai/blog 0.0.0-stage → 0.1.6
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/CHANGELOG.md +10 -0
- package/LICENSE +21 -0
- package/README.md +604 -2
- package/dist/cli/bin.d.ts +3 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +5 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/command.d.ts +9 -0
- package/dist/cli/command.d.ts.map +1 -0
- package/dist/cli/command.js +40 -0
- package/dist/cli/command.js.map +1 -0
- package/dist/cli/index.d.ts +4 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +5 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/run.d.ts +62 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +555 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/skill.d.ts +47 -0
- package/dist/cli/skill.d.ts.map +1 -0
- package/dist/cli/skill.js +221 -0
- package/dist/cli/skill.js.map +1 -0
- package/dist/content/article-file.d.ts +27 -0
- package/dist/content/article-file.d.ts.map +1 -0
- package/dist/content/article-file.js +179 -0
- package/dist/content/article-file.js.map +1 -0
- package/dist/contract.d.ts +77 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +5 -0
- package/dist/contract.js.map +1 -0
- package/dist/db/articles.d.ts +30 -0
- package/dist/db/articles.d.ts.map +1 -0
- package/dist/db/articles.js +138 -0
- package/dist/db/articles.js.map +1 -0
- package/dist/db/publish-run.d.ts +50 -0
- package/dist/db/publish-run.d.ts.map +1 -0
- package/dist/db/publish-run.js +168 -0
- package/dist/db/publish-run.js.map +1 -0
- package/dist/db/schema.d.ts +403 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +33 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/discovery/dates.d.ts +9 -0
- package/dist/discovery/dates.d.ts.map +1 -0
- package/dist/discovery/dates.js +19 -0
- package/dist/discovery/dates.js.map +1 -0
- package/dist/discovery/index.d.ts +8 -0
- package/dist/discovery/index.d.ts.map +1 -0
- package/dist/discovery/index.js +11 -0
- package/dist/discovery/index.js.map +1 -0
- package/dist/discovery/indexnow.d.ts +11 -0
- package/dist/discovery/indexnow.d.ts.map +1 -0
- package/dist/discovery/indexnow.js +23 -0
- package/dist/discovery/indexnow.js.map +1 -0
- package/dist/discovery/refresh.d.ts +49 -0
- package/dist/discovery/refresh.d.ts.map +1 -0
- package/dist/discovery/refresh.js +55 -0
- package/dist/discovery/refresh.js.map +1 -0
- package/dist/discovery/related.d.ts +17 -0
- package/dist/discovery/related.d.ts.map +1 -0
- package/dist/discovery/related.js +28 -0
- package/dist/discovery/related.js.map +1 -0
- package/dist/discovery/rss.d.ts +30 -0
- package/dist/discovery/rss.d.ts.map +1 -0
- package/dist/discovery/rss.js +48 -0
- package/dist/discovery/rss.js.map +1 -0
- package/dist/discovery/sitemap.d.ts +25 -0
- package/dist/discovery/sitemap.d.ts.map +1 -0
- package/dist/discovery/sitemap.js +31 -0
- package/dist/discovery/sitemap.js.map +1 -0
- package/dist/discovery/submit.d.ts +44 -0
- package/dist/discovery/submit.d.ts.map +1 -0
- package/dist/discovery/submit.js +46 -0
- package/dist/discovery/submit.js.map +1 -0
- package/dist/index.d.ts +371 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +69 -0
- package/dist/index.js.map +1 -0
- package/dist/messages/en.d.ts +83 -0
- package/dist/messages/en.d.ts.map +1 -0
- package/dist/messages/en.js +83 -0
- package/dist/messages/en.js.map +1 -0
- package/dist/messages/index.d.ts +158 -0
- package/dist/messages/index.d.ts.map +1 -0
- package/dist/messages/index.js +5 -0
- package/dist/messages/index.js.map +1 -0
- package/dist/messages/pl.d.ts +78 -0
- package/dist/messages/pl.d.ts.map +1 -0
- package/dist/messages/pl.js +78 -0
- package/dist/messages/pl.js.map +1 -0
- package/dist/next/context.d.ts +6 -0
- package/dist/next/context.d.ts.map +1 -0
- package/dist/next/context.js +27 -0
- package/dist/next/context.js.map +1 -0
- package/dist/next/data.d.ts +11 -0
- package/dist/next/data.d.ts.map +1 -0
- package/dist/next/data.js +40 -0
- package/dist/next/data.js.map +1 -0
- package/dist/next/discovery.d.ts +6 -0
- package/dist/next/discovery.d.ts.map +1 -0
- package/dist/next/discovery.js +49 -0
- package/dist/next/discovery.js.map +1 -0
- package/dist/next/index.d.ts +9 -0
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +10 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next/og-fonts.d.ts +6 -0
- package/dist/next/og-fonts.d.ts.map +1 -0
- package/dist/next/og-fonts.js +8 -0
- package/dist/next/og-fonts.js.map +1 -0
- package/dist/next/og-image.d.ts +36 -0
- package/dist/next/og-image.d.ts.map +1 -0
- package/dist/next/og-image.js +77 -0
- package/dist/next/og-image.js.map +1 -0
- package/dist/next/pages.d.ts +45 -0
- package/dist/next/pages.d.ts.map +1 -0
- package/dist/next/pages.js +189 -0
- package/dist/next/pages.js.map +1 -0
- package/dist/next/refresh.d.ts +9 -0
- package/dist/next/refresh.d.ts.map +1 -0
- package/dist/next/refresh.js +81 -0
- package/dist/next/refresh.js.map +1 -0
- package/dist/options.d.ts +320 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +184 -0
- package/dist/options.js.map +1 -0
- package/dist/pages/body.d.ts +18 -0
- package/dist/pages/body.d.ts.map +1 -0
- package/dist/pages/body.js +21 -0
- package/dist/pages/body.js.map +1 -0
- package/dist/pages/dates.d.ts +21 -0
- package/dist/pages/dates.d.ts.map +1 -0
- package/dist/pages/dates.js +24 -0
- package/dist/pages/dates.js.map +1 -0
- package/dist/pages/index.d.ts +7 -0
- package/dist/pages/index.d.ts.map +1 -0
- package/dist/pages/index.js +9 -0
- package/dist/pages/index.js.map +1 -0
- package/dist/pages/json-ld.d.ts +33 -0
- package/dist/pages/json-ld.d.ts.map +1 -0
- package/dist/pages/json-ld.js +95 -0
- package/dist/pages/json-ld.js.map +1 -0
- package/dist/pages/listing.d.ts +46 -0
- package/dist/pages/listing.d.ts.map +1 -0
- package/dist/pages/listing.js +57 -0
- package/dist/pages/listing.js.map +1 -0
- package/dist/pages/paths.d.ts +37 -0
- package/dist/pages/paths.d.ts.map +1 -0
- package/dist/pages/paths.js +61 -0
- package/dist/pages/paths.js.map +1 -0
- package/dist/pages/redirects.d.ts +57 -0
- package/dist/pages/redirects.d.ts.map +1 -0
- package/dist/pages/redirects.js +78 -0
- package/dist/pages/redirects.js.map +1 -0
- package/dist/proxy/index.d.ts +15 -0
- package/dist/proxy/index.d.ts.map +1 -0
- package/dist/proxy/index.js +60 -0
- package/dist/proxy/index.js.map +1 -0
- package/dist/quality/blocks.d.ts +21 -0
- package/dist/quality/blocks.d.ts.map +1 -0
- package/dist/quality/blocks.js +113 -0
- package/dist/quality/blocks.js.map +1 -0
- package/dist/quality/catalog.d.ts +10 -0
- package/dist/quality/catalog.d.ts.map +1 -0
- package/dist/quality/catalog.js +71 -0
- package/dist/quality/catalog.js.map +1 -0
- package/dist/quality/check-article.d.ts +34 -0
- package/dist/quality/check-article.d.ts.map +1 -0
- package/dist/quality/check-article.js +74 -0
- package/dist/quality/check-article.js.map +1 -0
- package/dist/quality/check-files.d.ts +23 -0
- package/dist/quality/check-files.d.ts.map +1 -0
- package/dist/quality/check-files.js +44 -0
- package/dist/quality/check-files.js.map +1 -0
- package/dist/quality/external-links.d.ts +19 -0
- package/dist/quality/external-links.d.ts.map +1 -0
- package/dist/quality/external-links.js +30 -0
- package/dist/quality/external-links.js.map +1 -0
- package/dist/quality/finding.d.ts +17 -0
- package/dist/quality/finding.d.ts.map +1 -0
- package/dist/quality/finding.js +15 -0
- package/dist/quality/finding.js.map +1 -0
- package/dist/quality/gate.d.ts +5 -0
- package/dist/quality/gate.d.ts.map +1 -0
- package/dist/quality/gate.js +10 -0
- package/dist/quality/gate.js.map +1 -0
- package/dist/quality/index.d.ts +15 -0
- package/dist/quality/index.d.ts.map +1 -0
- package/dist/quality/index.js +16 -0
- package/dist/quality/index.js.map +1 -0
- package/dist/quality/link-targets.d.ts +44 -0
- package/dist/quality/link-targets.d.ts.map +1 -0
- package/dist/quality/link-targets.js +91 -0
- package/dist/quality/link-targets.js.map +1 -0
- package/dist/quality/options.d.ts +113 -0
- package/dist/quality/options.d.ts.map +1 -0
- package/dist/quality/options.js +93 -0
- package/dist/quality/options.js.map +1 -0
- package/dist/quality/plugin.d.ts +34 -0
- package/dist/quality/plugin.d.ts.map +1 -0
- package/dist/quality/plugin.js +7 -0
- package/dist/quality/plugin.js.map +1 -0
- package/dist/quality/rules/blocks.d.ts +5 -0
- package/dist/quality/rules/blocks.d.ts.map +1 -0
- package/dist/quality/rules/blocks.js +35 -0
- package/dist/quality/rules/blocks.js.map +1 -0
- package/dist/quality/rules/images.d.ts +4 -0
- package/dist/quality/rules/images.d.ts.map +1 -0
- package/dist/quality/rules/images.js +33 -0
- package/dist/quality/rules/images.js.map +1 -0
- package/dist/quality/rules/input.d.ts +11 -0
- package/dist/quality/rules/input.d.ts.map +1 -0
- package/dist/quality/rules/input.js +2 -0
- package/dist/quality/rules/input.js.map +1 -0
- package/dist/quality/rules/links.d.ts +17 -0
- package/dist/quality/rules/links.d.ts.map +1 -0
- package/dist/quality/rules/links.js +46 -0
- package/dist/quality/rules/links.js.map +1 -0
- package/dist/quality/rules/structure.d.ts +13 -0
- package/dist/quality/rules/structure.d.ts.map +1 -0
- package/dist/quality/rules/structure.js +139 -0
- package/dist/quality/rules/structure.js.map +1 -0
- package/dist/quality/rules/style.d.ts +11 -0
- package/dist/quality/rules/style.d.ts.map +1 -0
- package/dist/quality/rules/style.js +129 -0
- package/dist/quality/rules/style.js.map +1 -0
- package/dist/quality/rules/ymyl.d.ts +5 -0
- package/dist/quality/rules/ymyl.d.ts.map +1 -0
- package/dist/quality/rules/ymyl.js +51 -0
- package/dist/quality/rules/ymyl.js.map +1 -0
- package/dist/quality/rulesets/en/ruleset.d.ts +3 -0
- package/dist/quality/rulesets/en/ruleset.d.ts.map +1 -0
- package/dist/quality/rulesets/en/ruleset.js +106 -0
- package/dist/quality/rulesets/en/ruleset.js.map +1 -0
- package/dist/quality/rulesets/index.d.ts +7 -0
- package/dist/quality/rulesets/index.d.ts.map +1 -0
- package/dist/quality/rulesets/index.js +7 -0
- package/dist/quality/rulesets/index.js.map +1 -0
- package/dist/quality/rulesets/pl/ruleset.d.ts +3 -0
- package/dist/quality/rulesets/pl/ruleset.d.ts.map +1 -0
- package/dist/quality/rulesets/pl/ruleset.js +114 -0
- package/dist/quality/rulesets/pl/ruleset.js.map +1 -0
- package/dist/quality/rulesets/types.d.ts +28 -0
- package/dist/quality/rulesets/types.d.ts.map +1 -0
- package/dist/quality/rulesets/types.js +2 -0
- package/dist/quality/rulesets/types.js.map +1 -0
- package/dist/quality/settings.d.ts +26 -0
- package/dist/quality/settings.d.ts.map +1 -0
- package/dist/quality/settings.js +32 -0
- package/dist/quality/settings.js.map +1 -0
- package/dist/quality/text.d.ts +43 -0
- package/dist/quality/text.d.ts.map +1 -0
- package/dist/quality/text.js +85 -0
- package/dist/quality/text.js.map +1 -0
- package/dist/render/glossary.d.ts +27 -0
- package/dist/render/glossary.d.ts.map +1 -0
- package/dist/render/glossary.js +71 -0
- package/dist/render/glossary.js.map +1 -0
- package/dist/render/images.d.ts +42 -0
- package/dist/render/images.d.ts.map +1 -0
- package/dist/render/images.js +84 -0
- package/dist/render/images.js.map +1 -0
- package/dist/render/index.d.ts +6 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +8 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/reading-time.d.ts +8 -0
- package/dist/render/reading-time.d.ts.map +1 -0
- package/dist/render/reading-time.js +17 -0
- package/dist/render/reading-time.js.map +1 -0
- package/dist/render/render-article.d.ts +97 -0
- package/dist/render/render-article.d.ts.map +1 -0
- package/dist/render/render-article.js +373 -0
- package/dist/render/render-article.js.map +1 -0
- package/dist/render/slugify-heading.d.ts +2 -0
- package/dist/render/slugify-heading.d.ts.map +1 -0
- package/dist/render/slugify-heading.js +21 -0
- package/dist/render/slugify-heading.js.map +1 -0
- package/dist/server/health.d.ts +3 -0
- package/dist/server/health.d.ts.map +1 -0
- package/dist/server/health.js +11 -0
- package/dist/server/health.js.map +1 -0
- package/dist/server/index.d.ts +10 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +13 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/og-fonts.d.ts +24 -0
- package/dist/server/og-fonts.d.ts.map +1 -0
- package/dist/server/og-fonts.js +85 -0
- package/dist/server/og-fonts.js.map +1 -0
- package/dist/server/options.d.ts +17 -0
- package/dist/server/options.d.ts.map +1 -0
- package/dist/server/options.js +56 -0
- package/dist/server/options.js.map +1 -0
- package/dist/sitemap.d.ts +11 -0
- package/dist/sitemap.d.ts.map +1 -0
- package/dist/sitemap.js +35 -0
- package/dist/sitemap.js.map +1 -0
- package/dist/ui/blog-article.d.ts +49 -0
- package/dist/ui/blog-article.d.ts.map +1 -0
- package/dist/ui/blog-article.js +45 -0
- package/dist/ui/blog-article.js.map +1 -0
- package/dist/ui/blog-glossary.d.ts +27 -0
- package/dist/ui/blog-glossary.d.ts.map +1 -0
- package/dist/ui/blog-glossary.js +20 -0
- package/dist/ui/blog-glossary.js.map +1 -0
- package/dist/ui/blog-layout.d.ts +31 -0
- package/dist/ui/blog-layout.d.ts.map +1 -0
- package/dist/ui/blog-layout.js +25 -0
- package/dist/ui/blog-layout.js.map +1 -0
- package/dist/ui/blog-listing.d.ts +15 -0
- package/dist/ui/blog-listing.d.ts.map +1 -0
- package/dist/ui/blog-listing.js +29 -0
- package/dist/ui/blog-listing.js.map +1 -0
- package/dist/ui/blog-method.d.ts +5 -0
- package/dist/ui/blog-method.d.ts.map +1 -0
- package/dist/ui/blog-method.js +21 -0
- package/dist/ui/blog-method.js.map +1 -0
- package/dist/ui/index.d.ts +7 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +8 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/page-context.d.ts +15 -0
- package/dist/ui/page-context.d.ts.map +1 -0
- package/dist/ui/page-context.js +2 -0
- package/dist/ui/page-context.js.map +1 -0
- package/migrations/0001_create_articles.sql +67 -0
- package/migrations/README.md +8 -0
- package/module.json +28 -0
- package/package.json +102 -4
- package/skill/SKILL.md +72 -0
- package/skill/references/reviewer.md +39 -0
- package/skill/references/rules.md +122 -0
- package/skill/references/structure.md +69 -0
- package/skill/references/template.md +86 -0
- package/src/cli/bin.ts +5 -0
- package/src/cli/command.ts +49 -0
- package/src/cli/index.ts +20 -0
- package/src/cli/run.ts +591 -0
- package/src/cli/skill.ts +242 -0
- package/src/content/article-file.ts +184 -0
- package/src/contract.ts +88 -0
- package/src/db/articles.ts +160 -0
- package/src/db/publish-run.ts +224 -0
- package/src/db/schema.ts +36 -0
- package/src/discovery/dates.ts +27 -0
- package/src/discovery/index.ts +18 -0
- package/src/discovery/indexnow.ts +25 -0
- package/src/discovery/refresh.ts +79 -0
- package/src/discovery/related.ts +35 -0
- package/src/discovery/rss.ts +77 -0
- package/src/discovery/sitemap.ts +59 -0
- package/src/discovery/submit.ts +69 -0
- package/src/index.ts +99 -0
- package/src/messages/en.ts +82 -0
- package/src/messages/index.ts +7 -0
- package/src/messages/pl.ts +77 -0
- package/src/next/context.ts +30 -0
- package/src/next/data.ts +55 -0
- package/src/next/discovery.ts +49 -0
- package/src/next/index.ts +25 -0
- package/src/next/next-modules.d.ts +15 -0
- package/src/next/og-fonts.ts +14 -0
- package/src/next/og-image.tsx +108 -0
- package/src/next/pages.tsx +251 -0
- package/src/next/refresh.ts +85 -0
- package/src/options.ts +224 -0
- package/src/pages/body.ts +38 -0
- package/src/pages/dates.ts +39 -0
- package/src/pages/index.ts +37 -0
- package/src/pages/json-ld.ts +120 -0
- package/src/pages/listing.ts +95 -0
- package/src/pages/paths.ts +84 -0
- package/src/pages/redirects.ts +120 -0
- package/src/proxy/index.ts +66 -0
- package/src/quality/blocks.ts +130 -0
- package/src/quality/catalog.ts +86 -0
- package/src/quality/check-article.ts +112 -0
- package/src/quality/check-files.ts +63 -0
- package/src/quality/external-links.ts +37 -0
- package/src/quality/finding.ts +29 -0
- package/src/quality/gate.ts +15 -0
- package/src/quality/index.ts +28 -0
- package/src/quality/link-targets.ts +107 -0
- package/src/quality/options.ts +105 -0
- package/src/quality/plugin.ts +43 -0
- package/src/quality/rules/blocks.ts +43 -0
- package/src/quality/rules/images.ts +34 -0
- package/src/quality/rules/input.ts +12 -0
- package/src/quality/rules/links.ts +56 -0
- package/src/quality/rules/structure.ts +137 -0
- package/src/quality/rules/style.ts +137 -0
- package/src/quality/rules/ymyl.ts +57 -0
- package/src/quality/rulesets/en/ruleset.ts +117 -0
- package/src/quality/rulesets/index.ts +9 -0
- package/src/quality/rulesets/pl/ruleset.ts +126 -0
- package/src/quality/rulesets/types.ts +31 -0
- package/src/quality/settings.ts +60 -0
- package/src/quality/text.ts +113 -0
- package/src/render/glossary.ts +103 -0
- package/src/render/images.ts +110 -0
- package/src/render/index.ts +29 -0
- package/src/render/reading-time.ts +18 -0
- package/src/render/render-article.ts +487 -0
- package/src/render/slugify-heading.ts +22 -0
- package/src/server/health.ts +12 -0
- package/src/server/index.ts +28 -0
- package/src/server/og-fonts.ts +102 -0
- package/src/server/options.ts +62 -0
- package/src/sitemap.ts +36 -0
- package/src/ui/blog-article.tsx +186 -0
- package/src/ui/blog-glossary.tsx +104 -0
- package/src/ui/blog-layout.tsx +89 -0
- package/src/ui/blog-listing.tsx +95 -0
- package/src/ui/blog-method.tsx +34 -0
- package/src/ui/index.ts +8 -0
- package/src/ui/page-context.ts +17 -0
- package/styles.css +498 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { en } from "./en.js";
|
|
2
|
+
export type BlogMessages = typeof en;
|
|
3
|
+
/** Complete default dictionaries; apps pass partial overrides per locale. */
|
|
4
|
+
export declare const blogMessages: {
|
|
5
|
+
en: {
|
|
6
|
+
kinds: {
|
|
7
|
+
article: string;
|
|
8
|
+
term: string;
|
|
9
|
+
};
|
|
10
|
+
statuses: {
|
|
11
|
+
draft: string;
|
|
12
|
+
published: string;
|
|
13
|
+
withdrawn: string;
|
|
14
|
+
};
|
|
15
|
+
render: {
|
|
16
|
+
footnotesHeading: string;
|
|
17
|
+
footnoteLabel: string;
|
|
18
|
+
backToText: string;
|
|
19
|
+
opensInNewTab: string;
|
|
20
|
+
tableOfContents: string;
|
|
21
|
+
};
|
|
22
|
+
pages: {
|
|
23
|
+
blogTitle: string;
|
|
24
|
+
blogDescription: string;
|
|
25
|
+
titleWithBrand: string;
|
|
26
|
+
empty: string;
|
|
27
|
+
otherCluster: string;
|
|
28
|
+
startHere: string;
|
|
29
|
+
readingTime: string;
|
|
30
|
+
updatedOn: string;
|
|
31
|
+
breadcrumbs: string;
|
|
32
|
+
published: string;
|
|
33
|
+
updated: string;
|
|
34
|
+
currentAsOf: string;
|
|
35
|
+
readingTimeLabel: string;
|
|
36
|
+
contents: string;
|
|
37
|
+
summary: string;
|
|
38
|
+
faq: string;
|
|
39
|
+
sources: string;
|
|
40
|
+
signature: string;
|
|
41
|
+
methodLink: string;
|
|
42
|
+
disclaimerLabel: string;
|
|
43
|
+
glossaryLink: string;
|
|
44
|
+
glossaryTeaser: string;
|
|
45
|
+
readNext: string;
|
|
46
|
+
};
|
|
47
|
+
glossary: {
|
|
48
|
+
title: string;
|
|
49
|
+
description: string;
|
|
50
|
+
empty: string;
|
|
51
|
+
explainedIn: string;
|
|
52
|
+
allTerms: string;
|
|
53
|
+
};
|
|
54
|
+
method: {
|
|
55
|
+
title: string;
|
|
56
|
+
description: string;
|
|
57
|
+
whoTitle: string;
|
|
58
|
+
whoBody: string;
|
|
59
|
+
factsTitle: string;
|
|
60
|
+
factsBody: string;
|
|
61
|
+
sourcesTitle: string;
|
|
62
|
+
sourcesBody: string;
|
|
63
|
+
checksTitle: string;
|
|
64
|
+
checksBody: string;
|
|
65
|
+
correctionsTitle: string;
|
|
66
|
+
correctionsBody: string;
|
|
67
|
+
};
|
|
68
|
+
gone: {
|
|
69
|
+
title: string;
|
|
70
|
+
heading: string;
|
|
71
|
+
body: string;
|
|
72
|
+
link: string;
|
|
73
|
+
};
|
|
74
|
+
feed: {
|
|
75
|
+
unavailable: string;
|
|
76
|
+
};
|
|
77
|
+
og: {
|
|
78
|
+
alt: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
pl: {
|
|
82
|
+
kinds: {
|
|
83
|
+
article: string;
|
|
84
|
+
term: string;
|
|
85
|
+
};
|
|
86
|
+
statuses: {
|
|
87
|
+
draft: string;
|
|
88
|
+
published: string;
|
|
89
|
+
withdrawn: string;
|
|
90
|
+
};
|
|
91
|
+
render: {
|
|
92
|
+
footnotesHeading: string;
|
|
93
|
+
footnoteLabel: string;
|
|
94
|
+
backToText: string;
|
|
95
|
+
opensInNewTab: string;
|
|
96
|
+
tableOfContents: string;
|
|
97
|
+
};
|
|
98
|
+
pages: {
|
|
99
|
+
blogTitle: string;
|
|
100
|
+
blogDescription: string;
|
|
101
|
+
titleWithBrand: string;
|
|
102
|
+
empty: string;
|
|
103
|
+
otherCluster: string;
|
|
104
|
+
startHere: string;
|
|
105
|
+
readingTime: string;
|
|
106
|
+
updatedOn: string;
|
|
107
|
+
breadcrumbs: string;
|
|
108
|
+
published: string;
|
|
109
|
+
updated: string;
|
|
110
|
+
currentAsOf: string;
|
|
111
|
+
readingTimeLabel: string;
|
|
112
|
+
contents: string;
|
|
113
|
+
summary: string;
|
|
114
|
+
faq: string;
|
|
115
|
+
sources: string;
|
|
116
|
+
signature: string;
|
|
117
|
+
methodLink: string;
|
|
118
|
+
disclaimerLabel: string;
|
|
119
|
+
glossaryLink: string;
|
|
120
|
+
glossaryTeaser: string;
|
|
121
|
+
readNext: string;
|
|
122
|
+
};
|
|
123
|
+
glossary: {
|
|
124
|
+
title: string;
|
|
125
|
+
description: string;
|
|
126
|
+
empty: string;
|
|
127
|
+
explainedIn: string;
|
|
128
|
+
allTerms: string;
|
|
129
|
+
};
|
|
130
|
+
method: {
|
|
131
|
+
title: string;
|
|
132
|
+
description: string;
|
|
133
|
+
whoTitle: string;
|
|
134
|
+
whoBody: string;
|
|
135
|
+
factsTitle: string;
|
|
136
|
+
factsBody: string;
|
|
137
|
+
sourcesTitle: string;
|
|
138
|
+
sourcesBody: string;
|
|
139
|
+
checksTitle: string;
|
|
140
|
+
checksBody: string;
|
|
141
|
+
correctionsTitle: string;
|
|
142
|
+
correctionsBody: string;
|
|
143
|
+
};
|
|
144
|
+
gone: {
|
|
145
|
+
title: string;
|
|
146
|
+
heading: string;
|
|
147
|
+
body: string;
|
|
148
|
+
link: string;
|
|
149
|
+
};
|
|
150
|
+
feed: {
|
|
151
|
+
unavailable: string;
|
|
152
|
+
};
|
|
153
|
+
og: {
|
|
154
|
+
alt: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAG7B,MAAM,MAAM,YAAY,GAAG,OAAO,EAAE,CAAC;AAErC,6EAA6E;AAC7E,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAI7B,6EAA6E;AAC7E,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export declare const pl: {
|
|
2
|
+
kinds: {
|
|
3
|
+
article: string;
|
|
4
|
+
term: string;
|
|
5
|
+
};
|
|
6
|
+
statuses: {
|
|
7
|
+
draft: string;
|
|
8
|
+
published: string;
|
|
9
|
+
withdrawn: string;
|
|
10
|
+
};
|
|
11
|
+
render: {
|
|
12
|
+
footnotesHeading: string;
|
|
13
|
+
footnoteLabel: string;
|
|
14
|
+
backToText: string;
|
|
15
|
+
opensInNewTab: string;
|
|
16
|
+
tableOfContents: string;
|
|
17
|
+
};
|
|
18
|
+
pages: {
|
|
19
|
+
blogTitle: string;
|
|
20
|
+
blogDescription: string;
|
|
21
|
+
titleWithBrand: string;
|
|
22
|
+
empty: string;
|
|
23
|
+
otherCluster: string;
|
|
24
|
+
startHere: string;
|
|
25
|
+
readingTime: string;
|
|
26
|
+
updatedOn: string;
|
|
27
|
+
breadcrumbs: string;
|
|
28
|
+
published: string;
|
|
29
|
+
updated: string;
|
|
30
|
+
currentAsOf: string;
|
|
31
|
+
readingTimeLabel: string;
|
|
32
|
+
contents: string;
|
|
33
|
+
summary: string;
|
|
34
|
+
faq: string;
|
|
35
|
+
sources: string;
|
|
36
|
+
signature: string;
|
|
37
|
+
methodLink: string;
|
|
38
|
+
disclaimerLabel: string;
|
|
39
|
+
glossaryLink: string;
|
|
40
|
+
glossaryTeaser: string;
|
|
41
|
+
readNext: string;
|
|
42
|
+
};
|
|
43
|
+
glossary: {
|
|
44
|
+
title: string;
|
|
45
|
+
description: string;
|
|
46
|
+
empty: string;
|
|
47
|
+
explainedIn: string;
|
|
48
|
+
allTerms: string;
|
|
49
|
+
};
|
|
50
|
+
method: {
|
|
51
|
+
title: string;
|
|
52
|
+
description: string;
|
|
53
|
+
whoTitle: string;
|
|
54
|
+
whoBody: string;
|
|
55
|
+
factsTitle: string;
|
|
56
|
+
factsBody: string;
|
|
57
|
+
sourcesTitle: string;
|
|
58
|
+
sourcesBody: string;
|
|
59
|
+
checksTitle: string;
|
|
60
|
+
checksBody: string;
|
|
61
|
+
correctionsTitle: string;
|
|
62
|
+
correctionsBody: string;
|
|
63
|
+
};
|
|
64
|
+
gone: {
|
|
65
|
+
title: string;
|
|
66
|
+
heading: string;
|
|
67
|
+
body: string;
|
|
68
|
+
link: string;
|
|
69
|
+
};
|
|
70
|
+
feed: {
|
|
71
|
+
/** The plain-text body of a 503 when the texts cannot be read. */
|
|
72
|
+
unavailable: string;
|
|
73
|
+
};
|
|
74
|
+
og: {
|
|
75
|
+
alt: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=pl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pl.d.ts","sourceRoot":"","sources":["../../src/messages/pl.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAsEX,kEAAkE;;;;;;CAMrE,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const pl = {
|
|
2
|
+
kinds: {
|
|
3
|
+
article: "Artykuł",
|
|
4
|
+
term: "Pojęcie w słowniku",
|
|
5
|
+
},
|
|
6
|
+
statuses: {
|
|
7
|
+
draft: "Szkic",
|
|
8
|
+
published: "Opublikowany",
|
|
9
|
+
withdrawn: "Wycofany",
|
|
10
|
+
},
|
|
11
|
+
render: {
|
|
12
|
+
footnotesHeading: "Przypisy",
|
|
13
|
+
footnoteLabel: "Przypis {number}",
|
|
14
|
+
backToText: "Wróć do tekstu",
|
|
15
|
+
opensInNewTab: "(otwiera się w nowej karcie)",
|
|
16
|
+
tableOfContents: "Spis treści",
|
|
17
|
+
},
|
|
18
|
+
pages: {
|
|
19
|
+
blogTitle: "Blog",
|
|
20
|
+
blogDescription: "Teksty, które wyjaśniają temat krok po kroku, ze źródłami i datą sprawdzenia faktów.",
|
|
21
|
+
titleWithBrand: "{title} | {brand}",
|
|
22
|
+
empty: "Pierwsze teksty są w drodze.",
|
|
23
|
+
otherCluster: "Pozostałe teksty",
|
|
24
|
+
startHere: "Od tego zacznij",
|
|
25
|
+
readingTime: "{minutes} min czytania",
|
|
26
|
+
updatedOn: "Zaktualizowano {date}",
|
|
27
|
+
breadcrumbs: "Okruszki",
|
|
28
|
+
published: "Opublikowano",
|
|
29
|
+
updated: "Zaktualizowano",
|
|
30
|
+
currentAsOf: "Aktualne na",
|
|
31
|
+
readingTimeLabel: "Czas czytania",
|
|
32
|
+
contents: "W tym tekście",
|
|
33
|
+
summary: "W skrócie",
|
|
34
|
+
faq: "Pytania i odpowiedzi",
|
|
35
|
+
sources: "Źródła",
|
|
36
|
+
signature: "Redakcja {brand}",
|
|
37
|
+
methodLink: "Jak powstają teksty",
|
|
38
|
+
disclaimerLabel: "Zastrzeżenie",
|
|
39
|
+
glossaryLink: "Słownik pojęć",
|
|
40
|
+
glossaryTeaser: "krótkie definicje pojęć, których używają teksty.",
|
|
41
|
+
readNext: "Przeczytaj też",
|
|
42
|
+
},
|
|
43
|
+
glossary: {
|
|
44
|
+
title: "Słownik pojęć",
|
|
45
|
+
description: "Krótkie definicje pojęć, których używają teksty, każda z datą sprawdzenia i źródłami.",
|
|
46
|
+
empty: "Pierwsze definicje są w drodze.",
|
|
47
|
+
explainedIn: "Rozwijamy w tekstach",
|
|
48
|
+
allTerms: "Wszystkie pojęcia",
|
|
49
|
+
},
|
|
50
|
+
method: {
|
|
51
|
+
title: "Jak powstają teksty",
|
|
52
|
+
description: "Kto pisze teksty, skąd biorą się fakty i co sprawdzamy, zanim tekst zostanie opublikowany.",
|
|
53
|
+
whoTitle: "Kto pisze",
|
|
54
|
+
whoBody: "Redakcja wybiera każdy temat i podpisuje każdy tekst nazwą serwisu.",
|
|
55
|
+
factsTitle: "Skąd fakty",
|
|
56
|
+
factsBody: "Każda liczba pochodzi ze źródła podanego pod tekstem albo z wyliczenia, które tekst pokazuje. Każdy tekst podaje dzień, w którym sprawdziliśmy fakty.",
|
|
57
|
+
sourcesTitle: "Źródła",
|
|
58
|
+
sourcesBody: "Cytujemy najpierw przepisy, oficjalne statystyki i dokumenty źródłowe, a każde źródło linkujemy, żebyś mógł je sprawdzić sam.",
|
|
59
|
+
checksTitle: "Sprawdzenie przed publikacją",
|
|
60
|
+
checksBody: "Zanim tekst trafi na stronę, automatyczne testy sprawdzają jego strukturę, linki i źródła. Tekst, który ich nie przejdzie, nie zostanie opublikowany.",
|
|
61
|
+
correctionsTitle: "Poprawki",
|
|
62
|
+
correctionsBody: "Gdy fakt się zmienia, aktualizujemy tekst i jego datę. Tekst, którego nie da się już poprawić, wycofujemy.",
|
|
63
|
+
},
|
|
64
|
+
gone: {
|
|
65
|
+
title: "Tekst wycofany",
|
|
66
|
+
heading: "Ten tekst został wycofany",
|
|
67
|
+
body: "Zdjęliśmy go, bo przestał być aktualny albo poprawny.",
|
|
68
|
+
link: "Zobacz pozostałe teksty na blogu",
|
|
69
|
+
},
|
|
70
|
+
feed: {
|
|
71
|
+
/** The plain-text body of a 503 when the texts cannot be read. */
|
|
72
|
+
unavailable: "Kanał jest chwilowo niedostępny. Spróbuj ponownie za kilka minut.",
|
|
73
|
+
},
|
|
74
|
+
og: {
|
|
75
|
+
alt: "Artykuł z bloga",
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=pl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pl.js","sourceRoot":"","sources":["../../src/messages/pl.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,KAAK,EAAE;QACL,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,oBAAoB;KAC3B;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,OAAO;QACd,SAAS,EAAE,cAAc;QACzB,SAAS,EAAE,UAAU;KACtB;IACD,MAAM,EAAE;QACN,gBAAgB,EAAE,UAAU;QAC5B,aAAa,EAAE,kBAAkB;QACjC,UAAU,EAAE,gBAAgB;QAC5B,aAAa,EAAE,8BAA8B;QAC7C,eAAe,EAAE,aAAa;KAC/B;IACD,KAAK,EAAE;QACL,SAAS,EAAE,MAAM;QACjB,eAAe,EAAE,sFAAsF;QACvG,cAAc,EAAE,mBAAmB;QACnC,KAAK,EAAE,8BAA8B;QACrC,YAAY,EAAE,kBAAkB;QAChC,SAAS,EAAE,iBAAiB;QAC5B,WAAW,EAAE,wBAAwB;QACrC,SAAS,EAAE,uBAAuB;QAClC,WAAW,EAAE,UAAU;QACvB,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE,gBAAgB;QACzB,WAAW,EAAE,aAAa;QAC1B,gBAAgB,EAAE,eAAe;QACjC,QAAQ,EAAE,eAAe;QACzB,OAAO,EAAE,WAAW;QACpB,GAAG,EAAE,sBAAsB;QAC3B,OAAO,EAAE,QAAQ;QACjB,SAAS,EAAE,kBAAkB;QAC7B,UAAU,EAAE,qBAAqB;QACjC,eAAe,EAAE,cAAc;QAC/B,YAAY,EAAE,eAAe;QAC7B,cAAc,EAAE,kDAAkD;QAClE,QAAQ,EAAE,gBAAgB;KAC3B;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,uFAAuF;QACpG,KAAK,EAAE,iCAAiC;QACxC,WAAW,EAAE,sBAAsB;QACnC,QAAQ,EAAE,mBAAmB;KAC9B;IACD,MAAM,EAAE;QACN,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,4FAA4F;QACzG,QAAQ,EAAE,WAAW;QACrB,OAAO,EAAE,qEAAqE;QAC9E,UAAU,EAAE,YAAY;QACxB,SAAS,EAAE,uJAAuJ;QAClK,YAAY,EAAE,QAAQ;QACtB,WAAW,EAAE,+HAA+H;QAC5I,WAAW,EAAE,8BAA8B;QAC3C,UAAU,EAAE,uJAAuJ;QACnK,gBAAgB,EAAE,UAAU;QAC5B,eAAe,EAAE,4GAA4G;KAC9H;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,gBAAgB;QACvB,OAAO,EAAE,2BAA2B;QACpC,IAAI,EAAE,uDAAuD;QAC7D,IAAI,EAAE,kCAAkC;KACzC;IACD,IAAI,EAAE;QACJ,kEAAkE;QAClE,WAAW,EAAE,mEAAmE;KACjF;IACD,EAAE,EAAE;QACF,GAAG,EAAE,iBAAiB;KACvB;CACF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type SoftureConfig } from "@softure-ai/core";
|
|
2
|
+
import type { BlogContext } from "../db/articles.js";
|
|
3
|
+
import type { BlogPageContext } from "../ui/page-context.js";
|
|
4
|
+
export declare function getBlogContext(config?: SoftureConfig): Promise<BlogContext>;
|
|
5
|
+
export declare function getPageContext(config: SoftureConfig): BlogPageContext;
|
|
6
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/next/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,wBAAsB,cAAc,CAAC,MAAM,GAAE,aAAkC,GAAG,OAAO,CAAC,WAAW,CAAC,CAOrG;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe,CAWrE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// What the adapter hands the store: the registered config, the process-wide database handle and the
|
|
2
|
+
// wall clock; and what it hands the components: the copy, paths, brand and disclaimer.
|
|
3
|
+
import { systemClock } from "@softure-ai/core";
|
|
4
|
+
import { getSoftureConfig } from "@softure-ai/core/next";
|
|
5
|
+
import { getConfiguredDatabase } from "@softure-ai/db";
|
|
6
|
+
import { getBlogMessages, getBlogOptions, getBlogRoutes } from "../server/options.js";
|
|
7
|
+
export async function getBlogContext(config = getSoftureConfig()) {
|
|
8
|
+
if (config.database === null) {
|
|
9
|
+
// Unreachable for a validated config: the module has a database schema.
|
|
10
|
+
throw new Error("@softure-ai/blog: softure.config.ts has no database; the blog needs one");
|
|
11
|
+
}
|
|
12
|
+
const { db } = await getConfiguredDatabase(config.database);
|
|
13
|
+
return { db, clock: systemClock, config };
|
|
14
|
+
}
|
|
15
|
+
export function getPageContext(config) {
|
|
16
|
+
const options = getBlogOptions(config);
|
|
17
|
+
const routes = getBlogRoutes(config);
|
|
18
|
+
return {
|
|
19
|
+
messages: getBlogMessages(config),
|
|
20
|
+
locale: config.locale,
|
|
21
|
+
routes,
|
|
22
|
+
methodPath: options.methodPage ? routes.method : null,
|
|
23
|
+
brand: options.brand?.name ?? null,
|
|
24
|
+
disclaimer: options.disclaimer === undefined ? null : (options.disclaimer[config.locale] ?? options.disclaimer.en),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/next/context.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,uFAAuF;AACvF,OAAO,EAAE,WAAW,EAAsB,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGtF,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,SAAwB,gBAAgB,EAAE;IAC7E,IAAI,MAAM,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;QAC7B,wEAAwE;QACxE,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;IAC7F,CAAC;IACD,MAAM,EAAE,EAAE,EAAE,GAAG,MAAM,qBAAqB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5D,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAqB;IAClD,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACrC,OAAO;QACL,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC;QACjC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM;QACN,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;QACrD,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,IAAI,IAAI,IAAI;QAClC,UAAU,EAAE,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;KACnH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SoftureConfig } from "@softure-ai/core";
|
|
2
|
+
import type { BlogArticle } from "../contract.js";
|
|
3
|
+
/** The tag of every cached read: `revalidateTag("softure-blog", { expire: 0 })` refreshes the blog at once (`refreshBlogCache`). */
|
|
4
|
+
export declare const BLOG_CACHE_TAG = "softure-blog";
|
|
5
|
+
/** Published articles (not terms), newest first. */
|
|
6
|
+
export declare function getPublishedArticles(config: SoftureConfig): Promise<BlogArticle[]>;
|
|
7
|
+
/** Published glossary terms, in the store's order (pages sort them). */
|
|
8
|
+
export declare function getPublishedTerms(config: SoftureConfig): Promise<BlogArticle[]>;
|
|
9
|
+
/** The row under a slug in any status: the page decides what to show. */
|
|
10
|
+
export declare function getTextBySlug(config: SoftureConfig, slug: string): Promise<BlogArticle | null>;
|
|
11
|
+
//# sourceMappingURL=data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/next/data.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD,oIAAoI;AACpI,eAAO,MAAM,cAAc,iBAAiB,CAAC;AA6B7C,oDAAoD;AACpD,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAExF;AAED,wEAAwE;AACxE,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAErF;AAED,yEAAyE;AACzE,wBAAsB,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAGpG"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { unstable_cache } from "next/cache";
|
|
2
|
+
import { findArticleBySlug, listArticles } from "../db/articles.js";
|
|
3
|
+
import { getBlogOptions } from "../server/options.js";
|
|
4
|
+
import { getBlogContext } from "./context.js";
|
|
5
|
+
/** The tag of every cached read: `revalidateTag("softure-blog", { expire: 0 })` refreshes the blog at once (`refreshBlogCache`). */
|
|
6
|
+
export const BLOG_CACHE_TAG = "softure-blog";
|
|
7
|
+
/**
|
|
8
|
+
* The cache keeps JSON, so a `Date` comes back as a string: revive them, or every page served from
|
|
9
|
+
* the cache would fail on its dates (FIRE's bug, kept fixed).
|
|
10
|
+
*/
|
|
11
|
+
function reviveDates(article) {
|
|
12
|
+
const toDate = (value) => (value === null ? null : new Date(value));
|
|
13
|
+
return { ...article, publishedAt: toDate(article.publishedAt), updatedAt: toDate(article.updatedAt), createdAt: new Date(article.createdAt) };
|
|
14
|
+
}
|
|
15
|
+
let reads = null;
|
|
16
|
+
function getCachedReads(config) {
|
|
17
|
+
if (reads?.config === config)
|
|
18
|
+
return reads.value;
|
|
19
|
+
const options = { revalidate: getBlogOptions(config).revalidateSeconds, tags: [BLOG_CACHE_TAG] };
|
|
20
|
+
const value = {
|
|
21
|
+
published: unstable_cache(async () => listArticles(await getBlogContext(config)), ["softure-blog", "published"], options),
|
|
22
|
+
bySlug: unstable_cache(async (slug) => findArticleBySlug(await getBlogContext(config), slug), ["softure-blog", "by-slug"], options),
|
|
23
|
+
};
|
|
24
|
+
reads = { config, value };
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
/** Published articles (not terms), newest first. */
|
|
28
|
+
export async function getPublishedArticles(config) {
|
|
29
|
+
return (await getCachedReads(config).published()).filter((text) => text.kind === "article").map(reviveDates);
|
|
30
|
+
}
|
|
31
|
+
/** Published glossary terms, in the store's order (pages sort them). */
|
|
32
|
+
export async function getPublishedTerms(config) {
|
|
33
|
+
return (await getCachedReads(config).published()).filter((text) => text.kind === "term").map(reviveDates);
|
|
34
|
+
}
|
|
35
|
+
/** The row under a slug in any status: the page decides what to show. */
|
|
36
|
+
export async function getTextBySlug(config, slug) {
|
|
37
|
+
const text = await getCachedReads(config).bySlug(slug);
|
|
38
|
+
return text === null ? null : reviveDates(text);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/next/data.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,oIAAoI;AACpI,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;AAO7C;;;GAGG;AACH,SAAS,WAAW,CAAC,OAAoB;IACvC,MAAM,MAAM,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1F,OAAO,EAAE,GAAG,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;AAChJ,CAAC;AAED,IAAI,KAAK,GAA2E,IAAI,CAAC;AAEzF,SAAS,cAAc,CAAC,MAAqB;IAC3C,IAAI,KAAK,EAAE,MAAM,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC;IACjD,MAAM,OAAO,GAAG,EAAE,UAAU,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC;IACjG,MAAM,KAAK,GAAgB;QACzB,SAAS,EAAE,cAAc,CAAC,KAAK,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,EAAE,OAAO,CAAC;QACzH,MAAM,EAAE,cAAc,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,cAAc,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC;KAC5I,CAAC;IACF,KAAK,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC1B,OAAO,KAAK,CAAC;AACf,CAAC;AAED,oDAAoD;AACpD,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,MAAqB;IAC9D,OAAO,CAAC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAC/G,CAAC;AAED,wEAAwE;AACxE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAqB;IAC3D,OAAO,CAAC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAC5G,CAAC;AAED,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAAqB,EAAE,IAAY;IACrE,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACvD,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GET <routes.rss>`: the RSS 2.0 feed of the published articles and terms. A failed read answers
|
|
3
|
+
* **503**, never an empty feed: a reader that got a feed without items could take the texts as deleted.
|
|
4
|
+
*/
|
|
5
|
+
export declare function serveBlogRss(): Promise<Response>;
|
|
6
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/next/discovery.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,QAAQ,CAAC,CA4BtD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// The blog's RSS feed route in Next, over the cached reads of `data.ts` (one query per
|
|
2
|
+
// `revalidateSeconds`). The sitemap contributor is `blogSitemap()` of the root entry (`../sitemap.ts`).
|
|
3
|
+
//
|
|
4
|
+
// app/blog/rss.xml/route.ts export { serveBlogRss as GET } from "@softure-ai/blog/next";
|
|
5
|
+
// export const dynamic = "force-dynamic";
|
|
6
|
+
import { errorLogLabel, formatMessage, getSiteUrls } from "@softure-ai/core";
|
|
7
|
+
import { getSoftureConfig } from "@softure-ai/core/next";
|
|
8
|
+
import { buildBlogRss } from "../discovery/rss.js";
|
|
9
|
+
import { getClusterLabel } from "../pages/listing.js";
|
|
10
|
+
import { getBlogOptions } from "../server/options.js";
|
|
11
|
+
import { getPageContext } from "./context.js";
|
|
12
|
+
import { getPublishedArticles, getPublishedTerms } from "./data.js";
|
|
13
|
+
/** Seconds a feed reader should wait after a 503: the cache's own lifetime is a fair guess. */
|
|
14
|
+
const RETRY_AFTER_SECONDS = 300;
|
|
15
|
+
/**
|
|
16
|
+
* `GET <routes.rss>`: the RSS 2.0 feed of the published articles and terms. A failed read answers
|
|
17
|
+
* **503**, never an empty feed: a reader that got a feed without items could take the texts as deleted.
|
|
18
|
+
*/
|
|
19
|
+
export async function serveBlogRss() {
|
|
20
|
+
const config = getSoftureConfig();
|
|
21
|
+
const context = getPageContext(config);
|
|
22
|
+
try {
|
|
23
|
+
const [articles, terms] = await Promise.all([getPublishedArticles(config), getPublishedTerms(config)]);
|
|
24
|
+
const { clusters } = getBlogOptions(config);
|
|
25
|
+
const copy = context.messages;
|
|
26
|
+
const xml = buildBlogRss({
|
|
27
|
+
articles,
|
|
28
|
+
terms,
|
|
29
|
+
urls: getSiteUrls(config),
|
|
30
|
+
routes: context.routes,
|
|
31
|
+
feedPath: context.routes.rss,
|
|
32
|
+
channel: {
|
|
33
|
+
title: context.brand === null ? copy.pages.blogTitle : formatMessage(copy.pages.titleWithBrand, { title: copy.pages.blogTitle, brand: context.brand }),
|
|
34
|
+
description: copy.pages.blogDescription,
|
|
35
|
+
language: config.locale,
|
|
36
|
+
},
|
|
37
|
+
getCategory: (text) => (text.kind === "term" ? copy.glossary.title : text.cluster === null ? null : getClusterLabel(text.cluster, clusters, config.locale)),
|
|
38
|
+
});
|
|
39
|
+
return new Response(xml, { headers: { "content-type": "application/rss+xml; charset=utf-8" } });
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
console.error(`blog: the RSS feed could not read the texts: ${errorLogLabel(error)}`);
|
|
43
|
+
return new Response(context.messages.feed.unavailable, {
|
|
44
|
+
status: 503,
|
|
45
|
+
headers: { "content-type": "text/plain; charset=utf-8", "retry-after": String(RETRY_AFTER_SECONDS) },
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/next/discovery.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,wGAAwG;AACxG,EAAE;AACF,6FAA6F;AAC7F,wEAAwE;AACxE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEpE,+FAA+F;AAC/F,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAEhC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAClC,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,CAAC;QACH,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACvG,MAAM,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC9B,MAAM,GAAG,GAAG,YAAY,CAAC;YACvB,QAAQ;YACR,KAAK;YACL,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;YACzB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG;YAC5B,OAAO,EAAE;gBACP,KAAK,EAAE,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;gBACtJ,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe;gBACvC,QAAQ,EAAE,MAAM,CAAC,MAAM;aACxB;YACD,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;SAC5J,CAAC,CAAC;QACH,OAAO,IAAI,QAAQ,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,oCAAoC,EAAE,EAAE,CAAC,CAAC;IAClG,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,gDAAgD,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACtF,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE;YACrD,MAAM,EAAE,GAAG;YACX,OAAO,EAAE,EAAE,cAAc,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,CAAC,mBAAmB,CAAC,EAAE;SACrG,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { getBlogContext, getPageContext } from "./context.js";
|
|
2
|
+
export { serveBlogRss } from "./discovery.js";
|
|
3
|
+
export { refreshBlogCache } from "./refresh.js";
|
|
4
|
+
export { BLOG_CACHE_TAG, getPublishedArticles, getPublishedTerms, getTextBySlug } from "./data.js";
|
|
5
|
+
export { createOgFontLoader, loadBrandOgFonts, type OgFontLoaderOptions, type OgFontsResult } from "./og-fonts.js";
|
|
6
|
+
export { BlogArticleOgImage, getOgColors, getOgFontFamily, OG_IMAGE_SIZE, renderArticleOgImage, type OgFont, type RenderArticleOgImageInput } from "./og-image.js";
|
|
7
|
+
export type { OgFontSource, OgFontWeight } from "../options.js";
|
|
8
|
+
export { BlogArticlePage, BlogIndexPage, BlogMethodPage, generateArticleMetadata, generateBlogIndexMetadata, generateBlogStaticParams, generateGlossaryIndexMetadata, generateMethodMetadata, generateTermMetadata, GlossaryIndexPage, GlossaryTermPage, type BlogArticlePageProps, type BlogIndexPageProps, type GlossaryTermPageProps, } from "./pages.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/next/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AACnH,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAE,KAAK,MAAM,EAAE,KAAK,yBAAyB,EAAE,MAAM,eAAe,CAAC;AACnK,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EACL,eAAe,EACf,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// The Next.js adapter of @softure-ai/blog: the pages, their metadata, the article's OG image, the RSS
|
|
2
|
+
// feed, the cache refresh route and the cached reads (docs/02-module-standard.md §8).
|
|
3
|
+
export { getBlogContext, getPageContext } from "./context.js";
|
|
4
|
+
export { serveBlogRss } from "./discovery.js";
|
|
5
|
+
export { refreshBlogCache } from "./refresh.js";
|
|
6
|
+
export { BLOG_CACHE_TAG, getPublishedArticles, getPublishedTerms, getTextBySlug } from "./data.js";
|
|
7
|
+
export { createOgFontLoader, loadBrandOgFonts } from "./og-fonts.js";
|
|
8
|
+
export { BlogArticleOgImage, getOgColors, getOgFontFamily, OG_IMAGE_SIZE, renderArticleOgImage } from "./og-image.js";
|
|
9
|
+
export { BlogArticlePage, BlogIndexPage, BlogMethodPage, generateArticleMetadata, generateBlogIndexMetadata, generateBlogStaticParams, generateGlossaryIndexMetadata, generateMethodMetadata, generateTermMetadata, GlossaryIndexPage, GlossaryTermPage, } from "./pages.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/next/index.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,sFAAsF;AACtF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAgD,MAAM,eAAe,CAAC;AACnH,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAA+C,MAAM,eAAe,CAAC;AAEnK,OAAO,EACL,eAAe,EACf,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GAIjB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { OgFontSource } from "../options.js";
|
|
2
|
+
import { type OgFontsResult } from "../server/og-fonts.js";
|
|
3
|
+
export { createOgFontLoader, type OgFontLoaderOptions, type OgFontsResult } from "../server/og-fonts.js";
|
|
4
|
+
/** The brand's fonts for the card, read from the app's root (where Next runs) and cached. */
|
|
5
|
+
export declare function loadBrandOgFonts(fonts: readonly OgFontSource[]): Promise<OgFontsResult>;
|
|
6
|
+
//# sourceMappingURL=og-fonts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"og-fonts.d.ts","sourceRoot":"","sources":["../../src/next/og-fonts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAIzG,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAEvF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createOgFontLoader } from "../server/og-fonts.js";
|
|
2
|
+
export { createOgFontLoader } from "../server/og-fonts.js";
|
|
3
|
+
const loadFromApp = createOgFontLoader({ root: process.cwd() });
|
|
4
|
+
/** The brand's fonts for the card, read from the app's root (where Next runs) and cached. */
|
|
5
|
+
export function loadBrandOgFonts(fonts) {
|
|
6
|
+
return loadFromApp(fonts);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=og-fonts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"og-fonts.js","sourceRoot":"","sources":["../../src/next/og-fonts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAsB,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,kBAAkB,EAAgD,MAAM,uBAAuB,CAAC;AAEzG,MAAM,WAAW,GAAG,kBAAkB,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAEhE,6FAA6F;AAC7F,MAAM,UAAU,gBAAgB,CAAC,KAA8B;IAC7D,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ImageResponse } from "next/og";
|
|
2
|
+
import type { BlogOptions } from "../options.js";
|
|
3
|
+
import type { OgFont } from "../server/og-fonts.js";
|
|
4
|
+
export type { OgFont } from "../server/og-fonts.js";
|
|
5
|
+
/** The card's size: the 1.91:1 every network crops to. */
|
|
6
|
+
export declare const OG_IMAGE_SIZE: {
|
|
7
|
+
readonly width: 1200;
|
|
8
|
+
readonly height: 630;
|
|
9
|
+
};
|
|
10
|
+
export interface RenderArticleOgImageInput {
|
|
11
|
+
readonly title: string;
|
|
12
|
+
/** Under the title: the blog's name. */
|
|
13
|
+
readonly label: string;
|
|
14
|
+
readonly brand: BlogOptions["brand"];
|
|
15
|
+
/** Fonts for the card; `next/og`'s default font otherwise. */
|
|
16
|
+
readonly fonts?: readonly OgFont[];
|
|
17
|
+
}
|
|
18
|
+
/** The card's colours: the brand's, else the dark scheme of @softure-ai/ui's default theme. */
|
|
19
|
+
export declare function getOgColors(brand: BlogOptions["brand"]): {
|
|
20
|
+
background: string;
|
|
21
|
+
foreground: string;
|
|
22
|
+
accent: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The card's `font-family`: every family it is given, once each and in order, so a second family (a
|
|
26
|
+
* `latin-ext` subset file under its own name) draws the characters the first lacks.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getOgFontFamily(fonts: readonly OgFont[]): string | undefined;
|
|
29
|
+
export declare function renderArticleOgImage({ title, label, brand, fonts }: RenderArticleOgImageInput): ImageResponse;
|
|
30
|
+
/** The default export of an article's `opengraph-image.tsx`. */
|
|
31
|
+
export declare function BlogArticleOgImage({ params }: {
|
|
32
|
+
readonly params: Promise<{
|
|
33
|
+
readonly slug: string;
|
|
34
|
+
}>;
|
|
35
|
+
}): Promise<ImageResponse>;
|
|
36
|
+
//# sourceMappingURL=og-image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"og-image.d.ts","sourceRoot":"","sources":["../../src/next/og-image.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAMpD,YAAY,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD,0DAA0D;AAC1D,eAAO,MAAM,aAAa;;;CAAwC,CAAC;AAGnE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAOnH;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAG5E;AAED,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,yBAAyB,GAAG,aAAa,CA4B7G;AAQD,gEAAgE;AAChE,wBAAsB,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAUpI"}
|