From bc0cbf907063ccd484da7d56c8e42cf5e90489b8 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 5 Nov 2015 12:31:34 +0000 Subject: [PATCH] Add a lazy loading template for all non-system tiddlers With this new template you can run TiddlyWiki under Node.js such that all non-system tiddlers are lazily loaded, and not baked into the HTML file. --- core/templates/save-lazy-all.tid | 6 ++++++ editions/tw5.com/tiddlers/features/LazyLoading.tid | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 core/templates/save-lazy-all.tid diff --git a/core/templates/save-lazy-all.tid b/core/templates/save-lazy-all.tid new file mode 100644 index 000000000..5f9220e19 --- /dev/null +++ b/core/templates/save-lazy-all.tid @@ -0,0 +1,6 @@ +title: $:/core/save/lazy-all + +\define saveTiddlerFilter() +[is[system]] -[prefix[$:/state/popup/]] -[[$:/HistoryList]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] +\end +{{$:/core/templates/tiddlywiki5.html}} diff --git a/editions/tw5.com/tiddlers/features/LazyLoading.tid b/editions/tw5.com/tiddlers/features/LazyLoading.tid index 542b94918..c408f98ea 100644 --- a/editions/tw5.com/tiddlers/features/LazyLoading.tid +++ b/editions/tw5.com/tiddlers/features/LazyLoading.tid @@ -1,5 +1,5 @@ created: 20140206214608586 -modified: 20140912141710950 +modified: 20151105122712982 tags: Features title: LazyLoading type: text/vnd.tiddlywiki @@ -8,14 +8,22 @@ Ordinarily with TiddlyWiki, the full content of all tiddlers is embedded into th Lazy loading can be used in two configurations: -* When running [[TiddlyWiki on Node.js]], image tiddlers can be subject to lazy loading +* When running [[TiddlyWiki on Node.js]], just image tiddlers or all non-system tiddlers can be subject to lazy loading * When running [[TiddlyWiki in the Sky for TiddlyWeb]], all tiddlers are subject to lazy loading See the LazyLoadingMechanism for details of how lazy loading is implemented. ! Lazy loading under Node.js -To run TiddlyWiki with lazy loading for images, use this alternative ServerCommand to start the server: +To start TiddlyWiki with lazy loading for image tiddlers use this command: + + +``` +tiddlywiki --server 8080 $:/core/save/lazy-images +``` + +To apply lazy loading to all non-system tiddlers use this command: + ``` tiddlywiki --server 8080 $:/core/save/lazy-images