aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-08-18 00:35:48 -0400
committertdro <tdro@noreply.example.com>2022-08-18 00:35:48 -0400
commit8c40a54bbad00edc2025599f9ba5874953323a13 (patch)
tree3e2900aaeb4c40130acbfcbb67a620ead4167f6f /themes/default/layouts/_default
parent6a713aa0732366447cd8ee051b17bca24712ae65 (diff)
downloadcanory-8c40a54bbad00edc2025599f9ba5874953323a13.tar.gz
canory-8c40a54bbad00edc2025599f9ba5874953323a13.tar.bz2
canory-8c40a54bbad00edc2025599f9ba5874953323a13.zip
themes/default/layouts/_default/summary: Truncate over limit
Diffstat (limited to 'themes/default/layouts/_default')
-rw-r--r--themes/default/layouts/_default/summary.html15
1 files changed, 14 insertions, 1 deletions
diff --git a/themes/default/layouts/_default/summary.html b/themes/default/layouts/_default/summary.html
index 4e9d93d..fb7a829 100644
--- a/themes/default/layouts/_default/summary.html
+++ b/themes/default/layouts/_default/summary.html
@@ -1,4 +1,17 @@
-<micro-card {{ if .Weight }}pinned{{ end }} id="{{ partial "card-id.html" . }}">
+{{- $limit := gt .WordCount 75 -}}
+{{- if $limit -}}<input hidden type="checkbox" id="expand-{{ partial "card-id.html" . }}" />{{- end -}}
+<micro-card
+ id="{{ partial "card-id.html" . }}"
+ {{ if .Weight }}pinned{{ end }}
+ {{- if $limit }}limit{{ end }}
+>
+ {{ if $limit }}
+ <micro-overlay>
+ <micro-expand>
+ <label for="expand-{{ partial "card-id.html" . }}">Click to Expand</label>
+ </micro-expand>
+ </micro-overlay>
+ {{ end }}
{{ if .ExpiryDate }}<micro-expires>{{ end }}
<micro-summary {{ if .Draft }}draft{{ end }} title="{{- partial "meta-title.html" . -}}">
<micro-thumbnail>