External-js file naming adjusted. import docs form tw5.com. make extrnal-js more visible (#7361)

* external-js file naming adjusted. import docs form tw5.com. make external-js more visible

* add comment about doc usage in server-external-js edition

* add changes suggested by cdruan

* change modifed date to start vercel rebuild process
This commit is contained in:
Mario Pietsch 2023-05-06 12:37:05 +02:00 committed by GitHub
parent a1b706a945
commit b61aef27d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 30 additions and 5 deletions

View File

@ -5,7 +5,10 @@ title: $:/core/save/all-external-js
\define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$
\end
<!-- Important: core library is provided by serving URI encoded $:/core/templates/tiddlywiki5.js -->
\define defaultCoreURL() %24%3A%2Fcore%2Ftemplates%2Ftiddlywiki5.js
<$let coreURL={{{ [[coreURL]is[variable]then<coreURL>else<defaultCoreURL>] }}}>
{{$:/core/templates/tiddlywiki5-external-js.html}}
</$let>

View File

@ -0,0 +1,7 @@
created: 20230314153132081
modified: 20230314153243008
title: $:/DefaultTiddlers
type: text/vnd.tiddlywiki
GettingStarted
[[Using the external JavaScript template]]

View File

@ -0,0 +1,4 @@
title: $:/config/SaveWikiButton/Filename
type: text/vnd.tiddlywiki
external-<<version>>.html

View File

@ -0,0 +1,8 @@
{
"tiddlers": [
{
"file": "../../../tw5.com/tiddlers/webserver/Using the external JavaScript template.tid",
"isTiddlerFile": true
}
]
}

View File

@ -2,8 +2,7 @@
"description": "Client-server edition with external tiddlywiki.js",
"plugins": [
"tiddlywiki/tiddlyweb",
"tiddlywiki/filesystem",
"tiddlywiki/highlight"
"tiddlywiki/filesystem"
],
"themes": [
"tiddlywiki/vanilla",
@ -13,7 +12,7 @@
"listen": [
"--listen","root-tiddler=$:/core/save/all-external-js","use-browser-cache=yes"],
"index": [
"--render","$:/core/save/offline-external-js","index.html","text/plain",
"--render","$:/core/save/offline-external-js","[[external-]addsuffix<version>addsuffix[.html]]","text/plain",
"--render","$:/core/templates/tiddlywiki5.js","[[tiddlywikicore-]addsuffix<version>addsuffix[.js]]","text/plain"],
"static": [
"--render","$:/core/templates/static.template.html","static.html","text/plain",

View File

@ -1,9 +1,13 @@
created: 20180905075846391
modified: 20221207112242775
modified: 20230319130830880
tags: [[WebServer Guides]]
title: Using the external JavaScript template
type: text/vnd.tiddlywiki
<!--
This tiddler is also included in the "server-external-js" edition. Take care before editing or moving it.
-->
You can use a special template to externalise ~TiddlyWiki's core code into a separate file. This configuration allows the browser to cache the core for improved efficiency.
! Background
@ -60,7 +64,7 @@ The "server-external-js" edition lets you save the snapshot from the command lin
tiddlywiki YOUR_WIKI_FOLDER --build index
```
The files `index.html` and `tiddlywikicore-5.x.x.js` will be saved in your wiki folder's `output` directory.
The files `external-5-x-x.html` and `tiddlywikicore-5.x.x.js` will be saved in your wiki folder's `output` directory.
!! Obtaining the ~TiddlyWiki core in the browser