From b4586a52d87897aa0470e2d6a3ef92cc5406cf74 Mon Sep 17 00:00:00 2001 From: JP Hastings-Spital Date: Tue, 16 Jul 2024 23:25:15 +0100 Subject: [PATCH] Don't create shortlinks for non-regular pages --- layouts/partials/shortlink.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/shortlink.txt b/layouts/partials/shortlink.txt index 4c007a8a..af6664a1 100644 --- a/layouts/partials/shortlink.txt +++ b/layouts/partials/shortlink.txt @@ -2,7 +2,7 @@ {{- $chars := split "123456789bcdfghjkmnpqrstuvwxyz" "" -}}{{/* Omit vowels and confusing characters to prevent accidental spelling of words */}} {{- $base := len $chars -}} {{- $size := 8 -}}{{/* 8 chars with 30 possibilities means 0.0091% chance of collision with 10k posts; I currently have 3,213 */}} -{{- if and (not $shortlink) true -}}{{/* .IsPage Don't make dynamic shortlinks for list taxonomy/list/non-regular pages */}} +{{- if and (not $shortlink) .IsPage -}}{{/* Don't make dynamic shortlinks for list taxonomy/list/non-regular pages */}} {{- $hex := .RelPermalink | crypto.MD5 -}} {{- $idx := 0 -}}