Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
56 lines (56 loc) · 1.96 KB
/
Copy pathindex.html
File metadata and controls
56 lines (56 loc) · 1.96 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>GTFS feeds — SIMOVI</title>
</head>
<body>
<h1>GTFS feeds</h1>
<p>
Feeds live at <code>/<agency>/<feed-type>/<file></code>. For example: <code>/incofer/schedule/gtfs.zip</code>.</p>
<p>
Each file is overwritten in place, so the URLs below are stable.
</p>
<hr>
{{- $hasFeeds := false }}
{{- range $agency := (listFiles "/") }}
{{- $agencyPath := printf "/%s" $agency }}
{{- if (fileStat $agencyPath).IsDir }}
{{- /* Collect first so an agency directory with no feed files renders nothing. */}}
{{- $entries := list }}
{{- range $feedType := (listFiles $agencyPath) }}
{{- $feedTypePath := printf "%s/%s" $agencyPath $feedType }}
{{- if (fileStat $feedTypePath).IsDir }}
{{- range $file := (listFiles $feedTypePath) }}
{{- $path := printf "%s/%s" $feedTypePath $file }}
{{- $info := fileStat $path }}
{{- if not $info.IsDir }}
{{- $href := printf "/%s/%s/%s" (pathEscape $agency) (pathEscape $feedType) (pathEscape $file) }}
{{- $entries = append $entries (dict "href" $href "label" (printf "%s/%s/%s" $agency $feedType $file) "info" $info) }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if $entries }}
{{- $hasFeeds = true }}
<h2>{{ $agency }}</h2>
<ul>
{{- range $entry := $entries }}
<li>
<a href="{{ $entry.href }}">{{ $entry.label }}</a>
— {{ humanize "size" (printf "%d" $entry.info.Size) }},
updated {{ $entry.info.ModTime.UTC.Format "2006-01-02 15:04 UTC" }}
</li>
{{- end }}
</ul>
{{- end }}
{{- end }}
{{- end }}
{{- if not $hasFeeds }}
<p>No feeds are available yet.</p>
{{- end }}
<hr>
<p>The feeds are compliant with the <a href="https://gtfs.org/documentation/schedule/reference/" target="_blank">GTFS Schedule reference</a> and are provided by the <a href="https://simovi.org" target="_blank">Intelligent Mobility Systems Lab (SIMOVI)</a> from the University of Costa Rica.</p>
</body>
</html>