diff options
| author | Joe Carstairs <me@joeac.net> | 2026-03-21 22:20:38 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-03-21 22:20:38 +0000 |
| commit | 1248542cc6b509a1b070ed5812ca5c327823a018 (patch) | |
| tree | 8c1343046f3bf63f25f74a96e845ae900dff11d8 /src/index.ts | |
| parent | 237990619e1f5a4ea9223f603d1ce599bc3b0fd1 (diff) | |
remove cruft: just a content entry type now!
Diffstat (limited to 'src/index.ts')
| -rw-r--r-- | src/index.ts | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/index.ts b/src/index.ts index 4e20848..86ef18a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,19 +1,8 @@ import type {AstroIntegration, ContentEntryType, HookParameters} from "astro" import {fileURLToPath} from "url" -import gemtextVitePlugin from "./vitePlugin.js" import {parse as parseYaml} from "yaml" -/** Gemtext configuration options */ -export interface GemtextConfig { - /** Absolute import path to the layout to use for all gemtext pages. - * If not provided, HMR and the Astro toolbar will not work. (default: none) */ - layout?: string - /** The format to use for the page title. Can be one of: - * - `first-heading`: The first heading in the document will be used as the title. (default) - * - `filename`: The filename of the document will be used as the title. - */ - titleFormat?: "first-heading" | "filename" -} +export interface GemtextConfig {} type SetupHookParams = HookParameters<"astro:config:setup"> & { // `addPageExtension` and `contentEntryType` are not a public APIs @@ -23,9 +12,6 @@ type SetupHookParams = HookParameters<"astro:config:setup"> & { } export default function gemtext(config: GemtextConfig = {}): AstroIntegration { - if (!config.titleFormat) { - config.titleFormat = "first-heading" - } return { name: "astro-gemtext", hooks: { @@ -35,10 +21,10 @@ export default function gemtext(config: GemtextConfig = {}): AstroIntegration { params.addContentEntryType({ extensions: [".gmi"], getRenderFunction: async (config) => { - return async (entry) => ({ - html: entry.body ?? '', - frontmatter: entry.data, - }); + return async (entry) => ({ + html: entry.body ?? "", + frontmatter: entry.data, + }) }, getEntryInfo: async ({fileUrl, contents}) => { const lines = contents.split("\n") @@ -81,11 +67,6 @@ export default function gemtext(config: GemtextConfig = {}): AstroIntegration { } }, }) - params.updateConfig({ - vite: { - plugins: [gemtextVitePlugin(config)], - }, - }) }, }, } |
