mirror of
https://github.com/quartz-community/content-page.git
synced 2026-07-22 02:50:24 +00:00
chore: commit dist/ and remove prepare script
Pre-built output is now committed to the repository so that Quartz can skip the build step during plugin installation. The prepare script is removed to prevent redundant builds when installing from npm/git.
This commit is contained in:
parent
7066328215
commit
547194c22d
12 changed files with 83 additions and 8 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -4,7 +4,6 @@ node_modules/
|
|||
.pnp.js
|
||||
|
||||
# Build output
|
||||
dist/
|
||||
build/
|
||||
*.tsbuildinfo
|
||||
|
||||
|
|
|
|||
7
dist/components/index.d.ts
vendored
Normal file
7
dist/components/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { QuartzComponent } from '@quartz-community/types';
|
||||
|
||||
interface ContentBodyOptions {
|
||||
}
|
||||
declare const _default: () => QuartzComponent;
|
||||
|
||||
export { _default as ContentBody, type ContentBodyOptions };
|
||||
18
dist/components/index.js
vendored
Normal file
18
dist/components/index.js
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { htmlToJsx } from '@quartz-community/utils/jsx';
|
||||
import { jsx } from 'preact/jsx-runtime';
|
||||
|
||||
// src/components/ContentBody.tsx
|
||||
var ContentBody_default = (() => {
|
||||
const ContentBody = ({ fileData, tree }) => {
|
||||
const content = htmlToJsx(tree);
|
||||
const frontmatter = fileData?.frontmatter;
|
||||
const classes = frontmatter?.cssclasses ?? [];
|
||||
const classString = ["popover-hint", ...classes].join(" ");
|
||||
return /* @__PURE__ */ jsx("article", { class: classString, children: content });
|
||||
};
|
||||
return ContentBody;
|
||||
});
|
||||
|
||||
export { ContentBody_default as ContentBody };
|
||||
//# sourceMappingURL=index.js.map
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
dist/components/index.js.map
vendored
Normal file
1
dist/components/index.js.map
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../../src/components/ContentBody.tsx"],"names":[],"mappings":";;;;AAcA,IAAO,uBAAS,MAAM;AACpB,EAAA,MAAM,WAAA,GAA+B,CAAC,EAAE,QAAA,EAAU,MAAK,KAA4B;AACjF,IAAA,MAAM,OAAA,GAAU,UAAU,IAAY,CAAA;AAEtC,IAAA,MAAM,cAAc,QAAA,EAAU,WAAA;AAC9B,IAAA,MAAM,OAAA,GAAU,WAAA,EAAa,UAAA,IAAc,EAAC;AAC5C,IAAA,MAAM,cAAc,CAAC,cAAA,EAAgB,GAAG,OAAO,CAAA,CAAE,KAAK,GAAG,CAAA;AAEzD,IAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAQ,KAAA,EAAO,WAAA,EAAc,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,EAC/C,CAAA;AAEA,EAAA,OAAO,WAAA;AACT,CAAA","file":"index.js","sourcesContent":["import type {\n QuartzComponent,\n QuartzComponentConstructor,\n QuartzComponentProps,\n} from \"@quartz-community/types\";\nimport { htmlToJsx } from \"@quartz-community/utils/jsx\";\nimport type { Node } from \"hast\";\n\nexport interface ContentBodyOptions {}\n\ntype FrontmatterWithClasses = {\n cssclasses?: string[];\n};\n\nexport default (() => {\n const ContentBody: QuartzComponent = ({ fileData, tree }: QuartzComponentProps) => {\n const content = htmlToJsx(tree as Node);\n\n const frontmatter = fileData?.frontmatter as FrontmatterWithClasses | undefined;\n const classes = frontmatter?.cssclasses ?? [];\n const classString = [\"popover-hint\", ...classes].join(\" \");\n\n return <article class={classString}>{content}</article>;\n };\n\n return ContentBody;\n}) satisfies QuartzComponentConstructor;\n"]}
|
||||
9
dist/index.d.ts
vendored
Normal file
9
dist/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
export { ContentBody, ContentBodyOptions } from './components/index.js';
|
||||
import { QuartzPageTypePlugin } from '@quartz-community/types';
|
||||
export { PageMatcher, QuartzComponent, QuartzComponentConstructor, QuartzComponentProps, QuartzPageTypePlugin, QuartzPageTypePluginInstance } from '@quartz-community/types';
|
||||
|
||||
interface ContentPageOptions {
|
||||
}
|
||||
declare const ContentPage: QuartzPageTypePlugin<ContentPageOptions>;
|
||||
|
||||
export { ContentPage, type ContentPageOptions };
|
||||
32
dist/index.js
vendored
Normal file
32
dist/index.js
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { htmlToJsx } from '@quartz-community/utils/jsx';
|
||||
import { jsx } from 'preact/jsx-runtime';
|
||||
|
||||
// src/components/ContentBody.tsx
|
||||
var ContentBody_default = (() => {
|
||||
const ContentBody = ({ fileData, tree }) => {
|
||||
const content = htmlToJsx(tree);
|
||||
const frontmatter = fileData?.frontmatter;
|
||||
const classes = frontmatter?.cssclasses ?? [];
|
||||
const classString = ["popover-hint", ...classes].join(" ");
|
||||
return /* @__PURE__ */ jsx("article", { class: classString, children: content });
|
||||
};
|
||||
return ContentBody;
|
||||
});
|
||||
|
||||
// src/pageType.ts
|
||||
var contentMatcher = ({ slug }) => {
|
||||
if (slug.endsWith("/index")) return false;
|
||||
if (slug.startsWith("tags/")) return false;
|
||||
return true;
|
||||
};
|
||||
var ContentPage = () => ({
|
||||
name: "ContentPage",
|
||||
priority: 0,
|
||||
match: contentMatcher,
|
||||
layout: "content",
|
||||
body: ContentBody_default
|
||||
});
|
||||
|
||||
export { ContentBody_default as ContentBody, ContentPage };
|
||||
//# sourceMappingURL=index.js.map
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
dist/index.js.map
vendored
Normal file
1
dist/index.js.map
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/components/ContentBody.tsx","../src/pageType.ts"],"names":[],"mappings":";;;;AAcA,IAAO,uBAAS,MAAM;AACpB,EAAA,MAAM,WAAA,GAA+B,CAAC,EAAE,QAAA,EAAU,MAAK,KAA4B;AACjF,IAAA,MAAM,OAAA,GAAU,UAAU,IAAY,CAAA;AAEtC,IAAA,MAAM,cAAc,QAAA,EAAU,WAAA;AAC9B,IAAA,MAAM,OAAA,GAAU,WAAA,EAAa,UAAA,IAAc,EAAC;AAC5C,IAAA,MAAM,cAAc,CAAC,cAAA,EAAgB,GAAG,OAAO,CAAA,CAAE,KAAK,GAAG,CAAA;AAEzD,IAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAQ,KAAA,EAAO,WAAA,EAAc,QAAA,EAAA,OAAA,EAAQ,CAAA;AAAA,EAC/C,CAAA;AAEA,EAAA,OAAO,WAAA;AACT,CAAA;;;ACrBA,IAAM,cAAA,GAA8B,CAAC,EAAE,IAAA,EAAK,KAAM;AAChD,EAAA,IAAI,IAAA,CAAK,QAAA,CAAS,QAAQ,CAAA,EAAG,OAAO,KAAA;AACpC,EAAA,IAAI,IAAA,CAAK,UAAA,CAAW,OAAO,CAAA,EAAG,OAAO,KAAA;AACrC,EAAA,OAAO,IAAA;AACT,CAAA;AAEO,IAAM,cAAwD,OAAO;AAAA,EAC1E,IAAA,EAAM,aAAA;AAAA,EACN,QAAA,EAAU,CAAA;AAAA,EACV,KAAA,EAAO,cAAA;AAAA,EACP,MAAA,EAAQ,SAAA;AAAA,EACR,IAAA,EAAM;AACR,CAAA","file":"index.js","sourcesContent":["import type {\n QuartzComponent,\n QuartzComponentConstructor,\n QuartzComponentProps,\n} from \"@quartz-community/types\";\nimport { htmlToJsx } from \"@quartz-community/utils/jsx\";\nimport type { Node } from \"hast\";\n\nexport interface ContentBodyOptions {}\n\ntype FrontmatterWithClasses = {\n cssclasses?: string[];\n};\n\nexport default (() => {\n const ContentBody: QuartzComponent = ({ fileData, tree }: QuartzComponentProps) => {\n const content = htmlToJsx(tree as Node);\n\n const frontmatter = fileData?.frontmatter as FrontmatterWithClasses | undefined;\n const classes = frontmatter?.cssclasses ?? [];\n const classString = [\"popover-hint\", ...classes].join(\" \");\n\n return <article class={classString}>{content}</article>;\n };\n\n return ContentBody;\n}) satisfies QuartzComponentConstructor;\n","import type { PageMatcher, QuartzPageTypePlugin } from \"@quartz-community/types\";\nimport ContentBody from \"./components/ContentBody\";\n\nexport interface ContentPageOptions {}\n\nconst contentMatcher: PageMatcher = ({ slug }) => {\n if (slug.endsWith(\"/index\")) return false;\n if (slug.startsWith(\"tags/\")) return false;\n return true;\n};\n\nexport const ContentPage: QuartzPageTypePlugin<ContentPageOptions> = () => ({\n name: \"ContentPage\",\n priority: 0,\n match: contentMatcher,\n layout: \"content\",\n body: ContentBody,\n});\n"]}
|
||||
3
dist/types.d.ts
vendored
Normal file
3
dist/types.d.ts
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export { BuildCtx, PageGenerator, PageMatcher, ProcessedContent, QuartzPageTypePlugin, QuartzPageTypePluginInstance, QuartzPluginData, StaticResources, VirtualPage } from '@quartz-community/types';
|
||||
export { ContentPageOptions } from './index.js';
|
||||
export { ContentBodyOptions } from './components/index.js';
|
||||
3
dist/types.js
vendored
Normal file
3
dist/types.js
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
//# sourceMappingURL=types.js.map
|
||||
//# sourceMappingURL=types.js.map
|
||||
1
dist/types.js.map
vendored
Normal file
1
dist/types.js.map
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
||||
14
package-lock.json
generated
14
package-lock.json
generated
|
|
@ -10,10 +10,7 @@
|
|||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@quartz-community/types": "github:quartz-community/types",
|
||||
"@quartz-community/utils": "github:quartz-community/utils",
|
||||
"tsup": "^8.5.0",
|
||||
"typescript": "^5.9.3",
|
||||
"vfile": "^6.0.3"
|
||||
"@quartz-community/utils": "github:quartz-community/utils"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/hast": "^3.0.4",
|
||||
|
|
@ -26,6 +23,8 @@
|
|||
"preact": "^10.28.2",
|
||||
"prettier": "^3.6.2",
|
||||
"sass": "^1.97.3",
|
||||
"tsup": "^8.5.0",
|
||||
"typescript": "^5.9.3",
|
||||
"vitest": "^2.1.9"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -34,7 +33,8 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@jackyzha0/quartz": "^4.5.2",
|
||||
"preact": "^10.0.0"
|
||||
"preact": "^10.0.0",
|
||||
"vfile": "^6.0.3"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@jackyzha0/quartz": {
|
||||
|
|
@ -42,6 +42,9 @@
|
|||
},
|
||||
"preact": {
|
||||
"optional": false
|
||||
},
|
||||
"vfile": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -4046,7 +4049,6 @@
|
|||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.11",
|
||||
"picocolors": "^1.1.1",
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@
|
|||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"prepare": "npm run build",
|
||||
"dev": "tsup --watch",
|
||||
"lint": "eslint . --max-warnings=0",
|
||||
"format": "prettier . --check",
|
||||
|
|
|
|||
Loading…
Reference in a new issue