File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html >
3+ < head >
4+ < meta charset ="utf-8 " />
5+ < title > STAC API - Children</ title >
6+ < style >
7+ body {
8+ font-family : sans-serif;
9+ }
10+ </ style >
11+ </ head >
12+ < body >
13+ < h1 > STAC API - Children</ h1 >
14+ < ul id ="schema-list ">
15+ </ ul >
16+ < script type ="text/javascript ">
17+ ( async ( ) => {
18+ const response = await fetch ( `https://api.github.com/repos/stac-api-extensions/children/git/trees/gh-pages?recursive=true` ) ;
19+ const data = await response . json ( ) ;
20+ schemas = data . tree
21+ . filter ( f => f . path . startsWith ( 'v' ) && f . type === 'blob' )
22+ . sort ( ( a , b ) => a . path . localeCompare ( b . path ) ) ;
23+ // Create a list of links to each file,grouped by folder / version
24+ let htmlString = '' ;
25+ let currentVersion = '' ;
26+ schemas . forEach ( schema => {
27+ const [ version , filename ] = schema . path . split ( '/' , 2 ) ;
28+ if ( version !== currentVersion ) {
29+ if ( currentVersion !== '' ) {
30+ htmlString += '</ul>' ;
31+ }
32+ currentVersion = version ;
33+ htmlString += `<li><strong>${ version } </strong><ul>` ;
34+ }
35+ htmlString += `<li><a href="${ schema . path } " target="_blank">${ filename } </a></li>` ;
36+ } ) ;
37+
38+ document . getElementById ( 'schema-list' ) . innerHTML = htmlString ;
39+ } ) ( ) ;
40+ </ script >
41+ </ body >
42+ </ html >
You can’t perform that action at this time.
0 commit comments