summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authoraspizu <aspizu@protonmail.com>2025-03-10 04:12:38 +0530
committeraspizu <aspizu@protonmail.com>2025-03-10 04:12:38 +0530
commitb04c5eb7f783f8f83931fc8b479fd8aa45d7c00c (patch)
tree359cb03abc6ef394e0095c59448f7cc4c4369e10 /README.md
parent1656bbef4ac09f60d901c372617312888dd147d9 (diff)
feat: update README and package.json for version 0.3.0; add titleFormat option to GemtextConfig
Diffstat (limited to 'README.md')
-rw-r--r--README.md30
1 files changed, 25 insertions, 5 deletions
diff --git a/README.md b/README.md
index f1f566a..659f746 100644
--- a/README.md
+++ b/README.md
@@ -2,10 +2,15 @@
![https://www.npmjs.com/package/astro-gemtext](https://img.shields.io/npm/dm/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
-```
-bun add --save astro-gemtext
+```shell
+npm install astro-gemtext
```
Add to `astro.config.mjs`
@@ -18,9 +23,13 @@ export default defineConfig({
})
```
+> [!IMPORTANT]
+> If you do not provide a layout option, Astro's HMR (Hot Module Reloading) and toolbar
+> will not work.
+
## Usage
-Create a `/src/pages/example.gmi` file
+Create a .gmi file in your project, for example:
```gmi
# Hello World
@@ -35,5 +44,16 @@ This is a gemtext file.
### `layout`
The layout to use for the page. Set to an absolute import path such as
-`/src/layouts/Layout.astro`. If you do not use a layout, you will not get HMR, or the
-Astro toolbar.
+`/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.