@@ -140,120 +140,120 @@ enum SiteURL: Resourceable, Sendable {
140140 switch self {
141141 case . addAPackage:
142142 return " add-a-package "
143-
143+
144144 case let . api( next) :
145145 return " api/ \( next. path) "
146-
146+
147147 case let . author( . value( owner) ) :
148148 return owner
149-
149+
150150 case . author:
151151 fatalError ( " invalid path: \( self ) " )
152-
152+
153153 case . blog:
154154 return " blog "
155-
155+
156156 case . blogFeed:
157157 return " blog/feed.xml "
158-
158+
159159 case let . blogPost( . value( slug) ) :
160160 return " blog/ \( slug) "
161-
161+
162162 case . blogPost:
163163 fatalError ( " invalid path: \( self ) " )
164-
164+
165165 case let . builds( . value( id) ) :
166166 return " builds/ \( id. uuidString) "
167-
167+
168168 case . builds( . key) :
169169 fatalError ( " invalid path: \( self ) " )
170-
170+
171171 case . buildMonitor:
172172 return " build-monitor "
173-
173+
174174 case let . collections( . value( key) ) :
175175 return " collections/ \( key. urlPathEncoded) "
176-
176+
177177 case . collections( . key) :
178178 fatalError ( " invalid path: \( self ) " )
179-
179+
180180 case let . docs( next) :
181181 return " docs/ \( next. path) "
182-
182+
183183 case . faq:
184184 return " faq "
185-
185+
186186 case . home:
187187 return " "
188-
188+
189189 case let . images( name) :
190190 return " images/ \( name) "
191-
191+
192192 case let . javascripts( name) :
193193 return " / \( name) .js "
194-
194+
195195 case let . keywords( . value( keyword) ) :
196196 return " keywords/ \( keyword) "
197-
197+
198198 case . keywords:
199199 fatalError ( " invalid path: \( self ) " )
200-
200+
201201 case let . package ( . value( owner) , . value( repo) , . none) :
202202 let owner = owner. addingPercentEncoding ( withAllowedCharacters: . urlPathAllowed) ?? owner
203203 let repo = repo. addingPercentEncoding ( withAllowedCharacters: . urlPathAllowed) ?? repo
204204 return " \( owner) / \( repo) "
205-
205+
206206 case let . package ( owner, repo, . some( next) ) :
207207 return " \( Self . package ( owner, repo, . none) . path) / \( next. path) "
208-
208+
209209 case . package :
210210 fatalError ( " invalid path: \( self ) " )
211-
211+
212212 case let . packageCollectionAuthor( . value( owner) ) :
213213 return " \( owner) /collection.json "
214-
214+
215215 case . packageCollectionAuthor( . key) :
216216 fatalError ( " invalid path: \( self ) " )
217-
217+
218218 case let . packageCollectionCustom( . value( key) ) :
219219 return " collections/ \( key. urlPathEncoded) /collection.json "
220-
220+
221221 case . packageCollectionCustom( . key) :
222222 fatalError ( " invalid path: \( self ) " )
223-
223+
224224 case . packageCollections:
225225 return " package-collections "
226-
226+
227227 case . privacy:
228228 return " privacy "
229-
229+
230230 case . readyForSwift6:
231231 return " ready-for-swift-6 "
232-
232+
233233 case . rssPackages:
234234 return " packages.rss "
235-
235+
236236 case . rssReleases:
237237 return " releases.rss "
238-
238+
239239 case . search:
240240 return " search "
241-
241+
242242 case . siteMapIndex:
243243 return " sitemap.xml "
244-
244+
245245 case . siteMapStaticPages:
246246 return " sitemap-static-pages.xml "
247-
247+
248248 case . supporters:
249249 return " supporters "
250-
250+
251251 case let . stylesheets( name) :
252252 return " / \( name) .css "
253-
253+
254254 case . tryInPlayground:
255255 return " try-in-a-playground "
256-
256+
257257 case . validateSPIManifest:
258258 return " validate-spi-manifest "
259259 }
@@ -278,58 +278,58 @@ enum SiteURL: Resourceable, Sendable {
278278 . tryInPlayground,
279279 . validateSPIManifest:
280280 return [ . init( stringLiteral: path) ]
281-
281+
282282 case let . api( next) :
283283 return [ " api " ] + next. pathComponents
284-
284+
285285 case . author:
286286 return [ " :owner " ]
287-
287+
288288 case . blogFeed:
289289 return [ " blog " , " feed.xml " ]
290-
290+
291291 case . blogPost:
292292 return [ " blog " , " :slug " ]
293-
293+
294294 case . builds( . key) :
295295 return [ " builds " , " :id " ]
296-
296+
297297 case . builds( . value) :
298298 fatalError ( " pathComponents must not be called with a value parameter " )
299-
299+
300300 case . collections( . key) :
301301 return [ " collections " , " :key " ]
302-
302+
303303 case . collections( . value) :
304304 fatalError ( " pathComponents must not be called with a value parameter " )
305-
305+
306306 case let . docs( next) :
307307 return [ " docs " ] + next. pathComponents
308-
308+
309309 case . keywords:
310310 return [ " keywords " , " :keyword " ]
311-
311+
312312 case . package ( . key, . key, . none) :
313313 return [ " :owner " , " :repository " ]
314-
314+
315315 case let . package ( k1, k2, . some( next) ) :
316316 return Self . package ( k1, k2, . none) . pathComponents + next. pathComponents
317-
317+
318318 case . package :
319319 fatalError ( " pathComponents must not be called with a value parameter " )
320-
320+
321321 case . packageCollectionAuthor( . key) :
322322 return [ " :owner " , " collection.json " ]
323-
323+
324324 case . packageCollectionAuthor( . value) :
325325 fatalError ( " pathComponents must not be called with a value parameter " )
326-
326+
327327 case . packageCollectionCustom( . key) :
328328 return [ " collections " , " :key " , " collection.json " ]
329-
329+
330330 case . packageCollectionCustom( . value) :
331331 fatalError ( " pathComponents must not be called with a value parameter " )
332-
332+
333333 case . images, . javascripts, . stylesheets:
334334 fatalError ( " invalid resource path for routing - only use in static HTML (DSL) " )
335335 }
0 commit comments