To generate run script
generateSite.py in directory
bin. Output are stored in directory
output.
You can use other XSLT application - modify
XSLT.py file.
Directory structure
Dir structure:
bin/ - script for generation
content/ - content for site
db-xml/
common.xml - common information
about site: year, name, email
news.xml - news of site, are showed
on first page
pages.xml - list of site's pages
pages/ - directory with page's content
fp.xml - first page
about.xml - this page :)
...
xslt/
other/
pages2text.xsl - xslt for load array pageId in
PageRepository.py
fp-page.xsl - xslt for first page
site-page.xsl - xslt for any other page
include/ - py classes
output/ - here are stored generated pages
How to make self pages
To make self page, you must:
Create xml-content for page. F.e. I want to add page 'Poems':
add to file pages.xml (in dir 'db-xml') -
<page id="poems" name="Poems" descr="My Poems"/> inside tag
<pages> (in this case page will be on top)
or inside any
<page>.
create
poems.xml in dir
/content/pages/.
f.e.
<?xml vesrion="1.0"?>
<page-content>
<p>This is my poem</p>
</page-content>
it all. Run
generateSite.py
Next step if you want to add specific tags, f.e.
<myTagInPoemPage/>:
<?xml vesrion="1.0"?>
<page-content>
<p>This is my poem.
<myTagInPoemPage/>
</p>
</page-content>
in this case you must to write
xslt-transformation for this tag in file
site-page.xsl (content/xslt)
f.e.
<xsl:template match="myTagInPoemPage" mode="content">
<xsl:text>to be or not to be</xsl:text>
</xsl:template>
it all. Run
generateSite.py
Next step (or first) - changing desing - change
site-page.xsl and
fp-page.xsl files.
Next steps - you can add you specific pages classes as
PageFP,
but this is other story :)...
Author:
Nemilya Price: free Version: 0.2 Platform(s): All