1.0.1 • Published 5 years ago

hexo-additional-helper v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

new helpers:

1. ah_list_archives

ah_list_archives based on implementation of list_archives, support one more option:callback, which will take over constructing content of each archive item. example(using bootstrap4):

		```
		      <%- ah_list_archives({show_count: theme.show_count, type: theme.archive_type, callback:function(name,url,cnt)
                    {
                    let result='<a href="';
                    result += url;
                    result +='" class="list-group-item">';
                    result += name;
                    result += ' <span class="badge badge-primary">';
                    result += cnt;
                    result += '</span></a>';                        
                    return result; 
                    }}) %>
		```

2. ah_list_posts

list posts of specified tag callback function with three parameters:title, url, content example:

  ```
		<%- ah_list_posts({tagname:'hexo',callback:function(title,url,content){return '<p>'+title+url+'</p>';}}) %>
		```

powered by JM Zhang