@ninjainfosys/site-kit 0.5.0 → 0.5.1
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 +6 -0
- package/package.json +19 -6
- package/src/lib/rehype-posts.mjs +3 -2
package/README.md
CHANGED
|
@@ -70,6 +70,12 @@ The header is data. `kit.header` carries the logo, the utility strip, mega-menu
|
|
|
70
70
|
|
|
71
71
|
A post whose `date` is after the build day (YYYY-MM-DD) is left out of every production page: the post, the blog front, tag and page lists, RSS, llms.txt, share cards, related and read-next, and so the sitemap. It appears on a rebuild on or after its date. This works like the glossary's `published` date. `SHOW_SCHEDULED=1` shows scheduled posts in a build, and the dev server always shows them (and drafts). Drafts stay out of production. Posts on the same day are ordered by id, so a build does not depend on cache state.
|
|
72
72
|
|
|
73
|
+
## Post bodies
|
|
74
|
+
|
|
75
|
+
- **Links to posts that do not ship.** In a build, a link to `/blog/<slug>` in a post or glossary body becomes plain text when that post is a draft or scheduled for later. Links to posts that do not exist are left as written. The dev server keeps every link.
|
|
76
|
+
- **Tables.** Tables in blog posts are wrapped at build time in a bordered scroll box (`.table-scroll`). The header stays at the top and the first column at the left while scrolling sideways, rows are zebra-striped with a hover tint, and columns that are mostly numbers or prices get class `num` (right-aligned, no wrapping). Markdown outside `src/content/blog` is left alone. Glossary bodies are plain paragraphs and lists and have no tables.
|
|
77
|
+
- **Updated date.** The post meta line shows "Updated" only when `updated` is a later day than `date`; structured data still uses `updated ?? date`.
|
|
78
|
+
|
|
73
79
|
## Commands
|
|
74
80
|
|
|
75
81
|
`site-kit <command>` runs from the site's root and reads `site-kit.config.mjs` there.
|
package/package.json
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninjainfosys/site-kit",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Shared blog, glossary, SEO, layout and build tooling for the Ninja Infosys Astro marketing sites.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"repository": {
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://git.ninjainfosys.com/ninja-infosys/site-kit.git"
|
|
10
|
+
},
|
|
8
11
|
"exports": {
|
|
9
|
-
"./integration": {
|
|
12
|
+
"./integration": {
|
|
13
|
+
"types": "./src/integration.d.mts",
|
|
14
|
+
"default": "./src/integration.mjs"
|
|
15
|
+
},
|
|
10
16
|
"./contract": "./src/contract.ts",
|
|
11
17
|
"./config": "./src/config.ts",
|
|
12
18
|
"./components/*": "./src/components/*",
|
|
@@ -18,9 +24,16 @@
|
|
|
18
24
|
"./scripts/*": "./src/scripts/*",
|
|
19
25
|
"./package.json": "./package.json"
|
|
20
26
|
},
|
|
21
|
-
"bin": {
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
"bin": {
|
|
28
|
+
"site-kit": "bin/site-kit.mjs"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"src",
|
|
32
|
+
"bin"
|
|
33
|
+
],
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=20"
|
|
36
|
+
},
|
|
24
37
|
"peerDependencies": {
|
|
25
38
|
"astro": "^5"
|
|
26
39
|
},
|
package/src/lib/rehype-posts.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Rehype steps for post bodies.
|
|
2
2
|
//
|
|
3
|
-
// rehypeTables wraps each table in a scroll box (so the page never scrolls
|
|
3
|
+
// rehypeTables (blog posts only) wraps each table in a scroll box (so the page never scrolls
|
|
4
4
|
// sideways) and marks the columns of mostly numbers and prices with class
|
|
5
5
|
// `num`, which the post styles right-align.
|
|
6
6
|
//
|
|
@@ -49,7 +49,8 @@ export function rehypeTables() {
|
|
|
49
49
|
return child;
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
// Only blog posts: legal pages and other Markdown keep their tables as written.
|
|
53
|
+
return (tree, file) => { if (/[\\/]content[\\/]blog[\\/]/.test(String(file?.path ?? ''))) walk(tree); };
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
export function rehypeUnlinkHidden(options = {}) {
|