From 61eae5c5f9881cab29712f6e696085baa977e1f9 Mon Sep 17 00:00:00 2001 From: Jeffrey Tse Date: Wed, 11 Sep 2019 12:19:34 +0800 Subject: release: v1.0.0 --- _includes/functions/get_categories.html | 12 ++++++++++++ _includes/functions/get_datetimes.html | 18 ++++++++++++++++++ _includes/functions/get_tags.html | 12 ++++++++++++ _includes/functions/get_value.html | 17 +++++++++++++++++ _includes/functions/log.html | 17 +++++++++++++++++ 5 files changed, 76 insertions(+) create mode 100644 _includes/functions/get_categories.html create mode 100644 _includes/functions/get_datetimes.html create mode 100644 _includes/functions/get_tags.html create mode 100644 _includes/functions/get_value.html create mode 100644 _includes/functions/log.html (limited to '_includes/functions') diff --git a/_includes/functions/get_categories.html b/_includes/functions/get_categories.html new file mode 100644 index 0000000..babb7a0 --- /dev/null +++ b/_includes/functions/get_categories.html @@ -0,0 +1,12 @@ +{% assign split_mark = '<|>' %} + +{% assign categories = '' %} +{% for category in site.categories %} + {% assign name = category | first %} + {% assign categories = categories | append: split_mark | append: name %} +{% endfor %} + +{% assign return = categories + | remove_first: split_mark + | split: split_mark + | sort: self %} diff --git a/_includes/functions/get_datetimes.html b/_includes/functions/get_datetimes.html new file mode 100644 index 0000000..4398fbf --- /dev/null +++ b/_includes/functions/get_datetimes.html @@ -0,0 +1,18 @@ +{% if include.filter %} + {% assign filter = include.filter %} +{% endif %} + +{% assign split_mark = '<|>' %} + +{% assign dates = '' %} +{% for post in site.posts %} + {% assign name = post.date | date: filter %} + {% assign dates = dates | append: split_mark | append: name %} +{% endfor %} + +{% assign return = dates + | remove_first: split_mark + | split: split_mark + | sort: self + | uniq %} + diff --git a/_includes/functions/get_tags.html b/_includes/functions/get_tags.html new file mode 100644 index 0000000..8528eeb --- /dev/null +++ b/_includes/functions/get_tags.html @@ -0,0 +1,12 @@ +{% assign split_mark = '<|>' %} + +{% assign tags = '' %} +{% for tag in site.tags %} + {% assign name = tag | first %} + {% assign tags = tags | append: split_mark | append: name %} +{% endfor %} + +{% assign return = tags + | remove_first: split_mark + | split: split_mark + | sort: self %} diff --git a/_includes/functions/get_value.html b/_includes/functions/get_value.html new file mode 100644 index 0000000..2d90b19 --- /dev/null +++ b/_includes/functions/get_value.html @@ -0,0 +1,17 @@ +{%- if include.name -%} + {%- assign name = include.name -%} +{%- endif -%} + +{%- assign return = include.return -%} + +{%- if page[name] -%} + {%- assign return = page[name] -%} +{%- elsif site.data[name] -%} + {%- assign return = site.data[name] -%} +{%- elsif site.defaults[page.layout][name] -%} + {%- assign return = site.defaults[page.layout][name] -%} +{%- elsif site.data.defaults[page.layout][name] -%} + {%- assign return = site.data.defaults[page.layout][name] -%} +{%- elsif layout[name] -%} + {%- assign return = layout[name] -%} +{%- endif -%} diff --git a/_includes/functions/log.html b/_includes/functions/log.html new file mode 100644 index 0000000..b2a6130 --- /dev/null +++ b/_includes/functions/log.html @@ -0,0 +1,17 @@ +{% if include.level %} + {% assign level = include.level %} +{% endif %} + +{% if include.msg %} + {% assign msg = include.msg %} +{% endif %} + +{% if site.debug == true %} + {% if level == 'debug' %} + {% if jekyll.environment == "development" %} + + {% endif %} + {% else %} + + {% endif %} +{% endif %} -- cgit v1.2.3