Organisation des sources du projet

At this writing we are maintaining pelican generated static websites, one for www.bernatchez.net and one for www.ogopogo.biz.

We use our script "compile_rst" to add a few generated .rst files to the source site before using pelican to generate the site from source.

We can generate a list of links to the files in a subdirectory.

Accomplished like this in the Makefile.

$(COMPILE_RST) -p '*.pdf' -s sitepdfs -o pdfs_list -i

That would generate a link for each .pdf file in sitepdfs/ and emit the result to the file pdfs_list.rst

Such a file is intended to be included within one or more of our manually produced .rst pages with a line like:

.. include:: ../../pdfs_list.rst

That would include our generated link list in that page.

We can also generate music album like pages with links to the files in a compilation subdirectory.

Accomplished like this in the Makefile.

$(COMPILE_RST) -p '*.mp3' -s compilations -o album -a

This would generate - possibly - several album_N.rst files in the pages/ subdirectory, where N is a sequence number. You will get as many pages as there are albums referenced in the m3 files in the compilations directory.

Invocations of compile_rst must take place every time the make html target is requested.

For example, the bernatchez_staticweb Makefile contains this

html:

    $(COMPILE_RST) -p '*.mp3' -s compilations -o album -a
    $(COMPILE_RST) -p '*.tar.gz' -s tarballs -o tarballs_list -i
    $(COMPILE_RST) -p '*.pdf' -s sitepdfs -o pdfs_list -i
    $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)

So that content/pages/album_N.rst files and tarballs_list.rst, pdfs_list.rst are all regenerated prior to invoking pelican to generate the site.

In short

Files tarballs/*.tar.gz , sitepfds/*.pdf, and compilations/*.mp3 as well as all the .rst files under the content subdirectory determine what goes into our website.

At this writing the content is only proof of concept data.

Publié le par Pierre Bernatchez dans «entretien». Mots-clés: pelican, site, source, organisation