-
Notifications
You must be signed in to change notification settings - Fork 2
/
categories.html
73 lines (57 loc) · 4.32 KB
/
categories.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
layout: page
title: Categories
permalink: categories/
---
<!--
Synonyms are grouped between "|" symbols.
thesaurus_string contains every taxonomy term from the old Drupal site. I wanted to import them all so that all the old /taxonomy/term/<tid> and /tags/<category> links would still work.
thesaurus_reduced_string MUST have the same number of synonym groups; and they MUST be in the same order as in thesaurus_string. thesuarus_reduced_string is a subset of thesaurus_string. It is the subset that we want to display on the categories page.
-->
{% assign thesaurus_string = "open climate fix=non-profit|PhD=MSc|student project|competition|online courses=conferences=open science=funding=workshop=patents|software engineering=programming=robotics=electronics=code documentation=linux=laptop=UML=1-wire=iphone=web=C++=JavaScript=HTML5=SVG=udev=metadata=computer science=MATLAB=eclipse=nxj=svn=git=make=owfs=Doxygen|document authoring=Emacs=LaTeX=Lyx=Zotero=bibliographies=epub=e-books=e-readers|machine learning=information theory=graphical models|GNUplot=diagrams=graphs=data visualisation=MetaUML=imagemagick=pdf=reveal=d3|introducing smart meter disaggregation=disaggregation=nilm=NeuralNILM=introducing smart meter disaggregation|nilmtk=metrics|UK-DALE|children=teaching=belham=kids=making|green diary=refurbishment=MVHR=insulation=under floor heating=windows=lights=solar=solar thermal=air quality=climate change mitigation=renovation=control=energy efficiency=nanode=diy=LEDs=gas consumption=OpenTRV=fluorescent=recommendations|climate science|photography=colour=flickr=gallery2|transport=travel=train=rail strikes=ferry=plane=trains|food=garden=plants=waste=worms=wormery=rainwater|smart meters=alertme=CurrentCost=current cost=EcoManager=google power meter=electrical efficiency=DECC=consultations=reactive power=UK=EDF=home automation|notes=filmmaking=video|htpc=xbmc=mythtv|economics" %}
{% assign thesaurus = thesaurus_string | split: "|" %}
{% assign thesaurus_reduced_string = "open climate fix=non-profit|PhD=MSc|student project|competition|online courses=conferences=open science=funding=workshop|software engineering=programming=robotics=electronics=code documentation=linux=laptop=UML=1-wire|document authoring=Emacs=LaTeX=Lyx=Zotero=bibliographies|machine learning|GNUplot=diagrams=graphs=data visualisation=MetaUML|disaggregation=nilm|nilmtk|UK-DALE|children=teaching=belham=kids=making|green diary=refurbishment=MVHR=insulation=under floor heating=windows=lights=solar=solar thermal=air quality=climate change mitigation|climate science|photography=colour|transport=travel=train=rail strikes=ferry=plane|food=garden=plants=waste=worms=wormery=rainwater|smart meters=alertme=CurrentCost=EcoManager=google power meter=electrical efficiency=DECC|notes=filmmaking=video|htpc=xbmc=mythtv|economics" %}
{% assign thesaurus_reduced = thesaurus_reduced_string | split: "|" %}
<ul>
{% for synonyms_string in thesaurus_reduced %}
{% assign synonyms = synonyms_string | split: "=" %}
<li><a href="#{{ synonyms | first }}">{{ synonyms | array_to_sentence_string }}</a></li>
{% endfor %}
<li><a href="#uncategorised">Uncategorised</a></li>
</ul>
<p><hr/></p>
{% for synonyms_string in thesaurus %}
{% assign synonyms = synonyms_string | split: "=" %}
{% for category in synonyms %}
<a name="{{ category }}"></a>
{% endfor %}
{% assign synonyms_reduced = thesaurus_reduced[forloop.index0] | split: "=" %}
<h3>{{ synonyms_reduced | array_to_sentence_string }}</h3>
{% assign posts = "" | split: "" %}
{% for category in synonyms %}
{% for post in site.categories[category] %}
{% unless posts contains post %}
{% assign posts = posts | push: post %}
{% endunless %}
{% endfor %}
{% endfor %}
{% assign posts = posts | sort: 'date' | reverse %}
{% include list-posts.html posts=posts %}
{% endfor %}
<p><hr/></p>
<a name="uncategorised"></a>
<h3>Uncategorised</h3>
<ul>
{% for post in site.posts %}
{% assign post_is_uncategorised = true %}
{% for category in post.categories %}
{% if thesaurus_string contains category %}
{% assign post_is_uncategorised = false %}
{% break %}
{% endif %}
{% endfor %}
{% if post_is_uncategorised %}
<li style="text-indent: -9em; padding-left: 9em;">{{ post.date | date_to_string }} - <a href="{{ post.url }}">{{ post.title }}</a></li>
{% endif %}
{% endfor %}
</ul>