Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inspired by hexo-spoiler

Install

npm install hexo-sliding-spoiler --save

If hexo can't detect this plugin automatically, you need to modify the plugins section of [path_to_your_site]/_config.yml manually, like:

plugins:
 - hexo-sliding-spoiler

Syntax

{% sliding_spoiler title %}
content
{% endsliding_spoiler %}

It will hide your text and place the title at the top with a dropdown/scroll up arrow.

⚠️ Breaking change (v2.0.0): The tag was renamed from {% spoiler %} to {% sliding_spoiler %} to avoid conflicts with hexo-spoiler. Update your posts to use the new tag name.

Demo

Example

One word title

{% sliding_spoiler word %}
content
{% endsliding_spoiler %}

Title containing spaces

{% sliding_spoiler "Several spaces in the title" %}
content
{% endsliding_spoiler %}

Using code blocks inside spoilers

Markdown code fences (triple backticks) inside spoiler tags can cause parsing issues due to a Hexo/Nunjucks limitation. Use Hexo's built-in codeblock tag instead:

{% sliding_spoiler "Code example" %}
{% codeblock lang:javascript %}
console.log('Hello world');
{% endcodeblock %}
{% endsliding_spoiler %}

About

A sliding spoiler for hexo

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages