chore: minor fixes and add travis ci

This commit is contained in:
ppoffice 2020-03-12 14:18:00 -04:00
parent e4cdb01dd8
commit a8b7dd6c12
4 changed files with 69 additions and 17 deletions

53
.travis.yml Normal file
View File

@ -0,0 +1,53 @@
language: node_js
os: linux
cache: false
node_js:
- "8"
- "node"
before_script:
- export DEPS=$(node -e "const deps=require('./package.json').peerDependencies;console.log(Object.keys(deps).map(key=>key+'@'+deps[key]).join(' '));")
- npm install $DEPS
script:
- echo "Running tests against $(node -v) ..."
- npm run lint
jobs:
include:
- stage: github pages
node_js: "10"
git:
clone: false
script:
- echo "Publish site to github pages ..."
- git clone --recurse-submodules https://github.com/ppoffice/hexo-theme-icarus.git -b site $TRAVIS_BUILD_DIR
- cd $TRAVIS_BUILD_DIR/themes/icarus
- git fetch origin $TRAVIS_COMMIT && git merge $TRAVIS_COMMIT
- export DEPS=$(node -e "const deps=require('./package.json').peerDependencies;console.log(Object.keys(deps).map(key=>key+'@'+deps[key]).join(' '));")
- cd $TRAVIS_BUILD_DIR
- npm install -g hexo-cli
- npm install
- npm install $DEPS
- cp _config.theme.yml themes/icarus/_config.yml
- hexo g
deploy:
provider: pages
token: $GITHUB_TOKEN
keep_history: false
local_dir: public
skip_cleanup: true
on:
tags: true
- stage: github release
node_js: "10"
script: echo "Deploying to github release ..."
deploy:
provider: releases
token: $GITHUB_TOKEN
on:
tags: true

View File

@ -75,7 +75,7 @@ blog feature-rich and powerful.
<td>Baidu</td>
<td>Share.js</td>
<td>External Site Links</td>
<td>Light Gallery and Justified Gallery</td>
<td>Light and Justified Gallery</td>
</tr>
<tr>
<td>Gitalk</td>
@ -134,14 +134,14 @@ Icarus directly import stylesheets from the [highlight.js](https://highlightjs.o
<table>
<tr>
<td>Atom One Light</td>
<td>Monokai</td>
<td>Kimbie Dark</td>
<th>Atom One Light</th>
<th>Monokai</th>
<th>Kimbie Dark</th>
</tr>
<tr>
<td><img src="https://ppoffice.github.io/hexo-theme-icarus/gallery/code-highlight/atom-one-light.png?1"></td>
<td><img src="https://ppoffice.github.io/hexo-theme-icarus/gallery/code-highlight/monokai.png?1"></td>
<td><img src="https://ppoffice.github.io/hexo-theme-icarus/gallery/code-highlight/kimbie-dark.png"></td>
<td><img width="266" src="https://ppoffice.github.io/hexo-theme-icarus/gallery/code-highlight/atom-one-light.png?1"></td>
<td><img width="266" src="https://ppoffice.github.io/hexo-theme-icarus/gallery/code-highlight/monokai.png?1"></td>
<td><img width="266" src="https://ppoffice.github.io/hexo-theme-icarus/gallery/code-highlight/kimbie-dark.png"></td>
</tr>
</table>
@ -166,10 +166,10 @@ Icarus allows you to configure your site on a per-page or per-layout basis.
</td>
<td>
<pre>widgets:
- type: profile
position: left
- type: recent_posts
position: left</pre>
- type: profile
position: left
- type: recent_posts
position: left</pre>
</td>
<td>
<pre>widgets: null
@ -180,9 +180,9 @@ Icarus allows you to configure your site on a per-page or per-layout basis.
</td>
</tr>
<tr>
<td><img src="https://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/default-config.png"></td>
<td><img src="https://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/post-config.png"></td>
<td><img src="https://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/layout-config.png"></td>
<td><img width="266" src="https://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/default-config.png"></td>
<td><img width="266" src="https://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/post-config.png"></td>
<td><img width="266" src="https://ppoffice.github.io/hexo-theme-icarus/gallery/screenshots/layout-config.png"></td>
</tr>
</table>
</div>

View File

@ -1,7 +1,7 @@
/**
* Add resolved variables to the theme config for stylus.
*/
module.exports = function (hexo) {
module.exports = function(hexo) {
hexo.extend.filter.register('template_locals', locals => {
const fontcdn = hexo.extend.helper.get('fontcdn').bind(hexo);
hexo.theme.config['@fontface'] = {

View File

@ -10,8 +10,7 @@
"author": "ppoffice <zrp1994@gmail.com>",
"license": "MIT",
"scripts": {
"lint": "eslint --ext .js --ext .jsx --ext .json .",
"postpublish": "PACKAGE_VERSION=$(cat package.json | grep \\\"version\\\" | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]') && git tag $PACKAGE_VERSION && git push --tags"
"lint": "eslint --ext .js --ext .jsx --ext .json ."
},
"devDependencies": {
"eslint": "^6.8.0",