You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@annotator.apache.org by ge...@apache.org on 2021/05/09 11:54:02 UTC
[incubator-annotator-website] 02/06: Convert liquid to handelbars
This is an automated email from the ASF dual-hosted git repository.
gerben pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-annotator-website.git
commit c74f09e056c3e3492de091437a4da0940a813ced
Author: Gerben <ge...@treora.com>
AuthorDate: Sun May 9 00:32:41 2021 +0200
Convert liquid to handelbars
So we can reuse pieces for the TypeDoc template
---
.eleventy.js | 3 +++
src/_layouts/{default.liquid => default.hbs} | 12 ++++++------
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/.eleventy.js b/.eleventy.js
index b5878db..bd4a104 100644
--- a/.eleventy.js
+++ b/.eleventy.js
@@ -20,6 +20,9 @@ module.exports = function(eleventyConfig) {
'src/site.webmanifest': 'site.webmanifest'
});
+ eleventyConfig.addShortcode('eq', function(a, b) { return a === b });
+ eleventyConfig.addShortcode('not-eq', function(a, b) { return a !== b });
+
return {
dir: {
input: 'src',
diff --git a/src/_layouts/default.liquid b/src/_layouts/default.hbs
similarity index 94%
rename from src/_layouts/default.liquid
rename to src/_layouts/default.hbs
index 96b9cdd..2906275 100644
--- a/src/_layouts/default.liquid
+++ b/src/_layouts/default.hbs
@@ -47,15 +47,15 @@
<div class="ui grid">
<div class="three wide column">
<div class="ui vertical secondary menu">
- {%- for post in collections.all -%}
- {%- if post.url != '/' -%}
- <div class="{% if page.url == post.url %}active {% endif %}item"><a href="{{ post.url }}">{{ post.data.title }}</a></div>
- {%- endif -%}
- {%- endfor -%}
+ {{#each collections.all}}
+ {{#if (not-eq this.url '/')}}
+ <div class="{{#if (eq ../page.url this.url)}}active {{/if}}item"><a href="{{this.url}}">{{this.data.title}}</a></div>
+ {{/if}}
+ {{/each}}
</div>
</div>
<div class="nine wide column">
- {{ content }}
+ {{{content}}}
</div>
</div>
</div>