diff --git a/_includes/back-link.html b/_includes/back-link.html new file mode 100644 index 0000000..5f04f0d --- /dev/null +++ b/_includes/back-link.html @@ -0,0 +1,26 @@ +{% assign back_href = nil %} +{% assign back_label = nil %} + +{% assign path = page.url | remove: 'index.html' %} +{% unless path == '/' %} + {% if path == '/projects/' or path == '/projects' or path == '/writings/' or path == '/writings' or path == '/films/' or path == '/films' or path == '/contact/' or path == '/contact' %} + {% assign back_href = '/' %} + {% assign back_label = 'Home' %} + {% elsif page.collection == 'projects' %} + {% assign back_href = '/projects' %} + {% assign back_label = 'Projects' %} + {% elsif page.collection == 'films' %} + {% assign back_href = '/films' %} + {% assign back_label = 'Films' %} + {% elsif page.categories contains 'writings' %} + {% assign back_href = '/writings' %} + {% assign back_label = 'Writings' %} + {% endif %} +{% endunless %} + +{% if back_href %} + + + {{ back_label }} + +{% endif %} diff --git a/_layouts/default.html b/_layouts/default.html index 17e1f5c..1b0165c 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -86,6 +86,7 @@