File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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
22.DEFAULT_GOAL := help
33SHELL: =/bin/bash
44
@@ -42,11 +42,16 @@ teams-clean:
4242
4343teams : | teams-clean $(patsubst % ,$(TEAMS_DIR ) /% .md,$(TEAMS ) ) # # generates team gallery pages
4444
45+ core-project-json : content/specs/core-projects/core-projects.json
4546
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
4752 @hugo
4853
49- serve : prepare calendars # # serve the website
54+ serve : prepare calendars core-project-json # # serve the website
5055 @hugo --printI18nWarnings server
5156
5257serve-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