summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans-Nikolai Viessmann2016-10-15 17:43:07 +0100
committerHans-Nikolai Viessmann2016-10-15 17:43:07 +0100
commit458e802f321d40dc1fa35460a65b960391bcf203 (patch)
tree94dfe43fb0b6b9dd07aef0b25fb7cd66a5152a88
parent2c4c1d25cb07b731888742d8071bd793aca738d4 (diff)
downloadblog-458e802f321d40dc1fa35460a65b960391bcf203.tar.gz
blog-458e802f321d40dc1fa35460a65b960391bcf203.zip
Changed links JSON layout
I can not believe how silly my previous layout was...
-rwxr-xr-x_links.json303
-rwxr-xr-x_plugins/links.rb14
2 files changed, 158 insertions, 159 deletions
diff --git a/_links.json b/_links.json
index 07affeb..3787cf5 100755
--- a/_links.json
+++ b/_links.json
@@ -1,153 +1,150 @@
-[
- {
- "name":"LinkedIn",
- "show":true,
- "href":"//uk.linkedin.com/in/hansviessmann",
- "title":"LinkedIn Profile",
- "date":"23-07-2013",
- "cat":"Networking"
- },
- {
- "name":"Careers 2.0",
- "show":true,
- "href":"//careers.stackoverflow.com/viessmann",
- "title":"Another profile of mine, I like how StackExchange have done this...",
- "cat":"Networking"
- },
- {
- "name":"BitBucket",
- "show":true,
- "href":"//bitbucket.org/hv15",
- "title":"BitBucket repos",
- "cat":"Repository"
- },
- {
- "name":"GitHub",
- "show":true,
- "href":"//github.com/hv15",
- "title":"GitHub repos",
- "cat":"Repository"
- },
- {
- "name":"Self-hosted Git",
- "show":true,
- "href":"//git.hans.ninja/",
- "title":"Personal Git repos",
- "cat":"Repository"
- },
- {
- "name":"C. G. P. Grey",
- "show":true,
- "href":"//www.youtube.com/channel/UC2C_jShtL725hvbm1arSV9w",
- "title":"Videos about general quirky facts",
- "cat":"Videos"
- },
- {
- "name":"Periodic Table of Videos",
- "show":true,
- "href":"//www.youtube.com/channel/UCtESv1e7ntJaLJYKIO1FoYw",
- "title":"Awesome chemistry videos",
- "cat":"Videos"
- },
- {
- "name":"Vsauce",
- "show":true,
- "href":"//www.youtube.com/channel/UC6nSFpj9HTCZ5t-N3Rm3-HA",
- "title":"Questioning everything",
- "cat":"Videos"
- },
- {
- "name":"SciShow",
- "show":true,
- "href":"//www.youtube.com/channel/UCZYTClx2T1of7BRZ86-8fow",
- "title":"Just because...",
- "cat":"Videos"
- },
- {
- "name":"Sixty Symbols",
- "show":true,
- "href":"//www.youtube.com/channel/UCvBqzzvUBLCs8Y7Axb-jZew",
- "title":"Just the best collection of Physics knowledge on Youtube, plus more",
- "cat":"Videos"
- },
- {
- "name":"The Slingshot Channel",
- "show":true,
- "href":"https://www.youtube.com/channel/UCVZlxkKqlvVqzRJXhAGq42Q",
- "title":"Hah, pure awesome!",
- "cat":"Videos"
- },
- {
- "name":"Techmoan",
- "show":true,
- "href":"//www.youtube.com/channel/UC5I2hjZYiW9gZPVkvzM8_Cw",
- "title":"Nice collection of reviews about small camera, dashcams, hifi, and more",
- "cat":"Videos"
- },
- {
- "name":"Doug Coulter",
- "show":true,
- "href":"//www.youtube.com/channel/UCF5JXEQrIkOaZl009sYggjA",
- "title":"Interesting collection of videos by a guy who for fun tries/tried to build a fusion reactor at home",
- "cat":"Videos"
- },
- {
- "name":"EEVBlog",
- "show":true,
- "href":"//www.youtube.com/channel/UC2DjFE7Xf11URZqWBigcVOQ",
- "title":"Some of the best videos I've seen on electronics - very good walk-throughs and tear-downs",
- "cat":"Videos"
- },
- {
- "name":"Tom Scott",
- "show":true,
- "href":"//www.youtube.com/channel/UCBa659QWEk1AI4Tg--mrJ2A",
- "title":"Interesting videos on general knowledge",
- "cat":"Videos"
- },
- {
- "name":"Copyright And Licenses",
- "show":true,
- "href":"//www.smashingmagazine.com/2011/06/14/understanding-copyright-and-licenses/",
- "title":"Insightful explaination on the topic of copyright and licenses",
- "date":"25-07-2013",
- "cat":"Interesting"
- },
- {
- "name":"SSH-LPR",
- "show":true,
- "href":"//www.masella.name/technical/sshlpr.html",
- "title":"Could be useful for printing within a closed network from outside",
- "cat":"Interesting"
- },
- {
- "name":"HeadJS",
- "show":true,
- "href":"//headjs.com/",
- "title":"I used this in a project of mine, very useful little script when one has a lot of JS to load on different pages",
- "date":"28-07-2013",
- "cat":"Software"
- },
- {
- "name":"Bootstrap",
- "show":true,
- "href":"//twitter.github.com/bootstrap/",
- "title":"I actually like how the community got into this, there are thousands of plugins for this giving it crazy cool features",
- "date":"28-07-2013",
- "cat":"Software"
- },
- {
- "name":"r/homelab",
- "show":true,
- "href":"//www.reddit.com/r/homelab/",
- "title":"Useful resource for advise and suggestions on how to build/maintain a server at home",
- "cat":"Server Related"
- },
- {
- "name":"LowEndBox",
- "show":true,
- "href":"//lowendbox.com",
- "title":"A site dedicated to renting/buying low-cost servers",
- "cat":"Server Related"
- }
-]
+{
+ "Networking": [
+ {
+ "name":"LinkedIn",
+ "show":true,
+ "href":"//uk.linkedin.com/in/hansviessmann",
+ "title":"LinkedIn Profile",
+ "date":"23-07-2013"
+ },
+ {
+ "name":"Careers 2.0",
+ "show":true,
+ "href":"//careers.stackoverflow.com/viessmann",
+ "title":"Another profile of mine, I like how StackExchange have done this..."
+ },
+ {
+ "name":"Welcome Mat",
+ "show":true,
+ "href":"//viess.mn/",
+ "title":"This is my internet contact card"
+ }
+ ],
+ "Repository": [
+ {
+ "name":"BitBucket",
+ "show":true,
+ "href":"//bitbucket.org/hv15",
+ "title":"BitBucket repos"
+ },
+ {
+ "name":"GitHub",
+ "show":true,
+ "href":"//github.com/hv15",
+ "title":"GitHub repos"
+ },
+ {
+ "name":"Self-hosted Git",
+ "show":true,
+ "href":"//git.hans.ninja/",
+ "title":"Personal Git repos"
+ }
+ ],
+ "Videos": [
+ {
+ "name":"C. G. P. Grey",
+ "show":true,
+ "href":"//www.youtube.com/channel/UC2C_jShtL725hvbm1arSV9w",
+ "title":"Videos about general quirky facts"
+ },
+ {
+ "name":"Periodic Table of Videos",
+ "show":true,
+ "href":"//www.youtube.com/channel/UCtESv1e7ntJaLJYKIO1FoYw",
+ "title":"Awesome chemistry videos"
+ },
+ {
+ "name":"Vsauce",
+ "show":true,
+ "href":"//www.youtube.com/channel/UC6nSFpj9HTCZ5t-N3Rm3-HA",
+ "title":"Questioning everything"
+ },
+ {
+ "name":"SciShow",
+ "show":true,
+ "href":"//www.youtube.com/channel/UCZYTClx2T1of7BRZ86-8fow",
+ "title":"Just because..."
+ },
+ {
+ "name":"Sixty Symbols",
+ "show":true,
+ "href":"//www.youtube.com/channel/UCvBqzzvUBLCs8Y7Axb-jZew",
+ "title":"Just the best collection of Physics knowledge on Youtube, plus more"
+ },
+ {
+ "name":"The Slingshot Channel",
+ "show":true,
+ "href":"https://www.youtube.com/channel/UCVZlxkKqlvVqzRJXhAGq42Q",
+ "title":"Hah, pure awesome!"
+ },
+ {
+ "name":"Techmoan",
+ "show":true,
+ "href":"//www.youtube.com/channel/UC5I2hjZYiW9gZPVkvzM8_Cw",
+ "title":"Nice collection of reviews about small camera, dashcams, hifi, and more"
+ },
+ {
+ "name":"Doug Coulter",
+ "show":true,
+ "href":"//www.youtube.com/channel/UCF5JXEQrIkOaZl009sYggjA",
+ "title":"Interesting collection of videos by a guy who for fun tries/tried to build a fusion reactor at home"
+ },
+ {
+ "name":"EEVBlog",
+ "show":true,
+ "href":"//www.youtube.com/channel/UC2DjFE7Xf11URZqWBigcVOQ",
+ "title":"Some of the best videos I've seen on electronics - very good walk-throughs and tear-downs"
+ },
+ {
+ "name":"Tom Scott",
+ "show":true,
+ "href":"//www.youtube.com/channel/UCBa659QWEk1AI4Tg--mrJ2A",
+ "title":"Interesting videos on general knowledge"
+ }
+ ],
+ "Interesting": [
+ {
+ "name":"Copyright And Licenses",
+ "show":true,
+ "href":"//www.smashingmagazine.com/2011/06/14/understanding-copyright-and-licenses/",
+ "title":"Insightful explaination on the topic of copyright and licenses",
+ "date":"25-07-2013"
+ },
+ {
+ "name":"SSH-LPR",
+ "show":true,
+ "href":"//www.masella.name/technical/sshlpr.html",
+ "title":"Could be useful for printing within a closed network from outside"
+ }
+ ],
+ "Software": [
+ {
+ "name":"HeadJS",
+ "show":true,
+ "href":"//headjs.com/",
+ "title":"I used this in a project of mine, very useful little script when one has a lot of JS to load on different pages",
+ "date":"28-07-2013"
+ },
+ {
+ "name":"Bootstrap",
+ "show":true,
+ "href":"//twitter.github.com/bootstrap/",
+ "title":"I actually like how the community got into this, there are thousands of plugins for this giving it crazy cool features",
+ "date":"28-07-2013"
+ }
+ ],
+ "Server Related": [
+ {
+ "name":"r/homelab",
+ "show":true,
+ "href":"//www.reddit.com/r/homelab/",
+ "title":"Useful resource for advise and suggestions on how to build/maintain a server at home"
+ },
+ {
+ "name":"LowEndBox",
+ "show":true,
+ "href":"//lowendbox.com",
+ "title":"A site dedicated to renting/buying low-cost servers"
+ }
+ ]
+}
diff --git a/_plugins/links.rb b/_plugins/links.rb
index d5dfed2..5b087b4 100755
--- a/_plugins/links.rb
+++ b/_plugins/links.rb
@@ -29,12 +29,14 @@ module Jekyll
def read(file)
hashed = Hash.new
- JSON.parse(IO.read(file)).each{|link|
- next unless link['show']
- cat = link['cat'] || 'Uncategorised'
- date = link['date'] || Time.now.strftime("%d-%m-%Y")
- hashed[cat] = Array.new unless hashed.has_key?(cat)
- hashed[cat].push(["#{link['name']}","<a class=\"button-link link\" style=\"background-color: #{self.color};\" title=\"#{link['title']}; viewed on #{date}\" href=\"#{link['href']}\">#{link['name']}</a>\n"])
+ json = JSON.parse(IO.read(file))
+ json.each{|key, array|
+ array.each{|link|
+ next unless link['show']
+ date = link['date'] || Time.now.strftime("%d-%m-%Y")
+ hashed[key] = Array.new unless hashed.has_key?(key)
+ hashed[key].push(["#{link['name']}","<a class=\"button-link link\" style=\"background-color: #{self.color};\" title=\"#{link['title']}; viewed on #{date}\" href=\"#{link['href']}\">#{link['name']}</a>\n"])
+ }
}
hashed
end