File tree Expand file tree Collapse file tree 4 files changed +44
-6
lines changed Expand file tree Collapse file tree 4 files changed +44
-6
lines changed Original file line number Diff line number Diff line change 2
2
< ul >
3
3
{% for tag in post.tags %}
4
4
< li >
5
- < a href ="tags.html#{{ tag }} " title ="Voir les posts ayant le tag {{ tag }} "> {{ tag }}</ a >
5
+ < a href ="tags.html#{{ tag }} " title ="Voir les posts ayant le tag {{ tag }} "> {{ tag }}</ a >
6
6
</ li >
7
7
{% endfor %}
8
8
</ ul >
Original file line number Diff line number Diff line change @@ -382,12 +382,11 @@ article > footer {
382
382
}
383
383
384
384
.tags li {
385
- font-weight : bold;
386
385
display : inline-block;
387
386
background-color : # 6db900 ;
388
387
border-radius : 4px ;
389
388
padding : 0 0.6em ;
390
- margin : 0 0.2em ;
389
+ margin : 0.1 em 0.2em ;
391
390
}
392
391
393
392
.tags li a , .tags li a : hover , .tags li a : visited {
@@ -472,6 +471,21 @@ article > footer {
472
471
border-radius : 4px ;
473
472
}
474
473
474
+ /* ---- Tags ---- */
475
+
476
+ # tags header {
477
+ font-size : 80% ;
478
+ margin-bottom : 1em ;
479
+ }
480
+
481
+ # tags header ul {
482
+ margin : 0 ;
483
+ }
484
+
485
+ # tags header li .selected {
486
+ background-color : # 5cb0cc ;
487
+ }
488
+
475
489
/* ---- Site footer ---- */
476
490
477
491
# container > footer {
Original file line number Diff line number Diff line change
1
+ function selectTag ( tag ) {
2
+ window . location . hash = '#!' + tag . html ( ) ;
3
+ $ ( '#tags header li' ) . removeClass ( 'selected' ) ;
4
+ tag . parent ( ) . addClass ( 'selected' ) ;
5
+ $ ( '#tag-list > li' ) . hide ( ) . filter ( '#' + tag . html ( ) ) . slideDown ( ) ;
6
+ }
7
+
1
8
$ ( function ( ) {
2
- if ( $ ( '#tag-list ' ) . length ) {
9
+ if ( $ ( '#tags ' ) . length ) {
3
10
var hash = window . location . hash . substr ( 1 ) ;
11
+ hash = hash . indexOf ( '!' ) == 0 ? hash . substr ( 1 ) : hash ;
4
12
if ( hash != '' ) {
5
- $ ( '#tag-list > li[id!=' + hash + ']' ) . remove ( ) ;
6
- $ ( window ) . scrollTop ( 0 ) ;
13
+ if ( $ ( '#tag-' + hash ) . length ) {
14
+ $ ( window ) . scrollTop ( 0 ) ;
15
+ selectTag ( $ ( '#tag-' + hash + ' a' ) ) ;
16
+ }
7
17
}
18
+
19
+ $ ( '#tags header a' ) . click ( function ( ) {
20
+ selectTag ( $ ( this ) ) ;
21
+ return false ;
22
+ } ) ;
8
23
}
9
24
} ) ;
Original file line number Diff line number Diff line change 4
4
---
5
5
< section id ="tags ">
6
6
< h1 > Tags</ h1 >
7
+ < header >
8
+ < ul class ="tags ">
9
+ {% for tag in site.tags %}
10
+ < li id ="tag-{{ tag[0] }} ">
11
+ < a href ="tags.html#{{ tag[0] }} " title ="Voir les posts ayant le tag {{ tag[0] }} "> {{ tag[0] }}</ a >
12
+ </ li >
13
+ {% endfor %}
14
+ </ ul >
15
+ </ header >
7
16
< ul id ="tag-list ">
8
17
{% for tag in site.tags %}
9
18
< li id ="{{ tag[0] }} "> {{ tag[0] }}:
You can’t perform that action at this time.
0 commit comments