The minimalistic document archiving platform.
Papra - Website
The source code for the papra.app website.
[!TIP] If you are looking for the source code of the Papra app, you can find it here: papra-hq/papra.
Development
This project is a static website built with Astro and UnoCSS.
Clone the repository
git clone [email protected]:papra-hq/papra-website.git
cd papra-website
Install dependencies
pnpm install
Start the development server
pnpm dev
Documentation architecture
- Routes live under
/:locale/docs/*. Onlyenis enabled insrc/docs/docs.constants.ts; website locales are configured separately. Old/docs/*URLs permanently redirect to/en/docs/*. - Content lives in
src/docs/content/<locale>/<docId>.mdx. English is the required source for every document. A translation uses the same path under its locale directory; no locale frontmatter is needed. - Navigation references locale-independent IDs such as
self-hosting/installation/docker. Category, section, and shell labels use the existing translation dictionaries. getDocUrl()builds localized links.resolveDoc()selects a translation or falls back to English, and is shared by pages, sidebar titles, and pagination.
To enable translations, add a website-supported locale to DOCS_LOCALES, add translated MDX files, and translate the docs UI keys in src/locales/. The landing page is still English content and can be adapted when translations are introduced. There is no language picker while only English is enabled.
Static routes are generated for every document in every enabled docs locale. Missing translations keep the requested URL and navigation locale, show a notice, and mark the article's actual language. They canonicalize to English and are excluded from search; hreflang links advertise only published translations. Unknown documents are not generated (404), and missing English source documents fail the build.
Documentation search
Documentation search uses Pagefind, with an index generated automatically by pnpm build. The docs-search Astro integration indexes only /*/docs/**/*.html and writes the search assets into the build's client directory, so they are deployed with the website. data-pagefind-body limits indexing to document content, excluding the docs shell and pagination; data-pagefind-meta="title" supplies result titles. Pagefind separates actual translations by page language; fallback copies are excluded with data-pagefind-ignore="all" to avoid indexing English as another language.
Search is available from every docs page via the header button or Ctrl/Cmd + K. The dialog searches across all documentation categories and links to matching pages and headings.
The index is not generated by the development server. To test search locally:
pnpm build
pnpm preview
Open /en/docs, search for a term from the docs (e.g. authentication), and follow a result. Rebuild after content changes to refresh the index.
License
This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.
Credits
This project is crafted with ❤️ by Corentin Thomasset. If you find this project helpful, please consider supporting my work.