diff options
| author | Joe Carstairs <me@joeac.net> | 2026-03-21 20:35:45 +0000 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-03-21 20:35:45 +0000 |
| commit | 18ac414a8f89f0c5937d27758858ca2a7ad8e418 (patch) | |
| tree | 95424a96e21846c76ac7622f5f24d2a103b245f7 /src | |
| parent | 76766d5f29d02f3a90b15b00612dc459ef5afe59 (diff) | |
factors out body and slug in getEntryInfo()
Diffstat (limited to 'src')
| -rw-r--r-- | src/index.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/index.ts b/src/index.ts index f5e0d9b..fc5848e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -48,11 +48,15 @@ export default function gemtext(config: GemtextConfig = {}): AstroIntegration { } catch { } } + const body = lines.slice(bodyStartLineIndex).join('\n'); + + const slug = typeof data['slug'] === 'string' ? data['slug'] : fileUrl.pathname; + return { data, rawData: frontmatter, - body: lines.slice(bodyStartLineIndex).join('\n'), - slug: typeof data['slug'] === 'string' ? data['slug'] : fileUrl.pathname, + body, + slug, }; }, }) |
