才等录686.xxx的时候,h5页面调用微信js录音显示wwW686.xxx空白是咋回事

才等录193sihu的时候,页面显示wwW193sihu空白是咋回事_百度知道
才等录193sihu的时候,页面显示wwW193sihu空白是咋回事
我有更好的答案
估计是线路问题 6nm.pg6.tech
为您推荐:
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。才港等录得得啪wwWt66y的时候,页面得得啪显示t66ycOm空白是咋回事_百度知道
才港等录得得啪wwWt66y的时候,页面得得啪显示t66ycOm空白是咋回事
我有更好的答案
页面才加仔,a25.nt4.tech才缓存完
为您推荐:
其他类似问题
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。&figure&&img src=&https://pic4.zhimg.com/v2-02999d6fca7aaefb2a64c_b.jpg& data-rawwidth=&1200& data-rawheight=&628& class=&origin_image zh-lightbox-thumb& width=&1200& data-original=&https://pic4.zhimg.com/v2-02999d6fca7aaefb2a64c_r.jpg&&&/figure&&p&运营一个开源项目就像在运营着一家 Startup,你期待更多人来使用你的项目,并给你的项目加 Star/提交 PR,但好的项目除了其自身真正契合了开发者的需求外,还需要一个好的 README。&/p&&blockquote&&p&有好的 README 文档的项目不一定是一个好开源项目,但一个好开源项目一定有一个好的 README。&/p&&/blockquote&&p&目前 README 文档编写并没有规范,但一个友好的 README 是有其特征的,我们来看看一个好的 README 的必备要素。&/p&&h3&国际化问题&/h3&&p&首先要注意的是国际化问题,如果你希望自己的项目能获得更多人的使用,提供中英两种 README 文档是非常赞的。你可以在项目头部注明它。如 Coding 的 &a href=&https://link.zhihu.com/?target=https%3A//github.com/Coding/WebIDE%23coding-webide& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&WebIDE&/a& 项目:&figure&&img src=&https://pic4.zhimg.com/v2-d11aecab8a_b.jpg& data-rawwidth=&918& data-rawheight=&155& class=&origin_image zh-lightbox-thumb& width=&918& data-original=&https://pic4.zhimg.com/v2-d11aecab8a_r.jpg&&&/figure&&/p&&br&&h3&项目名及简介&/h3&&p&好的项目名及简介是好项目必不可少的。开源项目名不宜过长(除非你有特别的理由这么做),如果你不知道如何给自己的项目起名,可以使用 &a href=&https://link.zhihu.com/?target=http%3A//mrsharpoblunto.github.io/foswig.js/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&随机项目名产生器&/a&(适用于 Javascript 项目);项目简介可以是简单的几句话,但项目简介要说明几个你的开源项目用户想迫切了解的问题,这包括:&/p&&ul&&li&这个开源项目是做什么的?&/li&&li&这个项目是什么语言编写的?&/li&&li&项目维护、CI、依赖更新状态(如果有)&/li&&li&项目可用版本及其他版本&/li&&li&Demo 或官网地址(如果有)&/li&&/ul&&p&如 Coding 的 &a href=&https://link.zhihu.com/?target=https%3A//github.com/Coding/WebIDE& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&WebIDE&/a& 项目:&figure&&img src=&https://pic1.zhimg.com/v2-972d52e7aafd94fed5303c_b.jpg& data-rawwidth=&968& data-rawheight=&162& class=&origin_image zh-lightbox-thumb& width=&968& data-original=&https://pic1.zhimg.com/v2-972d52e7aafd94fed5303c_r.jpg&&&/figure&&/p&&p&此外你还可以给项目增加一些图标以提高可读性,推荐使用 &a href=&https://link.zhihu.com/?target=http%3A//shields.io/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Shields.io&/a&&/p&&h3&项目 Logo 和使用截图&/h3&&p&你还可以将项目 Logo(如果有的话)放置在 REAME 顶部(这里推荐一个在线制作 Logo 的网站 &a href=&https://link.zhihu.com/?target=https%3A//www.canva.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Canva&/a& ),项目截图(Gif 动图更佳)也可以帮助你的用户更快速更直观地了解你的开源项目。&figure&&img src=&https://pic4.zhimg.com/v2-b3c9aff809b66556e6bddb5ba9866a46_b.jpg& data-rawwidth=&480& data-rawheight=&336& class=&origin_image zh-lightbox-thumb& width=&480& data-original=&https://pic4.zhimg.com/v2-b3c9aff809b66556e6bddb5ba9866a46_r.jpg&&&/figure&&/p&&h3&功能&/h3&&p&你可以注明这个项目的功能特点,亮点特色会大大提高访客使用这个项目的概率。&/p&&p&如 Coding 的 &a href=&https://link.zhihu.com/?target=https%3A//github.com/Coding/WebIDE%23features& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&WebIDE&/a& 项目 &figure&&img src=&https://pic3.zhimg.com/v2-4e863745fde848bb273fd421aabe6031_b.jpg& data-rawwidth=&944& data-rawheight=&264& class=&origin_image zh-lightbox-thumb& width=&944& data-original=&https://pic3.zhimg.com/v2-4e863745fde848bb273fd421aabe6031_r.jpg&&&/figure&&/p&&h3&用法&/h3&&p&这是 README 中最重要的部分,你需要说明这个项目如何使用,这包括:&/p&&ul&&li&如何下载这个项目:一般情况下 git clone 该项目地址即可,当然你也可以提供其他包管理下载安装方式;&/li&&li&项目依赖:你需要说明编译运行这个项目前需要哪些依赖;&/li&&li&安装:你需要说明如何编译安装/运行这个项目;&/li&&li&部署:如果这个项目可以部署的话,请最好注明部署要注意的事项;&/li&&li&Debug 方法:理想状况下,你的用户会顺利编译并运行这个项目,但你要确保用户遇到了问题不会来打扰你(如提交 Issues),你还需要提供用户可能会遇到的常见问题;&figure&&img src=&https://pic1.zhimg.com/v2-5a3ad8c2dea7d_b.jpg& data-rawwidth=&961& data-rawheight=&601& class=&origin_image zh-lightbox-thumb& width=&961& data-original=&https://pic1.zhimg.com/v2-5a3ad8c2dea7d_r.jpg&&&/figure&&/li&&/ul&&h3&贡献&/h3&&p&对于一个开源项目来说,令其作者最开心的莫过于有人提交 Pull Request 了。加入一个 CONTRIBUTING 文档将大大提高他人贡献你的项目的概率。&/p&&p&你可以说明你的代码规范,项目架构,如何测试和提交 Pull Request 的正确格式,以及其他有利于开发者进行贡献的信息,这将会使你的项目变得更加的规整如一。你可以在项目根目录新建一个 CONTRIBUTING 进行详细的说明并在 README 中添加其文件锚链接。如 Google 的 &a href=&https://link.zhihu.com/?target=https%3A//github.com/GoogleCloudPlatform/Template/blob/master/CONTRIBUTING.md& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Template&/a&:&figure&&img src=&https://pic1.zhimg.com/v2-c7e376882fcdf6ebbce50_b.jpg& data-rawwidth=&488& data-rawheight=&383& class=&origin_image zh-lightbox-thumb& width=&488& data-original=&https://pic1.zhimg.com/v2-c7e376882fcdf6ebbce50_r.jpg&&&/figure&&/p&&h3&版权&/h3&&p&版权是非常重要的,如果没有声明版权,很多用户特别是企业级用户将受制于法律问题,无法使用你的项目。关于如何选择开源项目许可证,推荐阅读这篇文章:&a href=&https://link.zhihu.com/?target=http%3A//www.ruanyifeng.com/blog/2011/05/how_to_choose_free_software_licenses.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&《如何选择开源许可证?》&/a&&/p&&p&如 Coding 开源的 &a href=&https://link.zhihu.com/?target=https%3A//coding.net/u/coding/p/coding-docs/git& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&帮助文档&/a& 版权:&figure&&img src=&https://pic3.zhimg.com/v2-cf927eec9a3c946a2ac4_b.jpg& data-rawwidth=&831& data-rawheight=&131& class=&origin_image zh-lightbox-thumb& width=&831& data-original=&https://pic3.zhimg.com/v2-cf927eec9a3c946a2ac4_r.jpg&&&/figure&&/p&&h3&鸣谢&/h3&&p&你还可以感谢直接或间接为这个项目做出贡献的人、项目。&/p&&p&如 &a href=&https://link.zhihu.com/?target=https%3A//github.com/tsl0922/ttyd& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&ttyd&/a& 项目:&figure&&img src=&https://pic2.zhimg.com/v2-a6e65e8ae4b9fa63a5f57cc_b.jpg& data-rawwidth=&921& data-rawheight=&147& class=&origin_image zh-lightbox-thumb& width=&921& data-original=&https://pic2.zhimg.com/v2-a6e65e8ae4b9fa63a5f57cc_r.jpg&&&/figure&&/p&&h3&其他&/h3&&p&我们推荐使用 &a href=&https://link.zhihu.com/?target=https%3A//coding.net/help/doc/project/markdown.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Markdown&/a& 编写你的 README,请最好注意排版问题以增加文档可读性,推荐阅读 Coding 的 &a href=&https://link.zhihu.com/?target=https%3A//open.coding.net/copywriting.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&《文案排版规范》&/a&。&figure&&img src=&https://pic1.zhimg.com/v2-dcb12c7f980af8d_b.jpg& data-rawwidth=&500& data-rawheight=&375& class=&origin_image zh-lightbox-thumb& width=&500& data-original=&https://pic1.zhimg.com/v2-dcb12c7f980af8d_r.jpg&&&/figure&&/p&&p&这就是一个好的 README 所需元素了,当然你还可以增加其他任何利于开发者的信息如 Roadmap 等等,这因项目而异。现在,去完善你的开源项目信息或开始做一个开源项目吧!&/p&&blockquote&&p&一些建议:选择一个好的代码托管平台/社区可以让你的开源项目获得更多曝光,你可以在 Coding 的 &a href=&https://link.zhihu.com/?target=https%3A//coding.net/pp& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&冒泡社区&/a&(可以理解为程序员的朋友圈)发布你的项目简介,截图和地址,与 30 万中国开发者分享你的开源项目;另外我们推荐同时 push 项目到 Coding 和 GitHub(可参考 &a href=&https://link.zhihu.com/?target=https%3A//segmentfault.com/q/2591/a-1401& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&该回答&/a& ),得益于 Coding 遍布全国的 CDN,国内用户 clone 你的项目时的速度将大大提升(PS:&a href=&https://link.zhihu.com/?target=https%3A//coding.net& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Coding.net&/a& 的私有代码仓库也是完全免费的)。&/p&&/blockquote&&p&Happy C )&/p&&p&(完)&/p&&p&你可能会感兴趣的文章:&/p&&ul&&li&&a href=&https://link.zhihu.com/?target=https%3A//blog.coding.net/blog/how-coding-uses-coding-to-build-coding& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&《Coding 如何使用 Coding 开发 Coding》&/a&&/li&&li&&a href=&https://link.zhihu.com/?target=https%3A//blog.coding.net/blog/feature-branch-workflow& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&《使用 Feature Branch Workflow 让开发更简单》&/a&&/li&&li&&a href=&https://link.zhihu.com/?target=https%3A//blog.coding.net/blog/principle-of-Git& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&《使用原理视角看 Git》&/a&&/li&&/ul&
运营一个开源项目就像在运营着一家 Startup,你期待更多人来使用你的项目,并给你的项目加 Star/提交 PR,但好的项目除了其自身真正契合了开发者的需求外,还需要一个好的 README。有好的 README 文档的项目不一定是一个好开源项目,但一个好开源项目一定有…
&figure&&img src=&https://pic1.zhimg.com/406c1f8c036c9f9e3c232_b.jpg& data-rawwidth=&1920& data-rawheight=&1080& class=&origin_image zh-lightbox-thumb& width=&1920& data-original=&https://pic1.zhimg.com/406c1f8c036c9f9e3c232_r.jpg&&&/figure&&p&作为一个程序员,拥有一个自己的博客,平时记录一下,分享点技术文章,还是挺有必要的。建立博客的通常渠道包括:&br&&/p&&ol&&li&&p&在博客平台上注册,比如 博客园、CSDN、新浪博客 等。&/p&&/li&&li&&p&利用博客框架搭建,如 WordPress、Jekyll、hexo 等。&/p&&/li&&li&&p&自己用代码写一个。&/p&&/li&&/ol&&p&其中,第一种最简单,也最受限,说不定还会被删帖删号。第二种稍复杂,另外需要自己找部署的服务器,但可定制化较高,是很多程序员的选择。最后一种,是在重复造轮子,不过从另一个方面来看,倒是锻炼编程能力的好方式。&/p&&p&下面我们就来看下第二种搭建博客的方式。由于内容较多,会分为几篇内容,今天是第一篇:&/p&&ol&&li&&p&github+hexo 建立你的第一个博客&/p&&/li&&li&&p&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&Hexo(2)-部署博客及更新博文 - Crossin的编程教室 - 知乎专栏&/a&&br&&/p&&/li&&li&&p&&a href=&https://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMjM5MDEyMDk4Mw%3D%3D%26mid%3D%26idx%3D1%26sn%3D28ddeb2f2598%26scene%3D1%26srcid%3D0919BiBAnqYyqbJsCc0dzyTM%23rd& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Hexo(3)-安装自己喜欢的主题&/a&&/p&&/li&&li&&p&&a href=&https://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMjM5MDEyMDk4Mw%3D%3D%26mid%3Didx%3D1%26sn%3Dbe8632bcb08bf340ddd29%26chksm%3D3e4b5e4031d131e35a69cd4d97cb6e60048ebb606b935aa57c2f971%26scene%3D1%26srcid%3D0919oLK4LqP9Cj8r0LXp31hD%23rd& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Hexo(4)-安装多说评论框&/a&&br&&/p&&/li&&li&&p&&a href=&https://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMjM5MDEyMDk4Mw%3D%3D%26mid%3Didx%3D2%26sn%3D69cc7685dbd7a395cb2d30b%26chksm%3D3e4b5e4b6bc2e5ba5ab1e5fe9e4db129bb591%26scene%3D1%26srcid%3D0919B9JktkjwIQwnvnije6ZD%23rd& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Hexo(5)-购买并绑定域名&/a&&/p&&/li&&/ol&&p&感谢本文作者 大懒虫 同学的投稿。&/p&&h2&&strong&前言&/strong&&/h2&&p&其实呢,建立博客是非常简单的(哈哈,不管什么东西,你会的就觉得简单,不会的怎样都难),我来给大家说说如何使用 GitHubPages 和 Hexo 建立自己的博客。&/p&&p&这个有一点难度,但是不要怕,我会一步一步的给大家完成指导的,如果有任何问题也可以随时联系我,我会尽力给大家解决的!&br&&/p&&p&下面先介绍为何选择 GitHubPages 和 Hexo 来搭建博客,然后介绍搭建博客的详细过程。&/p&&h2&&strong&Why GitHub Pages and Hexo&/strong&&/h2&&p&因为 GitHub 的存在,我们得以简单快速地搭建个人博客。&/p&&p&&strong&GitHub&/strong&&/p&&p&GitHub,是一个代码托管网站和社交编程网站。这里聚集了世界上各路技术牛叉的大牛,和最优秀的代码库。把你的博客托管在这里,还有什么不放心的呢O(∩_∩)O。&/p&&p&&strong&GitHub Pages&/strong&&/p&&p&GitHub Pages,是用来托管 GitHub 上静态网页的免费站点,那 GitHub Pages具体有哪些功能呢:&/p&&ul&&li&&p&有足够的免费空间(1G),资料自己管理,保存可靠;&/p&&/li&&li&&p&享受 GitHub 的便利,上面有很多大牛,眼界会开阔很多;&/p&&/li&&li&&p&可以使用很多现成的博客框架,搭建过程简单快速。&/p&&/li&&/ul&&p&&strong&HEXO&/strong&&/p&&p&Hexo 是一个简单、快速、强大的静态博客框架,出自台湾大学生 tommy351 之手。我也看过使用 Jekyll、Octopress 搭建个人博客的过程,确实要繁琐许多。相比之下 Hexo 更轻便更快捷,下面是其官网强调的四大特点:&/p&&ol&&li&&p&极速生成静态页面&/p&&/li&&li&&p&一键部署博客&/p&&/li&&li&&p&丰富的插件支持&/p&&/li&&li&&p&支持 Markdown&/p&&/li&&/ol&&p&相信大家对 GitHub Pages 和 Hexo 有了一定的了解,下面进入正题。&/p&&h1&&strong&使用 GitHub Pages 建立博客站点&/strong&&/h1&&p&&strong&注册 GitHub&/strong&&/p&&p&访问 GitHub,注册十分简单,一定要记住注册时使用的邮箱,因为 GitHub 上很多通知都是通过邮箱的。如下图所示:&br&&figure&&img src=&https://pic2.zhimg.com/982df1f79bbf_b.jpg& data-rawwidth=&420& data-rawheight=&406& class=&content_image& width=&420&&&/figure&申请成功后,在 GitHub 官网上登录,并验证邮箱即可。&/p&&p&&strong&在 GitHub 上建立仓库&/strong&&/p&&p&与 GitHub 建立好连接之后,就可以方便的使用它提供的 Pages 服务,GitHub Pages 分两种,一种是用你的 GitHub 用户名建立的 &a href=&https://link.zhihu.com/?target=http%3A//username.github.io& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&username.github.io&/span&&span class=&invisible&&&/span&&/a& 这样的用户&组织站点,另一种是依附项目的 Pages。&/p&&p&想建立个人博客是用的第一种,形如 &a href=&https://link.zhihu.com/?target=http%3A//username.github.io& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&username.github.io&/span&&span class=&invisible&&&/span&&/a& 这样的可访问的站点,每个用户名下面只能建立一个。如下图所示:&/p&&p&&figure&&img src=&https://pic2.zhimg.com/0dddc118a048eca3c8b32_b.jpg& data-rawwidth=&640& data-rawheight=&413& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic2.zhimg.com/0dddc118a048eca3c8b32_r.jpg&&&/figure&&figure&&img src=&https://pic1.zhimg.com/f1ceb7c4c768acbf1a340_b.jpg& data-rawwidth=&640& data-rawheight=&436& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic1.zhimg.com/f1ceb7c4c768acbf1a340_r.jpg&&&/figure&关于 Github 的使用,我的老师 Crossin先生 也写了一篇通俗易懂的教程,大家可以去看看&/p&&p&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&极简 Github 上手教程&/a&&/p&&h2&&strong&安装软件&/strong&&/h2&&p&&strong&Node.js&/strong&&/p&&p&&a href=&https://link.zhihu.com/?target=https%3A//nodejs.org/en/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Node.js 下载&/a&&/p&&p&下载完成后根据提示一步一步安装就好,这个没有什么需要特别说明的。&br&&/p&&p&&strong&GitHub for Windows&/strong&&/p&&p&&a href=&https://link.zhihu.com/?target=https%3A//desktop.github.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub Desktop 下载&/a&&/p&&p&这里有一点说明,下载这个 github 时因为是先从官网下载下来了一个下载器,然后再在本地下载,因为是外网,可能有点卡,所以下载好了全部并整理好了离线版本,你下载这个直接就自动安装了:&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//pan.baidu.com/s/1bZthpW& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub 离线版 下载&/a& 密码:olr2&br&&/p&&p&下载并安装下面两个软件,一直点击下一步即可。&/p&&br&&h2&&strong&使用 GitHub for Windows 登录 GitHub&/strong&&/h2&&figure&&img src=&https://pic2.zhimg.com/6d31f1ffe7d888c94fae18_b.jpg& data-rawwidth=&640& data-rawheight=&353& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic2.zhimg.com/6d31f1ffe7d888c94fae18_r.jpg&&&/figure&&figure&&img src=&https://pic2.zhimg.com/85e7e96a00d_b.jpg& data-rawwidth=&640& data-rawheight=&339& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic2.zhimg.com/85e7e96a00d_r.jpg&&&/figure&&figure&&img src=&https://pic4.zhimg.com/ffed902ba855f0ece79dd1a5dd86a30b_b.jpg& data-rawwidth=&640& data-rawheight=&339& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic4.zhimg.com/ffed902ba855f0ece79dd1a5dd86a30b_r.jpg&&&/figure&&h1&&strong&配置 SSH&/strong&&/h1&&p&我们如何让本地 git 项目与远程的 GitHub 建立联系呢?方法是用 SSH。打开命令行,输入以下命令:&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&ssh -T
&/code&&/pre&&/div&&p&如图:&br&&figure&&img src=&https://pic1.zhimg.com/8bd580a57c0ddff4f125_b.jpg& data-rawwidth=&640& data-rawheight=&418& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic1.zhimg.com/8bd580a57c0ddff4f125_r.jpg&&&/figure&如果是下面之类的反馈(或者显示 Hi xxx):&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&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)?
&/code&&/pre&&/div&&p&不用紧张,输入 yes 之后,看到下图的结果,就配置成功了。&br&&figure&&img src=&https://pic1.zhimg.com/8f039c7f82df74f7a92a74c6d26aaccc_b.jpg& data-rawwidth=&640& data-rawheight=&418& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic1.zhimg.com/8f039c7f82df74f7a92a74c6d26aaccc_r.jpg&&&/figure&&/p&&h1&&strong&使用 Hexo 创建博客框架&/strong&&/h1&&p&&strong&Hexo 安装&/strong&&/p&&p&打开命令行,依次输入以下命令:&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&cd /
npm install hexo-cli -g
&/code&&/pre&&/div&&p&如图:&br&&figure&&img src=&https://pic1.zhimg.com/56e66c9de6fefd7b6c81ffb_b.jpg& data-rawwidth=&640& data-rawheight=&418& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic1.zhimg.com/56e66c9de6fefd7b6c81ffb_r.jpg&&&/figure&提示:cd / 作用是返回根目录,Git Shell 默认装在 C 盘,启动时默认路径为 C:\Users\xxx(用户名)\Documents\GitHub,输入 cd / 命令后就返回到了 C 盘根目录下,需不需要使用 cd / 看个人习惯(下同)&/p&&h1&&strong&Hexo 部署&/strong&&/h1&&p&Hexo 的部署可采用如下方法,输入命令:&/p&&p&hexo init [文件名]。&/p&&p&打开控制台,依次输入以下命令:&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&cd /
hexo init Hexo
&/code&&/pre&&/div&&p&回车后出现该提示则表示正确:&br&&figure&&img src=&https://pic3.zhimg.com/16be1bfccad1_b.jpg& data-rawwidth=&640& data-rawheight=&82& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic3.zhimg.com/16be1bfccad1_r.jpg&&&/figure&部署成功之后,Hexo 会自动在目标文件夹建立博客网站所需要的所有文件。此时可以通过输入以下命令在本地进行预览(在刚才创建的文件夹里):&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&hexo generate
hexo server
&/code&&/pre&&/div&&p&系统可能会出现提示,请点击允许。如下图所示则表示正确:&br&&figure&&img src=&https://pic4.zhimg.com/4a25a7847662ddad711e59_b.jpg& data-rawwidth=&640& data-rawheight=&418& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic4.zhimg.com/4a25a7847662ddad711e59_r.jpg&&&/figure&此时打开浏览器,在浏览器地址栏输入 &a href=&https://link.zhihu.com/?target=http%3A//localhost%3A4000/& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&localhost:4000/&/span&&span class=&invisible&&&/span&&/a& (默认端口为4000), 便可以看到最原始的博客了。以后发表博文想先预览,也可以通过 hexo server 在本地先跑起来,看看效果。&/p&&p&效果如下图所示:&br&&/p&&figure&&img src=&https://pic1.zhimg.com/e1c9f0ebbff6f527cbe3769_b.jpg& data-rawwidth=&640& data-rawheight=&360& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic1.zhimg.com/e1c9f0ebbff6f527cbe3769_r.jpg&&&/figure&&p&恭喜,到目前为止个人博客的雏形已经有了。&/p&&p&在 Git Shell 中按 Ctrl + C 并输入 y 可以停止该服务。&/p&&br&&br&&p&&u&其他文章及回答:&/u&&/p&&br&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&想用 Python 做数据分析?先玩玩这个再说 - Crossin的文章 - 知乎专栏&/a&&br&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&用 Python 实现你的量化交易策略 - Crossin的文章 - 知乎专栏&/a&&br&&a href=&https://www.zhihu.com/question//answer/& class=&internal&&学习编程的过程中可能会走哪些弯路,有哪些经验可以参考? - Crossin 的回答&/a&&br&&a href=&https://www.zhihu.com/question//answer/& class=&internal&&你是如何自学 Python 的? - Crossin 的回答&/a&&br&&a href=&https://zhuanlan.zhihu.com/p/?refer=crossin& class=&internal&&编程初学者如何使用搜索引擎 - Crossin的文章 - 知乎专栏&/a&&br&&a href=&https://zhuanlan.zhihu.com/p/?refer=crossin& class=&internal&&如何直观地理解程序的运行过程?- Crossin的文章 - 知乎专栏&/a&&br&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&如何在 Python 中使用断点调试 - Crossin的文章 - 知乎专栏&/a&&br&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&Python 抓取网页乱码原因分析 - Crossin的编程教室 - 知乎专栏&/a&&br&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&极简 Github 上手教程 - Crossin的编程教室 - 知乎专栏&/a&&br&&p&&b&Crossin的编程教室&/b&&br&&/p&&br&微信ID:crossincode&br&论坛:&a href=&https://link.zhihu.com/?target=http%3A//bbs.crossincode.com& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Crossin的编程教室&/a&&br&QQ群:&br&&figure&&img src=&https://pic4.zhimg.com/5b58c0ecafdc5d85c857_b.jpg& data-rawwidth=&258& data-rawheight=&258& class=&content_image& width=&258&&&/figure&
作为一个程序员,拥有一个自己的博客,平时记录一下,分享点技术文章,还是挺有必要的。建立博客的通常渠道包括: 在博客平台上注册,比如 博客园、CSDN、新浪博客 等。利用博客框架搭建,如 WordPress、Jekyll、hexo 等。自己用代码写一个。其中,第一种最…
&figure&&img src=&https://pic1.zhimg.com/v2-d4cea6c8d407_b.jpg& data-rawwidth=&640& data-rawheight=&280& class=&origin_image zh-lightbox-thumb& width=&640& data-original=&https://pic1.zhimg.com/v2-d4cea6c8d407_r.jpg&&&/figure&&h2&&b&前言:&/b&&/h2&&p&随着互联网浪潮的翻腾,国内外涌现出越来越多优秀的社交网站让用户分享信息更加便捷。然后,如果你是一个不甘寂寞的程序猿(媛),是否也想要搭建一个属于自己的个人网站,如果你曾经或者现在正有这样的想法,请跟随这篇文章发挥你的Geek精神,让你快速拥有自己的博客网站,写文章记录生活,享受这种从0到1的过程。&/p&&p&&a href=&https://www.zhihu.com/question/& class=&internal&&你见过的最棒的个人博客界面是什么样的?&/a& &/p&&h2&&b&什么是Hexo ?&/b&&/h2&&figure&&img src=&https://pic1.zhimg.com/v2-48900d9dae824b7f7cbb1_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&900& data-rawheight=&300& class=&origin_image zh-lightbox-thumb& width=&900& data-original=&https://pic1.zhimg.com/v2-48900d9dae824b7f7cbb1_r.jpg&&&/figure&&p&&br&&/p&&p&Hexo是一款基于Node.js的静态博客框架,依赖少易于安装使用,可以方便的生成静态网页托管在GitHub和Heroku上,是搭建博客的首选框架。这里我们选用的是GitHub,你没看错,全球最大的同性恋交友网站(逃……)。Hexo同时也是GitHub上的开源项目,参见:&a href=&https://link.zhihu.com/?target=https%3A//github.com/hexojs/hexo& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&hexojs/hexo&/a& 如果想要更加全面的了解Hexo,可以到其官网
&a href=&https://link.zhihu.com/?target=https%3A//hexo.io/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Hexo&/a&
了解更多的细节,因为Hexo的创建者是台湾人,对中文的支持很友好,可以选择中文进行查看。这里,默认各位猿/媛儿都知道GitHub就不再赘述。&/p&&p&&b&这是我的个人博客效果: &/b&&a href=&https://link.zhihu.com/?target=http%3A//iamwr.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&吴润 · RunDouble&/a&&/p&&p&下面正式从零开始搭建年轻人的第一个网站。&/p&&h2&&b&搭建步骤:&/b&&/h2&&ul&&li&获得个人网站域名&/li&&li&GitHub创建个人仓库&/li&&li&安装Git&/li&&li&安装Node.js&/li&&li&安装Hexo&/li&&li&推送网站&/li&&li&绑定域名&/li&&li&更换主题&/li&&li&初识MarkDown语法&/li&&li&发布文章&/li&&li&寻找图床&/li&&li&个性化设置&/li&&li&其他&/li&&li&附录&/li&&/ul&&p&&br&&/p&&p&&b&获得个人网站域名&/b&&/p&&p&域名是网站的入口,也是网站的第一印象,比如饿了么的官网的域名是:&a href=&https://link.zhihu.com/?target=https%3A//www.ele.me/& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://www.&/span&&span class=&visible&&ele.me/&/span&&span class=&invisible&&&/span&&/a& ,很是巧妙。常见的有com,cn,net,org等后缀,也有小众的xyz,me,io等后缀,根据你自己的喜好,选择不同的后缀,比如我选择就是常见的com后缀。很多小众奇特的后缀在大陆是没办法备案的,网站也就无法上线。然而使用GitHub托管我们的网站,完全不需要备案,因为托管我们的网站内容的服务器在美国,而且在国内备案流程也比较繁杂,时间需要一周左右。&/p&&p&申请域名的地方有很多,这里推荐阿里云:&a href=&https://link.zhihu.com/?target=https%3A//www.aliyun.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&阿里云-为了无法计算的价值&/a& 申请入口:&a href=&https://link.zhihu.com/?target=https%3A//wanwang.aliyun.com/domain/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&域名注册&/a& 购买域名这也是我们整个搭建过程中惟一一个需要花钱的地方。如果你已经有了空闲域名就无需购买,直接使用即可。&/p&&p&&br&&/p&&p&&br&&/p&&p&&b&GitHub创建个人仓库&/b&&/p&&p&登录到GitHub,如果没有GitHub帐号,使用你的邮箱注册GitHub帐号:&a href=&https://link.zhihu.com/?target=https%3A//github.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Build software better, together&/a&
点击GitHub中的New repository创建新仓库,仓库名应该为:&b&用户名&/b&.&a href=&https://link.zhihu.com/?target=http%3A//github.io& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&github.io&/span&&span class=&invisible&&&/span&&/a& 这个&b&用户名&/b&使用你的GitHub帐号名称代替,这是固定写法,比如我的仓库名为:&/p&&figure&&img src=&https://pic4.zhimg.com/v2-b4ac4ce7c3ccad3_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&272& data-rawheight=&118& class=&content_image& width=&272&&&/figure&&p&&b&安装Git&/b&&/p&&p&什么是Git ?简单来说Git是开源的分布式版本控制系统,用于敏捷高效地处理项目。我们网站在本地搭建好了,需要使用Git同步到GitHub上。如果想要了解Git的细节,参看&a href=&https://link.zhihu.com/?target=http%3A//weibo.com/liaoxuefeng& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&廖雪峰&/a&老师的Git教程:&a href=&https://link.zhihu.com/?target=http%3A//www.liaoxuefeng.com/wiki/bb000& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Git教程&/a&
从Git官网下载:&a href=&https://link.zhihu.com/?target=https%3A//git-scm.com/download/win& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Git - Downloading Package&/a& 现在的机子基本都是64位的,选择64位的安装包,下载后安装,在命令行里输入git测试是否安装成功,若安装失败,参看其他详细的Git安装教程。安装成功后,将你的Git与GitHub帐号绑定,鼠标右击打开Git Bash&/p&&p&&br&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-8b1cbe253d6ec6f98a9f52_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&251& data-rawheight=&364& class=&content_image& width=&251&&&/figure&&p&或者在菜单里搜索Git Bash,设置user.name和user.email配置信息:&/p&&div class=&highlight&&&pre&&code class=&language-bash&&&span&&/span&git config --global user.name &span class=&s2&&&你的GitHub用户名&&/span&
git config --global user.email &span class=&s2&&&你的GitHub注册邮箱&&/span&
&/code&&/pre&&/div&&p&生成ssh密钥文件:&br&&/p&&div class=&highlight&&&pre&&code class=&language-bash&&&span&&/span&ssh-keygen -t rsa -C &span class=&s2&&&你的GitHub注册邮箱&&/span&
&/code&&/pre&&/div&&p&然后直接三个回车即可,默认不需要设置密码&br&然后找到生成的.ssh的文件夹中的id_rsa.pub密钥,将内容全部复制&/p&&figure&&img src=&https://pic3.zhimg.com/v2-d1e475fbd27_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&781& data-rawheight=&175& class=&origin_image zh-lightbox-thumb& width=&781& data-original=&https://pic3.zhimg.com/v2-d1e475fbd27_r.jpg&&&/figure&&p&打开&a href=&https://link.zhihu.com/?target=https%3A//github.com/settings/keys& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&GitHub_Settings_keys&/a& 页面,新建new SSH Key&/p&&p&&br&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-72a3f22c080eaabce10e3c_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&727& data-rawheight=&378& class=&origin_image zh-lightbox-thumb& width=&727& data-original=&https://pic3.zhimg.com/v2-72a3f22c080eaabce10e3c_r.jpg&&&/figure&&p&Title为标题,任意填即可,将刚刚复制的id_rsa.pub内容粘贴进去,最后点击Add SSH key。&br&在Git Bash中检测GitHub公钥设置是否成功,输入 ssh
:&/p&&p&&br&&/p&&figure&&img src=&https://pic2.zhimg.com/v2-da481ffa686410becdebd6_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1193& data-rawheight=&282& class=&origin_image zh-lightbox-thumb& width=&1193& data-original=&https://pic2.zhimg.com/v2-da481ffa686410becdebd6_r.jpg&&&/figure&&p&如上则说明成功。这里之所以设置GitHub密钥原因是,通过非对称加密的公钥与私钥来完成加密,公钥放置在GitHub上,私钥放置在自己的电脑里。GitHub要求每次推送代码都是合法用户,所以每次推送都需要输入账号密码验证推送用户是否是合法用户,为了省去每次输入密码的步骤,采用了ssh,当你推送的时候,git就会匹配你的私钥跟GitHub上面的公钥是否是配对的,若是匹配就认为你是合法用户,则允许推送。这样可以保证每次的推送都是正确合法的。&/p&&p&&br&&/p&&p&&b&安装Node.js&/b&&/p&&p&Hexo基于Node.js,Node.js下载地址:&a href=&https://link.zhihu.com/?target=https%3A//nodejs.org/en/download/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Download | Node.js&/a& 下载安装包,注意安装Node.js会包含环境变量及npm的安装,安装后,检测Node.js是否安装成功,在命令行中输入 node -v :&/p&&p&&br&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-76ea38e781e_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&385& data-rawheight=&130& class=&content_image& width=&385&&&/figure&&p&检测npm是否安装成功,在命令行中输入npm -v :&/p&&p&&br&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-bede250bb455fda8c1dd9_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&318& data-rawheight=&93& class=&content_image& width=&318&&&/figure&&p&到这了,安装Hexo的环境已经全部搭建完成。&/p&&p&&br&&/p&&p&&b&安装Hexo&/b&&/p&&p&Hexo就是我们的个人博客网站的框架, 这里需要自己在电脑常里创建一个文件夹,可以命名为Blog,Hexo框架与以后你自己发布的网页都在这个文件夹中。创建好后,进入文件夹中,按住shift键,右击鼠标点击命令行&/p&&p&&br&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-a7c25dff8ad6f1d2046c_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&327& data-rawheight=&391& class=&content_image& width=&327&&&/figure&&p&使用npm命令安装Hexo,输入:&/p&&div class=&highlight&&&pre&&code class=&language-bash&&&span&&/span&npm install -g hexo-cli
&/code&&/pre&&/div&&p&&br&&/p&&p&这个安装时间较长耐心等待,安装完成后,初始化我们的博客,输入:&/p&&div class=&highlight&&&pre&&code class=&language-bash&&&span&&/span&hexo init blog
&/code&&/pre&&/div&&p&注意,这里的命令都是作用在刚刚创建的Blog文件夹中。&/p&&p&为了检测我们的网站雏形,分别按顺序输入以下三条命令:&/p&&div class=&highlight&&&pre&&code class=&language-bash&&&span&&/span&hexo new test_my_site
&/code&&/pre&&/div&&p&这些命令在后面作介绍,完成后,打开浏览器输入地址:&/p&&p&localhost:4000&/p&&p&可以看出我们写出第一篇博客,只不过我下图是我修改过的配置,和你的显示不一样。&/p&&p&&br&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-123e73cc856d99b04b55bb_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1919& data-rawheight=&446& class=&origin_image zh-lightbox-thumb& width=&1919& data-original=&https://pic1.zhimg.com/v2-123e73cc856d99b04b55bb_r.jpg&&&/figure&&p&现在来介绍常用的Hexo 命令&br&&br&npm install hexo -g
#安装Hexo&br&npm update hexo -g
#升级 &br&hexo init
#初始化博客&br&&br&命令简写&br&hexo n
&我的博客& == hexo new
&我的博客&
#新建文章&br&hexo g == hexo generate
#生成&br&hexo s == hexo server
#启动服务预览&br&hexo d == hexo deploy
#部署&br&&br&hexo server
#Hexo会监视文件变动并自动更新,无须重启服务器&br&hexo server -s
#静态模式&br&hexo server -p 5000
#更改端口&br&hexo server -i 192.168.1.1
#自定义 IP&br&hexo clean
#清除缓存,若是网页正常情况下可以忽略这条命令&br&&br&刚刚的三个命令依次是新建一篇博客文章、生成网页、在本地预览的操作。&/p&&p&&b&推送网站&/b&&/p&&p&上面只是在本地预览,接下来要做的就是就是推送网站,也就是发布网站,让我们的网站可以被更多的人访问。在设置之前,需要解释一个概念,在blog根目录里的_config.yml文件称为&b&站点&/b&配置文件,如下图&/p&&p&&br&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-cb1fd5e5a2e73f724c7c55_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&637& data-rawheight=&335& class=&origin_image zh-lightbox-thumb& width=&637& data-original=&https://pic4.zhimg.com/v2-cb1fd5e5a2e73f724c7c55_r.jpg&&&/figure&&p&进入根目录里的themes文件夹,里面也有个_config.yml文件,这个称为&b&主题&/b&配置文件,如下图&/p&&p&&br&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-4bf91c7d5ac3_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&699& data-rawheight=&610& class=&origin_image zh-lightbox-thumb& width=&699& data-original=&https://pic3.zhimg.com/v2-4bf91c7d5ac3_r.jpg&&&/figure&&p&下一步将我们的Hexo与GitHub关联起来,打开站点的配置文件_config.yml,翻到最后修改为:&/p&&p&deploy: &br&type: git&br&repo: 这里填入你之前在GitHub上创建仓库的完整路径,记得加上 .git&br&branch: master参考如下:&br&&/p&&p&&br&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-279acdc099defbb12eaa8_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&864& data-rawheight=&125& class=&origin_image zh-lightbox-thumb& width=&864& data-original=&https://pic1.zhimg.com/v2-279acdc099defbb12eaa8_r.jpg&&&/figure&&p&保存站点配置文件。&/p&&p&其实就是给hexo d 这个命令做相应的配置,让hexo知道你要把blog部署在哪个位置,很显然,我们部署在我们GitHub的仓库里。最后安装Git部署插件,输入命令:&/p&&div class=&highlight&&&pre&&code class=&language-basemake&&&span&&/span&&span class=&err&&npm&/span& &span class=&err&&install&/span& &span class=&err&&hexo-deployer-git&/span& &span class=&err&&--save&/span&
&/code&&/pre&&/div&&p&&br&&/p&&p&这时,我们分别输入三条命令:&/p&&p&&br&&/p&&div class=&highlight&&&pre&&code class=&language-bash&&&span&&/span&hexo clean
&/code&&/pre&&/div&&p&其实第三条的 hexo d 就是部署网站命令,d是deploy的缩写。完成后,打开浏览器,在地址栏输入你的放置个人网站的仓库路径,即 &a href=&https://link.zhihu.com/?target=http%3A//xxxx.github.io& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&xxxx.github.io&/span&&span class=&invisible&&&/span&&/a& (知乎排版可能会出现&http://&字样,参考下图) 比如我的xxxx就是我的GitHub用户名:&/p&&p&&br&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-d8bfef23d1b10_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&220& data-rawheight=&34& class=&content_image& width=&220&&&/figure&&p&你就会发现你的博客已经上线了,可以在网络上被访问了。&/p&&p&&b&绑定域名&/b&&/p&&p&虽然在Internet上可以访问我们的网站,但是网址是GitHub提供的:&a href=&https://link.zhihu.com/?target=http%3A//xxxx.github.io& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&xxxx.github.io&/span&&span class=&invisible&&&/span&&/a& (知乎排版可能会出现&http://&字样) 而我们想使用我们自己的个性化域名,这就需要绑定我们自己的域名。这里演示的是在阿里云万网的域名绑定,在国内主流的域名代理厂商也就阿里云和腾讯云。登录到阿里云,进入管理控制台的域名列表,找到你的个性化域名,进入解析&/p&&p&&br&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-4e206aef93a3d68f0670b6_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1250& data-rawheight=&192& class=&origin_image zh-lightbox-thumb& width=&1250& data-original=&https://pic4.zhimg.com/v2-4e206aef93a3d68f0670b6_r.jpg&&&/figure&&p&然后添加解析&/p&&p&&br&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-bb692aacbe2_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&750& data-rawheight=&737& class=&origin_image zh-lightbox-thumb& width=&750& data-original=&https://pic4.zhimg.com/v2-bb692aacbe2_r.jpg&&&/figure&&p&&br&&/p&&p&&br&&/p&&p&包括添加三条解析记录,192.30.252.153是GitHub的地址,你也可以ping你的 &a href=&https://link.zhihu.com/?target=http%3A//xxxx.github.io& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&xxxx.github.io&/span&&span class=&invisible&&&/span&&/a& 的ip地址,填入进去。第三个记录类型是CNAME,CNAME的记录值是:你的用户名.&a href=&https://link.zhihu.com/?target=http%3A//github.io& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&github.io&/span&&span class=&invisible&&&/span&&/a& 这里千万别弄错了。第二步,登录GitHub,进入之前创建的仓库,点击settings,设置Custom domain,输入你的域名&/p&&p&&br&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-85ba6dda906f22dea4c03df2b47d994b_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&913& data-rawheight=&168& class=&origin_image zh-lightbox-thumb& width=&913& data-original=&https://pic3.zhimg.com/v2-85ba6dda906f22dea4c03df2b47d994b_r.jpg&&&/figure&&p&点击save保存。第三步,进入本地博客文件夹 ,进入blog/source目录下,创建一个记事本文件,输入你的域名,对,只要写进你自己的域名即可。如果带有www,那么以后访问的时候必须带有www完整的域名才可以访问,但如果不带有www,以后访问的时候带不带www都可以访问。所以建议,不要带有www。这里我还是写了www(不建议带有www):&/p&&figure&&img src=&https://pic3.zhimg.com/v2-79abfff91af3f520e24cb91acf6aa994_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&536& data-rawheight=&191& class=&origin_image zh-lightbox-thumb& width=&536& data-original=&https://pic3.zhimg.com/v2-79abfff91af3f520e24cb91acf6aa994_r.jpg&&&/figure&&p&保存,命名为CNAME ,注意保存成&b&所有文件&/b&而不是&b&txt文件&/b&。&/p&&p&完成这三步,进入blog目录中,按住shift键右击打开命令行,依次输入:&/p&&div class=&highlight&&&pre&&code class=&language-bash&&&span&&/span&hexo clean
&/code&&/pre&&/div&&p&这时候打开浏览器在地址栏输入你的个性化域名将会直接进入你自己搭建的网站。&/p&&p&&b&更换主题&/b&&/p&&p&如果你不喜欢Hexo默认的主题,可以更换不同的主题,主题传送门:&a href=&https://link.zhihu.com/?target=https%3A//hexo.io/themes/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Themes&/a& 我自己使用的是Next主题,可以在blog目录中的themes文件夹中查看你自己主题是什么。现在把默认主题更改成Next主题,在blog目录中(就是命令行的位置处于blog目录)打开命令行输入:&/p&&div class=&highlight&&&pre&&code class=&language-bash&&&span&&/span&git clone https://github.com/iissnan/hexo-theme-next themes/next
&/code&&/pre&&/div&&p&这是将Next主题下载到blog目录的themes主题下的next文件夹中。打开&b&站点&/b&的_config.yml配置文件,修改主题为next&/p&&p&&br&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-b08cb15b485c65ae00f70_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&653& data-rawheight=&121& class=&origin_image zh-lightbox-thumb& width=&653& data-original=&https://pic4.zhimg.com/v2-b08cb15b485c65ae00f70_r.jpg&&&/figure&&p&打开&b&主题&/b&的_config.yml配置文件,不是站点主题文件,找到Scheme Settings&/p&&p&&br&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-1ac152c4aabe4c10b762ee_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&973& data-rawheight=&193& class=&origin_image zh-lightbox-thumb& width=&973& data-original=&https://pic4.zhimg.com/v2-1ac152c4aabe4c10b762ee_r.jpg&&&/figure&&p&next主题有三个样式,我用的是Pisces,你们可以自己试试看,选择你自己喜欢的样式(只需要把行首的#去除,#是注释),选择好后,再次部署网站,hexo g、hexo d,查看效果。选择其他主题,按照上述过程即可实现。&/p&&p&&b&初识Markdown语法&/b&&/p&&p&&br&&/p&&p&Markdown是一种可以使用普通文本编辑器编写的标记语言,通过简单的标记语法,它可以使普通文本内容具有一定的格式。Markdown语法简洁明了、容易掌握,而且功能比纯文本更强,因此写博客使用它,可以让用户更加专注的写文章,而不需要费尽心力的考虑样式,相对于html已经算是轻量级语言,像有道云笔记也支持Markdown写作。并且Markdown完全兼容html,也就是可以在文章里直接插入html代码。比如给博文添加音乐,就可以直接把音乐的外链html代码插入文章中。具体语法参看:&a href=&https://link.zhihu.com/?target=http%3A//www.appinn.com/markdown/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Markdown 语法说明(简体中文版)&/a& 可以说十分钟就可以入门。当然,工欲善其事必先利其器,选择一个好的Markdown编辑器也是非常重要的,这里推荐&a href=&https://link.zhihu.com/?target=http%3A//code52.org/DownmarkerWPF/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&MarkPad&/a& 和&a href=&https://link.zhihu.com/?target=http%3A//www.markdownpad.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&The Markdown Editor for Windows&/a& ,这是带有预览效果的编辑器,也可以使用本地的文本编辑器,更多的Markdown的语法与编辑器自己可以搜索了解。&/p&&p&&br&&/p&&p&&b&发布文章&/b&&/p&&p&我们开始正式发布上线博客文章,在命令行中输入:&/p&&div class=&highlight&&&pre&&code class=&language-bash&&&span&&/span&hexo n &span class=&s2&&&博客名字&&/span&
&/code&&/pre&&/div&&p&&br&&/p&&p&我们会发现在blog根目录下的source文件夹中的_post文件夹中多了一个&b& 博客名字.md&/b& 文件,使用Markdown编辑器打开,就可以开始你的个人博客之旅了,Markdown常用的样式也就十来种,完全能够满足一般博文的样式要求,这是我的一篇博文内容示例:&/p&&p&&br&&/p&&figure&&img src=&https://pic2.zhimg.com/v2-4f96cd03a88e68b8ae86c38bfb0808ac_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1919& data-rawheight=&1019& class=&origin_image zh-lightbox-thumb& width=&1919& data-original=&https://pic2.zhimg.com/v2-4f96cd03a88e68b8ae86c38bfb0808ac_r.jpg&&&/figure&&p&通过带有预览样式的Markdown编辑器实时预览书写的博文样式,也可以通过命令 hexo s --debug 在本地浏览器的localhost:4000 预览博文效果。写好博文并且样式无误后,通过hexo g、hexo d 生成、部署网页。随后可以在浏览器中输入域名浏览。&/p&&p&&br&&/p&&p&&b&寻找图床&/b&&/p&&p&图床,当博文中有图片时,若是少量图片,可以直接把图片存放在source文件夹中,但这显然不合理的,因为图片会占据大量的存储的空间,加载的时候相对缓慢 ,这时考虑把博文里的图片上传到某一网站,然后获得外部链接,使用Markdown语法,&b&![图片信息](外部链接) &/b&完成图片的插入,这种网站就被成为图床。常见的简易的图床网站有:&a href=&https://link.zhihu.com/?target=http%3A//www.tietuku.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&贴图库图片外链&/a& 国内算比较好的图床我认为有两个:新浪微博和 &a href=&https://link.zhihu.com/?target=https%3A//www.qiniu.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&七牛云&/a& ,七牛云的使用方法可以参看其他文章。图床最重要的就是稳定速度快,所以在挑选图床的时候一定要仔细,下图是博文插入图片,使用图床外链的示例:&/p&&figure&&img src=&https://pic2.zhimg.com/v2-af139ace5f371aae3ff3_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&941& data-rawheight=&178& class=&origin_image zh-lightbox-thumb& width=&941& data-original=&https://pic2.zhimg.com/v2-af139ace5f371aae3ff3_r.jpg&&&/figure&&p&&b&个性化设置&/b&&/p&&p&所谓的个性化设置就是根据个人需要添加不同的插件及功能。&/p&&p&基本的有:&/p&&p&在站点配置文件_config.yml修改基本的站点信息&/p&&p&&br&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-78bc0e4ecb269bf_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&800& data-rawheight=&211& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&https://pic1.zhimg.com/v2-78bc0e4ecb269bf_r.jpg&&&/figure&&p&依次是网站标题、副标题、网站描述、作者、网站头像外部链接、网站语言、时区等。&/p&&p&在主题配置文件_config.yml修改基本的主题信息,如:&/p&&p&&br&&/p&&figure&&img src=&https://pic2.zhimg.com/v2-451c5cb2fdcad_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&376& data-rawheight=&86& class=&content_image& width=&376&&&/figure&&p&博文打赏的微信、支付宝二维码图片,这里我是直接把这两张放在根目录的source文件夹中,并没有使用图床外链。&/p&&p&&br&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-69bbc45e973ebed8b33a55_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1387& data-rawheight=&606& class=&origin_image zh-lightbox-thumb& width=&1387& data-original=&https://pic3.zhimg.com/v2-69bbc45e973ebed8b33a55_r.jpg&&&/figure&&p&社交外链的设置,即在侧栏展示你的个人社交网站信息。&/p&&p&&br&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-5b3f6e02e0d3a0cdb685a4d2fd2718cb_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&590& data-rawheight=&108& class=&origin_image zh-lightbox-thumb& width=&590& data-original=&https://pic3.zhimg.com/v2-5b3f6e02e0d3a0cdb685a4d2fd2718cb_r.jpg&&&/figure&&p&博文分享的插件jiathis,值设置为true。在配置文件中有很多的个性化设置,可以自尝试更多的修改。&/p&&p&进阶个性化:&/p&&ul&&li&添加网易云音乐&/li&&/ul&&p&&br&&/p&&p&打开网页版的网易云音乐,选择喜欢的音乐,点击生成外链播放器&/p&&p&&br&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-fcb7d44ccdcad_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&699& data-rawheight=&448& class=&origin_image zh-lightbox-thumb& width=&699& data-original=&https://pic4.zhimg.com/v2-fcb7d44ccdcad_r.jpg&&&/figure&&p&复制外链的代码&/p&&p&&br&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-16eec195312cde7b1d257fac6f3c8d0b_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&745& data-rawheight=&687& class=&origin_image zh-lightbox-thumb& width=&745& data-original=&https://pic3.zhimg.com/v2-16eec195312cde7b1d257fac6f3c8d0b_r.jpg&&&/figure&&p&比如在侧栏插入这首歌的音乐播放器,修改 blog\themes\next\layout\_macro的sidebar.swig文件,添加刚刚复制的外链代码&/p&&figure&&img src=&https://pic1.zhimg.com/v2-03dbe4d5888e0efd577c7_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1326& data-rawheight=&473& class=&origin_image zh-lightbox-thumb& width=&1326& data-original=&https://pic1.zhimg.com/v2-03dbe4d5888e0efd577c7_r.jpg&&&/figure&&p&&br&&/p&&p&重新生成、部署网页,效果如下&/p&&figure&&img src=&https://pic2.zhimg.com/v2-3d587bf919df92db38ef1_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&258& data-rawheight=&240& class=&content_image& width=&258&&&/figure&&ul&&li&设置背景&/li&&/ul&&p&&br&&/p&&p&把你挑选的背景图片命名为:background.jpg,放在blog\themes\next\source\images里,在blog\themes\next\source\css\_custom文件的custom.styl首部添加:&/p&&div class=&highlight&&&pre&&code class=&language-css&&&span&&/span&&span class=&nt&&body&/span& &span class=&p&&{&/span&
&span class=&nb&&background&/span&&span class=&o&&:&/span&&span class=&sx&&url(/images/background.jpg)&/span&&span class=&p&&;&/span&
&span class=&nb&&background-attachment&/span&&span class=&o&&:&/span& &span class=&nb&&fixed&/span&&span class=&p&&;&/span&
&span class=&p&&}&/span&
&/code&&/pre&&/div&&p&background-attachment:是固定背景图片。&/p&&p&这是设置一张静态图片作为背景,其实Next主题自带有动态的背景效果,修改主题配置文件中的canvas_nest: false为canvas_nest: true即可。&/p&&ul&&li&增加侧栏菜单条目&/li&&/ul&&p&默认的侧栏菜单条目有:首页、归档、标签、关于、搜索等。如果你想要增加其他的菜单条目,修改主题配置文件_config.yml里的Menu Settings中的menu和menu_icons两个地方&br&&/p&&p&&br&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-666a22fedbba95d979eeb26e52fc29e2_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1503& data-rawheight=&780& class=&origin_image zh-lightbox-thumb& width=&1503& data-original=&https://pic1.zhimg.com/v2-666a22fedbba95d979eeb26e52fc29e2_r.jpg&&&/figure&&p&其中menu里是配置菜单项对应的页面位置(如:/love),menu_icons对应菜单项的图标,这里的图标是来自于&a href=&https://link.zhihu.com/?target=http%3A//fontawesome.io/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Font Awesome&/a& ,所以你需要在Font Awesome网站上找到你需要的icon,然后把该icon的名字写在menu_icons对应菜单名后面,注意冒号有一个英文输入状态的空格。设置好后,在命令行里输入:&/p&&div class=&highlight&&&pre&&code class=&language-bash&&&span&&/span&hexo new page &span class=&s2&&&你所要增加的菜单项名称(要和你在menu中的填写要匹配)&&/span&
&/code&&/pre&&/div&&p&新建的页面在博客根目录下的source文件里,这时你就可以对新建的页面自定义设计。&/p&&p&&br&&/p&&p&还有更多的进阶个性化设置,如SEO、评论系统、个人头像、博客分享、订阅功能、High功能、404网页设置等,可以参看:&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//theme-next.iissnan.com/theme-settings.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&主题配置 - NexT 使用文档&/a& &/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//theme-next.iissnan.com/third-party-services.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&第三方服务集成 - NexT 使用文档&/a& &/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//theme-next.iissnan.com/tag-plugins.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&内置标签 - NexT 使用文 &/a&&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//theme-next.iissnan.com/tag-plugins.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&档&/a&&a href=&https://link.zhihu.com/?target=http%3A//theme-next.iissnan.com/advanced-settings.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&进阶设定 - NexT 使用文档&/a&&/p&&p&有很多人私信问我High功能特效如何设置,这里推荐一篇同是Next主题网站博主的文章:&a href=&https://link.zhihu.com/?target=http%3A//www.iamlj.com/2016/08/add-special-effect-harlem-shake-for-hexo/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&为Hexo Next主题添加哈林摇特效(五)&/a&&/p&&p&&b&其他&/b&&/p&&p&终于写到这里了,也算是基本圆满完成了我的写作初衷,总结自己的一些经验,分享一些有趣的东西,不过脖子也是僵硬的受不了。我知道很多人想要建立自己的个人网站却一直没有付诸行动,希望这篇文章能给你一点点灵感与想法,just do it。本文是windows平台的搭建过程,其他平台可以参看相关资料,也有很多其他优秀的博客框架值得学习。如果有任何建议或想法、或疑问欢迎在评论区交流, 做好的网站不妨在评论区贴出网址,让大家一起学习。&/p&&p&&br&&/p&&p&&b&附录&/b&&/p&&p&&b&以下是评论区贴出网址的博客展示:&/b&&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//jmyblog.top/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&...Miss.j BlogDiary...&/a&&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//ibb.chaodamiao.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&RILWEIC&/a&&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//blog.sunxinfei.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Xin’s Notes&/a&&/p&&p&&a href=&https://link.zhihu.com/?target=https%3A//guguant.github.io/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&飞鸟与鱼&/a&&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//www.fuck-goods.tk/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&无名博客&/a&&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//helloqa.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&iTesting软件测试知识分享&/a&&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//bolg.upsky.top/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&赵小源的个人博客&/a&&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//www.huajiayi.top/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&华嘉熠’s Blog&/a&&/p&&p&&a href=&https://link.zhihu.com/?target=http%3A//asmire.site/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Cocoon&/a&&/p&&p&&b&其他优秀个人博客展示:&/b&&/p&&p&&a href=&https://link.zhihu.com/?target=https%3A//www.dandyweng.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&翁天信 · Dandy Weng&/a& &a href=&https://link.zhihu.com/?target=http%3A//chaoxuprime.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&chaoxuprim&/a& &a href=&https://link.zhihu.com/?target=http%3A//kenjiendo.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&KENJI ENDO&/a& &a href=&https://link.zhihu.com/?target=http%3A//shenzekun.cn/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Moorez&/a& &a href=&https://link.zhihu.com/?target=https%3A//codesky.me/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&CodeSky 代码之空&/a& &a href=&https://link.zhihu.com/?target=http%3A//www.helloshawn.cn/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&大江东去&/a& &a href=&https://link.zhihu.com/?target=http%3A//iconmoon.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&UI Design Portfolio of JJ Ying&/a& &a href=&https://link.zhihu.com/?target=http%3A//www.jeyzhang.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&JeyZhang&/a& &a href=&https://link.zhihu.com/?target=http%3A//blog.lightina.cn/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&jacklightChen | 得到的都是侥幸&/a& &a href=&https://link.zhihu.com/?target=https%3A//qingpei.me/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&edwardtoday&/a& &a href=&https://link.zhihu.com/?target=http%3A//rafaltomal.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Rafal Tomal - Web Designer and Genesis Developer&/a& &a href=&https://link.zhihu.com/?target=http%3A//strml.net/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Projects and Work&/a& &a href=&https://link.zhihu.com/?target=http%3A//miaoxiaoer.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&绘画爱好者&/a& &a href=&https://link.zhihu.com/?target=http%3A//ursocute.github.io/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&万世奇的博客&/a& &a href=&https://link.zhihu.com/?target=https%3A//rauchg.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Guillermo Rauch&/a& &/p&&hr&&p&&b&如果文章对您有用并且愿意赞助作者,请访问:&a href=&https://link.zhihu.com/?target=http%3A//iamwr.com/about/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&About&/a& 扫描二维码进行赞助,同时欢迎在:&/b&&a href=&https://link.zhihu.com/?target=http%3A//iamwr.com/about/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&About&/a& &b&留言交流。&/b&&/p&
前言:随着互联网浪潮的翻腾,国内外涌现出越来越多优秀的社交网站让用户分享信息更加便捷。然后,如果你是一个不甘寂寞的程序猿(媛),是否也想要搭建一个属于自己的个人网站,如果你曾经或者现在正有这样的想法,请跟随这篇文章发挥你的Geek精神,让你快…
&figure&&img src=&https://pic1.zhimg.com/5fdadacd2ae4_b.jpg& data-rawwidth=&963& data-rawheight=&606& class=&origin_image zh-lightbox-thumb& width=&963& data-original=&https://pic1.zhimg.com/5fdadacd2ae4_r.jpg&&&/figure&&h1&适合人群&/h1&&ul&&li&喜欢写Blog的人&/li&&li&有一定的编程基础&/li&&li&爱折腾的人&/li&&li&熟练使用版本控制Git&/li&&li&了解使用Github&/li&&li&熟悉基本的MarkDown语法&/li&&/ul&&h1&环境准备&/h1&&h2&安装Git&/h2&&p&下载 &a href=&https://link.zhihu.com/?target=http%3A//Redirecting%2520Git%2520for%2520Windows%27%2520homepage...& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&msysgit&/a& 并执行即可完成安装。&/p&&h2&安装Node.js&/h2&&p&在 Windows 环境下安装 &a href=&https://link.zhihu.com/?target=http%3A//Node.js& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Node.js&/a& 非常简单,仅须下载安装文件并执行即可完成安装。&/p&&h2&安装hexo&/h2&&p&利用 npm 命令即可安装。(在任意位置点击鼠标右键,选择Git bash)&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&npm install -g hexo
&/code&&/pre&&/div&&p&问题&/p&&ul&&li&npm ERR! registry error parsing json 错误&/li&&/ul&&p&可能需要设置npm代理,执行命令&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&npm config set registry http://registry.cnpmjs.org
&/code&&/pre&&/div&&ul&&li&hexo:command not found&br&删除刚刚安装的npm目录,重新执行命令npm install -g hexo安装hexo,&/li&&/ul&&h2&创建hexo文件夹&/h2&&p&安装完成后,在你喜爱的文件夹下(如H:\hexo),执行以下指令(在H:\hexo内点击鼠标右键,选择Git bash),Hexo 即会自动在目标文件夹建立网站所需要的所有文件。&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&hexo init
&/code&&/pre&&/div&&h2&安装依赖包&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&npm install
&/code&&/pre&&/div&&h2&本地查看&/h2&&p&现在我们已经搭建起本地的hexo博客了,执行以下命令(在H:\hexo),然后到浏览器输入localhost:4000看看。&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&hexo generate
hexo server
&/code&&/pre&&/div&&p&好了,至此,本地博客已经搭建起来了,只是本地哦,别人看不到的。下面,我们要部署到Github。&/p&&p&问题&/p&&ul&&li&执行hexo server提示找不到该指令&br&解决办法:&br&在Hexo 3.0 后server被单独出来了,需要安装server,安装的命令如下:&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&npm install hexo -server --save
&/code&&/pre&&/div&
安装此server后再试,问题解决&/li&&/ul&&h1&github 创建博客&/h1&&ul&&li&&h2&注册账号&/h2&
地址:&a href=&https://link.zhihu.com/?target=http%3A//How%2520people%2520build%2520software%%25B7%2520GitHub& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&How people build software · GitHub&/a&&br&输入账号、邮箱、密码,然后点击注册按钮.&figure&&img src=&https://pic3.zhimg.com/b0ccbbe209859daeaab46f0_b.jpg& data-rawwidth=&1039& data-rawheight=&512& class=&origin_image zh-lightbox-thumb& width=&1039& data-original=&https://pic3.zhimg.com/b0ccbbe209859daeaab46f0_r.jpg&&&/figure&&/li&&/ul&&h2&创建页面仓库&/h2&&p&这个仓库的名字需要和你的账号对应,格式: &a href=&https://link.zhihu.com/?target=http%3A//yourname.github.io& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&yourname.github.io&/span&&span class=&invisible&&&/span&&/a&&br&输入基本信息,然后点击创建仓库.&br&&figure&&img src=&https://pic4.zhimg.com/acd9cbce109fb52569b38caf72da27ec_b.jpg& data-rawwidth=&1047& data-rawheight=&421& class=&origin_image zh-lightbox-thumb& width=&1047& data-original=&https://pic4.zhimg.com/acd9cbce109fb52569b38caf72da27ec_r.jpg&&&/figure&&figure&&img src=&https://pic1.zhimg.com/eddff8d51a54a612b253440_b.jpg& data-rawwidth=&1018& data-rawheight=&501& class=&origin_image zh-lightbox-thumb& width=&1018& data-original=&https://pic1.zhimg.com/eddff8d51a54a612b253440_r.jpg&&&/figure&&br&注意&br&命名规则:你的github账号.&a href=&https://link.zhihu.com/?target=http%3A//github.io& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&github.io&/span&&span class=&invisible&&&/span&&/a&,我这里被坑了,之前是jekell写的,现在换成hexo,所以我是另建创库了。&/p&&h2&生成SSH密钥&/h2&&p&ssh-keygen -t rsa -C “你的邮箱地址”,按3个回车,密码为空。&/p&&p&在C:\Users\Administrator.ssh下,得到两个文件id_rsa和id_rsa.pub。&/p&&h2&在GitHub上添加SSH密钥&/h2&&p&打开id_rsa.pub,复制全文。&a href=&https://link.zhihu.com/?target=http%3A//Sign%2520in%2520to%2520GitHub%%25B7%2520GitHub& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Sign in to GitHub · GitHub&/a& ,Add SSH key,粘贴进去。&/p&&h1&hexo使用&/h1&&h2&目录结构&/h2&&p&.&br&├── .deploy
#需要部署的文件&br&├── node_modules
#Hexo插件&br&├── public
#生成的静态网页文件&br&├── scaffolds
#模板&br&├── source
#博客正文和其他源文件,404、favicon、CNAME 都应该放在这里&br&|
├── _drafts
#草稿&br&|
└── _posts
#文章&br&├── themes
#主题&br&├── _config.yml
#全局配置文件&br&└── package.json&/p&&h2&全局配置 _config.yml&/h2&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&# Hexo Configuration
# Docs: Configuration
# Source: GitHub - hexojs/hexo: A fast, simple & powerful blog framework, powered by Node.js.
# Site #站点信息
description:
#站点描述,给搜索引擎看的
language: zh-CN #语言
# URL #链接格式
root: / #根目录
permalink: :year/:month/:day/:title/ #文章的链接格式
tag_dir: tags #标签目录
archive_dir: archives #存档目录
category_dir: categories #分类目录
code_dir: downloads/code
permalink_defaults:
# Directory #目录
source_dir: source #源文件目录
public_dir: public #生成的网页文件目录
# Writing #写作
new_post_name: :title.md #新文章标题
default_layout: post #默认的模板,包括 post、page、photo、draft(文章、页面、照片、草稿)
titlecase: false #标题转换成大写
external_link: true #在新选项卡中打开连接
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
highlight: #语法高亮
enable: true #是否启用
line_number: true #显示行号
tab_replace:
# Category & Tag #分类和标签
default_category: uncategorized #默认分类
category_map:
# Archives
2: 开启分页
1: 禁用分页
0: 全部禁用
archive: 2
category: 2
# Server #本地服务器
port: 4000 #端口号
server_ip: localhost #IP 地址
logger: false
logger_format: dev
# Date / Time format #日期时间格式
date_format: YYYY-MM-DD #参考Moment.js | Docs
time_format: H:mm:ss
# Pagination #分页
per_page: 10 #每页文章数,设置成 0 禁用分页
pagination_dir: page
# Disqus #Disqus评论,替换为多说
disqus_shortname:
# Extensions #拓展插件
theme: landscape-plus #主题
exclude_generator:
plugins: #插件,例如生成 RSS 和站点地图的
- hexo-generator-feed
- hexo-generator-sitemap
# Deployment #部署,将 lmintlcx 改成用户名
repo: 刚刚github创库地址.git
branch: master
&/code&&/pre&&/div&&p&注意&/p&&ul&&li&配置文件的冒号“:”后面有一个空格&/li&&li&repo: 刚刚github创库地址.git&/li&&/ul&&h2&hexo命令行使用&/h2&&p&常用命令:&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&hexo help #查看帮助
hexo init #初始化一个目录
hexo new &postName& #新建文章
hexo new page &pageName& #新建页面
hexo generate #生成网页,可以在 public 目录查看整个网站的文件
hexo server #本地预览,'Ctrl+C'关闭
hexo deploy #部署.deploy目录
hexo clean #清除缓存,**强烈建议每次执行命令前先清理缓存,每次部署前先删除 .deploy 文件夹**
&/code&&/pre&&/div&&p&简写:&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&hexo n == hexo new
hexo g == hexo generate
hexo s == hexo server
hexo d == hexo deploy
&/code&&/pre&&/div&&h2&编辑文章&/h2&&p&新建文章&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&hexo new &标题&
&/code&&/pre&&/div&&p&在 _posts 目录下会生成文件标题.md&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&title: Hello World
07:56:29 #发表日期,一般不改动
categories: hexo #文章文类
tags: [hexo,github] #文章标签,多于一项时用这种格式
正文,使用Markdown语法书写
&/code&&/pre&&/div&&p&编辑完后保存,hexo server 预览&/p&&h1&hexo部署&/h1&&p&执行下列指令即可完成部署。&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&hexo generate
hexo deploy
&/code&&/pre&&/div&&p&hexo deploy问题:Deployer not found: git&br&执行&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&npm install hexo-deployer-git --save
&/code&&/pre&&/div&&p&重新deploy即可&/p&&p&以下提示说明部署成功&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&[info] Deploy done: git
&/code&&/pre&&/div&&p&点击 Github 上项目的 Settings,GitHub Pages,提示Your site is published at &a href=&https://link.zhihu.com/?target=http%3A//wuxiaolong.me& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&吴小龙同學&/a& (这是我买的域名)&/p&&h1&图床&/h1&&p&1.墙裂推荐七牛云储存,&a href=&https://link.zhihu.com/?target=https%3A//portal.qiniu.com/signup%3Fcode%3D3lk4saqepkdhu& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&注册地址&/a&。&/p&&p&2.七牛云储存提供10G的免费空间,以及每月10G的流量.存放个人博客图片最好不过了&/p&&p&3.七牛云储存还有各种图形处理功能、缩略图、视频存放速度也给力。&/p&&p&具体使用见&a href=&https://link.zhihu.com/?target=http%3A//wuxiaolong.github.io/blog//qiniu-photo-bed.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&使用七牛作为github博客的图床&/a&&/p&&h1&域名&/h1&&h2&将独立域名与GitHub Pages的空间绑定&/h2&&p&方法一:在站点source目录下面,新建一个名为CNAME的文本文件,里面写入你要绑定的域名,比如&a href=&https://link.zhihu.com/?target=http%3A//wuxiaolong.me& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&wuxiaolong.me&/span&&span class=&invisible&&&/span&&/a&&br&方法二:在Repository的根目录下面,新建一个名为CNAME的文本文件,里面写入你要绑定的域名,比如&a href=&https://link.zhihu.com/?target=http%3A//wuxiaolong.me& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&wuxiaolong.me&/span&&span class=&invisible&&&/span&&/a&&/p&&h2&DNS设置&/h2&&p&用&a href=&https://link.zhihu.com/?target=http%3A//DNSPod-%25E5%E8%25B4%25B9%25E6%2599%25BA%25E8%2583%25BDDNS%25E8%25A7%25A3%25E6%259E%%259C%258D%25E5%258A%25A1%25E5%& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&DNSpod&/a&,快,免费,稳定。&br&注册DNSpod,添加域名,如下图设置。&br&&figure&&img src=&https://pic4.zhimg.com/cef6daeb7dbab327c6ef_b.jpg& data-rawwidth=&809& data-rawheight=&281& class=&origin_image zh-lightbox-thumb& width=&809& data-original=&https://pic4.zhimg.com/cef6daeb7dbab327c6ef_r.jpg&&&/figure&&br&其中A的两条记录指向的ip地址是github Pages的提供的ip&br&如何知道你的github上项目的IP,如下:&figure&&img src=&https://pic3.zhimg.com/b4bb6aa84ac31_b.jpg& data-rawwidth=&643& data-rawheight=&178& class=&origin_image zh-lightbox-thumb& width=&643& data-original=&https://pic3.zhimg.com/b4bb6aa84ac31_r.jpg&&&/figure&&br&&

我要回帖

更多关于 信息录入页面模板 的文章

 

随机推荐