Skip to content

Commit

Permalink
chore: minor fixes and add travis ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ppoffice committed Mar 12, 2020
1 parent e4cdb01 commit a8b7dd6
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 17 deletions.
53 changes: 53 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>

Expand All @@ -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
Expand All @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion include/hexo/filter/stylus.js
Original file line number Diff line number Diff line change
@@ -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'] = {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"author": "ppoffice <[email protected]>",
"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",
Expand Down

0 comments on commit a8b7dd6

Please sign in to comment.