@ninjainfosys/site-kit 0.3.0 → 0.3.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 -5
- package/package.json +1 -1
- package/src/components/blog/PostCard.astro +1 -2
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ The package ships `.astro` and `.ts` source. The integration tells Vite to compi
|
|
|
37
37
|
|
|
38
38
|
| Page | Routes | Turn off with |
|
|
39
39
|
| --- | --- | --- |
|
|
40
|
-
| `blog` | `/blog`, `/blog/[slug]`, `/blog/page/[page]`, `/blog/tag/[tag]` | `pages: { blog: false }` |
|
|
40
|
+
| `blog` | `/blog`, `/blog/[slug]`, `/blog/page/[page]`, `/blog/tag/[tag]` | `pages: { blog: false }` (a site whose blog keeps its earlier layout supplies its own blog pages and still uses the kit's Pager, PostList and Topics) |
|
|
41
41
|
| `glossary` | `/glossary`, `/glossary/[slug]` | `pages: { glossary: false }` |
|
|
42
42
|
| `og` | `/og/[...slug].png` | `pages: { og: false }` |
|
|
43
43
|
| `rss` | `/rss.xml` | `pages: { rss: false }` |
|
|
@@ -49,11 +49,12 @@ The types are in `src/contract.ts`. A site provides these files under `src/`.
|
|
|
49
49
|
|
|
50
50
|
| File | What the kit reads |
|
|
51
51
|
| --- | --- |
|
|
52
|
-
| `config/site.ts` | `SITE_URL`, `SITE_NAME` (required). Optional: `COMPANY`, `CONTACT_EMAIL`, `CONTACT_PHONE_DISPLAY`, `CONTACT_PHONE_TEL`, `CONTACT_PHONE_JSONLD`, `OFFICE_LINE`, `LEGAL_ADDRESS`, `LEGAL_ADDRESS_LINE`, `SOCIAL_PROFILES
|
|
53
|
-
| `config/kit.ts` | `export const kit: SiteKit`. Required: `header`, `
|
|
52
|
+
| `config/site.ts` | `SITE_URL`, `SITE_NAME` (required). Optional: `COMPANY`, `CONTACT_EMAIL`, `CONTACT_PHONE_DISPLAY`, `CONTACT_PHONE_TEL`, `CONTACT_PHONE_JSONLD`, `OFFICE_LINE`, `LEGAL_ADDRESS`, `LEGAL_ADDRESS_LINE`, `SOCIAL_PROFILES` (an empty list is sent as `sameAs: []`), `PARENT_COMPANY_NAME`, `PARENT_COMPANY_URL`, `PARENT_COMPANY_ID`, `TAG_ACRONYMS` (shown in capitals in topic labels), `TAG_WORDS` (shown as written: `{ airfone: 'AirFone' }`). |
|
|
53
|
+
| `config/kit.ts` | `export const kit: SiteKit`. Required: `header`, `cta`, `og`, `llms`. Optional: `footer` (leave out when the site renders its own), `blog`, `seo`, `head`, `glossary`, `dashain`. `seo` can also replace the Organization data (`orgJsonLd`), the title rule (`titleFor`) and add WebPage data (`webPage`), an author meta and a robots meta. |
|
|
54
54
|
| `data/links.ts` | `productTags`, `productLink(slug)`, `productsForTags(tags)`, `solutionsForTags(tags)` (type `SiteLinks`). Return empty results on a site without products. |
|
|
55
|
-
| `layouts/Base.astro` | The site's layout. A site with nothing extra renders `@ninjainfosys/site-kit/layouts/Base.astro` and forwards its props. Slots on the kit layout: `head
|
|
55
|
+
| `layouts/Base.astro` | The site's layout. A site with nothing extra renders `@ninjainfosys/site-kit/layouts/Base.astro` and forwards its props. Slots on the kit layout: `head`, `head-end`, `header` and `footer` (the kit's Header and Footer are their fallbacks, so a site with its own footer passes it in `footer`), `scripts`, `body-end`. Write the slot elements with no whitespace between them or it leaks into `<main>`. |
|
|
56
56
|
| `styles/site.css` | Imports the site's fonts and tokens, then `@ninjainfosys/site-kit/styles/base.css` and `motion.css`, then rules only that site uses. |
|
|
57
|
+
| `components/BlogIndexExtra.astro` | Optional. Rendered under the pager of the blog front. |
|
|
57
58
|
| `data/glossary/terms/*.ts` | One `Term` per file, default export. Only when the glossary is on. |
|
|
58
59
|
| `content.config.ts` | The `blog` collection, with `postSchema` from `@ninjainfosys/site-kit/lib/blog-schema`. |
|
|
59
60
|
|
|
@@ -63,7 +64,7 @@ Site code imports kit modules by package path, for example `@ninjainfosys/site-k
|
|
|
63
64
|
|
|
64
65
|
### Header and footer
|
|
65
66
|
|
|
66
|
-
The header is data. `kit.header` carries the logo, the utility strip, mega-menu groups with one featured link each, plain links, the bar action and the mobile sheet links. `action.google: true` draws Google's own sign-in button with the link as its fallback.
|
|
67
|
+
The header is data. `kit.header` carries the logo, the utility strip, mega-menu groups with one featured link each, plain links, the bar action and the mobile sheet links. `action.google: true` draws Google's own sign-in button with the link as its fallback. `logo.kind: 'mark'` draws a mark and a name (`logo.text`) instead of a lockup; `logo.text` on a lockup adds a wordmark beside it. Sites style their own logo with `.site-header .bar .logo` rules in `styles/site.css`, which win over the kit's scoped ones. The kit's CSS names its accent `--lime`; a site whose accent has another name aliases it. `kit.footer` carries the mark and the link columns; contact lines come from `config/site.ts`.
|
|
67
68
|
|
|
68
69
|
## Commands
|
|
69
70
|
|
package/package.json
CHANGED
|
@@ -6,8 +6,7 @@ const { post, big = false, level = 'h2' } = Astro.props;
|
|
|
6
6
|
const d = post.data;
|
|
7
7
|
const H = level;
|
|
8
8
|
---
|
|
9
|
-
<article class:list={['card', { big, pic: !!d.cover }]}>
|
|
10
|
-
{d.cover && (
|
|
9
|
+
<article class:list={['card', { big, pic: !!d.cover }]}>{d.cover && ' '}{d.cover && (
|
|
11
10
|
<div class="thumb">
|
|
12
11
|
<Image src={d.cover} alt="" widths={big ? [600, 900, 1200] : [400, 600, 800]} sizes={big ? '(max-width: 900px) 100vw, 1200px' : '(max-width: 600px) 100vw, 400px'} loading={big ? 'eager' : 'lazy'} />
|
|
13
12
|
</div>
|