summaryrefslogtreecommitdiff
path: root/alabaster-lite/inc
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@macaw.me>2020-04-23 19:56:10 +0800
committerFrederick Yin <fkfd@macaw.me>2020-04-23 19:56:10 +0800
commitb8b525b213e6256513dce8ef20aa82889b4a63c2 (patch)
tree90af8a6c24329ae0396d25d0df0f2fefb21b6e52 /alabaster-lite/inc
Initial commit
Custom alabaster theme 3 blogposts and 2 metaposts Deployment script
Diffstat (limited to 'alabaster-lite/inc')
-rw-r--r--alabaster-lite/inc/homepage_nav.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/alabaster-lite/inc/homepage_nav.html b/alabaster-lite/inc/homepage_nav.html
new file mode 100644
index 0000000..ed2edfa
--- /dev/null
+++ b/alabaster-lite/inc/homepage_nav.html
@@ -0,0 +1,19 @@
+<h2>Navigation</h2>
+
+{% macro nav_tree(nav) -%}
+ <ul>
+ {% for nav_item in nav %}
+ {% if not nav_item.children %}
+ <li>
+ <a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
+ </li>
+ {% else %}
+ <li>
+ {{ nav_item.title }}
+ {{ nav_tree(nav_item.children) }}
+ </li>
+ {% endif %}
+ {% endfor %}
+ </ul>
+{%- endmacro %}
+{{ nav_tree(nav) }}