Skip to content

apache/casbin-website

Source for the official Apache Casbin documentation site. Casbin is under incubation at the Apache Software Foundation (ASF). The site is built with Docusaurus v3.

Build and deploy

On push to master or manual dispatch, the Build and Deploy workflow:

  1. Installs dependencies and, for non–pull-request runs, runs Crowdin sync (yarn crowdin:sync; requires the CROWDIN_PERSONAL_TOKEN repository secret).
  2. Runs yarn build to produce the static site.
  3. Publishes the build/ output to the asf-site branch of this repository (via peaceiris/actions-gh-pages).

ASF infrastructure serves the site from asf-site as configured in .asf.yaml. Pull requests run the workflow without Crowdin sync or publishing to asf-site.

Additional checks (Markdown lint, doc link checks, etc.) live under .github/workflows/.

Local development

Requirements

  1. Git
  2. Node.js 20.x or later (matches engines in package.json and CI)
  3. Yarn Classic (v1)

Run locally

git clone https://github.com/apache/casbin-website.git
cd casbin-website
yarn install
yarn start

Other useful scripts: yarn build, yarn serve, yarn lint.

Contributing

You can help with documentation, translations, and front-end work. Mailing lists and project metadata are listed on the incubator status page (for example dev@casbin.apache.org). On-site contributing guidance is also available under Docs → Start Contributing on the published site.

Documentation writing

For the sidebar, see Docusaurus: Sidebar. For Markdown/MDX features, see Markdown Features.

A typical doc front matter and structure:

---
title: Title
description: description
keywords: [keyword1, keyword2]
authors: [GitHub username]
---

## Headers

Only h2 and h3 will be in the TOC by default, so h1 is not recommended to use.

### h3

content

#### h4

content

We use markdownlint-cli for Markdown/MDX:

yarn lint:md

For VS Code, Sublime, or Vim/Neovim, consider a markdownlint extension.

Caution

Admonitions

You can use Admonitions; leave blank lines around blocks, for example:

:::info Title

Title is optional

:::
JSX

You can use JSX in docs (e.g. Tabs). To avoid Crowdin breaking code, follow mdx-solutions and wrap JSX with mdx-code-block:

```mdx-code-block
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
```

```mdx-code-block
<Tabs>
<TabItem value="go" label="Go">
```

content

```mdx-code-block
</TabItem>
<TabItem value="java" label="Java">
```

content

```mdx-code-block
</TabItem>
</Tabs>
```

Translation

Crowdin and Docusaurus i18n are used for translations.

Do not translate directive strings like :::note or :::tip; wrong translations can break rendering.

Do not translate interpolation placeholders in sentences such as:

At our {repoLink}, browse and submit {issueLink} or {prLink} for bugs you find or any new features you may want implemented.

Keep {repoLink}, {issueLink}, etc. as-is; see translate props.

Do not translate metadata lines like authors: [casbin].

Website development

Apache and trademarks

Apache Casbin is an effort undergoing incubation at the ASF. Apache®, the Apache feather logo, and related marks are trademarks of The Apache Software Foundation. See the incubator status page and the ASF trademark policy.

License

Apache License 2.0.

About

Apache Casbin Website

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors