Skip to content

Commit 1897e6d

Browse files
authored
Merge pull request #271 from neural-loop/main
refactor: date formats and details link
2 parents 511b48c + ecc962d commit 1897e6d

File tree

5 files changed

+48
-48
lines changed

5 files changed

+48
-48
lines changed

layouts/partials/components/event-card.html

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,50 +13,50 @@
1313
{{ $variant_class := printf "%s--%s" $base_class $variant }}
1414

1515
<div class="{{ $base_class }} {{ $variant_class }} {{ if eq $variant "wide" }}row{{ end }}">
16-
{{/* Media Column (for wide variant) or Full Width Media (for grid/featured) */}}
17-
<div class="{{ if eq $variant "wide" }}lg:col-4 md:col-12{{ end }} {{ $base_class }}__media-container {{ if and $image_param (not $video_id) (eq $show_play_icon true) }}group{{ end }}">
18-
{{ if and (eq $variant "featured") $video_id }}
19-
<div class="mb-4 rounded">
20-
{{ partial "youtube-lite.html" (dict "Id" $video_id) }}
21-
</div>
22-
{{ else if $image_param }}
23-
<a href="{{ $ctx.RelPermalink }}" class="{{ $base_class }}__image-link">
24-
{{ partial "image" (dict "Src" $image_param "Context" $ctx "Alt" $ctx.Title "Class" (printf "%s__image" $base_class) "Size" $image_size) }}
25-
{{ if and $show_play_icon (not $video_id) }}
26-
<div class="{{ $base_class }}__play-icon-overlay">
27-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 330 330" style="enable-background:new 0 0 330 330;" xml:space="preserve">
16+
{{/* Media Column (for wide variant) or Full Width Media (for grid/featured) */}}
17+
<div class="{{ if eq $variant "wide" }}lg:col-4 md:col-12{{ end }} {{ $base_class }}__media-container {{ if and $image_param (not $video_id) (eq $show_play_icon true) }}group{{ end }}">
18+
{{ if and (eq $variant "featured") $video_id }}
19+
<div class="mb-4 rounded">
20+
{{ partial "youtube-lite.html" (dict "Id" $video_id) }}
21+
</div>
22+
{{ else if $image_param }}
23+
<a href="{{ $ctx.RelPermalink }}" class="{{ $base_class }}__image-link">
24+
{{ partial "image" (dict "Src" $image_param "Context" $ctx "Alt" $ctx.Title "Class" (printf "%s__image" $base_class) "Size" $image_size) }}
25+
{{ if and $show_play_icon (not $video_id) }}
26+
<div class="{{ $base_class }}__play-icon-overlay">
27+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 330 330" style="enable-background:new 0 0 330 330;" xml:space="preserve">
2828
<path d="M37.728,328.12c2.266,1.256,4.77,1.88,7.272,1.88c2.763,0,5.522-0.763,7.95-2.28l240-149.999c4.386-2.741,7.05-7.548,7.05-12.72c0-5.172-2.664-9.979-7.05-12.72L52.95,2.28c-4.625-2.891-10.453-3.043-15.222-0.4C32.959,4.524,30,9.547,30,15v300C30,320.453,32.959,325.476,37.728,328.12z"/>
2929
</svg>
30-
</div>
31-
{{ end }}
32-
</a>
33-
{{ else }}
34-
<a href="{{ $ctx.RelPermalink }}" class="{{ $base_class }}__image-link">
35-
{{ partial "image" (dict "Src" $default_image_path "Alt" $ctx.Title "Class" (printf "%s__image %s__image--default" $base_class $base_class) "Size" $image_size) }}
36-
</a>
37-
{{ end }}
3830
</div>
31+
{{ end }}
32+
</a>
33+
{{ else }}
34+
<a href="{{ $ctx.RelPermalink }}" class="{{ $base_class }}__image-link">
35+
{{ partial "image" (dict "Src" $default_image_path "Alt" $ctx.Title "Class" (printf "%s__image %s__image--default" $base_class $base_class) "Size" $image_size) }}
36+
</a>
37+
{{ end }}
38+
</div>
3939

40-
{{/* Content Column (for wide variant) or Full Width Content (for grid/featured) */}}
41-
<div class="{{ if eq $variant "wide" }}lg:col-8 md:col-12{{ end }} {{ $base_class }}__content-container">
42-
<h4 class="{{ $base_class }}__title {{ if eq $variant "wide" }}mb-3 md:pt-4 lg:pt-0{{ else }}mb-3{{ end }}">
43-
<a href="{{ $ctx.RelPermalink }}">{{ $ctx.Title }}</a>
44-
</h4>
45-
<ul class="{{ $base_class }}__meta-list">
46-
<li class="{{ $base_class }}__meta-item inline-flex items-center">
47-
{{ partial "icon.html" (dict "style" "regular" "name" "circle-user" "class" "mr-2") }}{{ partial "components/author-links.html" $ctx }}
48-
</li>
49-
{{ if $ctx.Date }}
50-
<li class="{{ $base_class }}__meta-item inline-flex items-center">
51-
{{ partial "icon.html" (dict "style" "regular" "name" "calendar" "class" "mr-2") }}{{ dateFormat "2006, January 2" $ctx.Date }}
52-
</li>
53-
{{ end }}
54-
{{ if $ctx.Params.upcoming }}
55-
<li class="{{ $base_class }}__meta-item inline-flex items-center">
56-
{{ partial "icon.html" (dict "style" "regular" "name" "clock" "class" "mr-2") }}{{ $ctx.Params.start_time }} - {{ $ctx.Params.end_time }} {{ $ctx.Params.time_zone }}
57-
</li>
58-
{{ end }}
59-
</ul>
60-
<p class="{{ $base_class }}__description {{ if eq $variant "wide" }}mb-2{{ else }}mb-6{{ end }}">{{ $ctx.Description }}</p>
61-
</div>
62-
</div>
40+
{{/* Content Column (for wide variant) or Full Width Content (for grid/featured) */}}
41+
<div class="{{ if eq $variant "wide" }}lg:col-8 md:col-12{{ end }} {{ $base_class }}__content-container">
42+
<h4 class="{{ $base_class }}__title {{ if eq $variant "wide" }}mb-3 md:pt-4 lg:pt-0{{ else }}mb-3{{ end }}">
43+
<a href="{{ $ctx.RelPermalink }}">{{ $ctx.Title }}</a>
44+
</h4>
45+
<ul class="{{ $base_class }}__meta-list">
46+
<li class="{{ $base_class }}__meta-item inline-flex items-center">
47+
{{ partial "icon.html" (dict "style" "regular" "name" "circle-user" "class" "mr-2") }}{{ partial "components/author-links.html" $ctx }}
48+
</li>
49+
{{ if $ctx.Date }}
50+
<li class="{{ $base_class }}__meta-item inline-flex items-center">
51+
{{ partial "icon.html" (dict "style" "regular" "name" "calendar" "class" "mr-2") }}{{ $ctx.Date.Format "January 2, 2006" }}
52+
</li>
53+
{{ end }}
54+
{{ if $ctx.Params.upcoming }}
55+
<li class="{{ $base_class }}__meta-item inline-flex items-center">
56+
{{ partial "icon.html" (dict "style" "regular" "name" "clock" "class" "mr-2") }}{{ $ctx.Params.start_time }} - {{ $ctx.Params.end_time }} {{ $ctx.Params.time_zone }}
57+
</li>
58+
{{ end }}
59+
</ul>
60+
<p class="{{ $base_class }}__description {{ if eq $variant "wide" }}mb-2{{ else }}mb-6{{ end }}">{{ $ctx.Description }}</p>
61+
</div>
62+
</div>

layouts/partials/custom/hacking-hours-software-promo.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h3 class="text-xl font-bold mb-3 text-text dark:text-darkmode-text">Latest Hack
6464
{{ end }}
6565
<div class="flex-grow">
6666
<h4 class="text-lg font-semibold leading-tight"><a href="{{ $mostRecentPastHH.RelPermalink }}" class="text-primary dark:text-darkmode-primary hover:underline">{{ $mostRecentPastHH.Title }}</a></h4>
67-
<p class="text-xs text-gray-500 dark:text-gray-400 mb-1">{{ $mostRecentPastHH.Date.Format "Jan 2, 2006" }}</p>
67+
<p class="text-xs text-gray-500 dark:text-gray-400 mb-1">{{ $mostRecentPastHH.Date.Format "January 2, 2006" }}</p>
6868
<p class="text-sm text-gray-700 dark:text-gray-300">{{ $mostRecentPastHH.Description | truncate 80 }}</p>
6969
</div>
7070
</div>
@@ -86,7 +86,7 @@ <h3 class="text-xl font-bold mb-3 text-text dark:text-darkmode-text">Next Sessio
8686
{{ end }}
8787
<p class="text-md font-semibold text-primary dark:text-darkmode-primary flex items-baseline">
8888
{{ partial "icon.html" (dict "style" "regular" "name" "calendar" "class" "mr-2") }}
89-
{{ $upcomingHackingHourDetails.Date.Format "Monday, Jan 2, 2006" }}
89+
{{ $upcomingHackingHourDetails.Date.Format "Monday, January 2, 2006" }}
9090
</p>
9191
<p class="text-sm text-gray-600 dark:text-gray-400 flex items-baseline">
9292
{{ partial "icon.html" (dict "style" "regular" "name" "clock" "class" "mr-2") }}

layouts/partials/custom/modern-recent-events-section.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ <h5 class="text-xl font-semibold mb-1">
9393
</p>
9494
{{/* MODIFIED BUTTONS AREA */}}
9595
<div class="mt-4 flex flex-wrap gap-2 items-center {{ if not $img_thumb_path }}justify-center md:justify-start{{ end }}">
96-
<a href="{{ $featured_event.RelPermalink }}" class="btn btn-sm btn-outline-primary">Details & Video</a>
96+
<a href="{{ $featured_event.RelPermalink }}" class="btn btn-sm btn-outline-primary">Details</a>
9797
<a href="{{ $view_all_link | relLangURL }}" class="btn btn-sm btn-new-primary">{{ $view_all_text }}</a>
9898
</div>
9999
{{/* END MODIFIED BUTTONS AREA */}}

layouts/partials/student-talks-sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h3 class="pb-5 pt-5 text-xl">Upcoming Student Talks</h3>
1919
{{ end }}
2020
<div class="flex items-center mt-1">
2121
{{ partial "icon.html" (dict "style" "regular" "name" "calendar" "class" "mr-2") }}
22-
<span>{{ dateFormat "Jan 2, 2006" .Date }}</span>
22+
<span>{{ .Date.Format "January 2, 2006" }}</span>
2323
</div>
2424
<div class="flex items-center mt-1">
2525
{{ partial "icon.html" (dict "style" "regular" "name" "clock" "class" "mr-2") }}

layouts/partials/workshops-sidebar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ <h3 class="pb-5 pt-5 text-xl">Upcoming Workshops</h3>
1919
{{ end }}
2020
<div class="flex items-center mt-1">
2121
{{ partial "icon.html" (dict "style" "regular" "name" "calendar" "class" "mr-2") }}
22-
<span>{{ dateFormat "Jan 2, 2006" .Date }}</span>
22+
<span>{{ .Date.Format "January 2, 2006" }}</span>
2323
</div>
2424
<div class="flex items-center mt-1">
2525
{{ partial "icon.html" (dict "style" "regular" "name" "clock" "class" "mr-2") }}

0 commit comments

Comments
 (0)