Creating short titles, when titles are too long.
This commit is contained in:
parent
8fe49106bb
commit
fa6303b762
@ -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)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user