GitHub Pages是什么 应用GitHub Pages创建属于自己的个人博客,GitHub将提供免费的空间。GitHub提供的域名(用户名+github+io),在Repository name对应处填写资源名,其需要使用自己的用户名,每个用户名下面只能建立一个,并且资源命名必须符合这样的规则username/username.github.io,之后勾选下面的”Initialize this repository with a README” 。
$ ssh-keygen -t rsa -C "邮件地址@youremail.com" Generating public/private rsa key pair. Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa):<回车就好>
注意1: 此处的邮箱地址,你可以输入自己的邮箱地址; 注意2: 此处的「-C」的是大写的「C」
然后系统会要你输入密码:
Enter passphrase (empty for no passphrase):<输入加密串> Enter same passphrase again:<再次输入加密串>
The authenticity of host 'github.com (207.97.227.239)' can't be established. RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want to continue connecting (yes/no)? 不要紧张,输入yes就好,然后会看到: Hi cnfeat! You've successfully authenticated, but GitHub does not provide shell access.
npm ERR! Error: shasum check failed for C:\Users\ADMINI~1\AppData\Local\Temp\npm -30024-KDJHJzgP\registry.npmjs.org\hexo-cli\-\hexo-cli-0.1.6.tgz npm ERR! Expected: 7dc3ab939d0889c4bed6a961605ff3e2d67f67a2 npm ERR! Actual: 41de7d67a9b764352eb07c49c32fc38dd7f479b9 npm ERR! From: https://registry.npmjs.org/hexo-cli/-/hexo-cli-0.1.6.tgz npm ERR! at d:\Program Files\nodejs\node_modules\npm\node_modules\sha\index. js:38:8 npm ERR! at ReadStream.<anonymous> (d:\Program Files\nodejs\node_modules\npm \node_modules\sha\index.js:85:7) npm ERR! at ReadStream.emit (events.js:117:20) npm ERR! at _stream_readable.js:943:16 npm ERR! at process._tickCallback (node.js:419:13) npm ERR! If you need help, you may report this *entire* log, npm ERR! including the npm and node versions, at: npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.2.9200 npm ERR! command "d:\\Program Files\\nodejs\\node.exe" "d:\\Program Files\\nodej s\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "hexo" npm ERR! cwd C:\Users\Administrator\Desktop npm ERR! node -v v0.10.31 npm ERR! npm -v 1.4.23 npm ERR! registry error parsing json npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Users\Administrator\Desktop\npm-debug.log npm ERR! not ok code 0
莫非是因为被墙了?换国内镜像源试试。 npm config set registry="http://registry.cnpmjs.org", 然后再次执行npm install -g hexo,成功!
INFO Deploying: git INFO Clearing .deploy folder... INFO Copying files from public folder... warning: LF will be replaced by CRLF in 2015/05/30/hello-world/index.html. The file will have its original line endings in your working directory. ...... *** Please tell me who you are.
to set your account's default identity. Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'Administrator@PC-201505290750.(none)') Username for 'https://github.com': voidking Password for 'https://voidking@github.com': error: src refspec master does not match any. error: failed to push some refs to 'https://github.com/voidking/voidking.github.io.git' FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html Error: error: src refspec master does not match any. error: failed to push some refs to 'https://github.com/voidking/voidking.github.io.git'
at ChildProcess.<anonymous> (E:\hexo\node_modules\hexo-deployer-git\node_modules\hexo-util\lib\spawn.js:42:17) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:756:16) at Process.ChildProcess._handle.onexit (child_process.js:823:5)
# Site #整站的基本信息 title:1000wordsaDay#网站标题 subtitle:Writing1000WordsaDayChangesMyLife#网站副标题 description:学习总结思考感悟知识管理#网站描述 author:cnFeat#网站作者,在下方显示 email:cnFeat@gmail.com#联系邮箱 language:zh-CN#主题实际的文件名称 timezone:
# URL #这项暂不配置,绑定域名后,欲创建sitemap.xml需要配置该项 ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' url:http://yoursite.com root:/ permalink::year/:month/:day/:title/ permalink_defaults:
# Writing 文章布局、写作格式的定义,不修改 new_post_name::title.md# File name of new posts default_layout:post titlecase:false# Transform title into titlecase external_link:true# Open external links in new tab filename_case:0 render_drafts:false post_asset_folder:false relative_link:false future:true highlight: enable:true line_number:true auto_detect:true tab_replace:
# Category & Tag default_category:uncategorized category_map: tag_map:
# Date / Time format 日期格式,不修改 ## Hexo uses Moment.js to parse and display date ## You can customize the date format as defined in ## http://momentjs.com/docs/#/displaying/format/ date_format:YYYY-MM-DD time_format:HH:mm:ss
# Pagination 每页显示文章数,可以自定义,我将10改成了5 ## Set per_page to 0 to disable pagination per_page:5 pagination_dir:page