Create web site with 200 pages with minimal efforts
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
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 ;-)
ttree is your friend
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?
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!
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.
I acknowledge you said only .HTML files, if you were able to use asp.net you could use MasterPages
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.
精彩评论