Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hexo-tag-github-code

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hexo-tag-github-code

insert github code

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

hexo-tag-github-code

Insert code from GitHub when static files are generated.

Not embed.

Install

$ npm install hexo-tag-github-code --save

Usage

{% ghcode URL [start_line stop_line] [options] %}

Support URL

GitHub / Gist

Other site

If URL links to raw file, it will work.

Options

Set like as {cap:false,re:true}. Please do NOT insert any spaces.

optiondescriptiondefault
captrue: show caption
false: no caption
true
retrue: the first line number restart from 1
false: the first line number start from original code number
false

Config setting

You can change default settings in _config.yml as below.

github_code:
  cap: false
  re: true

Examples

Full code

{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js %}

Selected lines

Insert code from line 17 to line 22.

{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js 17 22 %}

Selected lines

Without caption

{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js 17 22 {cap:false} %}

Without caption

Restart the first line number from 1

{% ghcode https://github.com/nkmk/hexo-list-related-posts/blob/master/lib/index.js 17 22 {re:true} %}

Restart the first line number from 1

FAQs

Package last updated on 11 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc