-
Notifications
You must be signed in to change notification settings - Fork 2
/
.env-sample
111 lines (98 loc) · 4.25 KB
/
.env-sample
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# 🧧 HOW TO USE THIS SCRIPT
#
# `cp .env-sample .env`
#
# Then edit as needed.
# 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘
# Read this if you don't have an API Key for Notion yet:
# https://developers.notion.com/docs/getting-started
NOTION_API_KEY=secret_Qh1umsorrybutyoullhavetogetyourown
# 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘
# Aside from the db ID, none of these is strictly necessary as
# notion2svelte provides the following defaults:
#
# PUBLISHABLE_STATUS=Publishable
# OUTPUT_PATH=
# OUTPUT_STATIC_FOLDER=
#
# The empty OUTPUT_ values mean "current directory".
#
# The last assignment in a .env file wins (much like CSS), so
# if you're using `notion2svelte` for more than one project,
# this is a hacky way to switch between them…just keep each project
# organized in a single "chunk" and swap the chunks as needed.
# Here's what that might look like:
### Personal Website ###
NOTION_DATABASE_ID=c317033af18yadayadayadayadayadaa
PUBLISHABLE_STATUS=3. Ready to Publish
OUTPUT_PATH=./demo-app/src/routes/pages/
OUTPUT_STATIC_FOLDER=./demo-app/static/
### Client 1 Website ###
NOTION_DATABASE_ID=c31df833aaaaaaaaaaaaaaaaaaaaaaaa
PUBLISHABLE_STATUS=Ship it!
OUTPUT_PATH=../clientsite_1/src/routes/
OUTPUT_STATIC_FOLDER=../clientsite_1/static/
# Here, the values under Client 1 Website win out, so, as it stands,
# running `npm run start` will try to query a Notion db with the id
# `c31df833aaaaaaaaaaaaaaaaaaaaaaaa`. If that works, the pages
# returned from Notion will be limited to those with a _Status_ of
# "Ship it!". The first output path determines where the tool will
# spit out its `.svelte` pages. The second is where it will store
# copies of any images encountered.
#
# So, for example, if you have a publishable page with Slug* set
# to "contact-us", `notion2svelte`'s output will be saved to
# `../clientsite_1/src/routes/contact-us`, and, assuming the
# clientsite_1 is a Svelte project that uses file-based routing
# (e.g., SvleteKit, Routify, Sapper, et al?), the rendered page
# will have the (dev) URL: http://localhost:3000/contact-us.
#
# The other output, `OUTPUT_STATIC_FOLDER`, tells `notion2svelte`
# where to put any downloaded media. Currently, that means only
# images. There's some assumptions here that are currently hard-
# coded, but that could easily be added to these .env options:
#
# - All images are stored in a folder named after the image's
# parent page (using the Slug)
# - These folders are all tidily kept in an `assets` folder
#
# So, here in this example, if our `contact-us` page in Notion has 2
# images, they'll both end up in:
#
# `../clientsite_1/static/assets/contact-us/`
# * I did mention that you should have a property in your db
# labelled "Slug", right? No? Oh, well, you should definitely do
# that.
# 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘
# Development Settings
#
# If you find yourself needing to noodle with the way `notion2svelte`
# interprets specific types of Notion content, you probably don't
# need to hit the database on every local change, and you also
# might want to focus on just a single page. These settings
# skip the database query, instead operating on a single page.
# Uncomment or re-type as needed.
#
# Minimally, you'll need to specify that page's id. The exported Adding in the
# page will get the slug (and thus the filename & route), "test".
#
# NOTION_TEST_PAGE_ID=20f0dfbbthisisfakecd9039c7466476
#
# Setting the "cache token" allows you to skip Notion entirely, so
# long as `notion2svelte` can find a local .json dump of the test
# page. This is recommended, as it avoids redundant network calls,
# and it's EASY TO DO! Just uncomment the line below, and let
# `notion2svelte` append the page ID.
#
# CACHE_TOKEN
#
# Finally, there are two ways to force a round-trip to Notion for
# the test page, even if you have the cache token uncommented.
#
# 1. Dirty the cache by ensuring it doesn't match the page id
# 2. Uncomment this sucker ↓
#
# FORCE_REFRESH=true
#
# 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘 𐩘
# That's all, folks! 🐷