diff --git a/repository/TiddlyWiki/TiddlyWiki.class.st b/repository/TiddlyWiki/TiddlyWiki.class.st index ba13817..edab059 100644 --- a/repository/TiddlyWiki/TiddlyWiki.class.st +++ b/repository/TiddlyWiki/TiddlyWiki.class.st @@ -440,6 +440,13 @@ TiddlyWiki >> getRemoteTiddlers [ ^ self recentCommonTiddlersChanged ] +{ #category : #accessing } +TiddlyWiki >> hasTemplateInTiddlyHost [ + + self template ifNil: [ ^ false ]. + ^ self template asZnUrl host endsWith: 'tiddlyhost.com' +] + { #category : #accessing } TiddlyWiki >> htmlFileExists [ self file ifNil: [ @@ -802,11 +809,29 @@ TiddlyWiki >> taggedWith: aTag [ ] ] +{ #category : #accessing } +TiddlyWiki >> template [ + ^ template +] + { #category : #accessing } TiddlyWiki >> template: anUrl [ template := anUrl ] +{ #category : #accessing } +TiddlyWiki >> templateTiddlersContentsString [ + self hasTemplateInTiddlyHost ifFalse: [ ^ self ]. + ^ (self template asString, '/tiddlers.json') asZnUrl retrieveContents. +] + +{ #category : #accessing } +TiddlyWiki >> templateWiki [ + ^ (TiddlyWiki new fromString: self templateTiddlersContentsString) + name: 'Template Wiki'; + remote: self template +] + { #category : #accessing } TiddlyWiki >> tiddlers [ tiddlers ifNotNil: [ ^ tiddlers ].