Reputation: 4686
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:
<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.
Upvotes: 1
Views: 1850
Reputation: 1664
Copy your page directory directly to webapp directory on web server. Create portlet with index.jsp. Inside this jsp file add iframe tag with src="/your_page_directory/index.html"
and add around header and footer content.
I think it is also possible to keep static content in portlet project and only difference is in src path, e.g. src="/portlet_context/your_page_directory/index.html"
Upvotes: 1