Skip to content

Commit

Permalink
✨ Feat: open more custom blocks (#479)
Browse files Browse the repository at this point in the history
- custom-comment
- custom-post__footer:before
- custom-post__footer:after
  • Loading branch information
Lruihao committed Aug 3, 2024
1 parent 0a50079 commit c0942a9
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 7 deletions.
3 changes: 2 additions & 1 deletion assets/css/_page/_single.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
}

.featured-image {
margin: 0.5rem 0 1rem 0;
margin: 1rem 0;

img {
display: block;
Expand Down Expand Up @@ -131,6 +131,7 @@
}

.content {
margin-block: 1rem;
> h1,
> h2 {
font-size: 1.5em;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/_partials/_single/_collections.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.collection-card {
font-size: 0.875rem;
background-color: darken($global-background-color, 3%);
margin-block: 2rem -1rem;
margin-block: 1rem;
padding: 1rem 1.25rem;
position: relative;
@include border-radius($global-border-radius * 1.5);
Expand Down
1 change: 0 additions & 1 deletion assets/css/_partials/_single/_reward.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.post-reward {
padding: 1rem;
text-align: center;
margin-bottom: -1rem;
@extend .print-d-none;

&:has(.reward-ways:empty) {
Expand Down
9 changes: 9 additions & 0 deletions layouts/partials/custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
{{- define "custom-aside" -}}
{{- end -}}

{{- define "custom-comment" -}}
{{- end -}}

{{- define "custom-footer" -}}
{{- end -}}

Expand All @@ -20,3 +23,9 @@

{{- define "custom-assets" -}}
{{- end -}}

{{- define "custom-post__footer:before" -}}
{{- end -}}

{{- define "custom-post__footer:after" -}}
{{- end -}}
3 changes: 3 additions & 0 deletions layouts/partials/single/comment.html
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@
</noscript>
{{- end -}}
{{- end -}}

{{- /* Custom Comment System */ -}}
{{- block "custom-comment" . }}{{ end -}}
</div>
{{- /* lightgallery for Artalk and Twikoo */ -}}
{{- $params := partial "function/params.html" -}}
Expand Down
1 change: 0 additions & 1 deletion layouts/partials/single/related.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
{{- end -}}
{{- $related := $posts.Related . | first ($params.related.count | default 5) -}}
{{- with $related -}}
<hr class="awesome-hr" />
<h2 id="see-also">{{ T "single.relatedContent" }}</h2>
<ul>
{{- range $i, $p := . -}}
Expand Down
12 changes: 9 additions & 3 deletions layouts/posts/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
{{- /* Collection List */ -}}
{{- partial "single/collection-list.html" . -}}

{{- /* TODO Related Content */ -}}
{{/* {{- partial "single/related.html" . -}} */}}

{{- /* Custom Aside */ -}}
{{- block "custom-aside" . }}{{ end -}}
</aside>
Expand Down Expand Up @@ -194,16 +197,19 @@ <h1 class="single-title animate__animated animate__flipInX">
{{- /* FixIt Decryptor */ -}}
{{- partial "single/fixit-decryptor.html" . -}}

{{- /* Custom block before post footer */ -}}
{{- block "custom-post__footer:before" . }}{{ end -}}

{{- /* Footer */ -}}
{{- partial "single/footer.html" . -}}

{{- /* Reward after Footer */ -}}
{{- /* Reward after post footer */ -}}
{{- if eq $reward.position "after" -}}
{{- partial "single/reward.html" . -}}
{{- end -}}

{{- /* Custom post footer */ -}}
{{- block "custom-post__footer" . }}{{ end -}}
{{- /* Custom block after post footer */ -}}
{{- block "custom-post__footer:after" . }}{{ end -}}

{{- /* Comment */ -}}
{{- partial "single/comment.html" . -}}
Expand Down

0 comments on commit c0942a9

Please sign in to comment.