Redefining unique Ids for the Tiddlers.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2022-03-08 17:49:15 -05:00
parent c1568365f3
commit 251f5d3426

View File

@ -155,7 +155,7 @@ Tiddler >> exportSTONFileInto: subfolder [
| stonFile output dashedTitle sanitized date |
dashedTitle := '-' join: (self title substrings collect: [ :each | each ]).
sanitized := dashedTitle copyWithoutAll: #($¿ $? $! $/).
date := self created hash hex copyFrom: 1 to: 5.
date := self uid.
stonFile := self wiki file parent / subfolder / (sanitized, '--', date, '.ston').
^ MarkupFile exportAsFileOn: stonFile containing: self asStonStringPretty
]
@ -457,6 +457,17 @@ Tiddler >> type: anObject [
type := anObject
]
{ #category : #accessing }
Tiddler >> uid [
| tempId |
self created
ifNotNil: [ tempId := self created hash hex copyFrom: 1 to: 5. ]
ifNil: [ tempId := self class nowLocal hash hex copyFrom: 1 to: 5 ].
self customFields at: 'uid' put: tempId .
^ tempId
]
{ #category : #accessing }
Tiddler >> wiki [
^ wiki