summaryrefslogtreecommitdiffstats
path: root/search.json
diff options
context:
space:
mode:
authorMichael W <baddaemon87@gmail.com>2019-04-24 23:34:00 +0200
committerMichael W <baddaemon87@gmail.com>2019-04-25 12:54:59 +0200
commit8b9ee83f3ad2661b3bff2e2be739309020dcc278 (patch)
tree61b07e8d3056daf63f3d0bc008563f2c2af2556c /search.json
parenta8d0479c766db25e5f996bc5d7f895a9c79741bd (diff)
downloadlineage_wiki-8b9ee83f3ad2661b3bff2e2be739309020dcc278.tar.gz
lineage_wiki-8b9ee83f3ad2661b3bff2e2be739309020dcc278.tar.bz2
lineage_wiki-8b9ee83f3ad2661b3bff2e2be739309020dcc278.zip
wiki: bring back upgrading.html
* After moving the upgrade-instructions to per-device instructions, the link in older updater versions points to nowhere * Re-introduce the page by mimicing the existing build guides overview * Use "redirect_from" to give the page a better new name, leaving the old page only as a target for those knowing it already * Also modify search.json to get rid of empty entries -> this would otherwise introduce an entry for "upgrading.html" without a title -> Additionally solves getting an empty search entry for every other file using redirect_from * Switch the logic to append a comma so we don't have too many ones resulting in an invalid json Change-Id: I7e8586db78951f94c181a560410d55b00f7fc7eb
Diffstat (limited to 'search.json')
-rw-r--r--search.json16
1 files changed, 12 insertions, 4 deletions
diff --git a/search.json b/search.json
index b8ccf2fe..958d814b 100644
--- a/search.json
+++ b/search.json
@@ -9,19 +9,27 @@ search: exclude
{%- for page in site.pages %}
{%- unless page.search == "exclude" or page.url contains "_info.html" or page.url contains "_install.html" or page.url contains "_build.html" or page.url contains "devices.html" or page.url contains "_update.html" or page.url contains "_upgrade.html" or page.url contains ".css" %}
{%- unless page.url contains "/devices" and page.url contains "/build" or page.url contains "/devices" and page.url contains "/install" or page.url contains "/devices" and page.url contains "/update" or page.url contains "/devices" and page.url contains "/upgrade"%}
-{
{%- if page.url contains "/devices" %}
{%- assign device = site.data.devices[page.device] %}
-"title": "{{ device.codename | escape }} - {{ device.vendor | escape }} {{ device.name }}",
+{%- if device.codename %}
+{%- capture title %}{{ device.codename | escape }} - {{ device.vendor | escape }} {{ device.name }}{%- endcapture %}
+{%- endif %}
{% else -%}
-"title": "{{ page.title | escape }}",
+{%- assign title = page.title | escape %}
{% endif -%}
+{%- if title %}
+{%- if marker %}
+,
+{%- endif %}
+{% assign marker = true %}
+{
+"title": "{{ title }}",
"tags": "{{ page.tags }}",
"keywords": "{{page.keywords}}",
"url": "{{ page.url | relative_url }}",
"summary": "{{page.summary | strip }}"
}
-{%- unless forloop.last %}, {% endunless %}
+{%- endif %}
{%- endunless %}
{%- endunless %}
{%- endfor %}