:D 获取中...

1 GitBlog

1.1 Install and configuration

  • 下载解压,修改conf.yaml
#GitBlog配置文件,使用4个空格代替Tab
---
url: /index.php
title: Blog of Mu
subtitle: 自强不息 厚德载物
theme: quest
enableCache: true
highlight: true
mathjax: false
katex: true
youyan:
baiduAnalytics:
keywords: GitBlog,博客,Markdown,Mu
description: >
    Mu的博客
version: 2.2
author:
    name: Mu
    email: ywmu@sxu.edu.cn
    github: caesarmu
    weibo:
    avatar:
blog:
    recentSize: 0
    pageSize: 6
    pageBarSize: 5
    allBlogsForPage: false
text:
    title: 博主介绍
    intro: >
           穆跃文,男,副教授,硕士生导师,九三社员。2011年取得南京大学理学博士学位,2012入职山西大学,曾于2014年赴香港理工大学进修。主要从事二维纳米材料模拟研究,至今已发表SCI论文50余篇,被引1000余次,H指数为15.

1.2 GitBlog markdown model

<!--
author: caesarmu
date: 2018-04-01
title: 配置 yum 源的两种方法
tags: yum,linux (除专有字母其余字母小写)
category: System (除专有大写字母其余首字母大写)
status: publish
summary: 由于redhat的yum在线更新是收费的,如果没有注册的话不能使用,如果要使用,需将redhat的yum卸载后,重启安装,再配置其他源.本文包括配置本地源及第三方源。第三方源包
-->

内容

1.3 Prevent Copy

  • modify theme/quest/block/base.html
<body class="home blog wide" onmousemove=/HideMenu()/ oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()" >

1.4 Add Pulbons

  • modify theme/quest/widget/text.html
{% if attribute(site.text, "intro") %}
<aside class="widget widget_text sidebar-widget clearfix">
        <h3 class="widget-title">{{ site.text.title }}</h3>
        <div class="textwidget">
                <p>{{ site.text.intro }}</p>
                <span id="badgeCont133" style="display:block; margin-top:0.5cm"><script type="text/javascript" src="https://publons.com/mashlets?el=badgeCont133&rid=B-2057-2012"></script></span>
        </div>
</aside>
{% endif %}

1.5 Disable archive block

  • modify theme/quest/block\secondary.html
<div id="secondary" class="widget-area main-sidebar col-md-3" role="complementary">
        {% include "widget/search.html" %}
        {% include "widget/categories.html" %}
        <!--    {% include "widget/archive.html" %} -->
        {% include "widget/recent.html" %}
        {% include "widget/tagcloud.html" %}
        {% include "widget/text.html" %}
</div><!-- #secondary -->

modify theme/quest/block/footer.html

<footer id="colophon" class="copyright quest-row" role="contentinfo">
        <div class="container">
                <div class="row">
                        <div class="col-md-6 copyright-text">
    <ul><a href="/editor/" target="_blank" >editor.md</a></ul>
    <ul><a href="/katex/katex.min.js" target="_blank" >KaTex</a></ul>
    <ul><a href="/svgedit/editor/svg-editor.html" target="_blank" >SvgEdit</a></ul>
    <ul><a href="/my-mind/" target="_blank" >My Mind</a></ul>
    <ul><a href="/jsmol/jsmol.htm" target="_blank" >jsmol</a></ul>
    <ul><a href="http://ims.sxu.edu.cn/yjry/muyuewen.html" target="_blank" >My CV</a></ul>
    <ul><a href="https://github.com/jockchou/gitblog" target="_blank" >Powered by gitblog</a></ul>

                        </div>
                        <div class="col-md-6 social-icon-container clearfix">
                                 <ul>
                                     <div style="padding:0; margin:0; box-sizing:border-box;border:0;margin:0; height:32px; boder:solid 1px; width:200px;">
<form name="gbs" id="gbs" onsubmit="window.gbs.action='https://g18.library.edu.eu.org/search?q='+gbs.q.value;" target="_blank">
<input type="submit" value="Go" style="padding:0; margin:0; box-sizing:border-box;border:0; height:30px;width:20%;background-color:green;">
<input type=text style="padding:0; margin:0; box-sizing:border-box;border:0;height:30px;width:75%;background-color:white;color:red;" placeholder="Guge..." id=q name=q size=30>
</form></div>
                                                     </ul>
<ul><a href="http://www.miitbeian.gov.cn/" target="_blank" >晋ICP备19001054号</a></ul>
</div>
                </div>
                <!-- end row -->
        </div>
        <!-- end container -->
</footer>

1.7 GitBlog style

  • modify theme/quest/css/style.css
font-size: 200%;
  • For Math, you should use Y_{a}=... instead of Y_a=....

2 Nginx配置

...
        location / {
            root $NGHome/Blog4Mu/ ;
            auth_basic "Pass For Blog4Mu";
            auth_basic_user_file $NGHome/ngpass/caesarmu;
            location ~ \.(jpg|png|gif|js|css|swf|flv|ico)$ {
                expires 12h;
            }
            if ($arg_hl ~* "zh-CN") {
               proxy_pass https://ggsearch;
               break;
            }
            if (!-e $request_filename) {
               rewrite ^(.*)$ /index.php?$1 last ;
               break;
            }
            location ~* ^/(doc|logs|app|sys)/ {
                return 403;
            }
            location ~ .*\.(php|php5)?$
            {
                fastcgi_connect_timeout 300;
                fastcgi_send_timeout 300;
                fastcgi_read_timeout 300;
                fastcgi_pass  unix:/tmp/nginx/php/run/php7-fpm.sock ;
                #fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include        fastcgi_params;
            }
        }
...

3 Apach配置 On Qnap NAS

  1. Put unzipped file in the root directory
  2. modify /usr/local/apache/conf/original/httpd.conf on NAS server
LoadModule rewrite_module modules/mod_rewrite.so
  1. Restart Apach, /etc/init.d/Qthttpd.sh restart
  2. creat .htaccess in directory of gitblog (root directory)
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond $1 !^(index\.php|img|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
  1. Password and IP prection (error for gitblog) add to .htaccess
AuthName "Password needed!"
AuthType Basic
AuthUserFile /share/CACHEDEV1_DATA/Web/.htpasswd
require valid-user

Order deny,allow
Deny from all
Allow from 115.24.3.
Allow from 172.21.169.
Allow from 172.21.168.

creat .htpasswd

 /usr/local/apache/bin/htpasswd -bc htpasswd username password
  1. ceart .htaccess for public directory
Allow From All
Satisfy Any