mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-30 11:13:06 +00:00
theme: fix usage of <section> in attachments #88
This commit is contained in:
parent
03205f9f26
commit
6d96713902
2 changed files with 42 additions and 45 deletions
|
@ -1,10 +1,10 @@
|
||||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
{{- $_hugo_config := `{ "version": 1 }` }}
|
||||||
{{ $style := .Get "style" | default "neutral" }}
|
{{- $style := .Get "style" | default "neutral" }}
|
||||||
{{ $title := .Get "title" | default ("Attachments-label" | T) }}
|
{{- $title := .Get "title" | default ("Attachments-label" | T) }}
|
||||||
{{ $sort := .Get "sort" | default "asc" }}
|
{{- $sort := .Get "sort" | default "asc" }}
|
||||||
<section class="attachments {{ $style }}">
|
<div class="attachments {{ $style }}">
|
||||||
<div class="label">{{ $title }}</div>
|
<div class="label">{{ $title }}</div>
|
||||||
<div class="attachments-files">
|
<ul class="attachments-files">
|
||||||
{{- $filesName := "files" }}
|
{{- $filesName := "files" }}
|
||||||
{{- if ne .Page.File.BaseFileName "index" }}
|
{{- if ne .Page.File.BaseFileName "index" }}
|
||||||
{{- $filesName = printf "%s.files" .Page.File.BaseFileName }}
|
{{- $filesName = printf "%s.files" .Page.File.BaseFileName }}
|
||||||
|
@ -25,12 +25,9 @@
|
||||||
{{- $unit = "Megabyte-symbol" }}
|
{{- $unit = "Megabyte-symbol" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $unitsymbol := $unit | T }}
|
{{- $unitsymbol := $unit | T }}
|
||||||
<li>
|
<li><a href="{{ (printf "%s%s/%s" $fileDir $filesName .Name) | relLangURL }}">{{.Name}}</a> ({{$size}} {{$unitsymbol}})</li>
|
||||||
<a href="{{ (printf "%s%s/%s" $fileDir $filesName .Name) | relLangURL }}">{{.Name}}</a>
|
|
||||||
({{$size}} {{$unitsymbol}})
|
|
||||||
</li>
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</div>
|
</ul>
|
||||||
{{- .Inner }}
|
{{- .Inner }}
|
||||||
</section>
|
</div>
|
||||||
|
|
|
@ -507,7 +507,7 @@ div.notices.tip > div.label:first-child:before {
|
||||||
|
|
||||||
/* attachments shortcode */
|
/* attachments shortcode */
|
||||||
|
|
||||||
section.attachments {
|
div.attachments {
|
||||||
border-top-width: 2rem;
|
border-top-width: 2rem;
|
||||||
border-top-style: solid;
|
border-top-style: solid;
|
||||||
color: #505050;
|
color: #505050;
|
||||||
|
@ -519,14 +519,14 @@ section.attachments {
|
||||||
padding-bottom: .1px;
|
padding-bottom: .1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.attachments > div.label {
|
div.attachments > div.label {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
margin-top: -1.75rem;
|
margin-top: -1.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.attachments > div.label:first-child:before {
|
div.attachments > div.label:first-child:before {
|
||||||
font-family: "Font Awesome 5 Free";
|
font-family: "Font Awesome 5 Free";
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
margin-left: -.35rem;
|
margin-left: -.35rem;
|
||||||
|
@ -534,7 +534,7 @@ section.attachments > div.label:first-child:before {
|
||||||
content: "\f0c6";
|
content: "\f0c6";
|
||||||
}
|
}
|
||||||
|
|
||||||
section.attachments .attachments-files {
|
div.attachments .attachments-files {
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
|
@ -542,36 +542,36 @@ section.attachments .attachments-files {
|
||||||
margin-bottom: 0rem;
|
margin-bottom: 0rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.attachments.orange {
|
div.attachments.orange {
|
||||||
border-color: #BF8B44;
|
border-color: #BF8B44;
|
||||||
background-color: #FFF2DB;
|
background-color: #FFF2DB;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.attachments.green {
|
div.attachments.green {
|
||||||
border-color: #5AA55A;
|
border-color: #5AA55A;
|
||||||
background-color: #E6F9E6;
|
background-color: #E6F9E6;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.attachments.red {
|
div.attachments.red {
|
||||||
border-color: #D96A68;
|
border-color: #D96A68;
|
||||||
background-color: #FFEBEB;
|
background-color: #FFEBEB;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.attachments.blue {
|
div.attachments.blue {
|
||||||
border-color: #4897CC;
|
border-color: #4897CC;
|
||||||
background-color: #E9F5FD;
|
background-color: #E9F5FD;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.attachments.grey {
|
div.attachments.grey {
|
||||||
border-color: #505D65;
|
border-color: #505D65;
|
||||||
background-color: #F4F4F4;
|
background-color: #F4F4F4;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.attachments.neutral {
|
div.attachments.neutral {
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
section.attachments.neutral > div.label {
|
div.attachments.neutral > div.label {
|
||||||
color: #505050;
|
color: #505050;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue