@@ -52,30 +52,32 @@ ninja.data = [
52
52
{ % - endif - % }
53
53
{ % - endif - % }
54
54
{ % - endfor - % }
55
- { % - for post in site . posts - % }
56
- {
57
- { % - assign title = post . title | escape | strip - % }
58
- id : "post-{{ title | slugify }}" ,
59
- { % if post . redirect == blank % }
60
- title : "{{ title | truncatewords: 13 }}" ,
61
- { % elsif post . redirect contains '://' % }
62
- title : '{{ title | truncatewords: 13 }} <svg width="1.2rem" height="1.2rem" top=".5rem" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M17 13.5v6H5v-12h6m3-3h6v6m0-6-9 9" class="icon_svg-stroke" stroke="#999" stroke-width="1.5" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg>' ,
63
- { % else % }
64
- title : "{{ title | truncatewords: 13 }}" ,
65
- { % endif % }
66
- description : "{{ post.description | strip_html | strip_newlines | escape | strip }}" ,
67
- section : "Posts" ,
68
- handler : ( ) = > {
55
+ { % - if site . posts_in_search - % }
56
+ { % - for post in site . posts - % }
57
+ {
58
+ { % - assign title = post . title | escape | strip - % }
59
+ id : "post-{{ title | slugify }}" ,
69
60
{ % if post . redirect == blank % }
70
- window . location . href = "{{ post.url | relative_url }}" ;
61
+ title : "{{ title | truncatewords: 13 }}" ,
71
62
{ % elsif post . redirect contains '://' % }
72
- window . open ( " {{ post.redirect }}" , "_blank" ) ;
63
+ title : ' {{ title | truncatewords: 13 }} <svg width="1.2rem" height="1.2rem" top=".5rem" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M17 13.5v6H5v-12h6m3-3h6v6m0-6-9 9" class="icon_svg-stroke" stroke="#999" stroke-width="1.5" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg>' ,
73
64
{ % else % }
74
- window . location . href = "{{ post.redirect | relative_url }}" ;
65
+ title : "{{ title | truncatewords: 13 }}" ,
75
66
{ % endif % }
67
+ description : "{{ post.description | strip_html | strip_newlines | escape | strip }}" ,
68
+ section : "Posts" ,
69
+ handler : ( ) = > {
70
+ { % if post . redirect == blank % }
71
+ window . location . href = "{{ post.url | relative_url }}" ;
72
+ { % elsif post . redirect contains '://' % }
73
+ window . open ( "{{ post.redirect }}" , "_blank" ) ;
74
+ { % else % }
75
+ window . location . href = "{{ post.redirect | relative_url }}" ;
76
+ { % endif % }
77
+ } ,
76
78
} ,
77
- } ,
78
- { % - endfor - % }
79
+ { % - endfor - % }
80
+ { % - endif - % }
79
81
{ % - for collection in site . collections - % }
80
82
{ % - if collection . label != 'posts' - % }
81
83
{ % - for item in collection . docs - % }
0 commit comments