@hagicode/hagilight-starlight 0.2.3 → 0.2.4-dev.40.1.3e068a4

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.
@@ -0,0 +1,8 @@
1
+ import type { ZodBoolean, ZodObject, ZodOptional } from "astro/zod";
2
+
3
+ export const aiDisclosureSchema: ZodObject<{
4
+ isAITranslation: ZodOptional<ZodBoolean>;
5
+ isAIAuthor: ZodOptional<ZodBoolean>;
6
+ }>;
7
+
8
+ export { aiDisclosureSchema as default };
@@ -0,0 +1,7 @@
1
+ import type { ZodBoolean, ZodObject, ZodOptional } from "astro/zod";
2
+
3
+ export const articlePromotionSchema: ZodObject<{
4
+ hagicodePromotion: ZodOptional<ZodBoolean>;
5
+ }>;
6
+
7
+ export { articlePromotionSchema as default };
package/index.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ import type { StarlightPlugin } from "@astrojs/starlight";
2
+
3
+ export interface HagilightOptions {
4
+ header?: boolean | { enabled?: boolean };
5
+ notFoundPage?: boolean | { enabled?: boolean };
6
+ rss?: boolean | { enabled?: boolean };
7
+ analytics?: Record<string, unknown>;
8
+ seo?: unknown;
9
+ contentComponents?: Record<string, boolean>;
10
+ aiDisclosures?: unknown;
11
+ hagicodePromotion?: unknown;
12
+ promoto?: { enabled?: boolean; links?: Record<string, string> };
13
+ links?: Record<string, string>;
14
+ [key: string]: unknown;
15
+ }
16
+
17
+ export default function hagilight(options?: HagilightOptions): StarlightPlugin;
package/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import { fileURLToPath } from 'node:url';
3
+ import { resolveFaviconHeadEntry } from '@hagicode/hagilight/favicon';
3
4
  import { resolveRssLocales, resolveRssOptions } from './rss-utils.mjs';
4
5
  import {
5
6
  isValidSeoImageReference,
@@ -499,6 +500,13 @@ export default function hagilight(options = {}) {
499
500
  attrs: { rel: 'alternate', type: 'application/rss+xml', href: rssFeedUrl },
500
501
  }] : []),
501
502
  { tag: 'script', content: contentWidthHeadScript },
503
+ ...(() => {
504
+ const entry = resolveFaviconHeadEntry(
505
+ config.head,
506
+ config.favicon === undefined ? {} : { href: config.favicon },
507
+ );
508
+ return entry ? [entry] : [];
509
+ })(),
502
510
  ],
503
511
  components: {
504
512
  ...config.components,
@@ -513,4 +521,4 @@ export default function hagilight(options = {}) {
513
521
  },
514
522
  },
515
523
  };
516
- }
524
+ }
package/locales.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export interface LocaleDefinition {
2
+ label: string;
3
+ lang: string;
4
+ }
5
+
6
+ export const locales: Record<string, LocaleDefinition>;
7
+
8
+ export { locales as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hagicode/hagilight-starlight",
3
- "version": "0.2.3",
3
+ "version": "0.2.4-dev.40.1.3e068a4",
4
4
  "type": "module",
5
5
  "description": "Starlight customizations for HagiCode documentation",
6
6
  "repository": {
@@ -13,12 +13,30 @@
13
13
  "provenance": true
14
14
  },
15
15
  "exports": {
16
- ".": "./index.mjs",
17
- "./locales": "./locales.mjs",
18
- "./article-promotion-schema": "./article-promotion-schema.mjs",
19
- "./ai-disclosure-schema": "./ai-disclosure-schema.mjs",
20
- "./rss-schema": "./rss-schema.mjs",
21
- "./seo-schema": "./seo-schema.mjs",
16
+ ".": {
17
+ "types": "./index.d.ts",
18
+ "default": "./index.mjs"
19
+ },
20
+ "./locales": {
21
+ "types": "./locales.d.ts",
22
+ "default": "./locales.mjs"
23
+ },
24
+ "./article-promotion-schema": {
25
+ "types": "./article-promotion-schema.d.ts",
26
+ "default": "./article-promotion-schema.mjs"
27
+ },
28
+ "./ai-disclosure-schema": {
29
+ "types": "./ai-disclosure-schema.d.ts",
30
+ "default": "./ai-disclosure-schema.mjs"
31
+ },
32
+ "./rss-schema": {
33
+ "types": "./rss-schema.d.ts",
34
+ "default": "./rss-schema.mjs"
35
+ },
36
+ "./seo-schema": {
37
+ "types": "./seo-schema.d.ts",
38
+ "default": "./seo-schema.mjs"
39
+ },
22
40
  "./ContentLayoutToggle": "./ContentLayoutToggle.astro",
23
41
  "./Header": "./Header.astro",
24
42
  "./Footer": "./Footer.astro",
@@ -30,15 +48,17 @@
30
48
  },
31
49
  "files": [
32
50
  "index.mjs",
51
+ "index.d.ts",
33
52
  "*.css",
34
53
  "*.mjs",
54
+ "*.d.ts",
35
55
  "rss*.xml.ts",
36
56
  "*.astro",
37
57
  "assets/*.png"
38
58
  ],
39
59
  "dependencies": {
40
60
  "@astrojs/rss": "^4.0.19",
41
- "@hagicode/hagilight": "0.2.3"
61
+ "@hagicode/hagilight": "0.2.4-dev.40.1.3e068a4"
42
62
  },
43
63
  "peerDependencies": {
44
64
  "@astrojs/starlight": "^0.42.4",
@@ -0,0 +1,7 @@
1
+ import type { ZodBoolean, ZodObject, ZodOptional } from "astro/zod";
2
+
3
+ export const rssSchema: ZodObject<{
4
+ rss: ZodOptional<ZodBoolean>;
5
+ }>;
6
+
7
+ export { rssSchema as default };
@@ -0,0 +1,21 @@
1
+ import type {
2
+ ZodDate,
3
+ ZodObject,
4
+ ZodOptional,
5
+ ZodString,
6
+ } from "astro/zod";
7
+
8
+ export const seoSchema: ZodObject<{
9
+ seo: ZodOptional<
10
+ ZodObject<{
11
+ title: ZodOptional<ZodString>;
12
+ description: ZodOptional<ZodString>;
13
+ image: ZodOptional<ZodString>;
14
+ author: ZodOptional<ZodString>;
15
+ publishedDate: ZodOptional<ZodDate>;
16
+ }>
17
+ >;
18
+ }>;
19
+
20
+ export { seoSchema as seoFrontmatterSchema };
21
+ export { seoSchema as default };