How to export functional static website

175 views
Skip to first unread message

ILYA Khlopotov

unread,
Nov 28, 2019, 9:36:12 AM11/28/19
to tiddly...@googlegroups.com
Hello, 

I am trying to make an edition which would include a set of plugins and few custom tiddlers. This edition need to be exported as a web site. 
The website should act as read-only tiddlywiki. I.e. search and all included Javascript should continue to work. The exported site should have index.html (which would contain all system tiddlers) and a set of separate html files for non system tiddlers. All tiddlers from separate files need to be accessible from index.html.  
Ideally I want to achieve that via tiddlywiki.info file without extra scripts.
I know it should be possible but I cannot understand how to make it work.
I found few examples but they don't do what I need:
"--rendertiddler","$:/core/save/all","index.html","text/plain"] --- renders everything into a single file -"--rendertiddler","$:/core/templates/static.template.html","static.html","text/plain" --- produces noJS version of wiki I would like to avoid modifying all my tiddlers. I tried exporting using $:/core/save/empty but I don't know how to refer to other tiddlers (exported in html format) in output/static directory. I included the content of tiddlywiki.info in the attachment. 

Any hints or examples of doing something like this?

Best regards,
ILYA

tiddlywiki.info

TonyM

unread,
Nov 28, 2019, 10:18:25 PM11/28/19
to TiddlyWikiDev
ILYA,

Perhaps you could layout what you want to achieve with this. 
I do not think there is an exact solution waiting but depending on your objective it may be easy. 

Some notes that may or may not help
Personally I want to simply publish both static (Seperate HTML files) and dynamic tiddlers (in the index.html) to increase search visibility and allow low overhead views of tiddlers, 
is that what you want?
  • I would like to generate a full single file wiki (index.html with a splash screen) from a tiddlywiki with a separate static version of every content (non system) Tiddler, 
  • however any links there in would point to the actual tiddler(s) in the index.html. 
  • Thus searches will see the content of each rendered tiddler in a static version and link to the real tiddlers, 
  • but on the first interaction the full wiki loads and thus all the javascript interaction can take place.
  • In addition in the interactive wiki provide each tiddler with a button that on clicking opens the static version of that tiddler in a new tab,
I believe the above is achievable with a minor alteration to the appropriate template, and the provision of a view template button to open the static tiddlers separately if desired.

However a full interactive wiki is always the best for users, the splash screen keeps them waiting while it loads and adding a CDN like cloudflare on the front improves performance.

If the reason is your regular tiddlers are images or videos and your wiki is thus too big, perhaps you need to investigate;
Or even using other html methods https://www.w3schools.com/tags/tag_object.asp

Regards
Tony

ILYA

unread,
Nov 29, 2019, 12:50:08 AM11/29/19
to tiddly...@googlegroups.com
Thank you Tony for extended reply.


I got one idea to try. I am thinking about implementing a custom syncadapter. The build script would generate index.json which would be static and served by http server and used by `getSkinnyTiddlers(callback)`. The syncadapter would know how to retrieve index.json and tiddlers html from http server.

Best regards,
ILYA
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

ILYA

unread,
Nov 29, 2019, 1:24:23 AM11/29/19
to tiddly...@googlegroups.com
Also since WebServer API ( https://tiddlywiki.com/#WebServer%20API%3A%20Get%20All%20Tiddlers ) uses http get it should be possible to mimick it with the right folder structure. This should work for my use case (read-only web site). In such case even custom syncadapter is not needed.

Mohamed Sh. Amin

unread,
Dec 9, 2019, 4:30:00 PM12/9/19
to TiddlyWikiDev
Hello ILYA,

Did you manage to get a working solution for your requirement? I tried to use
"--rendertiddler","$:/core/save/all","index.html","text/plain"
and I got also a single HTML file.

What I'm thinking now is:-
1- some working solution with tiddlywiki.info (but after TonyM replay I think there is not a direct solution).
2- use TiddlyServer API.
3- create a script to split the single HTML file to separated files (hope not to go this way)

Regards 

ILYA

unread,
Dec 9, 2019, 7:56:09 PM12/9/19
to tiddly...@googlegroups.com
Hello Mohamed,

Not yet. I am planing to work on it this week.

Best regards,
ILYA

ILYA Khlopotov

unread,
Dec 10, 2019, 9:58:48 PM12/10/19
to tiddly...@googlegroups.com
Hello Mohamed,

> Hello ILYA,
> Did you manage to get a working solution for your requirement? I tried to use
> "--rendertiddler","$:/core/save/all","index.html","text/plain"
> and I got also a single HTML file.

Just wanted to provide an update from my side. I decided to implement custom sync adaptor. My current code is in the attached file.
It works as expected if I have following files in the root directory of a web server

index.html --- built using edition which includes my iilyak/static plugin
tiddlers.json
```
[
  {
	"title": "HelloThere",
	"tags": "FirstTag [[Second Tag]]",
	"fields": {
		"my-custom-field": "Field value"		
	}
  }
]
```
tiddlers/HelloThere
```
{
  "created": "20191128223719980",
  "modified": "20191128223730628",
  "tags": "FirstTag [[Second Tag]]",
  "text": "BlaBla",
  "title": "HelloThere",
  "type": "text/vnd.tiddlywiki",
  "my-custom-field": "Field value"
}
```

In the next couple of days I would be trying to find a way how to generate independent json files and how to generate tiddlers.json

Best regards,
iilyak

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/1253387f-4f3c-4adf-9179-5fd31277cf4d%40googlegroups.com.
$__plugins_iilyak_static.json

Mohammad

unread,
Apr 30, 2020, 4:29:58 AM4/30/20
to TiddlyWikiDev
Hi Ilya,
 This is wonderful solution! I would much appreciate if you kindly instruct how
to use the plugin and what is the relevant tiddlywiki.info 

--Mohammad
To unsubscribe from this group and stop receiving emails from it, send an email to tiddly...@googlegroups.com.

ILYA

unread,
May 1, 2020, 4:45:20 PM5/1/20
to tiddly...@googlegroups.com
Hi Mohammad,

Some docs available on demo site here https://iilyak.github.io/tiddlywiki-splitweb/

The code is here
https://github.com/iilyak/tiddlywiki-splitweb

Unfortunately it doesn't work with latest tw5 since the sync adapter interface has been changed.
I am slowly working on fixing the plugin.

Best regards,
ILYA

Mohammad

unread,
May 6, 2020, 1:01:24 AM5/6/20
to TiddlyWikiDev
Many thanks ILYA and sorry for this late reply!


On Saturday, May 2, 2020 at 1:15:20 AM UTC+4:30, ILYA wrote:
Hi Mohammad,

Some docs available on demo site here https://iilyak.github.io/tiddlywiki-splitweb/

The code is here
https://github.com/iilyak/tiddlywiki-splitweb

I got the code and doc! 


Unfortunately it doesn't work with latest tw5 since the sync adapter interface has been changed.
I am slowly working on fixing the plugin.

Wonderful! 

Best regards,
ILYA


Cheers
Mohammad
Reply all
Reply to author
Forward
0 new messages