Skip to content

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

License

Notifications You must be signed in to change notification settings

wenonly/hexo-dynamic-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexo-dynamic-config

A hexo plugin for using variable in 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

key description
env environment variable process.env
hexo hexo instance

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(',')}

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published