1.0.0 • Published 3 years ago

hexo-tag-codepen-x v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

hexo-tag-codepen-x

中文文档|English

This is a plug-in that allows Hexo blogs to use codeopen

Hexo Docs

CodeOpen

Usage

①Global configuration

Set the file _ config.yml under the Hexo blog directory

codepen:
  user: "xu-ux"
  theme: "33713"
  default_tabs: "js,result"
  height: 500
  width: "100%"
  click_load: false
  editable: true
  style: {height: 600px, border-radius: 10px}
FieldValueDesc
click_loadbooleanUse Click-to-Load (The result in Embedded Pens can either load right away, or be in a preview state where they need to be clicked to load, which can be good for performance.)
editablebooleanMake Code Editable (You can make the code in this Embedded Pen editable, meaning you can change code and see the results, just like in the Pen Editor here. Editable Embeds require more resources than non-editable Embeds.)
userxu-uxCodeopen UserId
themelight/darkThe embedded container theme(dark or light)
default_tabshtml,resultDefault tab page (html,result,js)
height600Height of the embedded container
width100%Width of the embedded container
styleObjectCustom styles

②Using tag in MD files

{% codepen slugHash user|anon tabs theme height width %}
FieldValueDesc
slugHashXWgPqjNCodeopen Unique ID
userxu-uxCodeopen UserId
themelight/darkThe embedded container theme(dark or light)
default_tabshtml,resultDefault tab page (html,result,js)
height600Height of the embedded container
width100%Width of the embedded container

The value inside the tag is used first, followed by the value of the global configuration

{% codepen XWgPqjN %}

OR

{% codepen XWgPqjN xu-ux %}

OR

{% codepen XWgPqjN xu-ux js,result dark 600 %}

OR

Display:

image-20210924225555974