Skip to content

Commit 12d3f5d

Browse files
committed
Adjust style.
1 parent ed225c9 commit 12d3f5d

File tree

3 files changed

+45
-143
lines changed

3 files changed

+45
-143
lines changed

_layouts/post.html

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,9 @@
11
---
2+
layout: page
23
---
3-
<!DOCTYPE html>
4-
<html>
5-
<head>
6-
<meta charset="UTF-8" />
7-
<title>{% if page.title %}{{ page.title }} - {% endif %}{{ site.name }}</title>
8-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
9-
<link rel="icon" href="/favicon.png" type="image/x-icon" />
10-
<link rel="shortcut icon" href="/favicon.png" type="image/x-icon" />
11-
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.css" />
12-
<link rel="stylesheet" href="/assets/css/common.css" />
13-
<style type="text/css">
14-
nav .logo{
15-
display: block;
16-
height: 60px;
17-
text-decoration: none;
18-
font: normal 2em/60px Consolas;
19-
color: #000;
20-
}
21-
nav .logo img{
22-
float: left;
23-
height: 100%;
24-
margin-right: .5em;
25-
}
26-
article.container{
27-
max-width: 640px;
28-
font-size: 1.2em;
29-
line-height: 1.8em;
30-
}
31-
article h1:first-child,
32-
article p.meta{
33-
text-align: center;
34-
}
35-
article p.meta{
36-
margin-bottom: 2em;
37-
font-size: 90%;
38-
}
39-
40-
@media (max-width: 640px) {
41-
nav .logo *:not(img){
42-
display: none;
43-
}
44-
article.container{
45-
width: 90%;
46-
max-width: 90%;
47-
}
48-
}
49-
</style>
50-
</head>
51-
<body class="page-{{ page.category }}">
52-
53-
<nav class="container">
54-
<a href="/" class="logo"><img src="/assets/img/logo-160.png" /><strong>Yncoder</strong></a>
55-
<ul>
56-
<li><a href="https://github.com/yncoder/yncoder.github.io/issues" target="_blank">社区讨论</a></li>
57-
<li><iframe src="https://ghbtns.com/github-btn.html?user=yncoder&amp;repo=yncoder.github.io&amp;type=watch&amp;count=true&amp;v=2" frameborder="0" scrolling="0" width="100" height="20"></iframe></li>
58-
</ul>
59-
</nav>
604

615
<article class="container">
626
<h1>{{ page.title }}</h1>
637
<p class="meta">By {{ page.author }} at {{ page.date | date: "%Y-%m-%d" }}</p>
648
{{ content }}
659
</article>
66-
67-
</body>
68-
</html>

assets/css/common.css

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ a:hover{
3737
text-decoration: underline;
3838
}
3939

40-
.row{
41-
position: relative;
42-
}
4340
.container{
4441
position: relative;
4542
width: 80%;
@@ -57,6 +54,18 @@ a:hover{
5754
nav{
5855
height: 60px;
5956
}
57+
nav .logo{
58+
display: block;
59+
height: 60px;
60+
text-decoration: none;
61+
font: normal 2em/60px Consolas;
62+
color: #000;
63+
}
64+
nav .logo img{
65+
float: left;
66+
height: 100%;
67+
margin-right: .5em;
68+
}
6069
nav ul{
6170
position: absolute;
6271
top: 0;
@@ -112,4 +121,31 @@ article blockquote{line-height:1.6em; margin:1em 0 1em 1.5em; border-left:2px so
112121
width: 90%;
113122
max-width: 90%;
114123
}
115-
}
124+
}
125+
126+
127+
128+
article.container,
129+
article.container{
130+
max-width: 640px;
131+
font-size: 1.2em;
132+
line-height: 1.8em;
133+
}
134+
.page-log article h1:first-child,
135+
.page-log article p.meta{
136+
text-align: center;
137+
}
138+
.page-log article p.meta{
139+
margin-bottom: 2em;
140+
font-size: 90%;
141+
}
142+
143+
@media (max-width: 640px) {
144+
nav .logo *:not(img){
145+
display: none;
146+
}
147+
.page-log article.container{
148+
width: 90%;
149+
max-width: 90%;
150+
}
151+
}

index.html

Lines changed: 4 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,8 @@
88
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
99
<link rel="icon" href="/favicon.png" type="image/x-icon" />
1010
<link rel="shortcut icon" href="/favicon.png" type="image/x-icon" />
11+
<link rel="stylesheet" href="/assets/css/common.css" />
1112
<style type="text/css">
12-
*{
13-
-webkit-box-sizing: border-box;
14-
-moz-box-sizing: border-box;
15-
box-sizing: border-box;
16-
17-
-webkit-text-size-adjust: none;
18-
}
19-
20-
html,body{
21-
margin: 0;
22-
padding: 0;
23-
border: none;
24-
line-height: 1;
25-
min-height:100%;
26-
height: 100%;
27-
}
28-
body{
29-
color: #555;
30-
font-size: 14px;
31-
font-family: "Microsoft YaHei","微软雅黑",Arial,Helvetica,sans-serif;
32-
}
33-
34-
ul,ol,figure,form,dl,dt,dd{
35-
margin: 0;
36-
padding: 0;
37-
}
38-
img{
39-
border: 0;
40-
vertical-align: middle;
41-
}
42-
43-
a{
44-
color: #43a8dc;
45-
text-decoration: none;
46-
}
47-
a:hover{
48-
text-decoration: underline;
49-
}
50-
5113
.holder{
5214
min-height: 100%;
5315
margin-bottom: -60px;
@@ -58,34 +20,8 @@
5820
height: 60px;
5921
}
6022

61-
.container{
62-
position: relative;
63-
width: 80%;
64-
max-width: 980px;
65-
margin: auto;
66-
}
67-
.container:after{
68-
content: "";
69-
display: block;
70-
clear: both;
71-
}
72-
73-
nav{
74-
height: 60px;
75-
}
76-
nav ul{
77-
position: absolute;
78-
top: 0;
79-
right: 0;
80-
padding: 20px 0;
81-
}
82-
nav li{
83-
list-style: none;
84-
display: inline-block;
85-
height: 20px;
86-
line-height: 20px;
87-
vertical-align: middle;
88-
margin-left: 20px;
23+
nav .logo{
24+
display: none;
8925
}
9026

9127
header{
@@ -143,12 +79,6 @@
14379
}
14480
}
14581

146-
@media (max-width: 1024px) {
147-
.container{
148-
width: 90%;
149-
}
150-
}
151-
15282
@media (max-width: 640px) {
15383
header h1{
15484
font-size: 2em;
@@ -168,12 +98,7 @@
16898

16999
<div class="holder">
170100

171-
<nav class="container">
172-
<ul>
173-
<li><a href="https://github.com/yncoder/yncoder.github.io/issues" target="_blank">社区讨论</a></li>
174-
<li><iframe src="https://ghbtns.com/github-btn.html?user=yncoder&amp;repo=yncoder.github.io&amp;type=watch&amp;count=true&amp;v=2" frameborder="0" scrolling="0" width="100" height="20"></iframe></li>
175-
</ul>
176-
</nav>
101+
{% include nav.html %}
177102

178103
<header class="container">
179104
<figure>

0 commit comments

Comments
 (0)