I’m in the process of moving my old contents to the new Kirby based site.
However I ran into a problem with trying to include html files in the Kirby site.
There are two purposes I need the html files for:
A few “past versions” of sites that are static html based, so I want to link to them as part of my archive
Code/design example, and one-offs that I would like to show that lives inside their associated page folder
So this solution:
…is not ideal as it forces me to place all of them inside a single folder/parent page, where as I’d like to keep them with the page/entry they are actually associated with for easier management.
Also while I like codepen, I want to keep my content on my site under my control because the recent Twitter debacle shows that you can’t trust anybody long term except yourself. I do not want to give up control of my content to any third party, which is the main reason I have a personal website in the first place.
Is it possible to create a route and associate logic where any request for “.html” file (and if possible “.htm” as well) shows you that page regardless of where in my site it’s located in?
You can also create a ‘static’ folder in the document root (or whatever you want to call it) and put all your html in there.
You can use subfolders under there to keep things tidy. Remember to turn off directory indexes in .htaccess or put a blank index.html file directly into the static folder to stop people browsing around the folder tree.
@jimbobrjames the solution I linked forces you to have a central folder, for example html-examples/ in the example shown. I want to be able to put html files in any folder because it want to have it associated with specific page/entry.
Of course, if that’s the only way this is my backup solution, but I’d rather not.
@texnixe yes I understand the panel upload limitation, I would be uploading them via ftp. However with default Kirby setup when I tried to visit the page I’m shown the default template with the title shown as the filename of the html page and empty page content.
Kirby seems to recognize that there’s a file so it’s not showing me the error page, but it’s not working.
Also another minor annoyance is that I can’t create a relative link to the file.
Let’s say I have a blog entry located at www.mysite.com/blog/example-entry
And in the content I want to link to an html file called static.html located in www.mysite.com/blog/example-entry/static.html (added via ftp).
Linking to in the content via the markdown syntax [static page](static.html) produces a link pointing to www.mysite.com/blog/static.html instead of www.mysite.com/blog/example-entry/static.html.
Well, your page would need a normal text file (to tell Kirby what template to use) and then you should be able to add the html file on top of that. This should prevent the effect you describe.
I did more testing and I see why it was showing the default template.
I named the html file the same as the text file, I think Kirby got confused. When I renamed the html file to a different name I got an error page when I tried to access it directly as expected.
And yes I can confirm I already have a text file, it’s a blog entry and the blog entry itself is showing normally.