diff --git a/.angular-cli.json b/.angular-cli.json index 6eb2cf8..524764f 100644 --- a/.angular-cli.json +++ b/.angular-cli.json @@ -26,7 +26,7 @@ "scripts": [ "../node_modules/jquery/dist/jquery.min.js", "../node_modules/bootstrap/dist/js/bootstrap.min.js", - "../node_modules/popper.js/dist/popper.min.js" + "../node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" ], "environmentSource": "environments/environment.ts", "environments": { diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..fe71598 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.linting.pylintEnabled": false +} \ No newline at end of file diff --git a/src/app/components/post/post.component.html b/src/app/components/post/post.component.html index 75d51cd..0516ac9 100644 --- a/src/app/components/post/post.component.html +++ b/src/app/components/post/post.component.html @@ -1,7 +1,7 @@
The cupboard is great, the cupboard is powerful!
diff --git a/src/assets/post/project/cupboard1/info.json b/src/assets/post/project/cupboard1/info.json new file mode 100644 index 0000000..e49c1a7 --- /dev/null +++ b/src/assets/post/project/cupboard1/info.json @@ -0,0 +1,3 @@ +{ + "title":"cupboard" +} \ No newline at end of file diff --git a/src/assets/post/project/test/test.html b/src/assets/post/project/test/full.html similarity index 100% rename from src/assets/post/project/test/test.html rename to src/assets/post/project/test/full.html diff --git a/src/assets/post/tech/lxdarch/full.html b/src/assets/post/tech/lxdarch/full.html new file mode 100644 index 0000000..8f7b0a2 --- /dev/null +++ b/src/assets/post/tech/lxdarch/full.html @@ -0,0 +1 @@ +LXD is pretty cool guys.
\ No newline at end of file diff --git a/src/assets/post/tech/lxdarch/info.json b/src/assets/post/tech/lxdarch/info.json new file mode 100644 index 0000000..9f75758 --- /dev/null +++ b/src/assets/post/tech/lxdarch/info.json @@ -0,0 +1,3 @@ +{ + "title":"some things about lxc in arch" +} \ No newline at end of file diff --git a/src/assets/posts.json b/src/assets/posts.json index a67fc86..84c47f3 100644 --- a/src/assets/posts.json +++ b/src/assets/posts.json @@ -1,7 +1 @@ -[ - { - "projects": [ - "test" - ] - } -] \ No newline at end of file +[{"post": {"id": "test", "title": "Test title"}, "type": "project"}, {"post": {"id": "cupboard1", "title": "cupboard"}, "type": "project"}, {"post": {"id": "lxdarch", "title": "some things about lxc in arch"}, "type": "tech"}] \ No newline at end of file diff --git a/src/scripts/compileposts.py b/src/scripts/compileposts.py new file mode 100644 index 0000000..62c0e60 --- /dev/null +++ b/src/scripts/compileposts.py @@ -0,0 +1,41 @@ +import os; +import json; + +# each folder in the post folder is a type of post +base = '../assets/post' +types = os.listdir(base); +outputfile = '../assets/posts.json' + +# go over the types +for type in types: + print type + +# build ourselves a json object +jsonresult = []; +for type in types: + # now read that folder + posts = os.listdir(base+"/"+type); + + # each folder in the current one is a post! the name of the folder is the _id_ + for post in posts: + print('doing post '+post) + postdir = base+"/"+type+"/"+post; + infofile = postdir+"/info.json"; + print(infofile) + with open(infofile) as j: + tt = j.read() + d = json.loads(tt) + d['id'] = post; + temp = {}; + temp['type'] = type; + if 'post' not in temp: + temp['post'] = []; + temp['post'] = d; + jsonresult.append(temp); + + # completely append the info.json file + +# print the result of the json parse +print(json.dumps(jsonresult)); +with open(outputfile, 'w') as outfile: + json.dump(jsonresult, outfile) \ No newline at end of file