NanoID as default uid in tiddlers metadata and name.
This commit is contained in:
parent
70ed99691e
commit
3f792e84a7
@ -213,7 +213,7 @@ Tiddler >> fileName [
|
||||
| dashedTitle sanitized |
|
||||
dashedTitle := '-' join: (self title substrings collect: [ :each | each ]).
|
||||
sanitized := dashedTitle copyWithoutAll: #($¿ $? $! $¡ $/).
|
||||
^ sanitized , '--', (self uid copyFrom: 1 to: 5), '.ston'.
|
||||
^ sanitized , '--', (self uid copyFrom: 1 to: 12), '.ston'.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
@ -234,7 +234,7 @@ Tiddler >> fromDictionary: aDictionary [
|
||||
revision: (aDictionary at: 'revision' ifAbsentPut: [ nil ]).
|
||||
customKeys := aDictionary keys
|
||||
copyWithoutAll: (self class instanceVariables collect: [ :each | each name ]).
|
||||
customKeys ifEmpty: [ ^ self ].
|
||||
customKeys ifEmpty: [ self uidGenerator ].
|
||||
customKeys do: [:key | | valueTemp |
|
||||
valueTemp := aDictionary at: key.
|
||||
valueTemp class = Array
|
||||
@ -539,8 +539,7 @@ Tiddler >> uid [
|
||||
{ #category : #accessing }
|
||||
Tiddler >> uidGenerator [
|
||||
|
||||
self created ifNil: [ self created: self class nowLocal ].
|
||||
^ self customFields at: 'uid' put: self createdReversableEncoded.
|
||||
^ self customFields at: 'uid' put: NanoID generate.
|
||||
|
||||
]
|
||||
|
||||
|
@ -155,8 +155,9 @@ TiddlyWiki >> exportCommonTiddlers [
|
||||
|
||||
| content |
|
||||
content := self commonTiddlers.
|
||||
^ content do: [ :each |
|
||||
content do: [ :each |
|
||||
each exportSTONFileOptimized ].
|
||||
^ self tiddlersFolder
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
Loading…
Reference in New Issue
Block a user