题图:87testing.com
前不久用wordpress搭建了一个博客,用起来感觉不是太好用,并且数据库经常会发生异常挂掉,没找到解决方案。
看到有不少人使用的hexo+github方式搭建属于自己的博客,
于是,我也做了一些尝试,将搭建的过程整理出来,希望也能帮到他人。
同时,推荐没有Blog的朋友也尝试自己搭建下,中间可能会遇到一些问题,解决问题的过程很痛苦,但是只要爱折腾,最终都能迎刃而解。
一、环境准备
1、安装git (https://git-scm.com/downloads) 安装目的:用来把本地的hexo内容push到github上。
2、安装node(https://nodejs.org/en/download/)安装目的:用来生成静态页面
3、申请github账号(https://github.com/) ssh keys相关的配置之前介绍过,这里就不过多描述:http://www.87testing.com/2017/07/02/pycharm-e5-85-b3-e8-81-94github/
二、安装hexo
1、创建一个文件夹blog,进入到这个blog目录,安装hexo,执行:sudo npm install -g hexo
如下代表执行成功:
TTZhangdeMacBook-Pro:blog admin$ sudo npm install -g hexo
Password:
npm WARN deprecated swig@1.4.2: This package is no longer maintained
/usr/local/bin/hexo -> /usr/local/lib/node_modules/hexo/bin/hexo
> dtrace-provider@0.8.5 install /usr/local/lib/node_modules/hexo/node_modules/dtrace-provider
> node scripts/install.js
> fsevents@1.1.2 install /usr/local/lib/node_modules/hexo/node_modules/fsevents
> node install
[fsevents] Success: "/usr/local/lib/node_modules/hexo/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
> hexo-util@0.6.1 postinstall /usr/local/lib/node_modules/hexo/node_modules/hexo-util
> npm run build:highlight
> hexo-util@0.6.1 build:highlight /usr/local/lib/node_modules/hexo/node_modules/hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json
/usr/local/lib
└─┬ hexo@3.3.8
├── abbrev@1.1.0
├── archy@1.0.0
├── bluebird@3.5.0
├─┬ chalk@1.1.3
│ ├── ansi-styles@2.2.1
│ ├── escape-string-regexp@1.0.5
│ ├─┬ has-ansi@2.0.0
│ │ └── ansi-regex@2.1.1
│ ├── strip-ansi@3.0.1
│ └── supports-color@2.0.0
├─┬ cheerio@0.20.0
│ ├─┬ css-select@1.2.0
│ │ ├── boolbase@1.0.0
│ │ ├── css-what@2.1.0
│ │ ├── domutils@1.5.1
│ │ └── nth-check@1.0.1
│ ├─┬ dom-serializer@0.1.0
│ │ └── domelementtype@1.1.3
│ ├── entities@1.1.1
│ ├─┬ htmlparser2@3.8.3
│ │ ├── domelementtype@1.3.0
│ │ ├── domhandler@2.3.0
│ │ ├── entities@1.0.0
│ │ └─┬ readable-stream@1.1.14
│ │ ├── core-util-is@1.0.2
│ │ ├── isarray@0.0.1
│ │ └── string_decoder@0.10.31
│ └─┬ jsdom@7.2.2
│ ├── abab@1.0.3
│ ├── acorn@2.7.0
│ ├── acorn-globals@1.0.9
│ ├── cssom@0.3.2
│ ├── cssstyle@0.2.37
│ ├─┬ escodegen@1.8.1
│ │ ├── esprima@2.7.3
│ │ ├── estraverse@1.9.3
│ │ ├── esutils@2.0.2
│ │ ├─┬ optionator@0.8.2
│ │ │ ├── deep-is@0.1.3
│ │ │ ├── fast-levenshtein@2.0.6
│ │ │ ├── levn@0.3.0
│ │ │ ├── prelude-ls@1.1.2
│ │ │ ├── type-check@0.3.2
│ │ │ └── wordwrap@1.0.0
│ │ └── source-map@0.2.0
│ ├── nwmatcher@1.4.1
│ ├── parse5@1.5.1
│ ├─┬ request@2.81.0
│ │ ├── aws-sign2@0.6.0
│ │ ├── aws4@1.6.0
│ │ ├── caseless@0.12.0
│ │ ├─┬ combined-stream@1.0.5
│ │ │ └── delayed-stream@1.0.0
│ │ ├── extend@3.0.1
│ │ ├── forever-agent@0.6.1
│ │ ├─┬ form-data@2.1.4
│ │ │ └── asynckit@0.4.0
│ │ ├─┬ har-validator@4.2.1
│ │ │ ├─┬ ajv@4.11.8
│ │ │ │ ├── co@4.6.0
│ │ │ │ └─┬ json-stable-stringify@1.0.1
│ │ │ │ └── jsonify@0.0.0
│ │ │ └── har-schema@1.0.5
│ │ ├─┬ hawk@3.1.3
│ │ │ ├── boom@2.10.1
│ │ │ ├── cryptiles@2.0.5
│ │ │ ├── hoek@2.16.3
│ │ │ └── sntp@1.0.9
│ │ ├─┬ http-signature@1.1.1
│ │ │ ├── assert-plus@0.2.0
│ │ │ ├─┬ jsprim@1.4.1
│ │ │ │ ├── assert-plus@1.0.0
│ │ │ │ ├── extsprintf@1.3.0
│ │ │ │ ├── json-schema@0.2.3
│ │ │ │ └─┬ verror@1.10.0
│ │ │ │ └── assert-plus@1.0.0
│ │ │ └─┬ sshpk@1.13.1
│ │ │ ├── asn1@0.2.3
│ │ │ ├── assert-plus@1.0.0
│ │ │ ├── bcrypt-pbkdf@1.0.1
│ │ │ ├─┬ dashdash@1.14.1
│ │ │ │ └── assert-plus@1.0.0
│ │ │ ├── ecc-jsbn@0.1.1
│ │ │ ├─┬ getpass@0.1.7
│ │ │ │ └── assert-plus@1.0.0
│ │ │ ├── jsbn@0.1.1
│ │ │ └── tweetnacl@0.14.5
│ │ ├── is-typedarray@1.0.0
│ │ ├── isstream@0.1.2
│ │ ├── json-stringify-safe@5.0.1
│ │ ├─┬ mime-types@2.1.16
│ │ │ └── mime-db@1.29.0
│ │ ├── oauth-sign@0.8.2
│ │ ├── performance-now@0.2.0
│ │ ├── qs@6.4.0
│ │ ├── safe-buffer@5.1.1
│ │ ├── stringstream@0.0.5
│ │ ├── tunnel-agent@0.6.0
│ │ └── uuid@3.1.0
│ ├── sax@1.2.4
│ ├── symbol-tree@3.2.2
│ ├─┬ tough-cookie@2.3.2
│ │ └── punycode@1.4.1
│ ├── webidl-conversions@2.0.1
│ ├─┬ whatwg-url-compat@0.6.5
│ │ └── tr46@0.0.3
│ └── xml-name-validator@2.0.1
├─┬ deep-assign@2.0.0
│ └── is-obj@1.0.1
├─┬ hexo-cli@1.0.3
│ ├── command-exists@1.2.2
│ ├── minimist@1.2.0
│ └── object-assign@4.1.1
├── hexo-front-matter@0.2.3
├─┬ hexo-fs@0.2.1
│ ├─┬ chokidar@1.7.0
│ │ ├─┬ anymatch@1.3.2
│ │ │ ├─┬ micromatch@2.3.11
│ │ │ │ ├─┬ arr-diff@2.0.0
│ │ │ │ │ └── arr-flatten@1.1.0
│ │ │ │ ├── array-unique@0.2.1
│ │ │ │ ├─┬ braces@1.8.5
│ │ │ │ │ ├─┬ expand-range@1.8.2
│ │ │ │ │ │ └─┬ fill-range@2.2.3
│ │ │ │ │ │ ├── is-number@2.1.0
│ │ │ │ │ │ ├─┬ isobject@2.1.0
│ │ │ │ │ │ │ └── isarray@1.0.0
│ │ │ │ │ │ ├─┬ randomatic@1.1.7
│ │ │ │ │ │ │ ├─┬ is-number@3.0.0
│ │ │ │ │ │ │ │ └── kind-of@3.2.2
│ │ │ │ │ │ │ └── kind-of@4.0.0
│ │ │ │ │ │ └── repeat-string@1.6.1
│ │ │ │ │ ├── preserve@0.2.0
│ │ │ │ │ └── repeat-element@1.1.2
│ │ │ │ ├─┬ expand-brackets@0.1.5
│ │ │ │ │ └── is-posix-bracket@0.1.1
│ │ │ │ ├── extglob@0.3.2
│ │ │ │ ├── filename-regex@2.0.1
│ │ │ │ ├─┬ kind-of@3.2.2
│ │ │ │ │ └── is-buffer@1.1.5
│ │ │ │ ├─┬ object.omit@2.0.1
│ │ │ │ │ ├─┬ for-own@0.1.5
│ │ │ │ │ │ └── for-in@1.0.2
│ │ │ │ │ └── is-extendable@0.1.1
│ │ │ │ ├─┬ parse-glob@3.0.4
│ │ │ │ │ ├── glob-base@0.3.0
│ │ │ │ │ └── is-dotfile@1.0.3
│ │ │ │ └─┬ regex-cache@0.4.3
│ │ │ │ ├── is-equal-shallow@0.1.3
│ │ │ │ └── is-primitive@2.0.0
│ │ │ └─┬ normalize-path@2.1.1
│ │ │ └── remove-trailing-separator@1.0.2
│ │ ├── async-each@1.0.1
│ │ ├─┬ fsevents@1.1.2
│ │ │ ├── nan@2.6.2
│ │ │ └─┬ node-pre-gyp@0.6.36
│ │ │ ├─┬ mkdirp@0.5.1
│ │ │ │ └── minimist@0.0.8
│ │ │ ├─┬ nopt@4.0.1
│ │ │ │ ├── abbrev@1.1.0
│ │ │ │ └─┬ osenv@0.1.4
│ │ │ │ ├── os-homedir@1.0.2
│ │ │ │ └── os-tmpdir@1.0.2
│ │ │ ├─┬ npmlog@4.1.0
│ │ │ │ ├─┬ are-we-there-yet@1.1.4
│ │ │ │ │ └── delegates@1.0.0
│ │ │ │ ├── console-control-strings@1.1.0
│ │ │ │ ├─┬ gauge@2.7.4
│ │ │ │ │ ├── aproba@1.1.1
│ │ │ │ │ ├── has-unicode@2.0.1
│ │ │ │ │ ├── object-assign@4.1.1
│ │ │ │ │ ├── signal-exit@3.0.2
│ │ │ │ │ ├─┬ string-width@1.0.2
│ │ │ │ │ │ ├── code-point-at@1.1.0
│ │ │ │ │ │ └─┬ is-fullwidth-code-point@1.0.0
│ │ │ │ │ │ └── number-is-nan@1.0.1
│ │ │ │ │ ├─┬ strip-ansi@3.0.1
│ │ │ │ │ │ └── ansi-regex@2.1.1
│ │ │ │ │ └── wide-align@1.1.2
│ │ │ │ └── set-blocking@2.0.0
│ │ │ ├─┬ rc@1.2.1
│ │ │ │ ├── deep-extend@0.4.2
│ │ │ │ ├── ini@1.3.4
│ │ │ │ ├── minimist@1.2.0
│ │ │ │ └── strip-json-comments@2.0.1
│ │ │ ├─┬ request@2.81.0
│ │ │ │ ├── aws-sign2@0.6.0
│ │ │ │ ├── aws4@1.6.0
│ │ │ │ ├── caseless@0.12.0
│ │ │ │ ├─┬ combined-stream@1.0.5
│ │ │ │ │ └── delayed-stream@1.0.0
│ │ │ │ ├── extend@3.0.1
│ │ │ │ ├── forever-agent@0.6.1
│ │ │ │ ├─┬ form-data@2.1.4
│ │ │ │ │ └── asynckit@0.4.0
│ │ │ │ ├─┬ har-validator@4.2.1
│ │ │ │ │ ├─┬ ajv@4.11.8
│ │ │ │ │ │ ├── co@4.6.0
│ │ │ │ │ │ └─┬ json-stable-stringify@1.0.1
│ │ │ │ │ │ └── jsonify@0.0.0
│ │ │ │ │ └── har-schema@1.0.5
│ │ │ │ ├─┬ hawk@3.1.3
│ │ │ │ │ ├── boom@2.10.1
│ │ │ │ │ ├── cryptiles@2.0.5
│ │ │ │ │ ├── hoek@2.16.3
│ │ │ │ │ └── sntp@1.0.9
│ │ │ │ ├─┬ http-signature@1.1.1
│ │ │ │ │ ├── assert-plus@0.2.0
│ │ │ │ │ ├─┬ jsprim@1.4.0
│ │ │ │ │ │ ├── assert-plus@1.0.0
│ │ │ │ │ │ ├── extsprintf@1.0.2
│ │ │ │ │ │ ├── json-schema@0.2.3
│ │ │ │ │ │ └── verror@1.3.6
│ │ │ │ │ └─┬ sshpk@1.13.0
│ │ │ │ │ ├── asn1@0.2.3
│ │ │ │ │ ├── assert-plus@1.0.0
│ │ │ │ │ ├── bcrypt-pbkdf@1.0.1
│ │ │ │ │ ├─┬ dashdash@1.14.1
│ │ │ │ │ │ └── assert-plus@1.0.0
│ │ │ │ │ ├── ecc-jsbn@0.1.1
│ │ │ │ │ ├─┬ getpass@0.1.7
│ │ │ │ │ │ └── assert-plus@1.0.0
│ │ │ │ │ ├── jodid25519@1.0.2
│ │ │ │ │ ├── jsbn@0.1.1
│ │ │ │ │ └── tweetnacl@0.14.5
│ │ │ │ ├── is-typedarray@1.0.0
│ │ │ │ ├── isstream@0.1.2
│ │ │ │ ├── json-stringify-safe@5.0.1
│ │ │ │ ├─┬ mime-types@2.1.15
│ │ │ │ │ └── mime-db@1.27.0
│ │ │ │ ├── oauth-sign@0.8.2
│ │ │ │ ├── performance-now@0.2.0
│ │ │ │ ├── qs@6.4.0
│ │ │ │ ├── safe-buffer@5.0.1
│ │ │ │ ├── stringstream@0.0.5
│ │ │ │ ├─┬ tough-cookie@2.3.2
│ │ │ │ │ └── punycode@1.4.1
│ │ │ │ ├── tunnel-agent@0.6.0
│ │ │ │ └── uuid@3.0.1
│ │ │ ├─┬ rimraf@2.6.1
│ │ │ │ └─┬ glob@7.1.2
│ │ │ │ ├── fs.realpath@1.0.0
│ │ │ │ ├── inflight@1.0.6
│ │ │ │ ├─┬ minimatch@3.0.4
│ │ │ │ │ └─┬ brace-expansion@1.1.7
│ │ │ │ │ ├── balanced-match@0.4.2
│ │ │ │ │ └── concat-map@0.0.1
│ │ │ │ └── path-is-absolute@1.0.1
│ │ │ ├── semver@5.3.0
│ │ │ ├─┬ tar@2.2.1
│ │ │ │ ├── block-stream@0.0.9
│ │ │ │ ├─┬ fstream@1.0.11
│ │ │ │ │ └── graceful-fs@4.1.11
│ │ │ │ └── inherits@2.0.3
│ │ │ └─┬ tar-pack@3.4.0
│ │ │ ├─┬ debug@2.6.8
│ │ │ │ └── ms@2.0.0
│ │ │ ├── fstream-ignore@1.0.5
│ │ │ ├─┬ once@1.4.0
│ │ │ │ └── wrappy@1.0.2
│ │ │ ├─┬ readable-stream@2.2.9
│ │ │ │ ├── buffer-shims@1.0.0
│ │ │ │ ├── core-util-is@1.0.2
│ │ │ │ ├── isarray@1.0.0
│ │ │ │ ├── process-nextick-args@1.0.7
│ │ │ │ ├── string_decoder@1.0.1
│ │ │ │ └── util-deprecate@1.0.2
│ │ │ └── uid-number@0.0.6
│ │ ├── glob-parent@2.0.0
│ │ ├── inherits@2.0.3
│ │ ├─┬ is-binary-path@1.0.1
│ │ │ └── binary-extensions@1.9.0
│ │ ├─┬ is-glob@2.0.1
│ │ │ └── is-extglob@1.0.0
│ │ ├── path-is-absolute@1.0.1
│ │ └─┬ readdirp@2.1.0
│ │ ├─┬ readable-stream@2.3.3
│ │ │ ├── isarray@1.0.0
│ │ │ ├── process-nextick-args@1.0.7
│ │ │ ├── string_decoder@1.0.3
│ │ │ └── util-deprecate@1.0.2
│ │ └── set-immediate-shim@1.0.1
│ └── graceful-fs@4.1.11
├─┬ hexo-i18n@0.2.1
│ └── sprintf-js@1.0.3
├─┬ hexo-log@0.1.3
│ └─┬ bunyan@1.8.12
│ ├── dtrace-provider@0.8.5
│ ├─┬ mv@2.1.1
│ │ ├─┬ mkdirp@0.5.1
│ │ │ └── minimist@0.0.8
│ │ ├── ncp@2.0.0
│ │ └─┬ rimraf@2.4.5
│ │ └─┬ glob@6.0.4
│ │ ├─┬ inflight@1.0.6
│ │ │ └── wrappy@1.0.2
│ │ └── once@1.4.0
│ └── safe-json-stringify@1.0.4
├─┬ hexo-util@0.6.1
│ ├─┬ camel-case@3.0.0
│ │ ├─┬ no-case@2.3.1
│ │ │ └── lower-case@1.1.4
│ │ └── upper-case@1.1.3
│ ├─┬ cross-spawn@4.0.2
│ │ ├─┬ lru-cache@4.1.1
│ │ │ ├── pseudomap@1.0.2
│ │ │ └── yallist@2.1.2
│ │ └─┬ which@1.3.0
│ │ └── isexe@2.0.0
│ ├── highlight.js@9.12.0
│ ├── html-entities@1.2.1
│ └── striptags@2.2.1
├─┬ js-yaml@3.9.1
│ ├── argparse@1.0.9
│ └── esprima@4.0.0
├── lodash@4.17.4
├─┬ minimatch@3.0.4
│ └─┬ brace-expansion@1.1.8
│ ├── balanced-match@1.0.0
│ └── concat-map@0.0.1
├── moment@2.13.0
├── moment-timezone@0.5.13
├─┬ nunjucks@2.5.2
│ ├── asap@2.0.6
│ └─┬ yargs@3.32.0
│ ├── camelcase@2.1.1
│ ├─┬ cliui@3.2.0
│ │ └── wrap-ansi@2.1.0
│ ├── decamelize@1.2.0
│ ├─┬ os-locale@1.4.0
│ │ └─┬ lcid@1.0.0
│ │ └── invert-kv@1.0.0
│ ├─┬ string-width@1.0.2
│ │ ├── code-point-at@1.1.0
│ │ └─┬ is-fullwidth-code-point@1.0.0
│ │ └── number-is-nan@1.0.1
│ ├── window-size@0.1.4
│ └── y18n@3.2.1
├── pretty-hrtime@1.0.3
├─┬ strip-indent@1.0.1
│ └── get-stdin@4.0.1
├─┬ swig@1.4.2
│ ├─┬ optimist@0.6.1
│ │ ├── minimist@0.0.10
│ │ └── wordwrap@0.0.3
│ └─┬ uglify-js@2.4.24
│ ├── async@0.2.10
│ ├─┬ source-map@0.1.34
│ │ └── amdefine@1.0.1
│ ├── uglify-to-browserify@1.0.2
│ └─┬ yargs@3.5.4
│ ├── camelcase@1.2.1
│ ├── window-size@0.1.0
│ └── wordwrap@0.0.2
├─┬ swig-extras@0.0.1
│ └─┬ markdown@0.5.0
│ └── nopt@2.1.2
├── text-table@0.2.0
├─┬ tildify@1.2.0
│ └── os-homedir@1.0.2
├── titlecase@1.1.2
└─┬ warehouse@2.2.0
├─┬ cuid@1.3.8
│ ├── browser-fingerprint@0.0.1
│ ├── core-js@1.2.7
│ └── node-fingerprint@0.0.2
├─┬ is-plain-object@2.0.4
│ └── isobject@3.0.1
└─┬ JSONStream@1.3.1
├── jsonparse@1.3.1
└── through@2.3.8
2、初始化hexo,执行:hexo init
此时,blog目录就是博客的根目录,已经建立完成了。
3、生成静态页面,执行:hexo g(或者执行:hexo generate)
如下代表执行成功:
TTZhangdeMacBook-Pro:blog admin$ hexo g
INFO Start processing
INFO Files loaded in 408 ms
INFO Generated: index.html
INFO Generated: archives/index.html
INFO Generated: fancybox/blank.gif
INFO Generated: fancybox/jquery.fancybox.css
INFO Generated: fancybox/jquery.fancybox.js
INFO Generated: fancybox/jquery.fancybox.pack.js
INFO Generated: fancybox/fancybox_loading.gif
INFO Generated: fancybox/fancybox_loading@2x.gif
INFO Generated: fancybox/fancybox_overlay.png
INFO Generated: fancybox/fancybox_sprite.png
INFO Generated: fancybox/fancybox_sprite@2x.png
INFO Generated: archives/2017/08/index.html
INFO Generated: archives/2017/index.html
INFO Generated: css/fonts/FontAwesome.otf
INFO Generated: js/script.js
INFO Generated: fancybox/helpers/jquery.fancybox-buttons.css
INFO Generated: fancybox/helpers/jquery.fancybox-buttons.js
INFO Generated: fancybox/helpers/jquery.fancybox-media.js
INFO Generated: fancybox/helpers/jquery.fancybox-thumbs.css
INFO Generated: css/style.css
INFO Generated: fancybox/helpers/jquery.fancybox-thumbs.js
INFO Generated: css/fonts/fontawesome-webfont.eot
INFO Generated: css/fonts/fontawesome-webfont.woff
INFO Generated: fancybox/helpers/fancybox_buttons.png
INFO Generated: css/images/banner.jpg
INFO Generated: css/fonts/fontawesome-webfont.svg
INFO Generated: css/fonts/fontawesome-webfont.ttf
INFO Generated: 2017/08/10/hello-world/index.html
INFO 28 files generated in 1.41 s
4、本地启动hexo,执行:hexo server
如下代表执行成功:
TTZhangdeMacBook-Pro:blog admin$ hexo server
INFO Start processing
INFO Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.
浏览器输入http://localhost:4000,即可打开hexo博客页面:如图:
此时只是完成了本地启动hexo,将本地的blog push到github上还需要本地跟github建立连接,接下来对github进行配置。
三、github配置
1、github上创建代码仓库
建立Repository,仓库名:yourname.github.io
2、然后再本地blog目录的_config.yml配置文件中最后一行增加如下配置:
deploy:
type: git
repo: https://github.com/TTtesting/tttesting.github.io.git
branch: master
冒号后面记得加空格,不然会报错。
3、_congig.yml配置修改保存后,执行如下命令:
npm install hexo-deployer-git --save
如下代表执行成功:
TTZhangdeMacBook-Pro:blog admin$ npm install hexo-deployer-git --save
hexo-site@0.0.0 /Users/admin/software/blog
└─┬ hexo-deployer-git@0.3.1
├─┬ babel-eslint@7.2.3
│ ├─┬ babel-code-frame@6.22.0
│ │ └── js-tokens@3.0.2
│ ├─┬ babel-traverse@6.25.0
│ │ ├── babel-messages@6.23.0
│ │ ├─┬ babel-runtime@6.25.0
│ │ │ ├── core-js@2.5.0
│ │ │ └── regenerator-runtime@0.10.5
│ │ ├── debug@2.6.8
│ │ ├── globals@9.18.0
│ │ └─┬ invariant@2.2.2
│ │ └── loose-envify@1.3.1
│ ├─┬ babel-types@6.25.0
│ │ └── to-fast-properties@1.0.3
│ └── babylon@6.17.4
└── moment@2.18.1
4、执行配置命令:
TTZhangdeMacBook-Pro:blog admin$ hexo deploy
INFO Deploying: git
INFO Setting up Git deployment...
Initialized empty Git repository in /Users/admin/software/blog/.deploy_git/.git/
[master (root-commit) d37715b] First commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 placeholder
INFO Clearing .deploy_git folder...
INFO Copying files from public folder...
INFO Copying files from extend dirs...
[master 28f7f04] Site updated: 2017-08-10 21:52:38
29 files changed, 5758 insertions(+)
create mode 100644 2017/08/10/hello-world/index.html
create mode 100644 archives/2017/08/index.html
create mode 100644 archives/2017/index.html
create mode 100644 archives/index.html
create mode 100644 css/fonts/FontAwesome.otf
create mode 100644 css/fonts/fontawesome-webfont.eot
create mode 100644 css/fonts/fontawesome-webfont.svg
create mode 100644 css/fonts/fontawesome-webfont.ttf
create mode 100644 css/fonts/fontawesome-webfont.woff
create mode 100644 css/images/banner.jpg
create mode 100644 css/style.css
create mode 100644 fancybox/blank.gif
create mode 100644 fancybox/fancybox_loading.gif
create mode 100644 fancybox/fancybox_loading@2x.gif
create mode 100644 fancybox/fancybox_overlay.png
create mode 100644 fancybox/fancybox_sprite.png
create mode 100644 fancybox/fancybox_sprite@2x.png
create mode 100644 fancybox/helpers/fancybox_buttons.png
create mode 100644 fancybox/helpers/jquery.fancybox-buttons.css
create mode 100644 fancybox/helpers/jquery.fancybox-buttons.js
create mode 100644 fancybox/helpers/jquery.fancybox-media.js
create mode 100644 fancybox/helpers/jquery.fancybox-thumbs.css
create mode 100644 fancybox/helpers/jquery.fancybox-thumbs.js
create mode 100644 fancybox/jquery.fancybox.css
create mode 100644 fancybox/jquery.fancybox.js
create mode 100644 fancybox/jquery.fancybox.pack.js
create mode 100644 index.html
create mode 100644 js/script.js
delete mode 100644 placeholder
To https://github.com/TTtesting/tttesting.github.io.git
* [new branch] HEAD -> master
Branch master set up to track remote branch master from https://github.com/TTtesting/tttesting.github.io.git.
INFO Deploy done: git
此时本地与gitbub仓库已建立连接,浏览器中输入:https://tttesting.github.io,即可打开blog ,如图:
四、更新本地修改到github
本地修改后每次部署的步骤,可按以下三步来进行。
hexo clean
hexo generate
hexo deploy
一些常用命令:
hexo new"postName" #新建文章
hexo new page"pageName" #新建页面
hexo generate #生成静态页面至public目录
hexo server #开启预览访问端口(默认端口4000,'ctrl + c'关闭server)
hexo deploy #将.deploy目录部署到GitHub
hexo help # 查看帮助
hexo version #查看Hexo的版本
五、博客首页显示所有文章列表配置
1、请确保node版本大于6.2
2、在博客根目录执行命令:npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true
最后,
给大家呈现出我的博客地址,如果只要借助github,就可使用github域名:https://tttesting.github.io
同时,有服务器的可以部署在自己的服务器上,使用自己申请的域名,欢迎访问我的博客:http://www.87testing.com
请加入测试技术分享圈,开始您的学习之旅吧!
长按二维码 一键加入
87testing.com
长按识别二维码加入:测试技术分享圈