Welcome to the documentation portal for the CoMapeo platform. This site is built with Docusaurus, which powers a modern static website and supports features like multilingual content and automatic Markdown generation from our Notion database.
Install all dependencies with:
bun i
Before proceeding to local development, set up your environment and fetch the latest Notion Markdown files:
- Rename (or copy) .env.example to .env and update it with your Notion API key and Database ID.
- Fetch the Notion Markdown documentation by running:
bun notion:fetch
The bun notion:fetch
script pulls structured content from Notion and rewrites local docs. Keep these rules in mind so the output matches your expectations:
- Filter criteria: Only pages where
Status
equalsReady to publish
and theParent item
relation is empty are treated as parent records. Pages that fail either check are skipped. - Sub-page grouping: Parents must link their language variants through the
Sub-item
relation. Each linked child should setLanguage
toEnglish
,Spanish
, orPortuguese
. Any other language values are ignored. - Element Type field drives layout:
Element Type = Page
exports markdown, regenerates frontmatter, rewrites remote images understatic/images/
, and tracks compression savings for the summary.Element Type = Toggle
creates a folder (plus_category_.json
for English) and increments the “section folders” counter.Element Type = Heading
stores the heading for the nextPage
entry’s sidebar metadata and increments the “title sections applied” counter.
- Summary counters: The totals printed at the end reflect the actions above. Zeros mean no matching work occurred (for example, no toggles, no headings, or no images to optimize).
- Translations: When a non-English child page is processed, its title is written to
i18n/<locale>/code.json
using the parent’s English title as the key. Ensure those files exist before running the script. - Slug and edit URL: Markdown frontmatter derives the slug and
custom_edit_url
from the parent title. Adjust the Notion title to change the generated path. - Safety checks: Missing
NOTION_API_KEY
orDATABASE_ID
cause the script to exit early after logging an error. Other runtime failures (such as image download issues) are logged and processing continues for remaining pages.
Launch a local development server with live reloading by running:
bun dev
This command opens your browser automatically and reflects changes immediately.
Compile all content—including Markdown files fetched from Notion and integrated translations—into static assets by running:
bun build
The resulting files are placed in the build
directory for deployment via any static hosting service.
Deploy your site using one of the following methods:
- Using SSH:
USE_SSH=true bun deploy
- Without SSH (using GitHub credentials):
GIT_USER=<Your GitHub username> bun deploy
For GitHub Pages hosting, this command conveniently builds the site and pushes to the gh-pages
branch.
- Develop a robust translation strategy to further enhance our multilingual support.
- Integrate GitHub Actions for continuous deployment and automated publishing.
- Refine the Notion-to-Markdown integration for more dynamic updates.