Skip to content

Commit df90446

Browse files
authored
Merge pull request #23 from appleple/develop
v1.0.6
2 parents 5cd0653 + 94c28da commit df90446

13 files changed

Lines changed: 921 additions & 848 deletions

File tree

themes/develop/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# テーマ「develop」Ver.1.0.5
1+
# テーマ「develop」Ver.1.0.6
22

33
## バンドル環境の使い方
44

themes/develop/_entry.twig

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{% set entryTagRelational =
1212
module(
1313
'V2_Entry_TagRelational',
14-
'hoge',
14+
null,
1515
{
1616
bid: null,
1717
cid: null,
@@ -42,7 +42,7 @@
4242
{{ include('/include/entry/body.twig', { sns_share: true }) }}
4343

4444
{% if entryTagRelational.items is not empty %}
45-
<section class="mt-16 md:mt-20 grid gap-y-8">
45+
<aside class="mt-16 md:mt-20 grid gap-y-8">
4646
<div>
4747
{{ include('/admin/module/setting.twig', { moduleInfo: tagCloud.moduleInfo }) }}
4848
<h2 class="text-lg font-bold">関連記事</h2>
@@ -57,15 +57,18 @@
5757
</p>
5858
</div>
5959

60-
{{
61-
include(
62-
'/include/entry/tag-relational-card.twig',
63-
{ items: relationalItems, moduleInfo: entryTagRelational.moduleInfo }
64-
)
65-
}}
60+
<div>
61+
{{ include('/admin/module/setting.twig', { moduleInfo: entryTagRelational.moduleInfo }) }}
62+
63+
<div class="grid gap-y-8">
64+
{{ include('/include/entry/tag-relational-card.twig', { items: relationalItems }) }}
6665

67-
{{ include('/include/entry/tag-relational-tiny.twig', { items: offsetRelationalItems }) }}
68-
</section>
66+
{% if offsetRelationalItems is not empty %}
67+
{{ include('/include/entry/tag-relational-tiny.twig', { items: offsetRelationalItems }) }}
68+
{% endif %}
69+
</div>
70+
</div>
71+
</aside>
6972
{% endif %}
7073
</article>
7174
{% endblock %}

themes/develop/_layouts/base.twig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
<html class="has-[dialog:open]:overflow-hidden" lang="ja">
33
<head>
44
<meta charset="UTF-8" />
5-
{% block headMeta %}
5+
{% block head_meta %}
66
{{ include('/include/head/meta.twig') }}
77
{% endblock %}
88

9-
{% block headLink %}
9+
{% block head_link %}
1010
{{ include('/include/head/link.twig') }}
1111
{% endblock %}
1212

13-
{% block headJs %}
13+
{% block head_js %}
1414
{{ include('/include/head/js.twig') }}
1515
{% endblock %}
1616

17-
{% block headStructuredData %}
17+
{% block head_structured_data %}
1818
{{ include('/include/structured-data/breadcrumb-list.twig') }}
1919
{% endblock %}
2020
</head>
2121
<body>
22-
{% block bodyStart %}
22+
{% block body_start %}
2323
{{ include('/include/body-start.twig') }}
2424
{% endblock %}
2525

@@ -29,14 +29,14 @@
2929
{% endblock %}
3030

3131
<!-- ※管理用パーツ -->
32-
{% block adminPart %}
32+
{% block admin_part %}
3333
<!-- アクションボックス -->
3434
@include("/admin/action.html")
3535
{{ include('/admin/switch-user.html') }}
3636
{% endblock %}
3737

3838
<main class="container py-20">
39-
{% block topicPath %}
39+
{% block topic_path %}
4040
<!-- トピックパス -->
4141
{% if touch('Touch_NotTop') %}
4242
<div class="mb-10">
@@ -60,7 +60,7 @@
6060
{{ include('/include/footer.twig') }}
6161
{% endblock %}
6262

63-
{% block bodyEnd %}
63+
{% block body_end %}
6464
{{ include('/include/body-end.twig') }}
6565
{% endblock %}
6666
</body>

themes/develop/_layouts/two-column.twig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
<html class="has-[dialog:open]:overflow-hidden" lang="ja">
33
<head>
44
<meta charset="UTF-8" />
5-
{% block headMeta %}
5+
{% block head_meta %}
66
{{ include('/include/head/meta.twig') }}
77
{% endblock %}
88

9-
{% block headLink %}
9+
{% block head_link %}
1010
{{ include('/include/head/link.twig') }}
1111
{% endblock %}
1212

13-
{% block headJs %}
13+
{% block head_js %}
1414
{{ include('/include/head/js.twig') }}
1515
{% endblock %}
1616

17-
{% block headStructuredData %}
17+
{% block head_structured_data %}
1818
{{ include('/include/structured-data/breadcrumb-list.twig') }}
1919
{% endblock %}
2020
</head>
2121
<body class="text-gray-700">
22-
{% block bodyStart %}
22+
{% block body_start %}
2323
{{ include('/include/body-start.twig') }}
2424
{% endblock %}
2525

@@ -29,14 +29,14 @@
2929
{% endblock %}
3030

3131
<!-- ※管理用パーツ -->
32-
{% block adminPart %}
32+
{% block admin_part %}
3333
<!-- アクションボックス -->
3434
@include("/admin/action.html")
3535
{{ include('/admin/switch-user.html') }}
3636
{% endblock %}
3737

3838
<div class="container py-16 md:py-20">
39-
{% block topicPath %}
39+
{% block topic_path %}
4040
<!-- トピックパス -->
4141
{% if touch('Touch_NotTop') %}
4242
<div class="mb-4">
@@ -98,7 +98,7 @@
9898
{{ include('/include/footer.twig') }}
9999
{% endblock %}
100100

101-
{% block bodyEnd %}
101+
{% block body_end %}
102102
{{ include('/include/body-end.twig') }}
103103
{% endblock %}
104104
</body>

themes/develop/contact/index.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{% block main %}
44
<div class="max-w-3xl mx-auto">
5-
<h2 class="text-gray-900 font-bold text-2xl mb-10">{{ CATEGORY_NAME }}</h2>
5+
<h1 class="text-gray-900 font-bold text-2xl mb-10">{{ CATEGORY_NAME }}</h1>
66
{{ include('/contact/form/main.twig') }}
77
</div>
88
{% endblock %}

themes/develop/include/entry/summary-card.twig

Lines changed: 79 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -19,77 +19,95 @@
1919
)
2020
%}
2121

22-
<div>
22+
{% if touch('Touch_Keyword') %}
23+
<h1 class="text-gray-900 text-2xl font-bold mb-8">
24+
{{ KEYWORD }} の検索結果:
25+
26+
{{ entrySummary.pagination.total }}件
27+
</h1>
28+
{% endif %}
29+
30+
<section>
2331
{{ include('/admin/module/setting.twig', { moduleInfo: entrySummary.moduleInfo }) }}
2432

33+
<h2 class="sr-only">記事一覧</h2>
34+
2535
{% if entrySummary.items is empty %}
2636
<p class="text-gray-900 text-lg text-center">
2737
記事が見つかりませんでした。
2838
</p>
2939
{% endif %}
3040

31-
{% if touch('Touch_Keyword') %}
32-
<p class="text-gray-900 text-2xl font-bold mb-8">
33-
{{ KEYWORD }} の検索結果:
34-
35-
{{ entrySummary.pagination.total }}件
36-
</p>
37-
{% endif %}
41+
{% if entrySummary.items is not empty %}
42+
{% if PAGE >= 2 %}
43+
<p class="sr-only">
44+
{{ PAGE }}ページ目
45+
</p>
46+
{% endif %}
3847

39-
<div class="grid grid-cols-12 pb-10 gap-y-8 gap-x-4 sm:gap-8">
40-
{% for entry in entrySummary.items %}
41-
<div class="flex flex-col items-start space-y-3 col-span-12 {{ column_class|default('sm:col-span-6') }}">
42-
<a href="{{ entry.url }}" class="block w-full text-sm hover:opacity-70">
43-
{% if entry.mainImage.path %}
44-
<img
45-
src="{{ entry.mainImage.path|resizeImg(686, 386) }}"
46-
width="343"
47-
height="193"
48-
alt="{{ entry.mainImage.alt }}"
49-
loading="lazy"
50-
decoding="async"
51-
class="object-cover w-full mb-4 overflow-hidden rounded-md shadow-sm aspect-video"
52-
/>
53-
{% else %}
54-
<img
55-
src="/images/default/noimage.gif"
56-
width="343"
57-
height="193"
58-
alt="画像なし"
59-
loading="lazy"
60-
decoding="async"
61-
class="object-cover w-full mb-4 overflow-hidden rounded-md shadow-sm aspect-video"
62-
/>
63-
{% endif %}
64-
<h2 class="mt-3 text-gray-900 text-lg font-bold line-clamp-2">{{ entry.title }}</h2>
65-
<p class="mt-2 line-clamp-2">
66-
{{ entry.summary }}
67-
</p>
68-
<div class="flex items-center mt-2">
69-
<p class="text-gray-500">
70-
<time datetime="{{ entry.datetime|date('Y-m-d') }}">{{ entry.datetime|date('Y年m月d日') }}</time>
48+
<div class="grid grid-cols-12 pb-10 gap-y-8 gap-x-4 sm:gap-8">
49+
{% for entry in entrySummary.items %}
50+
<article
51+
aria-labelledby="card-entry{{ entry.eid }}"
52+
class="col-span-12 {{ column_class|default('sm:col-span-6') }}"
53+
>
54+
<a href="{{ entry.url }}" class="block w-full hover:opacity-70">
55+
{% if entry.mainImage and entry.mainImage.path %}
56+
<img
57+
src="{{ entry.mainImage.path|resizeImg(700) }}"
58+
width="700"
59+
height="{{ entry.mainImage.ratio|getHeightFromRatio(700) }}"
60+
alt="{{ entry.mainImage.alt }}"
61+
loading="lazy"
62+
decoding="async"
63+
class="object-cover w-full mb-4 overflow-hidden rounded-md shadow-sm aspect-video"
64+
/>
65+
{% else %}
66+
<img
67+
src="/images/default/noimage.gif"
68+
width="640"
69+
height="480"
70+
alt=""
71+
loading="lazy"
72+
decoding="async"
73+
class="object-cover w-full mb-4 overflow-hidden rounded-md shadow-sm aspect-video"
74+
/>
75+
{% endif %}
76+
<h3 id="card-entry{{ entry.eid }}" class="mt-3 text-gray-900 text-base md:text-lg font-bold line-clamp-2">
77+
{{ entry.title }}
78+
</h3>
79+
<p class="mt-2 text-sm line-clamp-2">
80+
{{ entry.summary }}
7181
</p>
72-
{% if entry.isNew %}
73-
<p class="ml-2 px-2 py-1 rounded-full bg-gray-50 text-gray-900 text-xs">
74-
NEW
82+
<div class="flex flex-wrap items-center gap-x-2 gap-y-1 mt-2 text-sm">
83+
<p class="text-gray-500">
84+
<span class="sr-only">公開日</span><time datetime="{{ entry.datetime|date('Y-m-d') }}">{{
85+
entry.datetime|date('Y年m月d日')
86+
}}</time>
87+
</p>
88+
{% if entry.isNew %}
89+
<p class="px-2 py-1 rounded-full bg-gray-50 text-gray-900 text-xs">
90+
NEW
91+
</p>
92+
{% endif %}
93+
</div>
94+
{% if entry.category.items %}
95+
<p class="mt-2 text-gray-500 font-bold text-sm">
96+
<span class="sr-only">カテゴリー</span>{{ entry.category.items[0].name }}
7597
</p>
7698
{% endif %}
77-
</div>
78-
{% if entry.category.items %}
79-
<p class="mt-2 text-gray-500 font-bold">
80-
{{ entry.category.items[0].name }}
81-
</p>
82-
{% endif %}
83-
{% if entry.tags %}
84-
<ul class="flex flex-wrap gap-x-3 gap-y-1 mt-2 text-gray-500">
85-
{% for tag in entry.tags %}
86-
<li>#{{ tag.name }}</li>
87-
{% endfor %}
88-
</ul>
89-
{% endif %}
90-
</a>
91-
</div>
92-
{% endfor %}
93-
</div>
99+
{% if entry.tags %}
100+
<ul class="mt-2 flex flex-wrap gap-x-3 gap-y-1">
101+
{% for tag in entry.tags %}
102+
<li class="text-gray-500 text-sm">#{{ tag.name }}</li>
103+
{% endfor %}
104+
</ul>
105+
{% endif %}
106+
</a>
107+
</article>
108+
{% endfor %}
109+
</div>
110+
{% endif %}
111+
94112
{{ include('/include/parts/pagination.twig', { pagination: entrySummary.pagination }) }}
95-
</div>
113+
</section>

0 commit comments

Comments
 (0)