소스 검색

done with featured article in news page

staging
AzriIchik 2 달 전
부모
커밋
c865af1a0b

+ 1
- 1
content/collections/article.yaml 파일 보기

@@ -4,7 +4,7 @@ layout: layout
4 4
 revisions: false
5 5
 route: '/article/{slug}'
6 6
 date: true
7
-sort_dir: asc
7
+sort_dir: desc
8 8
 date_behavior:
9 9
   past: public
10 10
   future: private

+ 3
- 1
content/collections/article/2024-03-14.the-bola-1.md 파일 보기

@@ -4,9 +4,11 @@ blueprint: article
4 4
 title: 'The Bola 1'
5 5
 author: ab0729b7-bf3b-4b76-930d-938ff5d0a937
6 6
 updated_by: ab0729b7-bf3b-4b76-930d-938ff5d0a937
7
-updated_at: 1710555199
7
+updated_at: 1710565321
8 8
 date_field: '2024-03-13 08:50'
9 9
 image: group-6775.jpg
10
+article_date: '2024-03-13'
11
+article_featured: true
10 12
 ---
11 13
 Lorem ipsum dolor sit amet consectetur adipisicing elit. Vitae dicta commodi ad
12 14
 

+ 3
- 1
content/collections/article/2024-03-14.the-bola-2.md 파일 보기

@@ -4,9 +4,11 @@ blueprint: article
4 4
 title: 'The Bola 2'
5 5
 author: ab0729b7-bf3b-4b76-930d-938ff5d0a937
6 6
 updated_by: ab0729b7-bf3b-4b76-930d-938ff5d0a937
7
-updated_at: 1710555146
7
+updated_at: 1710565327
8 8
 duplicated_from: f1c71af9-e3fc-459e-8cda-e4a4be1b10f3
9 9
 date_field: '2024-03-13 08:50'
10 10
 image: group-6774.jpg
11
+article_date: '2024-03-14'
12
+article_featured: true
11 13
 ---
12 14
 Lorem ipsum dolor sit amet consectetur adipisicing elit. Vitae dicta commodi ad nobis illum accusamus molestias aliquid nostrum adipisci totam labore nihil facilis delectus soluta ratione, exercitationem perferendis architecto sequi consectetur optio? Molestiae repudiandae quae vitae vero cupiditate deleniti corporis culpa quos repellat. Praesentium iste consequuntur maxime qui sequi totam, ipsam, labore quo nisi at aspernatur saepe harum perspiciatis ullam aliquam, molestias quisquam corrupti expedita nostrum numquam nobis alias vel?

+ 3
- 1
content/collections/article/2024-03-14.the-bola-3.md 파일 보기

@@ -4,9 +4,11 @@ blueprint: article
4 4
 title: 'The Bola 3'
5 5
 author: ab0729b7-bf3b-4b76-930d-938ff5d0a937
6 6
 updated_by: ab0729b7-bf3b-4b76-930d-938ff5d0a937
7
-updated_at: 1710555151
7
+updated_at: 1710565345
8 8
 duplicated_from: 5adec921-111f-41b1-ab60-f29e0ffd2f58
9 9
 date_field: '2024-03-13 08:50'
10 10
 image: group-6773.jpg
11
+article_date: '2024-03-15'
12
+article_featured: false
11 13
 ---
12 14
 Lorem ipsum dolor sit amet consectetur adipisicing elit. Vitae dicta commodi ad nobis illum accusamus molestias aliquid nostrum adipisci totam labore nihil facilis delectus soluta ratione, exercitationem perferendis architecto sequi consectetur optio? Molestiae repudiandae quae vitae vero cupiditate deleniti corporis culpa quos repellat. Praesentium iste consequuntur maxime qui sequi totam, ipsam, labore quo nisi at aspernatur saepe harum perspiciatis ullam aliquam, molestias quisquam corrupti expedita nostrum numquam nobis alias vel?

+ 14
- 0
content/collections/article/2024-03-14.the-bola-4.md 파일 보기

@@ -0,0 +1,14 @@
1
+---
2
+id: 7844e490-0684-48a7-a655-a7044a4d9e9f
3
+blueprint: article
4
+title: 'The Bola 4'
5
+author: ab0729b7-bf3b-4b76-930d-938ff5d0a937
6
+updated_by: ab0729b7-bf3b-4b76-930d-938ff5d0a937
7
+updated_at: 1710565338
8
+duplicated_from: e41505ec-bbe3-456c-9bbd-36dcc0950727
9
+date_field: '2024-03-13 08:50'
10
+image: group-6772.jpg
11
+article_date: '2024-03-16'
12
+article_featured: true
13
+---
14
+Lorem ipsum dolor sit amet consectetur adipisicing elit. Vitae dicta commodi ad nobis illum accusamus molestias aliquid nostrum adipisci totam labore nihil facilis delectus soluta ratione, exercitationem perferendis architecto sequi consectetur optio? Molestiae repudiandae quae vitae vero cupiditate deleniti corporis culpa quos repellat. Praesentium iste consequuntur maxime qui sequi totam, ipsam, labore quo nisi at aspernatur saepe harum perspiciatis ullam aliquam, molestias quisquam corrupti expedita nostrum numquam nobis alias vel?

+ 7
- 0
public/assets/.meta/group-6772.jpg.yaml 파일 보기

@@ -0,0 +1,7 @@
1
+data: {  }
2
+size: 84879
3
+last_modified: 1710564961
4
+width: 526
5
+height: 436
6
+mime_type: image/jpeg
7
+duration: null

BIN
public/assets/group-6772.jpg 파일 보기


+ 8
- 0
public/css/main.css 파일 보기

@@ -218,6 +218,14 @@ p {
218 218
     background-position: center center;
219 219
 }
220 220
 
221
+.article-carousel-item{
222
+    background-size: cover;
223
+    background-repeat: no-repeat;
224
+    background-position: center center;
225
+    padding-top:30%;
226
+    cursor: pointer;
227
+}
228
+
221 229
 .article-details{
222 230
     height: 100%;
223 231
     width: 100%;

+ 5
- 0
public/js/main.js 파일 보기

@@ -11645,6 +11645,11 @@ setTimeout(function () {
11645 11645
   aos__WEBPACK_IMPORTED_MODULE_0___default().init();
11646 11646
 }, 500);
11647 11647
 $(document).ready(function () {
11648
+  $('.article-carousel-item').on('click', function () {
11649
+    var redirectlink = $(this).data('href');
11650
+    location.href = redirectlink;
11651
+  });
11652
+
11648 11653
   // this section is for booking page
11649 11654
   //check if booking section exist in any page
11650 11655
   var bookingContainer = $('#booking-section');

+ 16
- 7
resources/blueprints/collections/article/article.yaml 파일 보기

@@ -34,24 +34,33 @@ sections:
34 34
           instructions_position: above
35 35
           visibility: visible
36 36
       -
37
-        handle: date_field
37
+        handle: article_date
38 38
         field:
39 39
           mode: single
40
-          time_enabled: true
40
+          time_enabled: false
41 41
           time_seconds_enabled: false
42 42
           full_width: false
43 43
           inline: false
44 44
           columns: 1
45 45
           rows: 1
46
-          display: 'Article publish date'
46
+          display: 'Article date'
47 47
           type: date
48 48
           icon: date
49
-          instructions: 'Date of article published'
50
-          listable: true
49
+          instructions: 'Published date'
50
+          listable: hidden
51
+          instructions_position: above
52
+          visibility: visible
53
+      -
54
+        handle: article_featured
55
+        field:
56
+          default: false
57
+          display: 'Article Featured'
58
+          type: toggle
59
+          icon: toggle
60
+          instructions: 'Put in news carousel highlight'
61
+          listable: hidden
51 62
           instructions_position: above
52 63
           visibility: visible
53
-          validate:
54
-            - required
55 64
   sidebar:
56 65
     display: Sidebar
57 66
     fields:

+ 8
- 0
resources/css/main.css 파일 보기

@@ -213,6 +213,14 @@ p {
213 213
     background-position: center center;
214 214
 }
215 215
 
216
+.article-carousel-item{
217
+    background-size: cover;
218
+    background-repeat: no-repeat;
219
+    background-position: center center;
220
+    padding-top:30%;
221
+    cursor: pointer;
222
+}
223
+
216 224
 .article-details{
217 225
     height: 100%;
218 226
     width: 100%;

+ 6
- 0
resources/js/main.js 파일 보기

@@ -45,6 +45,12 @@ setTimeout(() => {
45 45
 $(document).ready(function () {
46 46
 
47 47
 
48
+    $('.article-carousel-item').on('click', function(){
49
+
50
+        let redirectlink = $(this).data('href')
51
+        location.href = redirectlink;
52
+    })
53
+
48 54
     // this section is for booking page
49 55
     //check if booking section exist in any page
50 56
     let bookingContainer = $('#booking-section');

+ 56
- 0
resources/views/article/index.antlers copy.html 파일 보기

@@ -0,0 +1,56 @@
1
+<section>
2
+    <div class="text-md-center text-light section-2" style="background-image: url(./assets/image/dbparticle2.png);">
3
+        <div class="container-fluid p-0 m-0" data-aos="zoom-in" >
4
+            <p class="db-h3 text-highlight">News</p>
5
+            <p class="mx-auto p-0 about-paragraph db-h5">You can book benue and field to organize your matches according to your preferred date and time.</p>
6
+        </div>
7
+    </div>
8
+</section>
9
+<section>
10
+    <div class="text-light section-5 py-7">
11
+
12
+        <div id="carouselExampleFade" class="carousel slide carousel-fade" data-bs-ride="carousel">
13
+            <div class="carousel-inner text-light">
14
+                {{ firstEntry = true }}
15
+                {{ collection:article sort="article_date:desc" }}
16
+                    {{ if article_featured }}
17
+                        {{ if firstEntry }}
18
+                            <div class="carousel-item active">
19
+                                <div class="container-fluid row">
20
+                                    <div class="col-6 bg-danger">
21
+                                        das
22
+                                    </div>
23
+                                    <div class="col-6 bg-info">
24
+                                        das
25
+                                    </div>
26
+                                </div>
27
+                            </div>
28
+                            {{ firstEntry = false }}
29
+                        {{ else }}
30
+                            <div class="carousel-item">
31
+                                <div class="container-fluid row">
32
+                                    <div class="col-6 bg-secondary">
33
+                                        das
34
+                                    </div>
35
+                                    <div class="col-6 bg-success">
36
+                                        das
37
+                                    </div>
38
+                                </div>
39
+                            </div>
40
+                        {{ /if }}
41
+                    {{ /if }}
42
+                {{ /collection:article }}
43
+            </div>
44
+
45
+            <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleFade" data-bs-slide="prev">
46
+              <span class="carousel-control-prev-icon" aria-hidden="true"></span>
47
+              <span class="visually-hidden">Previous</span>
48
+            </button>
49
+            <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleFade" data-bs-slide="next">
50
+              <span class="carousel-control-next-icon" aria-hidden="true"></span>
51
+              <span class="visually-hidden">Next</span>
52
+            </button>
53
+        </div>
54
+
55
+    </div>
56
+</section>

+ 56
- 3
resources/views/article/index.antlers.html 파일 보기

@@ -9,10 +9,63 @@
9 9
 <section>
10 10
     <div class="text-light section-5 py-7">
11 11
 
12
-        <div class="row g-0 article-container">
12
+        <div class="text-light section-5 article-container">
13
+
14
+            <div id="articleCarousel" class="carousel slide carousel-fade" data-bs-ride="carousel">
15
+                <div class="carousel-indicators p-0 m-0">
16
+                    <button type="button" data-bs-target="#articleCarousel" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
17
+                    <button type="button" data-bs-target="#articleCarousel" data-bs-slide-to="1" aria-label="Slide 2"></button>
18
+                    <button type="button" data-bs-target="#articleCarousel" data-bs-slide-to="2" aria-label="Slide 3"></button>
19
+                </div>
20
+                <div class="carousel-inner text-light">
21
+                    {{ firstEntry = true }}
22
+                    {{ collection:article sort="article_date:desc" }}
23
+                        {{ if article_featured }}
24
+                            {{ if firstEntry }}
25
+                                <div class="carousel-item active" data-bs-interval="1000000">
26
+                                    <div class="container-fluid row p-0 mx-auto">
27
+                                        <div data-href="/article/{{ slug }}" class="col-xl-5 article-carousel-item position-relative" style="background-image: url(.{{ image }});">
28
+                                            <div class="position-absolute" style="bottom:10px;left:20px">
29
+                                                <p class="article-details-datetime"> {{ article_date }} </p>
30
+                                                <hr class="text-db article-details-line" style="height: 5px;"/>
31
+                                            </div>
32
+                                        </div>
33
+                                        <div class="col-xl-7 px-0 py-5 px-xl-5 py-xl-0">
34
+                                            <p class="db-h3 text-highlight">{{ title }}</p>
35
+                                            <p>{{ content }}</p>
36
+                                        </div>
37
+                                    </div>
38
+                                </div>
39
+                                {{ firstEntry = false }}
40
+                            {{ else }}
41
+                            <div class="carousel-item" data-bs-interval="2000">
42
+                                <div class="container-fluid row p-0">
43
+                                    <div data-href="/article/{{ slug }}" class="col-xl-5 article-carousel-item position-relative" style="background-image: url(.{{ image }});">
44
+                                        <div class="position-absolute" style="bottom:10px;left:40px">
45
+                                            <p class="article-details-datetime"> {{ article_date }} </p>
46
+                                            <hr class="text-db article-details-line" style="height: 5px;"/>
47
+                                        </div>
48
+                                    </div>
49
+                                    <div class="col-xl-7 px-0 py-5 px-xl-5 py-xl-0">
50
+                                        <p class="db-h3 text-highlight">{{ title }}</p>
51
+                                        <p>{{ content }}</p>
52
+                                    </div>
53
+                                </div>
54
+                            </div>
55
+                            {{ /if }}
56
+                        {{ /if }}
57
+                    {{ /collection:article }}
58
+                </div>
59
+            </div>
13 60
 
14
-            {{ collection:article }}
15
-                {{ partial:partials/articlecard }}
61
+        </div>
62
+
63
+        <div class="row g-0 article-container">
64
+            <p class="text-highlight db-h5 fw-bold">More News</p>
65
+            {{ collection:article sort="article_date:desc" }}
66
+                {{ if article_featured == false}}
67
+                    {{ partial:partials/articlecard }}
68
+                {{ /if }}
16 69
             {{ /collection:article }}
17 70
 
18 71
         </div>

+ 2
- 2
resources/views/home.antlers.html 파일 보기

@@ -91,12 +91,12 @@
91 91
         </div>
92 92
         <div class="row g-0 article-container">
93 93
 
94
-            {{ collection:article }}
94
+            {{ collection:article limit="3" sort="article_date:desc" }}
95 95
                 {{ partial:partials/articlecard }}
96 96
             {{ /collection:article }}
97 97
 
98 98
         </div>
99
-        <button class="nav-link db-btn mx-auto d-none d-lg-block" style="font-size: clamp(18px,1vw,23px);font-weight: 500;padding: 0.5rem 3rem">See More</button>
99
+        <a href="/news" class="nav-link db-btn mx-auto d-none d-lg-block" style="font-size: clamp(18px,1vw,23px);font-weight: 500;padding: 0.5rem 3rem;text-decoration: none;">See More</a>
100 100
     </div>
101 101
 </section>
102 102
 <section>

+ 2
- 2
resources/views/partials/_articlecard.antlers.html 파일 보기

@@ -1,11 +1,11 @@
1 1
 <div data-aos="fade-up" class="col-xl-4 position-relative p-0 p-lg-3">
2 2
     <div class="position-relative article-item" style="background-image: url(.{{ image }});">
3 3
         <div class="position-absolute d-flex flex-wrap pt-4 pb-5 px-5 article-details">
4
-            <p class="article-details-datetime"> {{ date_field }} </p>
4
+            <p class="article-details-datetime"> {{ article_date }} </p>
5 5
             <div class="mt-auto article-details-link">
6 6
                 <p class="text-highlight db-h5 fw-bold"> {{ title }} </p>
7 7
                 <hr class="text-db article-details-line"/>
8
-                <p><a href="/article/{{ slug }}" class="text-light d-block article-details-href"> Read More <span><i class="fa-solid fa-angle-right ps-3 text-db"></i></span></a></p>
8
+                <p><a href="/article/{{ slug }}" class="d-block article-details-href db-link"> Read More <span><i class="fa-solid fa-angle-right ps-3 text-db"></i></span></a></p>
9 9
             </div>
10 10
         </div>
11 11
     </div>

Loading…
취소
저장