gitbook-plugin-signature
This is a plugin for automatically adding timestamp and copyright terms at the top and the bottom of every article. For now, it is using body font and you can specify the color, copyright owner and author of each article.
Feel free to create issues or pull request for any discussion.
Example
.md file
{% set author = "Hao" %}
# Title of the Article
content
.
.
Output
last modified by Hao, 2016/05/05 05:05:05
Title of the Article
content
Copyright © 2016 Hao.
.
.
.
All rights reserved.
Usage
book.json
"plugins": ["signature"]
"pluginsConfig": {
"gitbook-plugin-signature":{
"autoTimeStamp":{
"color":"gray",
"timeStampFormat": "YYYY/MM/DD HH:mm:ss"
},
"autoCopyright":{
"color":"gray",
"owner":"Hao",
"center":true
},
"signature":{
"key": "customized signature"
}
}
}
If you don't want to automatically add timestamp or copyright, simply drop the part in pluginsConfig
.
Auto Timestamp
Default author of each article will be set to the last git commiter of the file.
"pluginsConfig": {
"gitbook-plugin-signature":{
"autoTimeStamp":{
"color":"gray",
"timeStampFormat": "YYYY/MM/DD HH:mm:ss"
}
}
}
Set Author for Each Article
You can also set author of article manually.
{% set author = "Hao" %}
# Title of the Article
content
.
.
Auto Copyright
"pluginsConfig": {
"gitbook-plugin-signature":{
"autoCopyright":{
"color":"gray",
"owner":"Hao",
"center":true
}
}
}
autoCoyright.author
will be set to book.author
if no specified.
Customize signature
You can set your customized signature content in book.json
and use it in .md
files.
book.json
"pluginsConfig": {
"gitbook-plugin-signature":{
"signature":{
"key": "customized signature"
}
}
}
.md file
{{'key'|signature}}
or the simplified version
{{'key'|s}}
Liscence
gitbook-plugin-signature is freely distributable under the terms of the MIT license.
Author/Contributor
- Hao(@popodidi)
- Zachary(@zachary822)