I have a static site which just consists of html+js+css+images without any external dependencies. It's a lot of HTML pages in separate folders with links back and forth. It's a site compiled to static content with Jekyll.
I can drop it into any webserver or even Dropbox to view the site and everything works. Now I should integrate it to Liferay and I'm a little baffled on how to support a static site within in portal. I would have thought it to be a simple drop-into-place-and-use, but alas, there doesn't seem to be that option.
The only option I've found is something that I really don't like. I deploy the site somewhere else (dropbox for now) and have a generic portlet in Liferay. That portlet does this:
- Take the relative url of Liferay to see which page in the static site the user tries to access.
- Build an url to the dropbox-deployed site based on the base url + relative url
- Download the whole html for the actually deployed site
- Rewrite with regexp all the urls in the deployed site to point to the Liferay portal
- Grab the
<body>
of the static page and give it as a response in the portlet as it's own content.
This works somehow but it is ugly and causes a lot of issues with not being able to load <head>
, loading additional resources like images, rewriting the urls correctly etc. etc.
I'm wondering if this is really the best course of action and I got no other options. Ideally I would just want to drop the set of files into the Liferay installation and be able to access them directly with an url like www.myliferay.com/mysite/somepage.html.
What I need from the portlet is to have it's own header and footer around my static content.