hexo-dynamic-config

1.0.0 • Public • Published

hexo-dynamic-config

A hexo plugin for insert variable to configuration. for example, you can use environment variable in your _config.yml

Install

# install locally (recommended)
npm install hexo-dynamic-config --save

Or installing with yarn? yarn add hexo-dynamic-config

Usage

变量 描述
env 项目运行的环境变量 process.env
hexo hexo 实例

Using environment variable

You can create a .env file in the root of your project:

FTP_SECRET: YOURFTPSECRET

Fill your project configuration _config.yml like this:

deploy:
  type: ftp
  ftp_secret: ${env.FTP_SECRET}

Using hexo instance

Fill your project configuration _config.yml like this:

title: This is your blog title
subtitle: ${hexo.config.title} - Share good articles

.. Or like:

title: This is your blog title
tags:
  - env
  - linux
  - server
  - java
  - nginx
description: ${title} - share ${hexo.config.tags.join(',')}

Package Sidebar

Install

npm i hexo-dynamic-config

Weekly Downloads

11

Version

1.0.0

License

MIT

Unpacked Size

4.26 kB

Total Files

7

Last publish

Collaborators

  • wenonly