zoukankan      html  css  js  c++  java
  • Hexo常用指令

    Hexo常用指令

    大部分都是从官网复制粘贴,会持续更新

    此后会写一篇,修改Hexo主题的教程,或者Hexo工作流程剖析

    Hexo的目录结构:

    .
    ├── _config.yml
    ├── package.json
    ├── scaffolds
    ├── source
    |   ├── _drafts
    |   └── _posts
    └── themes
    
    package.json
    {
      "name": "hexo-site",
      "version": "0.0.0",
      "private": true,
      "hexo": {
        "version": ""
      },
      "dependencies": {
        "hexo": "^3.0.0",
        "hexo-generator-archive": "^0.1.0",
        "hexo-generator-category": "^0.1.0",
        "hexo-generator-index": "^0.1.0",
        "hexo-generator-tag": "^0.1.0",
        "hexo-renderer-ejs": "^0.1.0",
        "hexo-renderer-stylus": "^0.2.0",
        "hexo-renderer-marked": "^0.2.4",
        "hexo-server": "^0.1.2"
      }
    }
    

    scaffolds

    Scaffold folder. When you create a new post, Hexo bases the new file on the scaffold.

    source

    Source folder. This is where you put your site’s content. Hexo ignores hidden files and files or folders whose names are prefixed with _ (underscore) - except the _posts folder. Renderable files (e.g. Markdown, HTML) will be processed and put into the public folder, while other files will simply be copied.

    themes

    Theme folder. Hexo generates a static website by combining the site contents with the theme.

    Commands

    new

    $ hexo new [layout] <title>
    

    Creates a new article. If no layout is provided, Hexo will use the default_layout from _config.yml. If the title contains spaces, surround it with quotation marks.

    generate

    $ hexo generate
    

    Generates static files.

    Option Description

    -d, --deploy	Deploy after generation finishes
    -w, --watch	Watch file changes
    

    publish

    $ hexo publish [layout] <filename>
    

    Publishes a draft.

    server

    $ hexo server
    

    Starts a local server. By default, this is at http://localhost:4000/.

    Option Description

    -p, --port	Override default port
    -s, --static	Only serve static files
    -l, --log	Enable logger. Override logger format.
    

    deploy

    $ hexo deploy
    

    Deploys your website.

    Option Description

    -g, --generate	Generate before deployment
    

    render

    $ hexo render <file1> [file2] ...
    

    Renders files.

    Option Description

    -o, --output	Output destination
    

    migrate

    $ hexo migrate

    Migrates content from other blog systems.

    clean

    $ hexo clean
    

    Cleans the cache file (db.json) and generated files (public).

    list

    $ hexo list <type>
    

    Lists all routes.

    version

    $ hexo version
    

    Displays version information.

    Customize config file path

    $ hexo --config custom.yml
    

    Uses a custom config file (instead of _config.yml).

    Display drafts

    $ hexo --draft
    

    Displays draft posts (stored in the source/_drafts folder).

    Customize CWD

    $ hexo --cwd /path/to/cwd
    

    Customizes the path of current working directory.

  • 相关阅读:
    背包系列 hdu3449 有依赖背包
    背包系列 hdu 3535 分组背包
    屏蔽scrollview的滚动
    高精度算法代码
    输入法出现时,中间固定,底部上移的代码
    排序之分治排序
    排序之双向冒泡排序
    Miller Rabin 大素数测试
    来聊聊WWDC 苹果大会上的那些黑科技
    不想成为好leader的程序猿不是好攻城狮
  • 原文地址:https://www.cnblogs.com/ZxrGloria/p/5770310.html
Copyright © 2011-2022 走看看