Re: Off-Line Content Management Scheme?
by Corion (Patriarch) on Jan 03, 2006 at 09:12 UTC
|
As you don't seem to need much of the features a Content Management System provides (versioning, publishing, collaboration, ...), I think that Template Toolkit with its ttree tool will be enough for you - it takes a whole tree of Template::Toolkit files, processes them, and spits out the results into new files.
The problem you have is now that you need to learn the Template Toolkit syntax and how to structure your templates. There is ample documentation in the Template Toolkit book, but for the simpler things, the documentation of Template Toolkit itself is sufficient.
Of course, this leaves you with the problem of pushing that data on to a webserver, but that is easily done by using rsync or simply scp, depending on the volume of data to be transferred.
| [reply] [d/l] [select] |
Re: Off-Line Content Management Scheme?
by ozboomer (Friar) on Jan 03, 2006 at 10:41 UTC
|
Thanks to the suggestion about Template Toolkit, I had some more terms to search...
I've yet to fully investigate "TT" but I've already found an interesting article:
It compares the various templating options available, which is handy as I'm not sure how fancy I need to be with my web sites and their structures.
Many thanks for the helpful pointer.
John
| [reply] |
Re: Off-Line Content Management Scheme?
by samizdat (Vicar) on Jan 03, 2006 at 15:07 UTC
|
| [reply] |
Re: Off-Line Content Management Scheme?
by pajout (Curate) on Jan 03, 2006 at 11:30 UTC
|
It looks like a interest quest, :), though I do not know Template::Toolkit, I see following solution:
1/ Xmlize your input data. You can rewrite your C code to output XML rather then HTML.
2/ Prepare XML metadata files, which defines, which parts of your data have to be dressed on which clothes (clothes are other XML metadata)
3/ Prepare relatively generic XSLT stylesheet, which supports that processing (both XML data and metadata as input, HTML as output)
4/ Write the perl script to do these transformations
I think that sometimes it is better to write more code than learn some powerfull but huge tools... | [reply] |
|
|
Some interesting thoughts there, thanks... but beyond my present scope a mite :)
I've been using Perl for 10+ years now but have yet to learn XML or go beyond HTML (other than some basic CGI). I only learnt a bit about CSS in the last year or two... hence the desire to fix my web sites(!)
I haven't been working in SysAdmin for some years now so I don't need to "push" Perl as hard as I might have... but I still find Perl can do everything I need in both basic SysAdmin (my home computers) and applications (what with Perl/Tk, etc)... This is why I'm trying to come up with a simple solution, using (mostly) things I know.
| [reply] |
|
|
You are right, this is needless effort to study xslt transformations for you. It is powerfull tool supporting combining content and face, but it is long journey to make good knowledge about its advantages and/or disadvantages.
| [reply] |
Re: Off-Line Content Management Scheme?
by adrianh (Chancellor) on Jan 03, 2006 at 13:11 UTC
|
| [reply] |
Re: Off-Line Content Management Scheme?
by Thilosophy (Curate) on Jan 04, 2006 at 07:36 UTC
|
| [reply] |
Re: Off-Line Content Management Scheme?
by pileofrogs (Priest) on Jan 03, 2006 at 21:41 UTC
|
I use M4 and make.
M4 is a venerable, standard macro language and make
is great for keeping everything in sync. It's also really easy to learn.
define(`_foo',`<H1>$1</H1>')dnl
_foo(`That was easy')dnl
Now you know how to use M4.
Okay, maybe it's not that simple...
Here's the link to the manual for Gnu's M4.
http://www.gnu.org/software/m4/manual/html_node/index.html
It's great for writing re-usable chunks (_my_header(),
_my_footer(), etc..). Not so great for complex formatting (e.g., automatically generating a table of contents from all
your different sections)
-Pileofrogs
| [reply] [d/l] |
|
|
| [reply] |
Re: Off-Line Content Management Scheme?
by gloryhack (Deacon) on Jan 03, 2006 at 20:30 UTC
|
You might give a look at WML, Engelschall's "Website Meta Language". I maintain some smallish sites with it and it's saved me a lot of time. | [reply] |
Re: Off-Line Content Management Scheme?
by ozboomer (Friar) on Jan 04, 2006 at 07:22 UTC
|
As an initial cut at the job, it's looking like HTML::Template might be a suitable thing (if I go along the "custom-build" route), as it seems fairly simple to get something working. I have a question, though.
What about if I have my HTML with, for example, a header and a left-side navigation column (placement defined via CSS) and then some "main content". This might be a "normal" page.
If I have another page that has the same layout but with differing content... and additionally, a right-side column, I could have two templates - one with header/left column and another with header/left column/right column... but most of the HTML for both templates would be the same.
How to deal with this? Should I try and maintain the two separate templates... or build a (perl) program that will conditionally add that extra right-side column... and almost defeat the purpose of the templating anyway?
| [reply] |
|
|
How to deal with this? Should I try and maintain the two separate templates.
With care in defining the templates for the header, left and right columns, it should be possible to
"mix n match" those components by concatenating the templates, or concatenating the results of expanding the templates.
Your generating script then looks something like this pseudo-code:
if needsHeader
load header template
expand header template
output expanded header to file
endif
if needsLeftColumn
load LeftColumn template
expand LeftColumn template
output expanded LeftColumn to file
endif
if needsRightColumn
load needsRightColumn template
expand needsRightColumn template
output expanded needsRightColumn to file
endif
...
This way, you specify your pages at a higher level in terms of the subcomponents that need to appear on the page, and your generation script processes that higher level description by loading and expanding the appropriate mix of templates.
It does require care in defining the subcomponent templates, but with the use of css, and especially css2, it can make for a very concise page specifications, if the nature and layout of the data you are presenting is, or can be, standardised.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |
Re: Off-Line Content Management Scheme?
by saberworks (Curate) on Jan 03, 2006 at 15:48 UTC
|
Sounds like you want CityDesk by Fog Creek Software (http://www.fogcreek.com/) | [reply] |
Re: Off-Line Content Management Scheme?
by ozboomer (Friar) on Jan 05, 2006 at 11:11 UTC
|
Well, I've had another look at everyone's suggestions... and I think I'll have a go with using HTML::Template. For my situation, the other suggestions are probably over-complicated for the simple operations I will need to do.
I've installed HTML::Template and with the Monks tutorials, as well as the standard docs, I'm fairly sure I'll be able to create something fairly easy to use and maintain... and I'll understand it pretty well.
The only problem now is how to define the "structure/configuration" of the web sites... and for me, I'll probably store the info in plain text files. I'll probably manually build the files (rather than fiddling about with hashes or b-trees to maintain all the navigation paths) and use Config::Simple or maybe CSV files for the actual storage. I know - XML is de rigueur - but I've used CSV files a lot and I already have lots of code to manipulate CSV files.
Again, many thanks for everyone's help.
| [reply] |