github-source

Single sources content from a public GitHub repository Markdown file.

{{% github-source "org/repo" %}}
{{% github-source "org/repo" "path/to/file" %}}

The shortcode takes one positional argument for the user/organization and repository names such as digitalocean/sample-html. It takes an optional second positional argument for a filename like some-directory/some-markdown-file.md, but defaults to README.md.

This shortcode adds a preface at the beginning of the content which says:

This page is automatically generated from [URL].

For local development, set an environment variable called GH_TOKEN to a read-only GitHub access token. Without this token, this shortcode will use the unauthenticated GitHub API, which will work but has a low rate limit which you’re likely to hit.

Examples

See the App Platform sample apps.