Added <script> tag support to customJS

Added a "readmore" class to the read more links to enable finegrained css
This commit is contained in:
Ahmed Alsuwaidi 2022-02-27 13:10:25 +04:00 committed by Athul Cyriac Ajay
parent 57ff9c6ee9
commit 5fbc45536a
2 changed files with 3 additions and 1 deletions

View File

@ -24,7 +24,7 @@
{{ .Summary }}&hellip; {{ .Summary }}&hellip;
{{ end }} {{ end }}
</div> </div>
<a href="{{ .RelPermalink }}">Read more ⟶</a> <a class="readmore" href="{{ .RelPermalink }}">Read more ⟶</a>
</section> </section>
{{ end }} {{ end }}
{{ template "partials/paginator.html" . }} {{ template "partials/paginator.html" . }}

View File

@ -54,6 +54,8 @@
{{- range .Site.Params.customJS }} {{- range .Site.Params.customJS }}
{{- if or (hasPrefix . "http://") (hasPrefix . "https://") }} {{- if or (hasPrefix . "http://") (hasPrefix . "https://") }}
<script src="{{ . }}"></script> <script src="{{ . }}"></script>
{{- else if (hasPrefix . "<script")}}
{{ .| safeHTML }}
{{- else }} {{- else }}
<script src="{{ $.Site.BaseURL }}{{ . }}"></script> <script src="{{ $.Site.BaseURL }}{{ . }}"></script>
{{- end }} {{- end }}