Functions
local_loader
Create a local filesystem content loader.
local_loader
def local_loader(directory: str | Path) -> ContentSource
Create a local filesystem content loader.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
directory |
str | Path |
— | Path to content directory (relative to site root) |
Returns
LocalSource instanceContentSource
—
github_loader
Create a GitHub repository content loader.
Fetches markdown files from a GitHub repository. Suppor…
github_loader
def github_loader(repo: str) -> ContentSource
Create a GitHub repository content loader.
Fetches markdown files from a GitHub repository. Supports both public and private repositories (with token).
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
repo |
str |
— | Repository in "owner/repo" format |
Returns
GitHubSource instance Requires:ContentSource
— pip install bengal[github]
rest_loader
Create a REST API content loader.
Fetches content from any REST API that returns JSON.
rest_loader
def rest_loader(url: str) -> ContentSource
Create a REST API content loader.
Fetches content from any REST API that returns JSON.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
url |
str |
— | API endpoint URL |
Returns
RESTSource instance Requires:ContentSource
— pip install bengal[rest] # includes aiohttp
notion_loader
Create a Notion database content loader.
Fetches pages from a Notion database and converts them to…
notion_loader
def notion_loader(database_id: str) -> ContentSource
Create a Notion database content loader.
Fetches pages from a Notion database and converts them to markdown.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
database_id |
str |
— | Notion database ID (from URL or API) |
Returns
NotionSource instance Requires: Setup:ContentSource
— pip install bengal[notion]1. Create integration at https://www.notion.so/my-integrations
2. Share database with the integration
3. Set NOTION_TOKEN env var or pass token parameter