Git Product home page Git Product logo

fan's Introduction

Fan

这是一个深色主题,如梦幻般的星空,群星闪烁。

Preview

Install

git clone https://github.com/fan-lv/Fan.git themes/Fan

修改位于博客根目录下的 _config.yml 内的 theme 选项值为 Fan

Update

cd themes/Fan
git pull

Required packages

  • hexo-renderer-jade
  • hexo-renderer-stylus

若报错 extends includes/layout.pug block content include includes/recent-posts.pug include includes/pagination.pug

安装依赖包,重新生成

npm install --save hexo-renderer-jade hexo-renderer-stylus

Notes: 有说 hexo-renderer-jade 包过期的,可以用 hexo-renderer-pug

其他扩展依赖包参考

npm install --save hexo-generator-feed hexo-generator-sitemap hexo-generator-archive hexo-browsersync

Questions

  • 若报错 layout\includes\config.pug:1, Cannot read property 'appId' of undefined, 需要把 themes -> _config.ymlalgolia_search:enable 改成 false

Feature

Top article

支持文章置顶功能,在需要置顶的文章(Markdown 文件)加入 top: 1,数值越大越靠前。

如:

title: xxx
author: xxx
tags:
  - xxx
categories:
  - xxx
date: xxx
top: 1

Comments

目前支持 GitmentValine 评论。

使用方法:

  1. 在根目录下 _config.yml 文件中加入以下代码,["gitment", "valine"] 配置自行选择一个,第二步中选择使用哪个

    comments:
      gitment:
        enable: true
        owner: 'Your GitHub ID'
        repo: 'The repository to store your comments. Make sure you're repo's owner'
        client_id: 'GitHub client ID'
        client_secret: 'GitHub client secret'
    
      # 可以自由配置 valine 的其他配置项
      valine:
        appId: 'Your appId'
        appKey: 'Your appKey'
        placeholder: 'xxx'
        ...(valine配置项,参考链接 https://valine.js.org/configuration.html)
    
  2. themes -> _config.yml 中可以开启或关闭 comments,并且通过 type 指定使用的评论插件

    # 评论
    comments:
      enable: true
      # 使用哪种评论插件["gitment", "valine"]
      type: "valine"
    

Algolia_search

  1. 注册 Algolia账户,创建新的 Index,记下 index name

  2. 安装扩展

    npm install hexo-algolia --save
    
  3. 修改 Algolia 搜索 ACL(访问控制列表) 默认的 Search-Only API Key 不能修改,需要在 All API Keys -> New API Key

    勾选 ACLs: search addObject deleteObject listIndexes deletelndex

    执行安装

    export HEXO_ALGOLIA_INDEXING_KEY=New API Key
    hexo algolia
    

    Notes: Mac 和 git bash 为 export, Windows 为 set, Powershell 用 $env

  4. 获取 Key,更新站点根目录配置

    algolia:
      applicationID: 'Application ID'
      apiKey: 'New API Key'
      indexName: 'index name'
    
  5. 主题配置下开启 Algolia_search

    algolia_search:
      enable: true
      hits:
        per_page: 10
    

    注意,每次更新文章后记得执行 hexo algolia 更新索引。

主题预览图

License

MIT

fan's People

Contributors

doratiger avatar fan-lv avatar gcs-zhn avatar xcbyao 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar

fan's Issues

gitment评论问题

我给我的blog配置了gitment评论,部署之后gitment评论好像没用,不能初始化

hexo5.0.0+版本toc不会跳转

5.0.0+版的hexo在toc生成时会对中文toc-link进行编码,但是文章本体的toc-link地址不会编码。导致scroll.js的监听事件读取到的toc-link地址不匹配,无法正确的激活sidebar的toc。
我fork以后在sidebar.js最后加了一个对toc的toc-link的href进行decode的过程,sidebar就可以正常跳转和激活了。

Help!!

#Update
How to use localsearch or algolia? Can show me your config algolia or localsearch!!

在哪里添加备案信息?

在两个 config.yml 中都没有找到适合用于添加备案信息的 div 。希望能添加一个 div 用于在 footer 中显示自定义内容。

问题

安装并设置主题后,本地打不开为什么
并且访问博客后无法显示

请教下为啥我在本地显示不出来呢

页面上显示这个,不知道为啥,其它有pug标签的主题都试了,都不行
extends includes/layout.pug block content include includes/recent-posts.pug include includes/pagination.pug

资源消耗好大啊

资源消耗好大啊, 我mac电脑打开博客放一会 风扇转速飙升```关了博客就好了

移动端适配建议

移动端字太小了,很难看清楚,而且没法打开边栏
还希望能够设置边栏自动展开

Feature Request

1.can add the nprogress support ?
2.how can i add GitHub Corners?
3.how to add menu icon?
4. how to use search?

建议去掉鼠标滚轮的惯性滚动效果

电脑上在鼠标滚轮滚动时似乎模拟了触摸屏的惯性滚动效果,但是触屏惯性是系统层次实现的,想停在某一具体位置只需点击屏幕,而在滚轮滚动时使用惯性滚动很难控制滚动到某一细节位置。建议去掉这个效果。

功能扩展

什么时候可以加入分享以及打赏功能

细节问题补充(对新手友好)

  1. 在 config 文件中加入以下代码

这里希望补充一下,是 总配置文件里的 _config.yml ,对小白更友好,期待主题可以变得更完美

可以适配移动端嘛?

您好,很喜欢您这个主题,很漂亮,也很喜欢深色主题。

但是在手机上打开您的博客主页仍然是以 PC 端的方式打开的, 体验不太好,后期会优化嘛?

Sent from PPHub For GitHub

404页面问题

hexo new page 404后添加title: Page Not Found,permalink: /404,页面的确转跳404,但是标题是menu.Page Not Found

如图

配置了gitment却不显示

_config.yml

comments:
  gitment:
    owner: 'F-Unction'
    repo: '[email protected]:F-Unction/f-unction.github.io.git'
    client_id: 'bca5d27xxxxxxxxxed82'
    client_secret: '497a7994518727xxxxxxxxxxxxx2b7403294e401'

themes/Fan/_config.yml

comments:
    enable: true

实际效果
深度截图_选择区域_20200501094850

layout.pug文件报错

Unhandled rejection TypeError: F:\Blog\themes\Fan\layout\includes\layout.pug:11
9|
10| - var pageDescription = page.description || page.title || config.description || ''

11| - var pageKeywords = (config.keywords || []).join(',')
12| - if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
13| - var pageAuthor = config.author + ',' + config.email
14| - var pageCopyright = config.copyright || config.author

(config.keywords || []).join is not a function

第11行报错,说不是一个类

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.