美文网首页
搭建个人博客

搭建个人博客

作者: 赤龙绕月 | 来源:发表于2015-07-20 12:06 被阅读178次

注册GitHub账号

地址:https://github.com/

创建博客

根据:用静态页面生成静态博客

个性化博客

做自己的simple:

根据:About Simple

先fork,push到你fork之后的你的simple项目下,然后把src文件夹push到gh-pages分支

The template files are at /src/template, so you can modify the template files and css files. If you want use your own theme you can clone the project, modify the template files and push the entire src folder in your gh-pages branch which will allow you generate your own static blog.  

改名称:

You can use your own blog name, just modify the main.json file, and change name="username".  

设置disqus:

You can use disqus comment system, just modify the main.json file, and change disqus_shortname="" to disqus_shortname="your_shortname". 

实测要改成disqus_shortname="Login"才能加载

登录disqus: https://disqus.com/
在设置中的Website中填入博客地址

添加多说评论系统:

登录多说评论系统:http://duoshuo.com/

可知,在页面中加入以下代码即可:

<!-- 多说评论框 start -->
    <div class="ds-thread" data-thread-key="ID" data-title="请替换成文章的标题" data-url="请替换成文章的网址"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"yhcao"};
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0] 
         || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    </script>
<!-- 多说公共JS代码 end -->

修改自己simple项目的模版post.html

<div class="entry" id="main">

后添加:

<div class="duoshuo-div" id="duoshuo-div">
<!-- 多说评论框 start 
<div class="ds-thread" Id="data-duoshuo" data-thread-key="ID" data-title="标题" data-url="http://caojingyou.github.io"></div> -->
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"yhcao"};
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0] 
         || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
    </script>
<!-- 多说公共JS代码 end -->
</div>
<script id="pagesTemplate" type="text/mustache">

后添加:

<script id="duoshuo-sc" type="text/mustache">
<div class="ds-thread" Id="data-duoshuo" data-thread-key="{{key}}" data-title="{{title}}" data-url="博客网址{{url}}"></div>
</script>
$("#main").prepend(contentHtml);

后添加:

var duoshuoTemplate = Hogan.compile($("#duoshuo-sc").html());
var duoshuoHtml = duoshuoTemplate.render({"key": path, "title": post.title, "url": path});
$("#duoshuo-div").prepend(duoshuoHtml);

添加百度站内搜索:

进入百度站长平台
按照百度站内搜索所讲进行操作即可

添加swiftype站内搜索:

在github中百度站内搜索不识别,所有添加了swiftype而放弃百度。
网站地址:https://swiftype.com/

参考文档:

创建GitHub技术博客全攻略
用静态页面生成静态博客
About Simple
Github空间在线写文章和用Farbox,Droppages在Dropbox建博客网站
百度站内搜索
使用swiftype实现站内搜索
Sitemap.xml Support

原文地址:http://caojingyou.github.io/004.html

相关文章

  • Hexo博客搭建详细笔记(Win10+Gitee)

    目录 1、为什么要搭建个人博客 2、搭建个人博客的多种选择 (1)动态博客搭建 (2)静态博客搭建 3、先简要介绍...

  • Hexo+github搭建个人博客-博客发布篇

    通过 Hexo+github搭建个人博客-环境搭建篇 以及 Hexo+github搭建个人博客-博客初始化篇 ...

  • Blog

    个人博客搭建

  • 个人博客搭建

    https://ppb2.github.io/ 预览版

  • 个人博客搭建

    win7 安装虚拟环境 win10安装virtualenv 若要使用python虚拟环境进行开发,首先需要安装vi...

  • 搭建个人博客

    ruby更新好之后, 开心地安了 jekyll 到 wenyuanma.github.io 目录下 报错 Coul...

  • 个人博客搭建

    基础环境搭建 安装open jdk yum -y install java-1.8.0-openjdk java-...

  • 搭建个人博客

    搭建个人博客的想法 作为一个程序员时不时会看到和想到一些好的文章和观点,有时候还有些漂亮的代码段,想记录下来的方式...

  • 搭建个人博客

    [TOC]Hexo官方文档 步骤 在github中新建一个仓库,仓库的名称必须是 你的用户名.github.io ...

  • 搭建个人博客

    购买阿里云实例 我购买的是北京机房的随机分配,其他的默认配置,付款前,选择使用推荐码, yun999(这个是淘宝里...

网友评论

      本文标题:搭建个人博客

      本文链接:https://www.haomeiwen.com/subject/npypqttx.html