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;
{{ end }}
</div>
<a href="{{ .RelPermalink }}">Read more ⟶</a>
<a class="readmore" href="{{ .RelPermalink }}">Read more ⟶</a>
</section>
{{ end }}
{{ template "partials/paginator.html" . }}

View file

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