From 7967eb3b49e5864f28003c512c29c1cca637148c Mon Sep 17 00:00:00 2001 From: Jez Cope Date: Thu, 5 Aug 2021 12:20:37 +0100 Subject: [PATCH] Fix warning about .BaseFileName on zero object --- layouts/partials/scripts.html | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index c36011a..af23403 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -1,17 +1,19 @@ -{{ $page_id := .File.BaseFileName }} -{{ if .Site.Params.comments.webmention }} - {{ $webmention_js := resources.Get "js/webmention.js" | minify }} - -{{ end }} -{{ with .Site.Params.comments.cactus }} - +{{ if .File }} + {{ $page_id := .File.BaseFileName }} + {{ if .Site.Params.comments.webmention }} + {{ $webmention_js := resources.Get "js/webmention.js" | minify }} + + {{ end }} + {{ with .Site.Params.comments.cactus }} + + {{ end }} {{ end }}