@shift72/core-template 1.9.31 → 1.9.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,21 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased](https://github.com/shift72/core-template/compare/1.9.31...HEAD)
3
+ ## [Unreleased](https://github.com/shift72/core-template/compare/1.9.33...HEAD)
4
+
5
+ ## [1.9.33](https://github.com/shift72/core-template/compare/1.9.32...1.9.33)
6
+
7
+ ### Changed
8
+
9
+ - Update font.jet to use cdn.shift72.com for fonts. Preload poppins faces to prevent unwanted pop-ins.
10
+ - Blog post styling tweaks
11
+
12
+ ## [1.9.32](https://github.com/shift72/core-template/compare/1.9.31...1.9.32)
13
+
14
+ ### Added
15
+
16
+ - Blog posts and feed. A /posts/ route has been added to kibble.json for the feed,
17
+ but it shouldn't affect sites that don't actively use the posts feature and link
18
+ to it from the nav.
4
19
 
5
20
  ## [1.9.31](https://github.com/shift72/core-template/compare/1.9.29...1.9.31)
6
21
 
package/kibble.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "core-template",
3
- "version": "1.9.31",
3
+ "version": "1.9.33",
4
4
  "siteUrl": "https://tvoddemo.shift72.com",
5
- "builderVersion": "0.17.8",
5
+ "builderVersion": "0.17.10",
6
6
  "defaultLanguage": "en",
7
7
  "languages": {
8
8
  "ar": {
@@ -173,6 +173,23 @@
173
173
  "datasource": "PageIndex",
174
174
  "pageSize": 0
175
175
  },
176
+ {
177
+ "name": "postIndex",
178
+ "firstPageUrlPath": "/posts/",
179
+ "urlPath": "/posts/:index/",
180
+ "templatePath": "templates/page/post/posts-feed.jet",
181
+ "datasource": "PageIndex",
182
+ "options": {
183
+ "pageTypes": [
184
+ "post"
185
+ ],
186
+ "sortBy": [
187
+ "published_date:desc",
188
+ "title:asc"
189
+ ]
190
+ },
191
+ "pageSize": 5
192
+ },
176
193
  {
177
194
  "name": "bundleItem",
178
195
  "urlPath": "/bundle/:slug/",
@@ -199,5 +216,5 @@
199
216
  "pageSize": 0
200
217
  }
201
218
  ],
202
- "coreTemplateVersion": "1.9.31"
219
+ "coreTemplateVersion": "1.9.33"
203
220
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shift72/core-template",
3
- "version": "1.9.31",
3
+ "version": "1.9.33",
4
4
  "description": "Shift72 core template",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -53,7 +53,7 @@
53
53
  "postcss-cli": "^11.0.1",
54
54
  "rollup": "^2.23.0",
55
55
  "rollup-plugin-terser": "^6.1.0",
56
- "s72-kibble": "^0.17.8",
56
+ "s72-kibble": "^0.17.10",
57
57
  "sass": "^1.36.0"
58
58
  },
59
59
  "devDependencies": {
@@ -1745,5 +1745,14 @@
1745
1745
  },
1746
1746
  "wcag_aria_label_social_bluesky": {
1747
1747
  "other": "Visit us on Bluesky"
1748
+ },
1749
+ "posts_pagination_next": {
1750
+ "other": "Older posts"
1751
+ },
1752
+ "posts_pagination_prev": {
1753
+ "other": "Newer posts"
1754
+ },
1755
+ "post_preview_show_more": {
1756
+ "other": "Read more"
1748
1757
  }
1749
- }
1758
+ }
@@ -1,4 +1,4 @@
1
- @use "sass:math";
1
+ @use 'sass:math';
2
2
 
3
3
  label {
4
4
  @include subtitle-1-style;
@@ -1,4 +1,4 @@
1
- @use "sass:math";
1
+ @use 'sass:math';
2
2
 
3
3
  html {
4
4
  height: 100%;
@@ -169,10 +169,6 @@
169
169
  margin-right: 20px;
170
170
  width: 110px;
171
171
 
172
- &.poster-image {
173
- margin-bottom: 0px;
174
- }
175
-
176
172
  @include media-breakpoint-up(xs) {
177
173
  width: 155px;
178
174
  }
@@ -181,6 +177,10 @@
181
177
  width: 208px;
182
178
  }
183
179
 
180
+ &.poster-image {
181
+ margin-bottom: 0;
182
+ }
183
+
184
184
  .live {
185
185
  display: none;
186
186
  }
@@ -110,7 +110,6 @@
110
110
  }
111
111
  }
112
112
 
113
-
114
113
  s72-show-hide-switcher {
115
114
  display: block;
116
115
  margin-bottom: 15px;
@@ -38,6 +38,8 @@
38
38
  .curated-page,
39
39
  .library-page,
40
40
  .content-page,
41
+ .post-page,
42
+ .posts-feed-page,
41
43
  .form-page,
42
44
  .wishlist-page,
43
45
  .search-page,
@@ -0,0 +1,156 @@
1
+ .post-page,
2
+ .posts-feed-page {
3
+ margin-top: 2rem;
4
+ margin-left: auto;
5
+ margin-right: auto;
6
+ padding-left: 0;
7
+ padding-right: 0;
8
+ width: var(--page-reading-column-width);
9
+ max-width: calc(min(95vw, 1100px));
10
+ }
11
+
12
+ .post-title {
13
+ @include heading-2-style();
14
+ margin-bottom: 0.5rem;
15
+ line-height: 1.3;
16
+
17
+ > a {
18
+ text-decoration: none;
19
+
20
+ &:hover {
21
+ text-decoration: underline;
22
+ }
23
+ }
24
+ }
25
+
26
+ .post-meta {
27
+ display: flex;
28
+ flex-wrap: wrap;
29
+ opacity: 0.7;
30
+ font-size: var(--body-2-style-font-size);
31
+ margin-bottom: 1rem;
32
+ }
33
+
34
+ .post-published-date::first-letter {
35
+ text-transform: capitalize; // icky hack for dates like "yesterday 10:32am" maybe the s72-time component needs a 'format' prop so we can force short dates?
36
+ }
37
+
38
+ .post-header-image {
39
+ margin-bottom: 1rem;
40
+
41
+ s72-image {
42
+ display: flex;
43
+ flex-direction: column;
44
+ aspect-ratio: 1200 / 422;
45
+
46
+ border-radius: 0.5rem;
47
+ overflow: hidden;
48
+
49
+ transition: background-color 0.25s ease;
50
+ background-color: var(--poster-skeleton-background-color);
51
+
52
+ /* stylelint-disable selector-no-qualifying-type */
53
+ // a bit of a pedantic rule, wrong in this case. <s72-image> applies the
54
+ // modifier classes to the wrapper element as well as the <img>, but setting
55
+ // a background color for the skeleton needs to happen on the wrapper
56
+ // because you can't colour an <img>
57
+ &.s72-image--loaded {
58
+ background-color: transparent;
59
+ aspect-ratio: unset;
60
+ }
61
+
62
+ img {
63
+ transition: opacity 0.25s ease;
64
+ opacity: 0;
65
+
66
+ &.s72-image--loaded {
67
+ opacity: 1;
68
+ }
69
+ }
70
+ /* stylelint-enable selector-no-qualifying-type */
71
+ }
72
+ }
73
+
74
+ .post-body {
75
+ &,
76
+ p {
77
+ word-wrap: break-word;
78
+ font-weight: var(--post-body-font-weight);
79
+ line-height: var(--post-body-line-height);
80
+ }
81
+
82
+ strong {
83
+ font-weight: bolder;
84
+ }
85
+
86
+ a {
87
+ @include a;
88
+ }
89
+ }
90
+
91
+ .post-page .post,
92
+ .posts-feed-page .post-preview {
93
+ background-color: var(--post-background-color);
94
+ padding: 20px 25px;
95
+ border-radius: 8px;
96
+ }
97
+
98
+ .post-page {
99
+ .page-bg {
100
+ filter: blur(8px);
101
+ -webkit-filter: blur(8px);
102
+ }
103
+ .post {
104
+ margin: 1rem 0;
105
+ }
106
+ comment-section {
107
+ padding: 0;
108
+ margin-top: 2rem;
109
+ }
110
+ }
111
+
112
+ .posts-feed-page {
113
+ .post-preview + .post-preview {
114
+ margin-top: var(--posts-feed-spacing);
115
+ }
116
+
117
+ .post-preview-show-more {
118
+ text-align: center;
119
+ text-decoration: underline;
120
+ opacity: 0.8;
121
+ }
122
+
123
+ // Overflow behaviour: js in the template applies a .post-preview--overflowed class
124
+ .post-preview {
125
+ overflow: hidden;
126
+
127
+ .post-body {
128
+ margin-bottom: 40px;
129
+ max-height: var(--post-preview-height);
130
+ }
131
+
132
+ .post-preview-show-more {
133
+ display: none;
134
+ }
135
+
136
+ &.post-preview--overflowed {
137
+ .post-preview-show-more {
138
+ display: block;
139
+ }
140
+
141
+ .post-body {
142
+ mask-image: linear-gradient(180deg, #000 72%, transparent);
143
+ }
144
+ }
145
+ }
146
+
147
+ .posts-pagination {
148
+ display: flex;
149
+ justify-content: space-between;
150
+ margin-top: 4rem;
151
+
152
+ .posts-pagination-next {
153
+ margin-left: auto;
154
+ }
155
+ }
156
+ }
@@ -140,6 +140,15 @@
140
140
  --page-detail-padding-hz: 20px;
141
141
  --page-detail-padding-hz-lg: 50px;
142
142
 
143
+ --page-reading-column-width: 69ch;
144
+
145
+ --posts-feed-spacing: 3rem;
146
+ --post-preview-height: 250px;
147
+ --post-background-color: #030303a0;
148
+
149
+ --post-body-font-weight: 400;
150
+ --post-body-line-height: 1.55;
151
+
143
152
  --heading-1-style-letter-spacing: normal;
144
153
  --heading-2-style-letter-spacing: normal;
145
154
  --heading-3-style-letter-spacing: normal;
@@ -187,7 +196,6 @@
187
196
  --playback-progress-bar-color: var(--secondary);
188
197
  --playback-progress-bar-bg-color: rgba(var(--body-bg-rgb), 0.5);
189
198
 
190
-
191
199
  // Detail player
192
200
  --page-detail-player-padding-top: 140px;
193
201
  --page-detail-player-padding-top-lg: 200px;
@@ -10,6 +10,7 @@
10
10
  @import '_buttons';
11
11
  @import '_cta-buttons';
12
12
  @import '_pages';
13
+ @import '_posts';
13
14
  @import '_forms';
14
15
  @import '_card';
15
16
 
@@ -1,4 +1,6 @@
1
1
  {{block font()}}
2
- <link rel="preconnect" href="https://fonts.gstatic.com">
3
- <link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap" rel="stylesheet">
4
- {{end}}
2
+ <link rel="stylesheet" href="https://cdn.shift72.com/fonts/poppins/index.css">
3
+ <link rel="preload" href="https://cdn.shift72.com/fonts/poppins/files/poppins-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin>
4
+ <link rel="preload" href="https://cdn.shift72.com/fonts/poppins/files/poppins-latin-300-normal.woff2" as="font" type="font/woff2" crossorigin>
5
+ <link rel="preload" href="https://cdn.shift72.com/fonts/poppins/files/poppins-latin-500-normal.woff2" as="font" type="font/woff2" crossorigin>
6
+ {{end}}
@@ -0,0 +1,68 @@
1
+ {{extends "templates/application/application.jet"}}
2
+
3
+ {{import "templates/page/post/shared.jet"}}
4
+ {{import "templates/common/background-image.jet"}}
5
+
6
+ {{block body()}}
7
+ <main id="main" class="page posts-feed-page">
8
+ {{range page := pages}}
9
+ {{yield postPreview(post=page)}}
10
+ {{end}}
11
+ {{ if len(pagination.PreviousURL) > 0 || len(pagination.NextURL) > 0 }}
12
+ <div class="posts-pagination">
13
+ {{ if len(pagination.PreviousURL) > 0 }}
14
+ <a class="posts-pagination-prev" href="{{pagination.PreviousURL}}">{{i18n("posts_pagination_prev")}}</a>
15
+ {{end}}
16
+ {{ if len(pagination.NextURL) > 0 }}
17
+ <a class="posts-pagination-next" href="{{pagination.NextURL}}">{{i18n("posts_pagination_next")}}</a>
18
+ {{end}}
19
+ </div>
20
+ {{end}}
21
+ </main>
22
+
23
+ <script>
24
+ (function () {
25
+ function detectClamping() {
26
+ var previews = document.querySelectorAll('.post-preview');
27
+
28
+ previews.forEach(function (el) {
29
+ el.classList.remove('post-preview--overflowed');
30
+
31
+ var scroll = el.scrollHeight;
32
+ var client = el.clientHeight;
33
+
34
+ if (scroll > client + 1) {
35
+ el.classList.add('post-preview--overflowed');
36
+ }
37
+ });
38
+ }
39
+
40
+ detectClamping();
41
+ if (document.readyState === 'loading') {
42
+ document.addEventListener('DOMContentLoaded', detectClamping);
43
+ }
44
+
45
+ window.addEventListener('load', detectClamping);
46
+
47
+ var resizeTimeout;
48
+ window.addEventListener('resize', function () {
49
+ clearTimeout(resizeTimeout);
50
+ resizeTimeout = setTimeout(detectClamping, 150);
51
+ });
52
+ })();
53
+ </script>
54
+ {{end}}
55
+
56
+
57
+ {{block postPreview(post)}}
58
+ <div class="post-preview">
59
+ {{yield postTitle(post=post, href=routeTo(post, "pageItem"))}}
60
+ {{yield postMeta(post=post)}}
61
+ {{yield postHeaderImage(post=post)}}
62
+ {{yield postBody(text=post.Content)}}
63
+ <a class="post-preview-show-more" href='{{routeTo(post, "pageItem")}}'>{{i18n("post_preview_show_more")}}</a>
64
+ </div>
65
+ {{end}}
66
+
67
+
68
+ {{block appBadges()}}{{end}}
@@ -0,0 +1,40 @@
1
+ {{block postTitle(post, href="")}}
2
+ <h3 class="post-title">
3
+ {{if len(href) > 0}}
4
+ <a href="{{href}}">{{post.Title}}</a>
5
+ {{else}}
6
+ {{post.Title}}
7
+ {{end}}
8
+ </h3>
9
+ {{end}}
10
+
11
+ {{block postMeta(post)}}
12
+ <div class="post-meta">
13
+ {{if !post.PublishedDate.IsZero()}}
14
+ <div class="post-published-date">
15
+ <s72-time datetime="{{post.PublishedDate.UnixMilli()}}" mode="date"></s72-time>
16
+ &nbsp; {* nbsp helps prevent layout shift due to s72-time relish component loading delay *}
17
+ </div>
18
+ {{end}}
19
+ </div>
20
+ {{end}}
21
+
22
+ {{block postHeaderImage(post)}}
23
+ {{if len(post.Images.Header) > 0}}
24
+ <div class="post-header-image">
25
+ <s72-image src="{{post.Images.Header}}"></s72-image>
26
+ </div>
27
+ {{end}}
28
+ {{end}}
29
+
30
+ {{block postBody(text="")}}
31
+ <div class="post-body">
32
+ {{text | raw}}
33
+ </div>
34
+ {{end}}
35
+
36
+ {{block postBacktoPostsLink()}}
37
+ <div class="post-back-to-posts">
38
+ <a href="{{routeToPath("/posts/")}}">{{i18n("post_back_to_posts")}}</a>
39
+ </div>
40
+ {{end}}
@@ -0,0 +1,26 @@
1
+ {{extends "templates/application/application.jet"}}
2
+
3
+ {{import "templates/page/post/shared.jet"}}
4
+ {{import "templates/common/background-image.jet"}}
5
+
6
+ {{block head()}}
7
+ {{yield seo() page}}
8
+ {{end}}
9
+
10
+ {{block body()}}
11
+ <main id="main" class="page post-page">
12
+ {{yield backgroundImage(containerClass="page-bg", gradientClass="right-gradient", imageClass="page-bg-img", imageSrc=page.Images.Background)}}
13
+ {{yield postBacktoPostsLink()}}
14
+ <div class="post">
15
+ {{yield postTitle(post=page)}}
16
+ {{yield postMeta(post=page)}}
17
+ {{yield postHeaderImage(post=page)}}
18
+ {{yield postBody(text=page.Content)}}
19
+ </div>
20
+
21
+ {{if isEnabled("commenting")}}
22
+ <comment-section slug="{{page.Slug}}"></comment-section>
23
+ {{end}}
24
+ {{yield postBacktoPostsLink()}}
25
+ </main>
26
+ {{end}}