Giter Club home page Giter Club logo

hexo-component-inferno's Introduction

A collection of Inferno.js layout components and utility scripts for Hexo

Build Status NPM version Coverage Status

Install

$ npm install hexo-component-inferno --save

API Documentation

Please refer to this page.

Examples

Please refer to tests in the src directory or take a look at hexo-theme-icarus.

hexo-component-inferno's People

Contributors

imaegoo avatar leimao avatar liziwl avatar magic0whi avatar nofated095 avatar pj-568 avatar ppoffice avatar ppwwyyxx avatar ray-eldath avatar removeif avatar robberphex avatar tim-paik avatar wangzhiyao avatar y-young avatar yunchaozheng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hexo-component-inferno's Issues

Gitalk CDN need version update

it seems that version 1.6.2 used in gitalk.jsx will cause Error: Request failed with status code 403 when initiating comment in new articles. Gitalk changed its proxy config in latest version so change to 1.7.2 can solve the bug
Refer to gitalk/gitalk#426

Tab plugin does not work with other html hashes

The following code:

const $tabMenu = document.querySelector(\`a[href="\${location.hash}"]\`);
if (!$tabMenu) {
return;
}
const $tabMenuContainer = $tabMenu.parentElement.parentElement;
Array.from($tabMenuContainer.children).forEach($menu => $menu.classList.remove('is-active'));

treats any location.hash as part of an menu. However, in practice, location.hash may point to other elements in the page.

This causes my page to error at the line:

       Array.from($tabMenuContainer.children).forEach($menu => $menu.classList.remove('is-active')); 

because the classList attribute is not available.

I think there should be a check that location.hash really points to something in a tab menu.

Update KaTeX to 1.15.1

jsUrl: helper.cdn('katex', '0.13.22', 'dist/katex.min.js'),
cssUrl: helper.cdn('katex', '0.13.22', 'dist/katex.min.css'),
autoRenderUrl: helper.cdn('katex', '0.13.22', 'dist/contrib/auto-render.min.js'),
mhchemUrl: helper.cdn('katex', '0.13.22', 'dist/contrib/mhchem.min.js'),

Changelog: https://github.com/KaTeX/KaTeX/releases

Feature added: \relax, \nonumber and \notag were implemented.

Would you mind making a new release? The npm package hasn't been updated for 5 months. The katex plugin was still v0.11.1 and every new feature since then like align environment was not available.

fontcdn 设置不生效

https://github.com/ppoffice/hexo-component-inferno/blob/master/src/hexo/helper/cdn.js#L132-L139

this.config 取的是 hexo 的配置文件,而不是主题的配置文件。导致只取到默认值 google。

package.json
{
  "name": "hexo-site",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "4.2.0"
  },
  "dependencies": {
    "bulma-stylus": "0.8.0",
    "hexo": "^4.2.0",
    "hexo-abbrlink": "^2.0.5",
    "hexo-component-inferno": "^0.2.0",
    "hexo-filter-mathjax": "^0.4.1",
    "hexo-filter-nofollow": "^2.0.2",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-feed": "^2.2.0",
    "hexo-generator-index": "^1.0.0",
    "hexo-generator-seo-friendly-sitemap": "^0.0.25",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-inferno": "^0.1.3",
    "hexo-renderer-markdown-it": "^4.1.0",
    "hexo-renderer-stylus": "^1.1.0",
    "hexo-server": "^1.0.0",
    "inferno": "^7.3.3",
    "inferno-create-element": "^7.3.3"
  },
  "devDependencies": {
    "hexo-browsersync": "^0.3.0"
  }
}

External Links bug, unable to render url AND hide hostname with Icarus

Based on docs found here: https://ppoffice.github.io/hexo-component-inferno/module-view_widget_links-Links.html

Using the following YAML in _config.icarus.yml

	links:
      Link Name 1: /path/to/external/site
      Link Name 2:
        link: /path/to/external/site
        hide_hostname: true

The first link renders correctly.

The second link displays the name, and hides the space for the hostname, but does not render the hostname within the link so there is no link.

image

Feature Request: auto_expand for toc

currently the toc generated for post will show all subtitles at once. for many long articles, this will leads to a full-page catalogue with many lines wrapped:
image
it wastes space while affecting user experience, for some substitles may be hidden forever provided the toc is still sticked. one decent solution is to make the toc stacked by default, but expended when the subtitle enters viewport:

image

two popular hexo themes already bundled with such function AFAIK, related code is at here and here. I'm still investigating how to integrate such feature into icarus, hope the solution will be found out soon.

Is there any plans to add Waline comment system?

Waline is a safer inspired by Valine with self hoted backend support, I tried to deploy with docker and use mysql as it's database and found that it's easier to deploy than isso. Then I tried to add this feature to inferno by myself but I was not very familiar with js and failed. So I sincerely hope can get your help.

There are some links maybe helpful:
Waline Github
Waline HomePage

Thanks.

waline评论的问题

a/index.htmla/ 会被是为不同的网页,其评论不通用。虽然可以通过设置waline的path来解决(如下)

Waline({
  path: location.pathname.endsWith('/index.html')?location.pathname.substring(0,(location.pathname.lastIndexOf('/')+1)):location.pathname
})

但是 hexo-component-inferno 并没有提供设置 path 的接口,希望能提供一个设置path的接口。(虽然现在直接改js也能用

相关issue: ppoffice/hexo-theme-icarus#1021, walinejs/waline#748

TOC 功能新增

现在的toc三级以后的无法展开了...最好是能够看到所有层级,哪怕规定最多6级也可以。

还有就是能否加一个默认toc展开的选项,这样看起来会方便些。

Structured data missing "publisher"

image

Currently I validate my post which is using hexo-theme-icarus.
I notice that the google structured data validator report that the post doesn't have the required column named "publisher".
I think we could probably just add "publisher" into strutured data like "author".

Disable download icon

Lightgallery has the option to disable the download icon when viewing photos from the gallery but I can seem to find it.

Can anyone point me to the right direction? Thanks

Error: EISDIR: illegal operation on a directory, read. Package hexo-component-inferno is not installed.

问题描述

因为我想改些代码,所以先 fork 这个仓库,然后在我的博客 icarus 主题下安装我 fork 的这个仓库,执行 hexo g 报错 Error: EISDIR: illegal operation on a directory, read

复现步骤

  1. fork 该仓库。
  2. cd 到博客主题 icarus 目录下。
  3. npm 安装我刚 fork 的该仓库。
# gan @ ganzhixiongdeMac-Studio in ~/Documents/blog/themes/icarus on git:master x [13:14:32] 
$ npm install --save ganzhixiong/hexo-component-inferno


changed 1 package in 43s

75 packages are looking for funding
  run `npm fund` for details
  1. cd 到 hexo 博客根目录,执行 hexo ghexo s
# gan @ ganzhixiongdeMac-Studio in ~/Documents/blog on git:master x [13:19:26] 
$ hexo g
INFO  Validating config
ERROR {
  err: [Error: EISDIR: illegal operation on a directory, read] {
    errno: -21,
    code: 'EISDIR',
    syscall: 'read'
  }
} Plugin load failed: %s hexo-component-inferno
Inferno is in development mode.
INFO  =======================================
 ██╗ ██████╗ █████╗ ██████╗ ██╗   ██╗███████╗
 ██║██╔════╝██╔══██╗██╔══██╗██║   ██║██╔════╝
 ██║██║     ███████║██████╔╝██║   ██║███████╗
 ██║██║     ██╔══██║██╔══██╗██║   ██║╚════██║
 ██║╚██████╗██║  ██║██║  ██║╚██████╔╝███████║
 ╚═╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝
=============================================
INFO  === Checking package dependencies ===
ERROR Package hexo-component-inferno is not installed.
ERROR Please install the missing dependencies your Hexo site root directory:
ERROR npm install --save hexo-component-inferno@github:ganzhixiong/hexo-component-inferno
ERROR or:
ERROR yarn add hexo-component-inferno@github:ganzhixiong/hexo-component-inferno

# gan @ ganzhixiongdeMac-Studio in ~/Documents/blog on git:master x [13:19:32] C:255
$ hexo s
INFO  Validating config
Inferno is in development mode.
ERROR {
  err: [Error: EISDIR: illegal operation on a directory, read] {
    errno: -21,
    code: 'EISDIR',
    syscall: 'read'
  }
} Plugin load failed: %s hexo-component-inferno
INFO  =======================================
 ██╗ ██████╗ █████╗ ██████╗ ██╗   ██╗███████╗
 ██║██╔════╝██╔══██╗██╔══██╗██║   ██║██╔════╝
 ██║██║     ███████║██████╔╝██║   ██║███████╗
 ██║██║     ██╔══██║██╔══██╗██║   ██║╚════██║
 ██║╚██████╗██║  ██║██║  ██║╚██████╔╝███████║
 ╚═╝ ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝
=============================================
INFO  === Checking package dependencies ===
ERROR Package hexo-component-inferno is not installed.
ERROR Please install the missing dependencies your Hexo site root directory:
ERROR npm install --save hexo-component-inferno@github:ganzhixiong/hexo-component-inferno
ERROR or:
ERROR yarn add hexo-component-inferno@github:ganzhixiong/hexo-component-inferno

如何自定义 gitalk 的样式 ?

目前我是在 themes/icarus/source/css/ 目录下创建一个 gitalk.css 文件,然后修改 gitalk.js 中的 cssUrl 的值为 /css/gitalk.css,来实现的。但是这样得修改依赖包。

还有没有其他不修改依赖包的方法。

Generate Wrong TOC

I have a post with the following headings (there is no h3):

h2
h2
h2
h4
h4
h4
h4
h2

And I used the toc widget with depth=3.
I printed tocObj from

tocObj.forEach((item) => {
and it shows

[
  { text: 'Registration', id: 'Registration', level: 2 },
  {
    text: 'Pay for what you use',
    id: 'Pay-for-what-you-use',
    level: 2
  },
  { text: 'Global states', id: 'Global-states', level: 2 },
  { text: 'Name conflicts', id: 'Name-conflicts', level: 4 },
  { text: 'Overwrites', id: 'Overwrites', level: 4 },
  {
    text: 'Pickle & multiprocessing',
    id: 'Pickle-multiprocessing',
    level: 4
  },
  { text: 'Obscure Provenance', id: 'Obscure-Provenance', level: 4 },
  {
    text: 'Alternative: just use full qualname',
    id: 'Alternative-just-use-full-qualname',
    level: 2
  }
]

However, when I print the return value of the getToc function, it's:

{
  '1': { id: 'Registration', text: 'Registration', index: '1' },
  '2': {
    id: 'Pay-for-what-you-use',
    text: 'Pay for what you use',
    index: '2'
  },
  '3': {
    '1': {
      id: 'Obscure-Provenance',
      text: 'Obscure Provenance',
      index: '3.1'
    },
    id: 'Global-states',
    text: 'Global states',
    index: '3'
  },
  '4': {
    id: 'Alternative-just-use-full-qualname',
    text: 'Alternative: just use full qualname',
    index: '4'
  }
}

So among the 4 h4s, only one is kept.

I don't know what the intended behavior is (keep all h4? keep no h4? throw an error?), but the current behavior is probably not intended.

auto_expand should persist visibility between gaps of subtitles.

toc:
image

GIF:
gif

The problem is that when the viewport is scrolled into the three-level subtitles, the whole toc is stacked abruptly. Notably, this bug only happens in the first sequence of three-level subtitles but works fine at the second occurance of three-level subtitle. IMHO this is because the first and second three-level subtitles is directly under the first-level subtitle, namely there's a "gap" between its direct upper level and itself (1 down to 3, 2 is missed). when such gap perceived, the expected behavior, arguably, is to persist the visibility of the toc.

show hostname of links widget only there're enough space w/o wrap the line

Currently the links widget defaultly show all hostname. despite the situation where the description is long, and the item will wrap, causing very uncomforable looking, e.g.
image

and it's better to automatically discard the hostname part if there's no enough space. this could be archive by reimplement the structure in hexo-component-inferno → lib → view → widget → link.js → Links → <function> → value, using a grid system or whatnot.

currently I'm using hand-written and hard-coded length-of-string schema, kinda like this:

let item = [(0, _inferno.createVNode)(1, "span", "level-left", (0, _inferno.createVNode)(1, "span", "level-item", i, 0), 2)];
if (hostname.length <= 15)
  item.push((0, _inferno.createVNode)(1, "span", "level-right", (0, _inferno.createVNode)(1, "span", "level-item tag", hostname, 0), 2));
return (0, _inferno.createVNode)(1, "li", null, (0, _inferno.createVNode)(1, "a", "level is-mobile", item, ...

Considering the fact that this is a relatively very small, simple but great improvement, it'll be better if this small improvement could be merged into mainstream, and released ASAP.

Waline更新

已经更新到2.14.1了

(没有办法自动使用最新版的js吗..?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.