From fa6303b762413f679cfa37eadf34b0aae3733a60 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Wed, 25 Sep 2024 17:17:34 -0500 Subject: [PATCH] Creating short titles, when titles are too long. --- src/MiniDocs/LePage.extension.st | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/MiniDocs/LePage.extension.st b/src/MiniDocs/LePage.extension.st index 0703592..ac0d9c6 100644 --- a/src/MiniDocs/LePage.extension.st +++ b/src/MiniDocs/LePage.extension.st @@ -124,8 +124,15 @@ LePage >> exportMetadataToHead: markdeep [ { #category : #'*MiniDocs' } LePage >> exportedFileName [ - | sanitized | - sanitized := self title asDashedLowercase romanizeAccents copyWithoutAll: #($/ $: $🢒). + | sanitized titleWords shortTitle | + titleWords := self title splitOn: Character space. + (titleWords size > 11) + ifTrue: [ + titleWords := titleWords copyFrom: 1 to: 3. + shortTitle := titleWords joinUsing: Character space. + ] + ifFalse: [shortTitle := self title]. + sanitized := shortTitle asDashedLowercase romanizeAccents copyWithoutAll: #($/ $: $🢒 $,). ^ sanitized , '--' , (self uidString copyFrom: 1 to: 5) ]