-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathnetlify.toml
139 lines (116 loc) · 4.84 KB
/
netlify.toml
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
# 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: if you're using the netlify cli ( ie. "netlify dev" )
# this needs to be simply "public" ( otherwise it looks for "site/site/public" )
# tbd: is the global site config on netlify overriding this?
# could we switch this to be "public" always?
publish = "site/public/"
[build.environment]
# see also package.json, and docker-compose.yml
HUGO_VERSION = "0.128.2"
# 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]
# this command additionally builds draft content for deploy previews (PR's)
# cf https://docs.netlify.com/site-deploys/deploy-previews/
command = 'hugo -D && cp public/404/index.html public/404.html'
[context.branch-deploy]
# this command builds draft content for branches
command = 'hugo -D && cp public/404/index.html public/404.html'
[context.production]
# Note that there are two versions of the below command
# drafts are excluded (no `-D` option to hugo) for prod build. We also pull new code to the server in this case!
# 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
# TL;DR comment out the next line if you are working on your own Netlify site!
command = 'hugo && cp public/404/index.html public/404.html && 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 && sudo ./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)'
# uncomment the next line if you are working on your own Netlify site!
# command = 'hugo && cp public/404/index.html public/404.html'
## 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 back end + 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
## legacy (people have been using it for years) ical feed for pedalpalooza.
## Can't directly get to /legacy/cal content via www.shift2bikes.org
## due to other redirects, so proxying secretly here.
[[redirects]]
from = "/cal/icalpp.php"
to = "https://api.shift2bikes.org/api/pedalpalooza-calendar.php"
status = 200
force = true
## the official pedalpalooza feed
[[redirects]]
from = "/cal/pedalpalooza-calendar.php"
to = "https://api.shift2bikes.org/api/pedalpalooza-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
## 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
## remove-add trailing slashes kinda? fool can't really believe this works :P
[[redirects]]
from = "/addevent/*"
to = "/addevent"
status = 200
[[redirects]]
from = "/calendar/*"
to = "/calendar/event"
status = 200
## old pedalpalooza page should link to new one
[[redirects]]
from = "/pedalpalooza"
to = "/pages/pedalpalooza"
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