https://github.com/aspizu/astro-gemtext
gemtext integration for Astro
https://github.com/aspizu/astro-gemtext
astro gemini-protocol
Last synced: 2 months ago
JSON representation
gemtext integration for Astro
- Host: GitHub
- URL: https://github.com/aspizu/astro-gemtext
- Owner: aspizu
- License: mit
- Created: 2025-03-09T21:28:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-09T22:15:05.000Z (over 1 year ago)
- Last Synced: 2025-03-09T22:25:55.321Z (over 1 year ago)
- Topics: astro, gemini-protocol
- Language: TypeScript
- Homepage:
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `astro-gemtext`

`astro-gemtext` is the Astro integration for [gemtext](https://geminiprotocol.net/)
documents. gemtext is a hypertext markup language used in the Gemini protocol. This
integration allows you to use `.gmi` files as pages in your Astro site. Just install
the integration and `.gmi` files in `/src/pages` will be rendered as HTML.
## Installation
```shell
npm install astro-gemtext
```
Add to `astro.config.mjs`
```ts
import gemtext from "astro-gemtext"
export default defineConfig({
integrations: [gemtext({layout: "/src/layouts/Layout.astro"})],
})
```
> [!IMPORTANT]
> If you do not provide a layout option, Astro's HMR (Hot Module Reloading) and toolbar
> will not work.
## Usage
Create a .gmi file in your project, for example:
```gmi
# Hello World
This is a gemtext file.
=> gemtext.gemini README.md
```
## Configuration
### `layout`
The layout to use for the page. Set to an absolute import path such as
`/src/layouts/Layout.astro`.
Will be provided the `title` prop.
If you do not provide a layout option, Astro's HMR (Hot Module Reloading) and toolbar
will not work.
### `titleFormat`
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.
The title is passed to the layout as the `title` prop.