fix(theme): check dependencies

This commit is contained in:
MDLeom 2020-08-10 08:29:36 +00:00
parent 415a7591c8
commit 93c5ad783e
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
4 changed files with 32 additions and 2 deletions

View File

@ -104,5 +104,5 @@ theme_config:
Eepsite: http://mdleom.i2p
'Eepsite (B32)': http://ggucqf2jmtfxcw7us5sts3x7u2qljseocfzlhzebfpihkyvhcqfa.b32.i2p
# Load forkawesome icons? See the links option below.
# Load forkawesome icons?
icons: false

View File

@ -8,3 +8,24 @@ Chameleon is a fork of [Typing](https://github.com/geekplux/hexo-theme-typing) t
- Add a [Copy](https://clipboardjs.com/) button to each code block.
- Removed jQuery, fancyBox, web analytics, comment plugins, donation links and [typo.css](https://github.com/sofish/typo.css).
- Homepage shows index of posts (same as /archives).
## Options
Configure this theme from your **site**'s configuration:
``` yml
# _config.yml
theme_config:
# Header menu
menu:
Home: /
Archives: /archives/
Feed: /atom.xml
# Footer menu
footer:
GitLab: https://gitlab.com/curben/blog
# Load forkawesome icons?
icons: false
```

View File

@ -24,7 +24,7 @@
</nav>
<%/* Nav menu for mobile */%>
<nav class="mobile-nav">
<h1 class="site-title"><a href="<%- url_for(theme.menu['Home']) %>"><%= config.title %></a></h1>
<h1 class="site-title"><a href="<%- config.root %>"><%= config.title %></a></h1>
<ul class="mobile-nav-menu">
<label for="mobile-menu-toggle"><a class="no-underline" id="menu-button">&#9776;</a></label>
<input id="mobile-menu-toggle" type="checkbox"/>

View File

@ -9,6 +9,15 @@
* incompatible with hexo-yam
*/
const deps = ['autoprefixer', 'postcss', 'postcss-normalize']
deps.forEach(dep => {
try {
require.resolve(dep)
} catch (err) {
throw new Error(`Missing "${dep}" dependency. Please install it by running "npm install ${dep}".`)
}
})
const autoprefixer = require('autoprefixer')
const normalize = require('postcss-normalize')
const postcss = require('postcss')