Skip to content

Commit 0c3fcbf

Browse files
committed
💄 b3log#52 article
1 parent e08c9ae commit 0c3fcbf

9 files changed

Lines changed: 130 additions & 90 deletions

File tree

‎theme/comment/comments.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
{{if gt $.Pagination.PageCount 0}}
1717
{{if gt $.Pagination.PreviousPageNum 0}}
1818
<a class="pipe-comment__btn" href="?p={{$.Pagination.PreviousPageNum}}">
19-
<svg class="fn-left"><use xlink:href="#iconchevron-left"></use></svg> {{$.I18n.prePage}}
19+
<svg class="fn-left"><use xlink:href="#icon-chevron-left"></use></svg> {{$.I18n.prePage}}
2020
</a>
2121
{{end}}
2222
{{if lt $.Pagination.CurrentPageNum $.Pagination.PageCount}}

‎theme/scss/b3log/_editor.scss‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* editor
99
*
1010
* @author <a href="http://vanessa.b3log.org">Liyuan Li</ta>
11-
* @version 0.1.1.1, Nov 29, 2017
11+
* @version 0.1.1.2, Jan 10, 2018
1212
*/
1313

1414
.b3log-editor {
@@ -41,6 +41,7 @@
4141
text-align: center;
4242
display: inline-block;
4343
cursor: pointer;
44+
border-bottom: 0;
4445

4546
svg {
4647
color: $black-light;

‎theme/x/Gina/css/common.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/Koma/css/common.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/Next/article.html‎

Lines changed: 67 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -11,97 +11,87 @@
1111
{{template "Next/header" .}}
1212
<div class="wrapper">
1313
<article class="article__item">
14-
<header class="article__header{{if gt $.UserCount 1}} article__header--user{{end}}">
14+
<header class="article__header article__header--center">
1515
<h2>
16-
<a class="article__title" rel="bookmark" href="{{.Article.URL}}">
17-
{{if .Article.Topped}}
18-
<svg>
19-
<use xlink:href="#icon-focus"></use>
20-
</svg>
21-
{{end}}
22-
{{.Article.Title}}
23-
</a>
16+
{{if .Article.Topped}}
17+
<svg>
18+
<use xlink:href="#icon-focus"></use>
19+
</svg>
20+
{{end}}
21+
{{.Article.Title}}
2422
</h2>
25-
<time class="article__time{{if gt $.UserCount 1}} article__time--user{{end}}">{{.Article.CreatedAt}}</time>
26-
{{if gt $.UserCount 1}}
27-
<a rel="nofollow"
28-
class="avatar pipe-tooltipped pipe-tooltipped--n"
29-
aria-label="{{.Article.Author.Name}}"
30-
data-src="{{.Article.Author.AvatarURLWithSize 116}}"
31-
href="{{.Article.Author.URL}}">
32-
</a>
33-
{{end}}
23+
<div class="article__meta">
24+
{{if gt $.UserCount 1}}
25+
<a rel="nofollow"
26+
class="avatar pipe-tooltipped pipe-tooltipped--n"
27+
aria-label="{{.Article.Author.Name}}"
28+
data-src="{{.Article.Author.AvatarURLWithSize 116}}"
29+
href="{{.Article.Author.URL}}">
30+
</a>
31+
{{end}}
32+
<time>{{.Article.CreatedAt}}</time> &nbsp;
33+
| &nbsp;
34+
<a href="{{.URL}}">{{.Article.ViewCount}}</a> {{$.I18n.View}} &nbsp;
35+
| &nbsp;
36+
<a href="{{.URL}}#comments">{{.Article.CommentCount}}</a> {{$.I18n.Comment}}
37+
</div>
3438
</header>
35-
<section class="pipe-content__reset article__abstract" id="articleContent" data-author="{{.Article.Author.Name}}">
39+
<section class="pipe-content__reset" data-author="{{.Article.Author.Name}}">
3640
{{.Article.Content}}
3741
</section>
3842
<div class="article__footer fn-clear">
39-
<span class="article__share">
40-
<span class="article__share-btn article__share-btn--wechat" data-type="wechat">
41-
<svg><use xlink:href="#wechat"></use></svg>
42-
</span>
43-
<span class="article__share-btn article__share-btn--weibo" data-type="weibo">
44-
<svg><use xlink:href="#weibo"></use></svg>
45-
</span>
46-
<span class="article__share-btn article__share-btn--twitter" data-type="twitter">
47-
<svg><use xlink:href="#twitter"></use></svg>
48-
</span>
49-
<span class="article__share-btn article__share-btn--google" data-type="google">
50-
<svg><use xlink:href="#google"></use></svg>
51-
</span>
52-
<div class="article__code"
53-
data-title="{{.Article.Title}}"
54-
data-blogtitle="{{$.Setting.BasicBlogTitle}}"
55-
data-url="{{.Article.URL}}"
56-
data-avatar="{{.Article.Author.AvatarURLWithSize 128}}"></div>
57-
</span>
58-
<div class="fn-left">
59-
<svg>
60-
<use xlink:href="#icon-tag"></use>
61-
</svg>
43+
<span class="fn-left">
6244
{{range .Article.Tags}}
63-
<a class="tag" rel="tag" href="{{.URL}}">{{.Title}}</a>
45+
<a class="article__tag" rel="tag" href="{{.URL}}">{{.Title}}</a>
6446
{{end}}
65-
</div>
47+
</span>
48+
6649
<span class="fn-right">
67-
<a href="{{.Article.URL}}" aria-label="{{$.I18n.View}}"
68-
class="pipe-tooltipped pipe-tooltipped--w">
69-
{{.Article.ViewCount}}
70-
<svg>
71-
<use xlink:href="#icon-view"></use>
72-
</svg>
73-
</a>
50+
{{if .Article.Editable}}
51+
<a href="{{$.Conf.Server}}/admin/articles/post?id={{.Article.ID}}"
52+
aria-label="{{$.I18n.Edit}}"
53+
class="pipe-tooltipped pipe-tooltipped--n article__edit">
54+
<svg>
55+
<use xlink:href="#icon-edit"></use>
56+
</svg>
57+
</a>
58+
&nbsp; &nbsp;
59+
{{end}}
60+
61+
<span class="article__share">
62+
<span class="article__edit" data-type="wechat">
63+
<svg><use xlink:href="#wechat"></use></svg>
64+
</span> &nbsp; &nbsp;
65+
<span class="article__edit" data-type="weibo">
66+
<svg><use xlink:href="#weibo"></use></svg>
67+
</span> &nbsp; &nbsp;
68+
<span class="article__edit" data-type="twitter">
69+
<svg><use xlink:href="#twitter"></use></svg>
70+
</span> &nbsp; &nbsp;
71+
<span class="article__edit" data-type="google">
72+
<svg><use xlink:href="#google"></use></svg>
73+
</span> &nbsp; &nbsp;
74+
<div class="article__code"
75+
data-title="{{.Article.Title}}"
76+
data-blogtitle="{{$.Setting.BasicBlogTitle}}"
77+
data-url="{{.Article.URL}}"
78+
data-avatar="{{.Article.Author.AvatarURLWithSize 128}}"></div>
79+
</span>
80+
81+
<span id="articleCommentBtn" class="article__edit"
82+
data-title="{{$.I18n.Comment}}{{$.I18n.Colon}}{{.Article.Title}}"
83+
data-id="{{.Article.ID}}">
84+
<svg>
85+
<use xlink:href="#icon-reply"></use>
86+
</svg>
87+
{{$.I18n.Comment}}
88+
</span>
7489

75-
<a href="{{.Article.URL}}#comments" aria-label="{{$.I18n.Comment}}"
76-
class="pipe-tooltipped pipe-tooltipped--w">
77-
{{.Article.CommentCount}}
78-
<svg>
79-
<use xlink:href="#icon-comment"></use>
80-
</svg>
81-
</a>
82-
{{if .Article.Editable}}
83-
<a href="{{$.Conf.Server}}/admin/articles/post?id={{.Article.ID}}"
84-
aria-label="{{$.I18n.Edit}}"
85-
class="pipe-tooltipped pipe-tooltipped--w">&nbsp;<svg>
86-
<use xlink:href="#icon-edit"></use>
87-
</svg>
88-
</a>
89-
{{end}}
90-
<span id="articleCommentBtn"
91-
data-title="{{$.I18n.Comment}}{{$.I18n.Colon}}{{.Article.Title}}"
92-
data-id="{{.Article.ID}}">
93-
<svg>
94-
<use xlink:href="#icon-reply"></use>
95-
</svg>
96-
{{$.I18n.Comment}}
9790
</span>
98-
</span>
9991
</div>
10092
</article>
10193

102-
<article class="article__item">
103-
{{template "comment/comments" .}}
104-
</article>
94+
{{template "comment/comments" .}}
10595
</div>
10696
{{template "comment/editor" .}}
10797
{{template "Next/side" .}}

‎theme/x/Next/css/common.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/Next/css/common.scss‎

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,18 @@ a:hover {
394394
margin: 2px 5px 0 0;
395395
border-radius: 10px;
396396
}
397+
398+
&--center {
399+
text-align: center;
400+
401+
h2 {
402+
font-size: 28px;
403+
}
404+
405+
.article__meta {
406+
margin: 10px 0 40px;
407+
}
408+
}
397409
}
398410

399411
&__title {
@@ -465,10 +477,43 @@ a:hover {
465477
color: #666;
466478
border-bottom-width: 0;
467479
margin-top: 2px;
480+
cursor: pointer;
468481
&:hover {
469482
color: #222;
470483
}
471484
}
485+
486+
&__tag {
487+
padding: 1px 5px;
488+
background: #f5f5f5;
489+
border-bottom: none;
490+
margin-right: 10px;
491+
font-size: 13px;
492+
display: inline-block;
493+
494+
&:hover {
495+
background: #ccc;
496+
}
497+
}
498+
499+
&__share {
500+
display: inline-block;
501+
position: relative;
502+
503+
svg {
504+
height: 16px;
505+
width: 16px;
506+
}
507+
}
508+
509+
&__code {
510+
display: none;
511+
position: absolute;
512+
top: 16px;
513+
left: -12px;
514+
height: 128px;
515+
width: 128px;
516+
}
472517
}
473518

474519
// pagination
@@ -521,7 +566,16 @@ a:hover {
521566
}
522567
}
523568

524-
// side
569+
// reset comment
570+
#pipeComments {
571+
a {
572+
border-bottom: 0;
573+
574+
&:hover {
575+
text-decoration: underline;
576+
}
577+
}
578+
}
525579

526580

527581

@@ -684,11 +738,6 @@ a:hover {
684738
}
685739
}
686740

687-
// comment
688-
#pipeComments {
689-
padding: 15px 30px;
690-
}
691-
692741
// toc
693742
.toc {
694743
&__panel {

‎theme/x/Next/js/article.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const Article = {
4141
urls.google = 'https://plus.google.com/share?url=' + url
4242
urls.twitter = 'https://twitter.com/intent/tweet?status=' + title + ' ' + url
4343

44-
$this.find('.article__share-btn').click(function () {
44+
$this.find('span').click(function () {
4545
const key = $(this).data('type')
4646

4747
if (!key) {

‎theme/x/Next/js/article.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)