• 搭建个人博客


    注册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

  • 相关阅读:
    匹配下拉控件
    验证视图状态 MAC 失败
    打开网页要输入用户名和密码的解决方案!
    ASP.NET网站安装部署参考总结!
    IOS开发中常量的处理
    typedef与define的区别
    OC的单例模式
    js for循环中传入动态参数
    javascript array map方法
    javascript 得到兄弟节点的方法,jquery妙用
  • 原文地址:https://www.cnblogs.com/yhcao/p/4729752.html
Copyright © 2020-2023  润新知