-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bootstrap label alert #1682
Conversation
@liuzhenrain alert is duplicate of note tag? |
style = 'default'; | ||
} | ||
return ' <span class="label label-' + style + '">' + content + '</span> '; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary semicolon.
var text = '<div class="alert alert-' + style + '"><i class="fa ' + icon + ' fa-lg"> <strong>' + tip + '</strong></i> ' + content + '</div>'; | ||
|
||
return text; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary semicolon.
} | ||
|
||
content = hexo.render.renderSync({ text: content, engine: 'markdown' }); | ||
var text = '<div class="alert alert-' + style + '"><i class="fa ' + icon + ' fa-lg"> <strong>' + tip + '</strong></i> ' + content + '</div>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
icon = 'fa-bug'; | ||
break; | ||
default: | ||
tip = tip.length == 0 ? "Success Message" : tip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use '===' to compare with '0'.
Mixed double and single quotes.
icon = 'fa-bell'; | ||
break; | ||
case 'danger': | ||
tip = tip.length == 0 ? "Danger Message" : tip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use '===' to compare with '0'.
Mixed double and single quotes.
icon = 'fa-info'; | ||
break; | ||
case 'warning': | ||
tip = tip.length == 0 ? "Warning Message" : tip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use '===' to compare with '0'.
Mixed double and single quotes.
icon = 'fa-lightbulb-o'; | ||
break; | ||
case 'info': | ||
tip = tip.length == 0 ? "Info Message" : tip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use '===' to compare with '0'.
Mixed double and single quotes.
|
||
switch (style) { | ||
case 'success': | ||
tip = tip.length == 0 ? "Success Message" : tip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use '===' to compare with '0'.
Mixed double and single quotes.
style = 'default'; | ||
} | ||
return ' <span class="label label-' + style + '">' + content + '</span> '; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary semicolon.
var text = '<div class="alert alert-' + style + '"><i class="fa ' + icon + ' fa-lg"> <strong>' + tip + '</strong></i> ' + content + '</div>'; | ||
|
||
return text; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary semicolon.
} | ||
|
||
content = hexo.render.renderSync({ text: content, engine: 'markdown' }); | ||
var text = '<div class="alert alert-' + style + '"><i class="fa ' + icon + ' fa-lg"> <strong>' + tip + '</strong></i> ' + content + '</div>'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long.
icon = 'fa-bug'; | ||
break; | ||
default: | ||
tip = tip.length == 0 ? "Success Message" : tip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use '===' to compare with '0'.
Mixed double and single quotes.
icon = 'fa-bell'; | ||
break; | ||
case 'danger': | ||
tip = tip.length == 0 ? "Danger Message" : tip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use '===' to compare with '0'.
Mixed double and single quotes.
icon = 'fa-info'; | ||
break; | ||
case 'warning': | ||
tip = tip.length == 0 ? "Warning Message" : tip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use '===' to compare with '0'.
Mixed double and single quotes.
icon = 'fa-lightbulb-o'; | ||
break; | ||
case 'info': | ||
tip = tip.length == 0 ? "Info Message" : tip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use '===' to compare with '0'.
Mixed double and single quotes.
|
||
switch (style) { | ||
case 'success': | ||
tip = tip.length == 0 ? "Success Message" : tip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use '===' to compare with '0'.
Mixed double and single quotes.
@ivan-nginx maybe is true with duplicate note tag ,but is note same display,and note tag has some error.so I add the alert tag. |
Errors like what? I know how looks note tag, i made it. For example, at this link u can see same note tag, but with modify css. And, yes, i see how look your note (alert) tag, but this is css style only. Any other functionality is on same level, instead of original note.js have 11 strings of code and your alert.js have 45 strings of code. |
@ivan-nginx If i delete the second note tag ,it will be right to generate. |
@liuzhenrain may i see source code with this error? Mb u not right use this tag. |
@liuzhenrain ok, i see what u use {% note warning %}string{% endnote %}, right? No need to write this in 1 line, like that:
or like that:
Need to write it like u may see in note documentation link (#1160), like this:
|
@liuzhenrain let's do it again and catch this error: need clean source code in English language, without any other addition styles/letters/etc. |
I Changed two tag like :
IS OK |
@liuzhenrain you are welcome. Need to use by instructions all tags and/or modules if want no errors. |
@ivan-nginx if you can modify the Chinese doc with Bootstrap Callout. |
@liuzhenrain this can modify @iissnan and i don't know Chinese. And now i see what docs is not right. P.S. Close #1674 if solved. |
@ivan-nginx Need me to close this PR? |
@liuzhenrain no no, this PR no need to close for now. I will close it when i finish with this tags and styles. Thx. |
@ivan-nginx |
@liuzhenrain add modern note style in #1697. Some later i'll add label style too. |
Label tag was added in #1697 PART 8. @liuzhenrain thank's for pull, it really help for me! |
Label style
class :
files:
站点配置主要在 {% label primary %} 博客根目录 {% endlabel %}的`_config.yml`文件中配置
Result:
Alert
class :
files:
{% alert "警告提示" warning %}
`这是一个警告提示`
# Hello Bootstarp
{% endalert %}
Result: