prepare

$ npm i -g hexo-cli

init

$ mkdir myblog && cd myblog
$ hexo init
init details
  $ hexo init
  INFO  Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
  INFO  Install dependencies
  added 183 packages from 421 contributors and audited 189 packages in 22.277s

  12 packages are looking for funding
    run `npm fund` for details

  found 0 vulnerabilities

  INFO  Start blogging with Hexo!

add theme

credit belongs to snark

clone code

In a Git repo
In a folder
Update theme
$ git submodule add https://github.com/imarslo/hexo-theme-snark.git themes/snark
$ git clone https://github.com/imarslo/hexo-theme-snark.git themes/snark
$ sed '/highlight:/{n;s/^.*$/\ \ enable: false/}' -i _config.xml
$ sed '/highlight:/{n;n;s/^.*$/\ \ line_number: false/}' -i _config.xml
$ git submodule sync --recursive
$ git submodule update --init --recursive

install plugin

$ npm install hexo-renderer-pug --save
$ npm install hexo-renderer-sass --save
$ npm install hexo-generator-feed --save
$ npm install hexo-generator-search --save
$ npm install hexo-generator-sitemap --save

generate new pages

$ hexo new page archives
$ hexo new page categories
$ hexo new page tags
$ hexo new page about

diable the default highlight settings

default settings in _config.xml

cmd with sed
or
result
$ sed '/highlight:/{n;s/^.*$/\ \ enable: false/;n;s/^.*$/\ \ line_number: false/;}' -i _config.xml
$ sed '/highlight:/{n;s/^.*$/\ \ enable: false/}' -i _config.xml
$ sed '/highlight:/{n;n;s/^.*$/\ \ line_number: false/}' -i _config.xml
$ grep highlight: _config.yml -A 6
highlight:
  enable: false
  line_number: false
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false

Copyright © marslo 2020-2023 all right reserved,powered by GitbookLast Modified: 2024-03-12 15:01:30

results matching ""

    No results matching ""