-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathnetlify.toml
More file actions
203 lines (170 loc) · 6.63 KB
/
netlify.toml
File metadata and controls
203 lines (170 loc) · 6.63 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# build settings for netlify
# [build] and [build.environment] are defaults, will apply to all builds unless overridden in a context stanza below
[build]
base = "site"
# note: this is configured as "public" on netlify.com but this overrides.
# perhaps we should adjust hugo and vite to output to that root "public" instead?
publish = "site/public/"
[build.environment]
# extra environment variables if needed.
# we need to manually copy the 404 page over for now, in every environment
# cf https://github.com/shift-org/shift-docs/issues/862
[context.deploy-preview]
# -D builds draft content for deploy previews
# ( the doubledash is needed to pass the argument through to hugo )
# cf https://docs.netlify.com/site-deploys/deploy-previews/
command = 'npm run deploy -- -D'
[context.branch-deploy]
# operates on custom branches, same as deploy-preview.
command = 'npm run deploy -- -D'
[context.production]
# see this guide about why we do this funky thing with ssh:
# https://answers.netlify.com/t/support-guide-using-an-ssh-key-via-environment-variable-during-build/2457
#
# comment out the following command if you are using the Netlify cli locally
# and replace with one of the 'npm run deploy' commands from above.
#
# NOTE: This pulls new code to the api server!
# drafts are excluded (no `-D` option) for prod build.
#
command = 'npm run deploy && mkdir -p ~/.ssh && echo -e "${SSH_KEY//_/\\n}" > ~/.ssh/id_rsa && chmod og-rwx ~/.ssh/id_rsa && ssh -v -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ubuntu@api.shift2bikes.org "cd /opt/shift-docs && ./shift pull" || (echo "you seem to be building without ssh access - see https://github.com/shift-org/shift-docs#netlify-deployment for details" ; /bin/false)'
## ---------------------------------------------------------------------------
## domain redirects to serve alternative domains. First, we canonicalize
## so that we can serve just the "best" version (NETLIFY DNS record)
## such redirects must be first redirects in this file!
## ---------------------------------------------------------------------------
[[redirects]]
from = "https://shift2bikes.com/*"
to = "https://www.shift2bikes.org/:splat"
status = 301
force = true
[[redirects]]
from = "https://www.shift2bikes.com/*"
to = "https://www.shift2bikes.org/:splat"
status = 301
force = true
[[redirects]]
from = "https://shifttobikes.org/*"
to = "https://www.shift2bikes.org/:splat"
status = 301
force = true
[[redirects]]
from = "https://www.shifttobikes.org/*"
to = "https://www.shift2bikes.org/:splat"
status = 301
force = true
## ---------------------------------------------------------------------------
## dynamic backend + event images stored on our API server
## Solves CORS problems to proxy via Netlify
## cf https://docs.netlify.com/routing/redirects/rewrites-proxies/
## ---------------------------------------------------------------------------
[[redirects]]
from = "/api/*"
to = "https://api.shift2bikes.org/api/:splat"
status = 200
[[redirects]]
from = "/eventimages/*"
to = "https://api.shift2bikes.org/eventimages/:splat"
status = 200
[[redirects]]
from = "/socialapi/"
to = "https://pdx.social/@shift2bikes.rss"
status = 200
## ---------------------------------------------------------------------------
## ical feeds
## ---------------------------------------------------------------------------
## legacy (people have been using it for years) ical feed for pedalpalooza.
[[redirects]]
from = "/cal/icalpp.php"
to = "https://api.shift2bikes.org/api/shift-calendar.php"
status = 200
force = true
## the official pedalpalooza feed
[[redirects]]
from = "/cal/pedalpalooza-calendar.php"
to = "https://api.shift2bikes.org/api/shift-calendar.php"
status = 200
force = true
## the official "all events" feed.
[[redirects]]
from = "/cal/shift-calendar.php"
to = "https://api.shift2bikes.org/api/shift-calendar.php"
status = 200
force = true
## ---------------------------------------------------------------------------
## legacy links
## ---------------------------------------------------------------------------
## we can't translate REALLY legacy links (<2017) - they used some odd format.
## But let's at least land on the calendar page in case someone clicks one.
[[redirects]]
from = "/cal/*"
to = "/calendar/"
status = 301
## a special redirect for a URL that someone made up
[[redirects]]
from = "/calendar/pedalpalooza"
to = "/pages/pedalpalooza"
status = 301
## old Pedalpalooza page should link to new one
[[redirects]]
from = "/pedalpalooza"
to = "/pages/bike-summer"
status = 301
## old Pedalpalooza page should link to newer Bike Summer one
[[redirects]]
from = "/pages/pedalpalooza"
to = "/pages/bike-summer"
status = 301
## Older Pedalpalooza calendar should link to newer Bike Summer one
[[redirects]]
from = "/pedalpalooza-calendar"
to = "/bike-summer-calendar"
status = 301
## old bike rack webpage linked from PBoT and other offsite pages we can't fix
[[redirects]]
from = "/wiki/shift-shop:rack-rental"
to = "/pages/bike-racks/"
status = 301
## moved playbooks content onto meeting notes page
[[redirects]]
from = "/pages/playbooks"
to = "/pages/meeting-notes"
status = 301
## sample redirect for a campaign (e.g. QR code or other link you want to track specific usage of)
[[redirects]]
from = "/campaign1"
to = "/"
status = 301
#------------------------------------------------------------------------------------
# handlers for the various "single page applications".
#
# these map all urls under a starting path to a single page.
# ex. all urls starting with /calendar/ to the singular calendar page.
#
# currently, those singular pages are generated by hugo or vite.
# ie. `/calendar/event-ID` is handled by `content/calendar/event.md`
# and `/addevent/edit-ID-PASSWORD` by `content/addevent.md`
#
# note: this only works so long as there is no *actual* page stored at the full url.
# netlify will serve real pages before processing the redirects.
#------------------------------------------------------------------------------------
[[redirects]]
from = "/addevent/*"
to = "/addevent"
status = 200
[[redirects]]
from = "/calendar/*"
to = "/calendar/event"
status = 200
[[redirects]]
from = "/events/*"
to = "/events"
status = 200
# ---------------------------------------------------------------------------
# android progressive web app helper
# https://developers.google.com/digital-asset-links/v1/getting-started
# ---------------------------------------------------------------------------
[[redirects]]
from = "/.well-known/assetlinks.json"
to = "/events/assetlinks.json"
status = 200