Open ohare93 opened 4 years ago
Good work, you've definitely gotten things figured out. I'm sorry that it is sometimes hard to figure out. I don't always know how to explain things clearly.
You have two folders, images and personal. You also added another data folder called test. The button appeared because you also added the mkdir permission when you added the datafolder permission. The datafolder permission is enabled by default and actually sets whether the user is allowed to access data folders on the server (because they can easily gain access to the file system by creating a server startup module and reloading the wiki). You can find more info on these permissions here: https://arlen22.github.io/tiddlyserver/docs/serverconfig.html#localaddresspermissions-hashmap
If you have files in your images folder you can refer to them in any valid URL format. So /images/Lakes.jpg
or ../images/Lakes.jpg
.
Though some more trial and error I have found that simply placing an image into Test/Tiddlers/ allows me to reference and see it inside the Test wiki. Though it has the full path, for some reason. And I cannot reference these inside my Personal wiki.
This is because it is loaded from the file system as a tiddler (because it is in the tiddlers folder), and the file path is the default title if there is no meta file next to it. If you want files to remain inside the data folder, you should create a files folder beside the tiddlers folder in the data folder and store files in there. Then you access them via /Personal/files/Lakes.png
.
https://tiddlywiki.com/#Using%20the%20integrated%20static%20file%20server
TiddlyServer never serves files inside a data folder. All requests that fall under a datafolder are handed off to that datafolder so they act identical to the Node TiddlyWiki server including any plugins which apply to that data folder.
tiddlywiki --listen
command, here is a tiddler which explains it all: https://tiddlywiki.com/#WebServerOptional parameters may be set on a datafolder property at the top level of the config file (not to be confused with datafolder boolean property on the permissions object). In most cases, however, the defaults work fine. Individual datafolder authentication is disabled in favor of the cookie based login that TiddlyServer provides through authAccounts
.
{
"tree": [],
"authAccounts": {},
"datafolder": {}
}
Ahh I've gotten it to work by referencing it as an External file with [img[../Images/black_knives.png]]
! I was trying permeations of {{Images/Lakes.png}}
:sweat_smile: Thank you very much! :+1:
However this shows I still do not seem to understand something about this structure :thinking: So I can reference any file in my Test folder above simply because I have added that to the Tree in the config. Then what exactly is a "data folder"? Why would I want to create one? The name implies (to me) that is a folder where data can be stored and referenced. Is that wrong?
Test is another data folder, like Personal. Yes, it is an external file because it is not a tiddler, which is what you stated you wanted at the beginning (because lazy load wasn't working well). I prefer external files for most things as well. But everything is either a tiddler or an external file.
You could lookup _canonical_uri
. It might let you transclude an external file.
Sorry for the late reply!
Thanks for the help, I have found TiddlyServer to be very useful 👍 a few quick questions though:
Thanks for your work, mate.
Hello, I was drawn to TiddlyServer as a way to get my TiddlyWiki instance loading smoother by separating out the images and media files. Using the default Lazy Load was giving terrible load times for the images, so I hoped TiddlyServer could be the answer.
Going over the documentation it is very unclear:
None of the documentation actually says what to do in regards to data files. I only worked out what the features of a data folder was from your comments here, and I only gathered that I need to enable them in the config from your comments on #94. Though I am still lost as to what their intention is or what I should do to reference the files in them, or how to upload a file to an actual data folder.
So what I wanted to achieve in the beginning is to run my normal server TiddlyWiki (called "Personal") inside TiddlyServer, while having a place to put the images separately which can still be seen/used in my Personal wiki. Though a lot of googling and trial and error I have the following:
My Personal Wiki (which works fine) and an Images folder.
Inside that Images folder is a bunch of images I was using to test, however I could not reference them. Then after finding the ability to enable the datafolder in bindInfo/localAddressPermissions from one of your comments I got the button "Data Folder" below, which presumable creates a data folder. So I made one called "Test"
But this "data folder" is just a TiddlyWiki...? When I open it there is a blank TiddlyWiki. Am I supposed to upload images to this "data folder" via the normal TiddlyWiki drag/drop? Will this allow me to reference those images inside my Personal wiki?
Though some more trial and error I have found that simply placing an image into Test/Tiddlers/ allows me to reference and see it inside the Test wiki. Though it has the full path, for some reason. And I cannot reference these inside my Personal wiki.
Summary
So, how can I achieve my goal of linking to images from my Personal file? Have I missed something? Thanks