Skip to main content
Home

Built and signed on GitHub Actions

Import Notion pages into your Eleventy project

This package works with Node.js, Deno, Bun
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score
100%
Published
3 weeks ago (0.0.5)
type alias EleventyOptions

As part of the Eleventy build process, Notion is queried for updated Notion pages, and they are processed and written into a special folder. The filenames for the templates match the Notion page UUID, without the dashes. The extension is .html by default, but can be configured using the extension option. By default, these Notion templates are put into the notion/ folder under your Eleventy input directory. Note that the templates are only updated as part of an Eleventy "build" run, not when serving or watching.

Properties

The database containing all pages that should be imported. This should be specified as an ID (a UUID, either with or without the dashes) or a URL to the database's page (either as a string or URL object).

You must add the internal Notion integration to this page by finding and selecting it by navigating to "••• > Connections". This page functions as an index, so will not itself generate an output template.

optional
output: string

The folder to write the Eleventy templates to after being imported or updated from Notion. Is relative to your Eleventy input directory, and defaults to /notion/. For example, if your input directory is src/, then templates are dumped into src/notion/. The plugin keeps track of the last updated time using the .notion file in this output folder; if the specified output folder exists but does not contain the .notion file then an error is thrown. This is to prevent unintentionally overwriting files that were not meant to be overwritten.

Do not modify the templates in this directory.

The extension to use for the templates. The filename matches the Notion page ID. By default, the extension is html, which is processed by Eleventy as Liquid. This can be avoided by setting Eleventy's htmlTemplateEngine to false. That can be done either in your Eleventy configuration file, to disable it altogether, or you may put a data file in the output directory, as long as its filename does not start with a valid UUID nor a valid UUID without dashes.

optional
quiet: boolean

Large imports can take a while due to Notion's rate limits, so it can be helpful to know how far along an import really is. As such, the plugin by default lets you know how many pages will be imported, and logs the progress during the import process. To disable these messages, set this option to true.

If a Notion pages was updated, but its output template file was modified since the last successful import, then skip the importing of this page. This is mostly useful for large imports, or imports that can error out halfway through, since the plugin's "last updated" timestamp is only updated after a successful import. Defaults to false.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@vrugtehagel/eleventy-from-notion

Import symbol

import { type EleventyOptions } from "@vrugtehagel/eleventy-from-notion";
or

Import directly with a jsr specifier

import { type EleventyOptions } from "jsr:@vrugtehagel/eleventy-from-notion";

Add Package

pnpm i jsr:@vrugtehagel/eleventy-from-notion
or (using pnpm 10.8 or older)
pnpm dlx jsr add @vrugtehagel/eleventy-from-notion

Import symbol

import { type EleventyOptions } from "@vrugtehagel/eleventy-from-notion";

Add Package

yarn add jsr:@vrugtehagel/eleventy-from-notion
or (using Yarn 4.8 or older)
yarn dlx jsr add @vrugtehagel/eleventy-from-notion

Import symbol

import { type EleventyOptions } from "@vrugtehagel/eleventy-from-notion";

Add Package

npx jsr add @vrugtehagel/eleventy-from-notion

Import symbol

import { type EleventyOptions } from "@vrugtehagel/eleventy-from-notion";

Add Package

bunx jsr add @vrugtehagel/eleventy-from-notion

Import symbol

import { type EleventyOptions } from "@vrugtehagel/eleventy-from-notion";