fix(translation_list): wrap translation label in a span for better styling

fix(post_meta): add span tags for reading time, word count, and author metadata
fix(edit_post): wrap edit link in a span for consistent styling
This commit is contained in:
Aditya Telange
2025-09-27 00:04:33 +05:30
parent dfe2f63b61
commit ac64b01989
3 changed files with 10 additions and 8 deletions

View File

@@ -2,7 +2,9 @@
{{- $fileUrlPath := path.Join .File.Path }} {{- $fileUrlPath := path.Join .File.Path }}
{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }} | {{- end -}} {{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) .IsTranslated }} | {{- end -}}
<span>
<a href="{{ .Params.editPost.URL | default site.Params.editPost.URL }}{{ if .Params.editPost.appendFilePath | default ( site.Params.editPost.appendFilePath | default false ) }}/{{ $fileUrlPath }}{{ end }}" rel="noopener noreferrer edit" target="_blank"> <a href="{{ .Params.editPost.URL | default site.Params.editPost.URL }}{{ if .Params.editPost.appendFilePath | default ( site.Params.editPost.appendFilePath | default false ) }}/{{ $fileUrlPath }}{{ end }}" rel="noopener noreferrer edit" target="_blank">
{{- .Params.editPost.Text | default (site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}} {{- .Params.editPost.Text | default (site.Params.editPost.Text | default (i18n "edit_post" | default "Edit")) -}}
</a> </a>
</span>
{{- end }} {{- end }}

View File

@@ -5,16 +5,16 @@
{{- end }} {{- end }}
{{- if (.Param "ShowReadingTime") -}} {{- if (.Param "ShowReadingTime") -}}
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }} {{- $scratch.Add "meta" (slice (printf "<span>%s</span>" (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime)))) }}
{{- end }} {{- end }}
{{- if (.Param "ShowWordCount") -}} {{- if (.Param "ShowWordCount") -}}
{{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }} {{- $scratch.Add "meta" (slice (printf "<span>%s</span>" (i18n "words" .WordCount | default (printf "%d words" .WordCount)))) }}
{{- end }} {{- end }}
{{- if not (.Param "hideAuthor") -}} {{- if not (.Param "hideAuthor") -}}
{{- with (partial "author.html" .) }} {{- with (partial "author.html" .) }}
{{- $scratch.Add "meta" (slice .) }} {{- $scratch.Add "meta" (slice (printf "<span>%s</span>" .)) }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@@ -1,8 +1,8 @@
{{- if .IsTranslated -}} {{- if .IsTranslated -}}
{{- if (ne .Layout "search") }} {{- if (ne .Layout "search") }}
{{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }}&nbsp;|&nbsp;{{- end -}} {{- if or .Params.author site.Params.author (.Param "ShowReadingTime") (not .Date.IsZero) }}&nbsp;|&nbsp;{{- end -}}
{{- end }} {{- end -}}
{{- i18n "translations" | default "Translations" }}: <span>{{- i18n "translations" | default "Translations" }}:</span>
<ul class="i18n_list"> <ul class="i18n_list">
{{- range .Translations }} {{- range .Translations }}
<li> <li>