eleventy X notion edition
- use node 17
yarn/npm install- add
.envfile withNOTION_KEY- notion integration secretNOTION_BLOG_ID- ID of the notion blog pageNOTION_ART_ID- ID of the notion art pageNOTION_DEMO_ID- ID of the notion demo DB
yarn build/npm run build- builds page to./distyarn dev/npm run dev- starts a dev server, watches changes
- add a new page to the notion blog page
- images from notion will be served from static page
- currently supported content types
- formatted text
- images
- tables
- youtube embeds
- codepen embeds
- add a markdown file in the repo
- Deployment link in Notion triggers a dreampipe webhook, which sends a deployment request to netlify
- Specify a notion article id as env variable
INCOMING_HOOK_BODYto request the page uncached
- create new shortcode adapter to transform notions embed format to something eleventy can read (see
src/_helpers/imageToShortCode.js) - add adapter to API data endpoint (see
src/_data/blogs.js) - add function to resolve shortcode to transform the shortcode to HTML (see
src/_shortcodes/image.js) - register shortcode in
.eleventy.js
dotenv: provide API keyseleventy: static site generatoreleventy-img: crawl, optimize and output imageseleventy-toc: create table of content from markdowneleventy-plugin-rss: create rss feedsnotion client: fetch content from the notion APInotion-to-md: transform notion content to markdownquicklink: preload pagessass: CSS preprocessorlightningcss: CSS postprocessoresbuild: compile and bundle typescriptnetlify: hosting and cachingpipedream: deployment link from notion to netlify