diff options
author | Jeffrey Tse <jeffreytse.mail@gmail.com> | 2019-09-11 12:19:34 +0800 |
---|---|---|
committer | Jeffrey Tse <jeffreytse.mail@gmail.com> | 2019-09-11 12:21:17 +0800 |
commit | 61eae5c5f9881cab29712f6e696085baa977e1f9 (patch) | |
tree | bb301b58b94fee5dcefbdfae8f0c8fc13ee5bd21 /_includes/functions.html | |
parent | cd3a8163dd997d0a7c4d320816651efa8f7dce60 (diff) |
release: v1.0.0
Diffstat (limited to '_includes/functions.html')
-rw-r--r-- | _includes/functions.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/_includes/functions.html b/_includes/functions.html new file mode 100644 index 0000000..3f9fee2 --- /dev/null +++ b/_includes/functions.html @@ -0,0 +1,25 @@ +{%- if include.func -%} + {%- assign func = include.func -%} +{%- endif -%} + +{%- assign include_path = func -%} +{%- assign path_array = include_path | split: '.' -%} +{%- if path_array.size == 1 -%} + {%- assign include_path = include_path | append: '.html' -%} +{%- endif -%} + +{%- if func == 'log' -%} + {%- include functions/log.html level=include.level msg=include.msg -%} +{%- else -%} + {%- assign include_path = 'functions/' | append: include_path -%} + {%- include {{ include_path }} -%} +{%- endif -%} + +{%- if func != 'log' -%} + {%- assign msg = '[function][' + | append: {{func}} + | append: '] ' + | append: {{return}} + -%} + {%- include functions.html func='log' level='info' -%} +{%- endif -%} |