HTML preprocessor

B

Bart Vandewoestyne

The webspace I have access to from my ISP only allows me to use static
(X)HTML pages, so I'm trying to stick with static (X)HTML content for
my personal webpage.

There are however certain things that i need in each .html file, such as
the navigation, header, footer,... and therefore I'm looking for a good,
clean and maintainable way to create my .html files with navigation,
header, footer,... without the need to copy them to each .html file.

After some googling, I've found out that probably the best solution for me
is to use a HTML preprocessor, see for examle
http://www.htmlhelp.com/faq/html/all.html#15
A list of HTML preprocessors can be found at
http://www.htmlhelp.com/links/preprocessors.html

Now before I begin to look at these one by one, i would like to know
if there are people who can recommend me a certain HTML preprocessor from
that list. I don't need very complicated things, the most important is
that I can include my navigation, header and footer stuff into each page
and that the system allows easy modifications to the content of my static
(X)HTML website. Some playing with variables would also be nice.

I am only looking for Opebn Source Software that works on Linux or Windows,
so i won't consider freeware or closed source stuff.

Are there any recommended and easy to use HTML preprocessors?

Thanks,
Bart
 
D

David Dorward

Bart said:
Are there any recommended and easy to use HTML preprocessors?

These days I'm using a homebrew thing in Perl that does a bunch of
processing on documents (such as tagish indexes, related page blocks
and tables of content generated from the headings in the document), but
at the heart of it is Template-Toolkit.

http://www.template-toolkit.org/

The ttree program that comes with it sounds like just what you need.

http://www.template-toolkit.org/docs/plain/Tools/ttree.html

Note the insert and include directives.

http://www.template-toolkit.org/doc...ml#Processing_Other_Template_Files_and_Blocks
 
J

Jim Moe

Bart said:
The webspace I have access to from my ISP only allows me to use static
(X)HTML pages, so I'm trying to stick with static (X)HTML content for
my personal webpage.
I presume that you can create the pages locally and upload them to the site.
There are however certain things that i need in each .html file, such as
the navigation, header, footer,... and therefore I'm looking for a good,
clean and maintainable way to create my .html files with navigation,
header, footer,... without the need to copy them to each .html file.
Although PHP is normally a server-side addition, it has an executable
version that can process a page; it outputs HTML. Use PHP to generate all
of the common parts.
 
B

Bart Vandewoestyne

[...]
I presume that you can create the pages locally and upload them to the site.
Yes.

Although PHP is normally a server-side addition, it has an executable
version that can process a page; it outputs HTML.
Use PHP to generate all of the common parts.

Aha... this might indeed also be an interesting approach... I
thought I could not use PHP because it gets processed on the
server and my ISP does not support PHP. But if I can process my
..php files locally and then upload them, that might be a solution.

The only question that I'm left with is if that php-executable is
in some Debian (stable) package? Searching for 'php' at the
Debian packages website gives me

http://packages.debian.org/cgi-bin/...les&case=insensitive&version=stable&arch=i386

Or does the executable have another name?

Thanks,
Bart
 
D

David Dorward

Bart said:
The only question that I'm left with is if that php-executable is
in some Debian (stable) package? Searching for 'php' at the
Debian packages website gives me

I think you'll want "php4-cgi" which has the executable (as opposed to
Apache module) version.
 
D

David Dorward

aa said:
Javascript?

Running on the client? Very bad idea. It becomes invisible to anyone
without JS enabled, including search engine indexing bots.
 
B

Bart Vandewoestyne

I think you'll want "php4-cgi" which has the executable (as opposed to
Apache module) version.

Hmm... I've just installed php4-cli and that seems to have what i
need:

mc303@forsythe:~$ php -v
PHP 4.3.10-18 (cli) (built: Nov 3 2006 21:56:29)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

I'm not sure what the difference is with the cli-client from the php4-cgi
package.

Thanks!
Bart
 
A

aa

David Dorward said:
> Running on the client? Very bad idea. It becomes invisible to anyone
without JS enabled, including search engine indexing bots.

1. The author is talking about navigation, header, footer do not need to be
scanned by Search Engines. I appreciate that navigation, header, footer can
be loaded with keywords, but it is considered a dirty trick

2. What is the percentage of non-JS visitors? Are you saying that JS
should not be used at all?
 
A

aa

Interesting thing, yet not perfectly clear. If you install it on your local
machine only, then it is not more than a sort of an authoring assistant, is
it ?
If you change, say a footer, you will have to "recompile" all the pages
using the footer and then upload them?
What am I missing?
 
D

David Dorward

aa said:
1. The author is talking about navigation, header, footer do not need to be
scanned by Search Engines. I appreciate that navigation, header, footer can
be loaded with keywords, but it is considered a dirty trick

Search engines don't need to access the navigation? How are the going
to find the other pages on the site then?
2. What is the percentage of non-JS visitors?

Last time I looked at any statistics, I think it was something in the
order of 10%. Usual provisos about statistics apply.

With the increase in the mobile web, I wouldn't be surprised if this
figure increased (Opera Mini is a very nice piece of software, but it
doesn't do JS).
Are you saying that JS should not be used at all?

No. The key is progressive enhancement.

In short:

Essential functionality should be provided by the server.
Data should be provided by HTML.
Style by CSS.
Then JavaScript to increase usability and generally add convienience
methods to the page.
 
D

David Dorward

aa said:
Interesting thing, yet not perfectly clear. If you install it on your local
machine only, then it is not more than a sort of an authoring assistant, is
it ?
Yes.

If you change, say a footer, you will have to "recompile" all the pages
using the footer and then upload them?

Yes. So what? Once its set up, its usually a two button process to get
it online (assuming you want to have a chance to test the changes
before they go public, if you don't case then its a one button process).
 
B

Bart Vandewoestyne

Javascript?

I prefer not to use Javascript because of two reasons:

1) My knowledge of Javascript is quasi zero

2) I don't want to force my users to have Javascript enabled in
their browser.

Best wishes,
Bart
 
T

Toby Inkster

aa said:
1. The author is talking about navigation, header, footer do not need to be
scanned by Search Engines. I appreciate that navigation, header, footer can
be loaded with keywords, but it is considered a dirty trick

Navigation most certainly *does* need to be scanned by search engines --
how else are they going to find your other pages?
2. What is the percentage of non-JS visitors?

Varies from site to site, but typically 5-15%.
Are you saying that JS should not be used at all?

It is unwise to *rely* on Javascript for basic site functionality, but
that doesn't mean that it can't be used for some visual/behavioural
nicities.
 
T

Toby Inkster

aa said:
If you change, say a footer, you will have to "recompile" all the pages
using the footer and then upload them?

Yep, but that recompilation only needs to be a matter of running a single
script, taking at most a few seconds to complete.
 
B

Bart Vandewoestyne

Interesting thing, yet not perfectly clear. If you install it on your local
machine only, then it is not more than a sort of an authoring assistant, is
it ?
Indeed.

If you change, say a footer, you will have to "recompile" all the pages
using the footer and then upload them?
Indeed.

What am I missing?

I think you didn't miss anything and understood things right. My
ISP doesn't support PHP so I have to stick with a static webpage.
It isn't a big project, just a simple personal homepage. One
of the problems I'm having is that for now I copy-paste my
navigation to each .html file... and I want to make things a bit
more manageable, so I think my best option is to use some kind of
HTML-preprocessing system to generate the static HTML pages.

So my cycle will be:

1. Modify the templates/content
2. `Compile' the templates/content to static .html files
3. Upload these static .html files to the webspace my ISP
provides me.

For now, I am in doubt whether I will use the PHP command line
client, the Template Toolkit (http://www.template-toolkit.org/)
or htp (http://htp.sourceforge.net/) or anything alike...

I like the fact that PHP is used by many users and is currently
still under very active development (so lots of support). That
could be a good reason to choose PHP and not the Template Toolkit
or htp or a thing like that...

Best wishes,
Bart
 
C

Chaddy2222

aa said:
1. The author is talking about navigation, header, footer do not need to be
scanned by Search Engines.
Umm well they do, *unless you don't mind loseing customers (or sales
for that matter).

I appreciate that navigation, header, footer can
be loaded with keywords, but it is considered a dirty trick
Well, they can't and the keywords Meta Tag has nothing to do with what
where talking about!.
2. What is the percentage of non-JS visitors? Are you saying that JS
should not be used at all?
Yes, where items such as navigation are concerned anyway.
Nor should Flash be used, (for such things), for similar reasons.
 
A

aa

Yes. So what?
Nothing. I just want to have understanding if I will pay for it.

Once its set up, its usually a two button process to get
it online (assuming you want to have a chance to test the changes
before they go public, if you don't case then its a one button process).

Do you mean that no need to compile every single file, but all the files are
recompiled at two keystrokes?
When you say "to get it online" do you mean that it automatically uploads
the files?
 
A

aa

"David Dorward" <[email protected]> > Search engines don't need to access
the navigation? How are the going
to find the other pages on the site then?

By Navigarion I mean the navigation bar. I do not mean other links which are
always there.
From my experience on about 6 sites which I promoted in Google and a coulple
of others, they do not need to find the other pages
If the home page is correctly designed, they index it pretty well.
Of course if they changed their algorithm and do not rate well sites with
navigational menu available, then I totally agree with you

Last time I looked at any statistics, I think it was something in the
order of 10%. Usual provisos about statistics apply.

Is it a matter of business model and the target audience. In some cases it
makes sense to sacrifice 5% of DIY browsers to deliver good interactive
stuff to the rest

Disclaimer. Without prejudice. Please take this as a personal opinion not
intended to be imposed on anyone, for I noticed that some people here take
opinions different from theirs as personal offence
 
E

Ed Seedhouse

Bart Vandewoestyne wrote:
Although PHP is normally a server-side addition, it has an executable
version that can process a page; it outputs HTML.

Oh no it doesn't. Not unless you make it do so.

And the Apache module and the executable (CGI) version do substantially
the exact same thing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top