Notion JAM

Cover image

Sync pages from Notion to GitHub to be used as a static website (JAM)

Main features

  • Notion pages are converted to markdown files.
  • Database properties are automatically added as yaml frontmatter
  • All images are downloaded locally and path rewritten to relative paths
  • Page cover is downloaded
  • A Thumbnail property is added automatically to the frontmatter pointing to the page cover or fallback to the first image, icon. (or can be specified which image to be used as thumbnail by post)


Quick Start

  • Create a new Notion Integration

  • Add Notion secret to GitHub repository

    • Go to{user}/{repo}/settings/secrets/actions
    • Set NOTION_SECRET of Notion to your repository secret.

  • Share the Database with the integration

  • Create a workflow in .github/workflows/**.yml of your repository

    Example Workflow

    # This is a basic workflow to help you get started with Actions
    name: NotionJAM
    # Controls when the workflow will run
        - cron: "0 21 * * *" # daily
        branches: [master, main]
      # Allows you to run this workflow manually from the Actions tab
    # A workflow run is made up of one or more jobs that can run sequentially or in parallel
      # This workflow contains a single job called "build"
        # The type of runner that the job will run on
        runs-on: ubuntu-latest
        # Steps represent a sequence of tasks that will be executed as part of the job
          # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
          - uses: actions/checkout@v3
          - name: notion-jam
            uses: victornpb/notion-jam@v0.0.10
              NOTION_SECRET: ${{ secrets.NOTION_SECRET }}
              FILTER_PROP: Status
              FILTER_VALUES: Published
              CONVERT_PROP_CASE: snake
              ARTICLE_PATH: content/posts/{title}/
              ASSETS_PATH: ./
              PARALLEL_PAGES: 25
              DOWNLOAD_IMAGE_TIMEOUT: 30
              SKIP_DOWNLOADED_IMAGES: true
          - name: Save changes
            uses: stefanzweifel/git-auto-commit-action@v4
              commit_message: Commit changes



Name Description Required Default
NOTION_SECRET Notion API Token secret
NOTION_DATABASE Notion Database URL or ID (example:
FILTER_PROP Property on the database used to query pages Status
FILTER_VALUES Return pages with the FILTER_PROP is equal this list of values Ready,Published
CONVERT_PROP_CASE Convert the database property names before adding to the frontmatter (camel,pascal,kebab,snake,none) snake
ARTICLE_PATH Path template to where to save markdown files posts/{title}/
ASSETS_PATH Path to save images, if started with . will be relative to ARTICLE_PATH, otherwise absolute ./
PARALLEL_PAGES Fetch this amount of pages in parallel 25
PARALLEL_DOWNLOADS_PER_PAGE Number of images to download in parallel for each page 3
DOWNLOAD_IMAGE_TIMEOUT Timeout in seconds for each image download 30
SKIP_DOWNLOADED_IMAGES Skip downloading images if they already exist in the path true
DOWNLOAD_FRONTMATTER_IMAGES Downloads image urls in the frontmatter true


GitHub Action

image notion-jam - GitHub Marketplace\ A export Notion pages to markdown and images to be used as JAM stack (static website, github pages, eleventy...)\

GitHub Repository

favicon GitHub\ Sync pages from Notion to GitHub to be used as a static website (JAM) - GitHub - victornpb/notion-jam: Sync pages from Notion to GitHub to be used as a static website (JAM)\