1--- 2layout: page 3--- 4 5{%- assign _page_articles_data_source = page.articles.data_source | default: layout.articles.data_source -%} 6 7{%- if _page_articles_data_source -%} 8{%- assign _keys = _page_articles_data_source | split: '.' -%} 9{%- endif -%} 10 11{%- assign _articles = nil -%} 12{%- for _key in _keys -%} 13 {%- if forloop.first -%} 14 {%- case _key -%} 15 {%- when 'site' -%} 16 {%- assign _articles = site -%} 17 {%- when 'page' -%} 18 {%- assign _articles = page -%} 19 {%- when 'layout' -%} 20 {%- assign _articles = layout -%} 21 {%- when 'paginator' -%} 22 {%- assign _articles = paginator -%} 23 {%- else -%} 24 {%- assign _articles = site[_key] -%} 25 {%- else -%} 26 {%- endcase -%} 27 {%- else -%} 28 {%- assign _articles = _articles[_key] -%} 29 {%- endif -%} 30{%- endfor -%} 31 32{%- assign _type = page.articles.type | default: layout.articles.type -%} 33 34{%- if _articles -%} 35 36 <div class="layout--articles"> 37 38 {%- if _type == 'grid' -%} 39 {%- if page.articles.size == 'sm' -%} 40 {%- include article-list.html articles=_articles type='grid' size='sm' -%} 41 {%- else -%} 42 {%- include article-list.html articles=_articles type='grid' -%} 43 {%- endif -%} 44 45 {%- elsif _type == 'brief' -%} 46 {%- include snippets/assign.html 47 target=site.data.variables.default.page.articles.show_info 48 source0=layout.articles.show_info source1=page.articles.show_info -%} 49 {%- assign _show_info = __return -%} 50 51 {%- include article-list.html articles=_articles type='brief' show_info=_show_info -%} 52 53 {%- else -%} 54 {%- include snippets/assign.html 55 target=site.data.variables.default.page.articles.show_cover 56 source0=layout.articles.show_cover source1=page.articles.show_cover -%} 57 {%- assign _show_cover = __return -%} 58 59 {%- include snippets/assign.html 60 target=site.data.variables.default.page.articles.show_excerpt 61 source0=layout.articles.show_excerpt source1=page.articles.show_excerpt -%} 62 {%- assign _show_excerpt = __return -%} 63 64 {%- include snippets/assign.html 65 target=site.data.variables.default.page.articles.show_readmore 66 source0=layout.articles.show_readmore source1=page.articles.show_readmore -%} 67 {%- assign _show_readmore = __return -%} 68 69 {%- include snippets/assign.html 70 target=site.data.variables.default.page.articles.show_info 71 source0=layout.articles.show_info source1=page.articles.show_info -%} 72 {%- assign _show_info = __return -%} 73 74 {%- assign _article_type = page.articles.article_type | default: layout.articles.article_type -%} 75 {%- assign _cover_size = page.articles.cover_size | default: layout.articles.cover_size -%} 76 {%- assign _excerpt_type = page.articles.excerpt_type | default: layout.articles.excerpt_type -%} 77 78 {%- include article-list.html articles=_articles type='item' 79 article_type=_article_type 80 show_cover=_show_cover cover_size=_cover_size 81 show_excerpt=_show_excerpt excerpt_type=_excerpt_type 82 show_readmore=_show_readmore show_info=_show_info -%} 83 84 {%- endif -%} 85 86 </div> 87{%- endif -%} 88 89{{ content }}