ブログ記事を新着順にリスト一覧にするセクションを作っているのですが
エラーが出てしまいしたいのでご教授いただけますでしょうか。
表示は問題なくできておりますが、後々問題になりそうなので解消をしておきたいです。
参考にしたブログ
https://ikdlog.com/shopify-news-list/
どうぞ宜しくお願い致します
ERROR » update templates/index.json:
┃ セクションタイプ「news_list」は既存のセクションファイルを参照していません
{%- assign blog = blogs[section.settings.news_list] -%}
<div id="section_news_list">
<div class="container">
<div class="news_list_heading">
<h2>{{ section.settings.title | escape }}</h2>
</div>
<ul class="news_list">
{% for article in blog.articles limit: section.settings.post_limit %}
<li class="news_list_item">
<a href="{{ article.url }}">
<div class="news_list_info">
{% if section.settings.news_list_category %}
<span class="news_list_category">{{ article.tags }}</span>
{% endif %}
{% if section.settings.news_list_date %}
<span class="news_list_date">{{ article.published_at | date: "%Y ⁄ %m ⁄ %d" }}</span>
{% endif %}
</div>
<div class="news_list_title">{{ article.title }}</div>
</a>
</li>
{% endfor %}
</ul>
<div class="news_list_more">
<a href="{{ blog.url }}">一覧を見る</a>
</div>
</div>
</div>
{% schema %}
{
"name": "お知らせ一覧",
"settings": [
{
"id": "title",
"type": "text",
"label": "見出し",
"default": "お知らせ一覧"
},
{
"id": "news_list",
"type": "blog",
"label": "表示するブログ記事を選択"
},
{
"id": "post_limit",
"type": "range",
"label": "表示数を選択",
"min": 1,
"max": 6,
"step": 1,
"default": 3
},
{
"id": "news_list_date",
"type": "checkbox",
"label": "日付を表示する",
"default": true
},
{
"id": "news_list_category",
"type": "checkbox",
"label": "カテゴリーを表示する",
"default": true
}
],
"presets": [
{
"name": "お知らせ一覧",
"category": "お知らせ一覧"
}
]
}
{% endschema %}
{% stylesheet %}
#section_news_list .news_list_heading{
margin-bottom: 0.8rem;
text-align: center;
}
#section_news_list .container{
max-width: 80vw;
margin: 0 auto;
padding: 0.8rem;
}
#section_news_list .news_list li{
list-style:none;
}
#section_news_list .news_list_more {
text-align: right;
}
#section_news_list .news_list_item{
border-bottom: 1px solid #333;
}
#section_news_list .news_list_item>a{
display: flex;
align-items: center;
padding: 2rem;
color: #333;
text-decoration: none;
}
#section_news_list .news_list_item:last-child{
border-bottom: none;
}
#section_news_list .news_list_date{
font-size: 1em;
margin-right: 1rem;
}
#section_news_list .news_list_category{
font-size: 0.5em;
color: #fff;
background: #333;
padding:0.5em;
margin-right: 0.5em;
}
#section_news_list .news_list_info{
position: relative;
top: -1px;
}
#section_news_list .news_list_title{
font-size: 14px;
margin-bottom: 0;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
position: relative;
top: 1px;
}
@media screen and (max-width: 768px){
#section_news_list .container{
padding: 35px 20px;
}
#section_news_list .news_list_item>a{
display: block;
padding: 15px;
}
#section_news_list .news_list_info{
margin-bottom: 5px;
}
}
{% endstylesheet %}
index.json セクション箇所抜粋
"c75cf2d3-4454-4251-90ae-dd29f6cb08b9": {
"type": "news_list",
"settings": {
"title": "お知らせ一覧",
"news_list": "お知らせ",
"post_limit": 3,
"news_list_date": true,
"news_list_category": false
}
}
},