Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[v1.7.3][Buggy] add lineno / new theme to code block
  • Loading branch information
Huxpro committed Sep 24, 2018
1 parent 6242a67 commit 8476799
Show file tree
Hide file tree
Showing 10 changed files with 1,358 additions and 963 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -313,6 +313,10 @@ For other circumstances, check out existing issues or create a new one!

## FAQ

#### How can I customize the theme of code block?

This theme uses the default code syntax highlighter of jekyll, "rouge, which is compatible with Pygments theme so just pick any pygments theme css (e.g. from [here](http://jwarby.github.io/jekyll-pygments-themes/languages/javascript.html) and replace the content of `highlight.less`.

#### cannot load such file -- jekyll-paginate

Executing this command to install this plugin:
Expand Down
8 changes: 7 additions & 1 deletion _config.yml
Expand Up @@ -3,7 +3,7 @@ title: Hux Blog
SEOTitle: 黄玄的博客 | Hux Blog
header-img: img/home-bg.jpg
email: huxpro@gmail.com
description: "关于前端与设计、黑客与画家 | 黄玄,Web & Mobile Lover,Software Engineer,UX Designer | 这里是 @Hux黄玄 的个人博客,与你一起发现更大的世界。"
description: "关于程序与设计、黑客与画家 | 黄玄,Web & Mobile Lover,Software Engineer,UX Designer | 这里是 @Hux黄玄 的个人博客,与你一起发现更大的世界。"
keyword: "黄玄, Hux黄玄, Hux, 鬼栈, huxpro, @huxpro, 黄玄的博客, Hux Blog, 博客, 个人网站, 互联网, Web, JavaScript, 前端, 设计"
url: "https://huangxuan.me" # your host, for absolute URL
baseurl: "" # for example, '/blog' if your blog hosted on 'host/blog'
Expand Down Expand Up @@ -49,6 +49,12 @@ plugins: [jekyll-paginate]
markdown: kramdown
kramdown:
input: GFM # use Github Flavored Markdown !important
syntax_highlighter_opts:
span:
line_numbers: false
block:
line_numbers: true
start_line: 1



Expand Down
3 changes: 0 additions & 3 deletions _includes/head.html
Expand Up @@ -47,9 +47,6 @@
<!-- Custom CSS -->
<link rel="stylesheet" href="{{ "/css/hux-blog.min.css" | prepend: site.baseurl }}">

<!-- Pygments Github CSS -->
<link rel="stylesheet" href="{{ "/css/syntax.css" | prepend: site.baseurl }}">

<!-- Custom Fonts -->
<!-- <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
<!-- Hux change font-awesome CDN to qiniu -->
Expand Down
17 changes: 9 additions & 8 deletions _posts/2017-02-09-nextgen-web-pwa.markdown
Expand Up @@ -148,16 +148,17 @@ var localServer = google.gears.factory.create("bata.localserver");
var store = localServer.createManagedStore(STORE_NAME);
store.manifestUrl = "manifest.json"
```
```json
// manifest.json - 假设 JSON 有注释
```js
// manifest.json
{
  "betaManifestVersion": 1,
  "version":  "1.0",
  "entries": [ 
    { "url":  "index.html"},
    { "url":  "main.js"}
  ]
"betaManifestVersion": 1,
"version": "1.0",
"entries": [
{ "url": "index.html" },
{ "url": "main.js" }
]
}

```

是不是感到很熟悉?好像 [HTML5 规范][spec11]中的 Application Cache 也是类似的东西?
Expand Down
252 changes: 239 additions & 13 deletions css/hux-blog.css
@@ -1,8 +1,3 @@
/*!
* Hux Blog v1.7.0 (http://huxpro.github.io)
* Copyright 2018 Hux <huxpro@gmail.com>
*/

@media (min-width: 1200px) {
.post-container,
.sidebar-container {
Expand Down Expand Up @@ -304,6 +299,235 @@ button.paper-button {
margin: 16px;
border-radius: 2px;
}
.highlight,
pre.highlight {
background: #282c34;
color: #abb2bf;
}
.highlight pre {
background: #282c34;
}
.highlight .hll {
background: #282c34;
}
.highlight .c {
color: #5c6370;
font-style: italic;
}
.highlight .err {
color: #960050;
background-color: #1e0010;
}
.highlight .k {
color: #c678dd;
}
.highlight .l {
color: #98c379;
}
.highlight .n {
color: #abb2bf;
}
.highlight .o {
color: #abb2bf;
}
.highlight .p {
color: #abb2bf;
}
.highlight .cm {
color: #5c6370;
font-style: italic;
}
.highlight .cp {
color: #5c6370;
font-style: italic;
}
.highlight .c1 {
color: #5c6370;
font-style: italic;
}
.highlight .cs {
color: #5c6370;
font-style: italic;
}
.highlight .ge {
font-style: italic;
}
.highlight .gs {
font-weight: 700;
}
.highlight .kc {
color: #c678dd;
}
.highlight .kd {
color: #c678dd;
}
.highlight .kn {
color: #c678dd;
}
.highlight .kp {
color: #c678dd;
}
.highlight .kr {
color: #c678dd;
}
.highlight .kt {
color: #c678dd;
}
.highlight .ld {
color: #98c379;
}
.highlight .m {
color: #d19a66;
}
.highlight .s {
color: #98c379;
}
.highlight .na {
color: #d19a66;
}
.highlight .nb {
color: #e5c07b;
}
.highlight .nc {
color: #e5c07b;
}
.highlight .no {
color: #e5c07b;
}
.highlight .nd {
color: #e5c07b;
}
.highlight .ni {
color: #e5c07b;
}
.highlight .ne {
color: #e5c07b;
}
.highlight .nf {
color: #abb2bf;
}
.highlight .nl {
color: #e5c07b;
}
.highlight .nn {
color: #abb2bf;
}
.highlight .nx {
color: #abb2bf;
}
.highlight .py {
color: #e5c07b;
}
.highlight .nt {
color: #e06c75;
}
.highlight .nv {
color: #e5c07b;
}
.highlight .ow {
font-weight: 700;
}
.highlight .w {
color: #f8f8f2;
}
.highlight .mf {
color: #d19a66;
}
.highlight .mh {
color: #d19a66;
}
.highlight .mi {
color: #d19a66;
}
.highlight .mo {
color: #d19a66;
}
.highlight .sb {
color: #98c379;
}
.highlight .sc {
color: #98c379;
}
.highlight .sd {
color: #98c379;
}
.highlight .s2 {
color: #98c379;
}
.highlight .se {
color: #98c379;
}
.highlight .sh {
color: #98c379;
}
.highlight .si {
color: #98c379;
}
.highlight .sx {
color: #98c379;
}
.highlight .sr {
color: #56b6c2;
}
.highlight .s1 {
color: #98c379;
}
.highlight .ss {
color: #56b6c2;
}
.highlight .bp {
color: #e5c07b;
}
.highlight .vc {
color: #e5c07b;
}
.highlight .vg {
color: #e5c07b;
}
.highlight .vi {
color: #e06c75;
}
.highlight .il {
color: #d19a66;
}
.highlight .gu {
color: #75715e;
}
.highlight .gd {
color: #f92672;
}
.highlight .gi {
color: #a6e22e;
}
.highlighter-rouge .highlight {
margin-bottom: 10px;
border-radius: 6px;
}
.highlighter-rouge .highlight pre {
color: #555;
background: transparent;
border: 0;
margin: 0;
padding: 0;
word-wrap: normal;
}
.highlighter-rouge .highlight .lineno {
text-align: right;
margin-right: 10px;
}
.highlighter-rouge .highlight .table-responsive {
margin: 0px;
border: 0px;
padding: 10px;
}
.highlighter-rouge .highlight .table {
margin: 0px;
}
.highlighter-rouge .highlight table > tbody > tr > td {
margin: 0;
border: 0;
display: inline-block;
}
body {
/* Hux learn from
* TypeIsBeautiful,
Expand Down Expand Up @@ -385,9 +609,11 @@ select.sel-lang {
min-height: 28px;
font-size: 14px;
}
.table th,
.table td {
border: 1px solid #eee !important;
table.table > tbody th,
table.table > thead th,
table.table > tbody td,
table.table > thead td {
border: 1px solid #eee;
}
hr.small {
max-width: 100px;
Expand Down Expand Up @@ -911,10 +1137,10 @@ footer .copyright a:focus {
vertical-align: middle;
vertical-align: baseline;
opacity: 0;
-webkit-transition: top 0.3s ease,opacity 0.3s ease;
-moz-transition: top 0.3s ease,opacity 0.3s ease;
-ms-transition: top 0.3s ease,opacity 0.3s ease;
transition: top 0.3s ease,opacity 0.3s ease;
-webkit-transition: top 0.3s ease, opacity 0.3s ease;
-moz-transition: top 0.3s ease, opacity 0.3s ease;
-ms-transition: top 0.3s ease, opacity 0.3s ease;
transition: top 0.3s ease, opacity 0.3s ease;
}
.floating-label-form-group::not(:first-child) {
padding-left: 14px;
Expand Down Expand Up @@ -1070,7 +1296,7 @@ img::-moz-selection {
line-height: 28px;
margin: 0 2px;
margin-bottom: 8px;
background: #D6D6D6;
background: #d6d6d6;
}
#tag_cloud a:hover,
#tag_cloud .tag:hover,
Expand Down
7 changes: 1 addition & 6 deletions css/hux-blog.min.css

Large diffs are not rendered by default.

0 comments on commit 8476799

Please sign in to comment.