Skip to content

Commit

Permalink
feat: add config option to disable title capitalization (#408)
Browse files Browse the repository at this point in the history
* feat: add config option to disable title casing on the single.html
* feat: disable title capitalisation on archive page

Co-authored-by: Alexander Bilz <mail@alexbilz.com>
  • Loading branch information
ericswpark and lxndrblz authored Jul 24, 2024
1 parent d500419 commit 297bcc8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion assets/scss/partials/components/_archive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
&-title {
display: inline-block;
flex: 0.96;
text-transform: uppercase;

@include themed() {
color: t('primary');
Expand Down
4 changes: 4 additions & 0 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
{{ range .Pages }}
<ul class="archive__list">
<li class="archive__list-item">
{{ if (eq .Site.Params.disableArchiveTitleStyling true) }}
<a class="archive__list-title" href="{{ .RelPermalink }}" title="{{ .Title }}">{{ .Title }}</a>
{{ else }}
<a class="archive__list-title" href="{{ .RelPermalink }}" title="{{ .Title }}">{{ upper .Title }}</a>
{{ end }}
<div class="archive__list-date">
{{ if isset .Site.Params "listdateformat" }}
{{ if .Site.Params.localizedDates }}
Expand Down
6 changes: 5 additions & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
</div>
{{ end }}
<div class="post__content">
<h1>{{ title .Title }}</h1>
{{ if (eq .Site.Params.disableTitleCapitalization true) }}
<h1>{{ .Title }}</h1>
{{ else }}
<h1>{{ title .Title }}</h1>
{{ end }}
{{ if or (eq .Type "post") (eq .Type .Site.Params.postSectionName) }}
<ul class="post__meta">
<li class="post__meta-item">
Expand Down

0 comments on commit 297bcc8

Please sign in to comment.