liva-hugo
liva-hugo copied to clipboard
Refactor scripts in footer.html partial
The current cookie banner code has some issues such that the code formatters flag it as incorrect code. It is because it doesn't follow the correct coding guidelines.
The cookie banner script lies in layouts/partials/footer.html
The line which assigns the cookie expiry date is as:
expires: {{ site.Params.cookies.expire_days }}
This assignment causes the code formatters to go berserk.
The correct assignment would be:
expires: Number('{{ .Site.Params.cookies.expire_days }}')
Same goes for the script in the same file where the index URL is assigned as:
var indexURL = {{ "index.json" | absURL }}
The correct way would be:
var indexURL = '{{ "index.json" | absURL }}'