测试代码高亮

修改了官方主题原生的highlight,js和html基本Ok,别的先凑合着

测试行内代码块

测试行内代码块 var a=1测试行内代码块function(){console.log}测试行内代码块 嗨呀嗨呀baidu.com

JavaScript

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
document.getElementById("test").innerHTML = [1,3,5];
function $initHighlight(block, cls) {
  try {
    if (cls.search(/\bno\-highlight\b/) != -1)
      return process(block, true, 0x0F) +
             ` class="${cls}"`;
  } catch (e) {
    /* handle exception */
  }
  for (var i = 0 / 2; i < classes.length; i++) {
    if (checkCondition(classes[i]) === undefined)
      console.log('undefined');
  }
}

export $initHighlight;

HTML

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

  <div class="article-meta">
    <a href="/landscape-plus/20" class="article-date">
    <time itemprop="datePublished">2015-05-07</time>
    
  </div>
  <div class="article-inner">
    <h1 itemprop="name">
  </div>
    

CSS

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
h1{
    text-align: center;
    font-family: "Microsoft Yahei";
    font-weight: normal;
}
.list-group {
    padding-left: 0;
    margin-bottom: 20px;
}

.list-group-item {
    position: relative;
    display: block;
    padding: 5px 15px;
    margin-bottom: -1px;
    background-color: #fff;
    border: 1px solid #ddd;
}

bash

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
$ vi /etc/apt/sources.list
/serverspeeder/bin/serverSpeeder.sh stop
mkdir ~/test && cd ~/test
dd if=/dev/zero of=100mb.bin count=100 bs=1M
python -m SimpleHTTPServer 8080
#!/bin/bash
###### CONFIG
ACCEPTED_HOSTS="/root/.hag_accepted.conf"
BE_VERBOSE=false

if [ "$UID" -ne 0 ]
then
 echo "Superuser rights required"
 exit 2
fi

genApacheConf(){
 echo -e "# Host ${HOME_DIR}$1/$2 :"
}
Licensed under CC BY-NC-SA 4.0
Built with Hugo
主题 StackJimmy 设计