Skip to content

Commit

Permalink
Update hexo-generator-index
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Aug 9, 2020
1 parent 8abad20 commit b607ee6
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
18 changes: 9 additions & 9 deletions lib/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const fs = require('fs');
const path = require('path');
const table = require('text-table');
const { green, magenta, red } = require('chalk');

function resolve(name) {
return path.dirname(require.resolve(`${name}/package.json`));
Expand Down Expand Up @@ -36,14 +37,13 @@ function test(color) {
}

const basename = `${resolve('highlight.js')}/styles/`;
const list = fs.readdirSync(basename).filter(name => name.endsWith('.css')).map(name => {
let { file, background, foreground } = highlightTheme(name.replace('.css', ''));
file = file.replace(basename, '');
background = background.trim();
foreground = foreground.trim();
return [file, background, foreground];
}).filter(item => {
return !(test(item[1]) && test(item[2]));
});
const list = fs.readdirSync(basename)
.filter(name => name.endsWith('.css'))
.map(name => highlightTheme(name.replace('.css', '')))
.filter(({ background, foreground }) => {
return !(test(background) && test(foreground));
}).map(({ file, background, foreground }) => {
return [green(file.replace(basename, '')), magenta(background.trim()), red(foreground.trim())];
});

console.log(table(list));
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"hexo": "5.0.0",
"hexo-generator-archive": "1.0.0",
"hexo-generator-feed": "2.2.0",
"hexo-generator-index": "hexojs/hexo-generator-index",
"hexo-generator-index": "2.0.0",
"hexo-generator-searchdb": "1.3.2",
"hexo-renderer-marked": "hexojs/hexo-renderer-marked",
"hexo-renderer-stylus": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion source/_data/sidebar.njk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="cc-license motion-element" itemprop="sponsor">
<div class="cc-license animated" itemprop="sponsor">
<span class="exturl cc-opacity" title="Deploy with Netlify → https://www.netlify.com" data-url="aHR0cHM6Ly93d3cubmV0bGlmeS5jb20="><img width="80" src="https://www.netlify.com/img/global/badges/netlify-dark.svg" alt="Netlify"></span>
</div>
13 changes: 13 additions & 0 deletions source/docs/tag-plugins/note.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,26 @@ note info, note info, note info
{% note primary This is a summary %}
#### Details and summary
Note with summary: `note primary This is a summary`
{% endnote %}
```

{% note primary This is a summary %}
#### Details and summary
Note with summary: `note primary This is a summary`
{% endnote %}

```md
{% note info no-icon This is a summary %}
#### Details and summary (No icon)
Note with summary: `note info no-icon This is a summary`
{% endnote %}
```

{% note info no-icon This is a summary %}
#### Details and summary (No icon)
Note with summary: `note info no-icon This is a summary`
{% endnote %}

```md
{% note success %}
#### Codeblock in note
Expand Down
2 changes: 1 addition & 1 deletion source/docs/theme-settings/custom-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ menu:

{% note warning %}
If you enable any comment system for your site, comments will be shown for all posts and pages.
See [«How to Disable Comments on Page»](/docs/third-party-services/#How-to-Disable-Comments-on-Page) if you want to do it for pages like `tags` or `categories`.
See [«How to Disable Comments on Page»](/docs/third-party-services/comments.html#How-to-Disable-Comments-on-Page) if you want to do it for pages like `tags` or `categories`.
{% endnote %}

#### Tagcloud
Expand Down
2 changes: 1 addition & 1 deletion source/docs/theme-settings/front-matter.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Setting | Type | Description | Default
`header` | `boolean` | Whether to display the post header in index page | `true`
`mathjax` | `boolean` | MathJax support | `!math.per_page` in `_config.yml`
`sidebar` | `boolean` | Whether the sidebar will be shown | Depends on `sidebar.display` in `_config.yml`
`sticky` | `number` | [hexo-generator-indexed](https://github.com/next-theme/hexo-generator-indexed) plugin required | 0
`sticky` | `number` | [hexo-generator-index](https://github.com/hexojs/hexo-generator-index) plugin required | 0
`quicklink` | `object` (1) | Quicklink support | From `_config.yml`
`reward_settings` | `object` (1) | Reward settings | From `_config.yml`
`toc` | `object` (1) | Table of Contents in the sidebar | From `_config.yml`
Expand Down

0 comments on commit b607ee6

Please sign in to comment.