Creating short titles, when titles are too long.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-09-25 17:17:34 -05:00
parent 8fe49106bb
commit fa6303b762

View File

@ -124,8 +124,15 @@ LePage >> exportMetadataToHead: markdeep [
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
LePage >> exportedFileName [ LePage >> exportedFileName [
| sanitized | | sanitized titleWords shortTitle |
sanitized := self title asDashedLowercase romanizeAccents copyWithoutAll: #($/ $: $🢒). 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) ^ sanitized , '--' , (self uidString copyFrom: 1 to: 5)
] ]