A Hexo plugin that renders blockquotes to the note tag of the NexT theme.
You may first edit your _config.next.yml
to enable all features of the note tag. For example, this is mine:
note:
style: flat
icons: true
Surround the blockquotes that you want to transform to notes with <!--blockquote2note-->
(HEAD) and <!--end-blockquote2note-->
(TAIL), and they will be rendered as the note tags.
For example:
<!--blockquote2note-->
> This is an example blockquote.
<!--end-blockquote2note-->
will be rendered as:
{% note %}
This is an example blockquote.
{% endnote %}
Configuration is supported.
For example:
<!--blockquote2note:default,no-icon,Test-->
> This is an example blockquote.
<!--end-blockquote2note-->
will be rendered as:
{% note default no-icon Test %}
This is Line 1 of this blockquote.
{% endnote %}
After v1.1.0, purely blank lines between HEAD and TAIL are allowed. So it's also OK to use like:
<!--blockquote2note-->
> This is an example.
<!--end-blockquote2note-->
[!IMPORTANT] > Keep those commas, even if an option is empty.
For example:<!--blockquote2note:,,Test-->
.
Caution
Nested blockquotes are NOT supported.
npm install hexo-blockquote2note --save
git clone --depth=1 [email protected]:BlockLune/hexo-blockquote2note.git
pnpm install
pnpm test
Caution
Node v21 may not show correct line numbers in stack traces when testing. See this issue.