diff --git a/README.md b/README.md index 69a67ce..efd9bc1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -## hexo-multiauthor-plugin Plugin +## hexo-multiauthor-plugin Plugin 👥 + +![Static Badge](https://img.shields.io/badge/hexo-v7.0.0-blue?style=flat-square&logo=hexo&labelColor=white) +![npm](https://img.shields.io/npm/v/hexo-multiauthor-plugin?style=for-the-badge&logo=npm) +![npm bundle size](https://img.shields.io/bundlephobia/min/hexo-multiauthor-plugin?style=for-the-badge&logo=npm) +![NPM](https://img.shields.io/npm/l/hexo-multiauthor-plugin?style=for-the-badge&logo=github) + This plugin allows you to add multiple authors to your Hexo blog. It is based on the [hexo-multiauthor](https://github.com/bob983/hexo-multiauthor) @@ -45,7 +51,20 @@ Add this code snippet to your theme wherever you want to display the author's na For example, if you are using the default Hexo theme, you can add this code snippet to `themes/landscape/layout/_partial/article.ejs` just below `<%- post.content %>`: ```ejs -<%- post_author() %> +
+ <% if (post_author()){ %> + <% if (post.author.length > 1){ %> +

Co Authors

+ <% } else if (post.author.length == 1){ %> +

Author

+ <% } %> + <% post.author.forEach(function(au) { %> +
+ <%=au.name %>, <%=au.about %> +
+ <% }); %> + <% } %> +
``` ## Options diff --git a/package.json b/package.json index 566d084..7bb74c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-multiauthor-plugin", - "version": "1.1.0", + "version": "1.1.1", "description": "Hexo plugin to support multiple authors", "main": "index.js", "repository": { @@ -24,7 +24,6 @@ }, "license": "MIT", "dependencies": { - "hexo": "^7.0.0", "js-yaml": "^4.1.0" }, "devDependencies": {