File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1
- .PHONY : help prepare html serve serve-dev clean calendars teams teams-clean
1
+ .PHONY : help prepare html serve serve-dev clean calendars teams teams-clean core-project-json
2
2
.DEFAULT_GOAL := help
3
3
SHELL: =/bin/bash
4
4
@@ -42,11 +42,16 @@ teams-clean:
42
42
43
43
teams : | teams-clean $(patsubst % ,$(TEAMS_DIR ) /% .md,$(TEAMS ) ) # # generates team gallery pages
44
44
45
+ core-project-json : content/specs/core-projects/core-projects.json
45
46
46
- html : prepare calendars # # build the website in ./public
47
+ content/specs/core-projects/core-projects.json : content/specs/core-projects/[^_]* .md
48
+ @echo " Generating project JSON: $@ "
49
+ @python tools/md-header-to-json.py $? > $@
50
+
51
+ html : prepare calendars core-project-json # # build the website in ./public
47
52
@hugo
48
53
49
- serve : prepare calendars # # serve the website
54
+ serve : prepare calendars core-project-json # # serve the website
50
55
@hugo --printI18nWarnings server
51
56
52
57
serve-dev : prepare calendars
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+
3
+ import sys
4
+ import os
5
+ import yaml
6
+ import json
7
+
8
+ files = sys .argv [1 :]
9
+
10
+ out = []
11
+ for mdfile in files :
12
+ with open (mdfile ) as f :
13
+ data = f .readlines ()
14
+ end_header = data [1 :].index ("---\n " ) + 1
15
+ data = data [1 :end_header ]
16
+ header = yaml .load ("" .join (data ), Loader = yaml .SafeLoader )
17
+ out .append (header )
18
+
19
+ print (json .dumps (out , indent = 2 ))
You can’t perform that action at this time.
0 commit comments