Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-09-15 21:23:17

datorhaexa
Member
From: Düsseldorf, Germany
Registered: 2005-05-23
Posts: 115
Website

Export of website to static pages

I did a search on this but didn’t find anything about it. Is there a possibility to export a TXP site to a static one, i.e. edit content on a live install through TXP and then export static html pages?

Thanks for any feedback on that in advance!

Offline

#2 2008-09-15 21:47:41

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Export of website to static pages

What would be the point of that? Your using Txp to edit content from a browser right? Well that content can be viewed as pages within sections just like a static site, why bother creating duplicate html files of your site :S


~ Cameron

Offline

#3 2008-09-15 21:50:08

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Export of website to static pages

wget will do it – just point it at a site map/page with links to your articles.

Page template:

<txp:article_custom form="permlink" limit="99999"/>

Form: permlink

<txp:permlink><txp:title/></txp:permlink>

Offline

#4 2008-09-15 21:50:17

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,729
Website

Re: Export of website to static pages

datorhaexa, not quite sure what your purpose is – perhaps to be able to take the site on an offline-medium?

I’m not aware of a specific function but you could set up your site on a live install, then use one of the many site downloading tools to crawl your site and download the HTML pages. It will depend on your site – if it has lots of dynamically generated pages, some aspects won’t work though as the crawler won’t test every page. If it is mostly a fairly static site, you’ll have more luck.

If you want to be able to take your site on an offline medium, why not install a local webserver (see the textbook and there are other lightweight open-source packages). There are several free ones, some even as a portable version that you can run from a stick.


TXP Builders – finely-crafted code, design and txp

Offline

#5 2008-09-15 21:51:45

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: Export of website to static pages

I’ve not tried it in a similar situation, but maybe httrack can be useful.
edit: ouch! a lot of people was faster than me!

Last edited by redbot (2008-09-15 22:00:33)

Offline

#6 2008-09-15 21:54:21

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Export of website to static pages

@datorhaexa

Not sure about what are you trying to achieve.
A way to go is by visiting a particular webpage using your browser and then saving it.
Do you want to server your site as static .html files for getting a better performance? Not sure if you will really get a better, noticeable performance on serving a page using static .html files. Probably, using a plugin for caching TxP generated pages will improve your site performance, if that is what you are looking for.
There are also some tools (can anyone point one of them?) that let you “download” a whole site to your computer.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#7 2008-09-15 21:55:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Export of website to static pages

Don’t know if this is what you mean, but there is HTTrack.

Edit: oops, late again :)

Last edited by els (2008-09-15 21:56:20)

Offline

#8 2008-09-15 22:07:29

datorhaexa
Member
From: Düsseldorf, Germany
Registered: 2005-05-23
Posts: 115
Website

Re: Export of website to static pages

First, thanks for the fast reply to all!

I think I like jm’s Idea the most. I know that what I ask sounds weird :) We have a customer who might put us in a situation where we have no PHP/MySQL on a server. The site will be small and rarely updated, but since I am used to TXP and would like to spare me the trouble of doing changes to static html pages, this was one option we thought of trying. If we could do all changes on a local server and then press the button and get all out with relative paths this will be great. I will give that site map method a whirl.

Oh, and btw, I was reading on HTTrack. Never tried that before. Might be interesting though from what I read, it has its quirks.

Offline

#9 2008-09-16 20:02:23

datorhaexa
Member
From: Düsseldorf, Germany
Registered: 2005-05-23
Posts: 115
Website

Re: Export of website to static pages

Tested both suggested methods, and here the summary, just in case it may be useful for somebody.
JM’s method works lovely (one of the reasons I like TXP so much is such ingenious solutions) but because of the limitations of the current wget version it does not follow links in CSS (like image backgounds or imported other CSS files) and ignores javascript produced content. If one does not have any of that, this is a good solution.
For the rest comes HTTrack, indeed, which not only got all linked css images, js, rewrote paths, etc. but also was smart enough to figure out a redirect from a section to an article.

Thanks again for your help, guys!

Last edited by datorhaexa (2008-09-16 20:04:23)

Offline

#10 2008-09-16 22:22:03

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Export of website to static pages

Thanks for letting us know your findings!

Offline

Board footer

Powered by FluxBB