22
33{{- if (and site.Params.profileMode.enabled .IsHome) -}}
44{{- partial "index_profile.html" . -}}
5- {{- else }}{{/* if not profileMode */}}
5+ {{- else }}
66
77{{- if not .IsHome | and .Title -}}
88< header class ="page-header ">
@@ -14,101 +14,63 @@ <h1>{{ .Title }}</h1>
1414</ header >
1515{{- end -}}
1616
17- <!-- Add CSS inside the template -->
1817< style >
19- .posts -grid {
18+ .projects -grid {
2019 display : grid;
21- grid-template-columns : repeat (3 , 1fr ); /* Three posts per row */
22- gap : 20 px ;
23- padding : 20 px ;
20+ grid-template-columns : repeat (auto-fill , minmax ( 300 px , 1fr ));
21+ gap : 2 rem ;
22+ padding : 2 rem ;
2423 }
2524
26- .post-preview {
25+ .project-card {
2726 background : # fff ;
2827 border-radius : 8px ;
2928 box-shadow : 0 2px 10px rgba (0 , 0 , 0 , 0.1 );
30- overflow : hidden ;
29+ padding : 1.5 rem ;
3130 transition : transform 0.2s ease-in-out;
32- padding : 15px ;
3331 }
3432
35- .post-preview : hover {
33+ .project-card : hover {
3634 transform : translateY (-5px );
3735 }
3836
39- .post-image img {
40- width : 100% ;
41- height : auto;
42- display : block;
43- }
44-
45- .post-details {
46- padding : 15px ;
47- }
48-
49- .post-details h2 {
37+ .project-title {
5038 font-size : 1.5rem ;
51- margin-bottom : 10px ;
39+ margin-bottom : 1rem ;
40+ color : # 333 ;
5241 }
5342
54- .post-details p {
55- font-size : 1rem ;
56- color : # 555 ;
57- }
58-
59- @media (max-width : 1024px ) {
60- .posts-grid {
61- grid-template-columns : repeat (2 , 1fr ); /* Two columns for medium screens */
62- }
43+ .project-description {
44+ color : # 666 ;
45+ line-height : 1.6 ;
6346 }
6447
6548 @media (max-width : 768px ) {
66- .posts-grid {
67- grid-template-columns : repeat (1 , 1fr ); /* One column for small screens */
68- }
69- }
70-
71- /* Project-specific responsive title */
72- @media (max-width : 360px ) {
73- .post-details h2 {
74- font-size : 1.2rem ; /* Smaller font size for very small screens */
75- }
76- .post-details p {
77- font-size : 0.6rem ; /* Smaller font size for very small screens */
49+ .projects-grid {
50+ grid-template-columns : 1fr ;
51+ padding : 1rem ;
7852 }
7953 }
8054</ style >
8155
82- <!-- Updated layout for three-column grid -->
83- < div class ="posts-grid ">
84- {{- $pages := where .Site.RegularPages "Type" "in" (slice "summary") -}}
85- {{- $paginator := .Paginate $pages -}}
86- {{- range $paginator.Pages -}}
87- < article class ="post-preview ">
88- {{- with .Params.cover.image -}}
89- < div class ="post-image ">
90- < img src ="{{ . | absURL }} " alt ="{{ $.Params.cover.alt }} ">
91- </ div >
92- {{- end -}}
93- < div class ="post-details ">
94- < h2 > < a href ="{{ .Permalink }} " style ="color: black !important; "> {{ .Title }}</ a > </ h2 >
95- < time datetime ="{{ .Date }} "> {{ .Date.Format "January 2, 2006" }}</ time >
96- {{- if .Params.author -}}
97- < p class ="post-author "> {{ .Params.author }}</ p >
98- {{- else if .Params.authors -}}
99- < p class ="post-author "> {{ delimit .Params.authors ", " }}</ p >
56+ < div class ="projects-grid ">
57+ {{- $pages := where .Site.RegularPages "Section" "projects" -}}
58+ {{- range $pages -}}
59+ < article class ="project-card ">
60+ < h2 class ="project-title ">
61+ < a href ="{{ .Params.link }} " style ="color: inherit; text-decoration: none; "> {{ .Title }}</ a >
62+ </ h2 >
63+ < div class ="project-description ">
64+ {{- if .Description -}}
65+ {{ .Description | markdownify }}
66+ {{- else -}}
67+ {{ .Summary | plainify | truncate 160 }}
10068 {{- end -}}
10169 </ div >
10270 </ article >
10371 {{- end -}}
10472</ div >
10573
106- {{- if gt $paginator.TotalPages 1 -}}
107- < footer class ="pagination-footer ">
108- {{ template "_internal/pagination.html" . }}
109- </ footer >
110- {{- end -}}
111-
112- {{- end }}{{/* end profileMode */}}
74+ {{- end }}
11375
114- {{- end }}{{/* end main */}}
76+ {{- end }}
0 commit comments