Arlen22 / TiddlyServer

v2 - A static file server that can also save files and mount TiddlyWiki folders
https://arlen22.github.io/tiddlyserver/
MIT License
257 stars 36 forks source link

Reference to localhost images #79

Open ghost opened 4 years ago

ghost commented 4 years ago

With markdown plugin installed, I do not access to images. I have one tiddlers with:

Això és una *prova*
![prova](adjudicacions-interins-19-20-1.png)
![prova](/adjudicacions-interins-19-20-1.png)

I put file `adjudicacions-interins-19-20-1.png) in ./ running tiddlyserver and in my tiddlers directory:

$ ls personal/prova/
adjudicacions-interins-19-20-1.png  tiddlers  tiddlywiki.info
[xan@argonia tiddlyserver]$ ls personal/prova/tiddl
ls: no s’ha pogut accedir a 'personal/prova/tiddl': El fitxer o directori no existeix
[xan@argonia tiddlyserver]$ ls personal/prova/tiddlers/
'$__config_DefaultMoreSidebarTab.tid'                                  '$__StoryList.tid'
'$__config_PageControlButtons_Visibility_$__core_ui_Buttons_home.tid'  '$__themes_tiddlywiki_vanilla_options_sidebarlayout.tid'
'$__config_Tiddlers_TitleLinks.tid'                                    '$__themes_tiddlywiki_vanilla_settings_codefontfamily.tid'
'$__config_Toolbar_ButtonClass.tid'                                    '$__themes_tiddlywiki_vanilla_settings_editorfontfamily.tid'
'$__DefaultTiddlers.tid'                                               '$__themes_tiddlywiki_vanilla_settings_fontfamily.tid'
'$__languages_ca-ES.json'                                               adjudicacions-interins-19-20-1.png
'$__languages_ca-ES.json.meta'                                         "Draft of 'Inici'.md"
'$__language.tid'                                                      "Draft of 'Inici'.md.meta"
'$__plugins_tiddlywiki_markdown.json'                                   Inici.md
'$__plugins_tiddlywiki_markdown.json.meta'                              Inici.md.meta
'$__StoryList_1.tid'

My config is:

$ cat TiddlyServer-2.1.5/settings.json 
{
    "tree": "../personal",
    "bindInfo": {"bindAddress": ["127.0.0.1"]},
    "putsaver": {"backupFolder": "../backups"},
    "$schema": "./settings-2-1.schema.json"
}
ghost commented 4 years ago

You have to put images with absolute path in personal folder: ![prova](/adjudicacions-interins-19-20-1.png) this works after putting file in personal folder

Arlen22 commented 4 years ago

You can use relative paths as you like, but TiddlyServer will not serve files INSIDE a data folder. All requests to a data folder are handled by the TiddlyWiki --listen command, so anything inside it would need to be configured within the TiddlyWiki data folder instance, if that makes sense.

ghost commented 4 years ago

You can use relative paths as you like, but TiddlyServer will not serve files INSIDE a data folder. All requests to a data folder are handled by the TiddlyWiki --listen command, so anything inside it would need to be configured within the TiddlyWiki data folder instance, if that makes sense.

How can I configure it?

Arlen22 commented 4 years ago

How can I configure it?

Data folders work mostly the same whether loaded with TiddlyServer or the TiddlyWiki listen command. So data folder customization questions are much better directed to the tiddlywiki Google Group. However, the recommended way is to either store the files outside the folder (the static file server way), or store them in the files directory in the data folder (beside the tiddlers directory) and then access them at /datafolder/files/whatever.png (the TiddlyWiki way).