Insert Custom File Type into BSS

Hi, I wanted to ask if there is a trick I can do to include a custom file in bss? For example, I want to add *.md or other formatted files to my working directory. Currently I have to manually serve the directory containing the md file to get the url path I can use in the js script. Unfortunately with this method when I do a web publication with the domain *.bss.design *.md files are not published with the website.

It would be very helpful if there was some sort of feature that would allow custom files like the one above to be included directly.

Thanks.

Unfortunately there is no way to do this. This is intentional, we don’t want users to store arbitrary data in the bsdesign file, both for performance and security. Additionally, publishing unrestricted file types on our built-in hosting would also open up a lot of potential issues that we’d prefer not to have to deal with. We’d like to keep our hosting simple, this is the only way we can offer it long term for free.

All this shouldn’t be a problem since you can publish via SFTP to any host and get full access to modify files with FileZilla.

1 Like

There is a workaround, put your markdowns in json files and fetch them as text. It’s maybe not a proper way to have the markdown code in a json file, but it works.
Here is an example

BTW don’t try to fetch it as json that will give you an error

I know it’s bad idea to embed any file, but sometimes it’s needed. I can understand the reason.

Btw, publishing via sftp also not include external file by default, always need to do it manually. Currently i serve local dir directly so i can monitor any change in BSS by export it, but yeah i have to do export more instead of live preview.

That’s good idea, for developing mode, sometime i did that :"D
Just need to improve the idea, like writing some script to rename the json file to md and do some trick in js that read the path/file name.

@raniaamina

If you have your own server there is no problem. Upload your .md files to your server and fetch them from there. The example show a workaround if you don’t have access to another server

Yeps, i did.
Now i set some lines of js to handle it;

  • if it run on localhost i need to serve the directory of md spearately and use that local url
  • if it run not in localhost, the script will set where direcotory of md placed