tags:

views:

141

answers:

8

Hello,

I've to create a static web site, only .html files.

Each page will have the same layout.

I need a kind of template engine or a tool to generate about 200pages with minimal efforts...

only the body of the page will be different

Any ideas?

Thanks

+3  A: 

maybe server side includes?

http://en.wikipedia.org/wiki/Server_Side_Includes

if the data really comes from a powerpoint file than just save it as html ;-)

nWorx
How would you **generate .html files** using SSI? Start a server and crawl the pages?
sfussenegger
+1  A: 

Some content management system allow you to publish a static .html cache of your entire website - would that help, or are you avoiding CMS in general because you can't run anything on your server?

Sohnee
A: 

If you only want static html files then here's what you could do:

  • Create one page as a template
  • Break the template down into separate parts (header.html, body.html, footer.html)
  • Create a batch file (generate.bat) containing this:

    copy header.html + body.html + footer.html output.html

  • Change your body.html file.

  • Run the batch file and move and rename output.html

Repeat the last two until you're done!

Joe Axon
A: 

Depends on what OS you're working on. On *nix write a bash script to do it, on windows use powershell.

bash: for i in {1..200}; do touch page$i.html; done;

powershell: 1..200|%{new-item -type file page$_.html}

EDIT: With new information that the source of the data is a powerpoint presentation, then I recommend making a powerpoint macro to do this.

EDIT 2: Here is the code you can use to get started:

Sub save()
    ActivePresentation.SaveAs FileName:="C:\Export.html", _
        FileFormat:=ppSaveAsHTML, EmbedTrueTypeFonts:=msoFalse
End Sub

This will create a folder C:\Export_files. In there you will find html pages for each slide, and some other files. A few customizations and edits and you should be good to go.

Segfault
A: 

Make one page, empty.

Mark the place where you'd insert the content (and perhaps the title, and other changing content) so that you can use that page as a template.

Make a script that takes a list of page contents, and for each of these contents generates a page for it.
You'll need to define page names for each content, so the links work. You might have to figure out how to do the links... either the script fills them dinamically or you'll have to create them in correspondence with the naming that the script will generate from the names you select for each page.

ANeves
+1  A: 

ttree is your friend

David Dorward
Looks good, I'll try it, thanks
denisjacquemin
A: 

I acknowledge you said only .HTML files, if you were able to use asp.net you could use MasterPages

JamesM
A: 

If you go for some CMS with designing as static .html, yes its possible. Because we are expertise in developing websites on open source CMS since 1997.

I would suggest Joomla CMS is perfectly meets this solutions. Browse more info at http://www.hangar17.com/fr/cms-joomla-developpement-offshore-inde.htm

Smileone21