Coder Social home page Coder Social logo

cube-generator's Introduction

cube-generator

本项目是用于生成hexo-theme-cube的种子项目, 采用gulp进行自动化构建, 如果你想修改主题的代码, 可以通过该项目进行修改重新生成主题

安装启动

  • 在你的Hexo站点目录下clone该项目

      git clone https://github.com/ZEROKISEKI/cube-generator.git themes/cube-generator --depth 1
    
  • Hexo站点__config.yml切换主题

      theme: cube
    
  • 安装必要的模块

      npm install
    
  • 在你的Hexo目录安装搜索支持模块(可选)

      npm install hexo-generator-json-content --save
    

    如果不想要安装搜索模块, 那么请在主题的_config.yml进行配置

      search: false
    
  • 通过gulp进行主题生成

      gulp watch
    
  • gulp watch执行到clean状态之后, 执行下列命令

      hexo clean & hexo g
      hexo s
    

此时可以在本地上预览主题的效果

修改代码

如果你之前跑了gulp watch, 那么如果你修改了source或者是languages或者layout里面的文件, 都会重新生成新的主题,你会在终端看到下面的输出

请执行hexo s开启服务器查看效果   

这个时候你只要执行hexo s可以直接在本地查看效果(子进程已经帮你清除Hexo缓存并重新生成public文件夹了)

修改_config.yml

该项目下的_config.yml即是生成主题的_config.yml, 相关配置可以写在这个_config.yml上面, _config.yml的配置说明见hexo-theme-cube

修改markdown代码的主题风格

hexo-theme-cube默认采用的是vs2015的风格, 如果你要切换代码主题风格, 可以在gulp/config.js上面进行修改

// 设置markdown 代码块风格
const Markdown = 'vs2015';

代码主题采用的是highlight, 你可以在source/sass/highlight下找到对应代码主题的样式代码, 如果要切换主题, 修改markdown即可, 比如

// 在source/sass/highlight下有一个xcode.scss
const Markdown = 'xcode';

重新启动gulp watch(由于修改的是gulp目录下的文件, 监听是无效的, 如果之前有gulp watch的进程,kill掉后重新输入gulp watch), 按照上面的步骤重新生成主题

使用生成的主题

运行gulp deploy生成主题, 将主题的source/js/script.js.map删除(如果有的话, gulp在build那里的代码没写好, 如果之前gulp watch生成了cube主题, 那么deploy之后map不会被删除, 要手动删除)

协议

该项目基于MIT协议开源

cube-generator's People

Contributors

zerokiseki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cube-generator's Issues

是否可以修改代码块的默认字体?

感谢您能写出这个主题,这个cube主题的设计理念我非常喜欢。
如题,在尝试修改代码风格时遇到了一些问题,请问是否有途径调整代码块部分的字体?

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.