Skip to content

Commit

Permalink
加入代码高亮和目录
Browse files Browse the repository at this point in the history
  • Loading branch information
newpanjing committed Aug 24, 2019
1 parent 3eef6b9 commit d02ec17
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 7 deletions.
4 changes: 3 additions & 1 deletion static/css/markdown.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/css/markdown.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions static/css/markdown.less
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
font-family: Consolas, Monaco, Andale Mono, monospace;
background-color: #f7f7f7;
color: inherit;
border: none!important;
border-radius: inherit;
}

code {
Expand All @@ -114,7 +116,6 @@
line-height: 1.7em;
overflow: auto;
padding: 6px 10px;
border-left: 5px solid #6CE26C;
}

pre > code {
Expand All @@ -129,7 +130,7 @@
font-size: .95em;
white-space: pre;
background: 0 0;

background-color: #F2F4F5!important;
}

code {
Expand Down
33 changes: 32 additions & 1 deletion static/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 39 additions & 1 deletion static/css/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ header .top {
}

h5 {
font-size: 12px!important;
font-size: 12px !important;
}
}

Expand Down Expand Up @@ -874,4 +874,42 @@ header .top {
font-weight: 700;
font-size: 14px;
}
}

.article {
.toc {
position: fixed;
left: 20px;
top: 100px;
background-color: white;
color: #929aa2;
max-width: 170px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;

&:before {
content: '目录';
display: block;
border-bottom: #ccc 1px solid;
padding: 5px 10px;
}

a {
color: #929aa2;
}

ul {
list-style-type: decimal;
margin: 10px;

a {
font-size: 12px;
font-weight: 400;
&:hover{
color: @basic-color;
}
}
}
}
}
2 changes: 1 addition & 1 deletion templates/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<meta property="og:description" content="{{ article.subject|clear }}">
<meta property="og:author" content="{{ article.user }}">
{% compress css %}
<link rel="stylesheet" type="text/css" href="/static/css/markdown.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/code.css"/>
<link rel="stylesheet" type="text/css" href="/static/css/markdown.css"/>
{% endcompress %}
{% endblock %}

Expand Down

0 comments on commit d02ec17

Please sign in to comment.