.. _structures: ********** Structures ********** .. index:: Page (Structure) .. _page_structure: Pages ===== Both the site contents and DMCM interface are defined in terms of pages. The same static media (CSS, Javascript, etc.) is used to give both a common look-and-feel and to allow previewing of content which has not yet been published. (see :ref:`design_diagram`) The DMCM interface is used to manage the contents of the site. Both the DMCM interface and site pages have a Banner heading, a navigation Menu and a Footer. Pages are stored on the database using the `Page `_ model. Example ------- The Markdown part of this published page is outlined in yellow: .. _image-published-page: .. image:: _static/published_page.png :alt: ahernp.com home page Here is the Markdown: .. literalinclude:: _static/ahernp_homepage_source.txt :language: guess :linenos: Note that HTML may be embedded in the Markdown as necessary. .. index:: List (Structure) .. _list_structure: Lists ===== Lists are like :ref:`page_structure` but the Markdown body is not freeform text. It is generated from prefix and suffix text with list items in the middle. The list is generated from a template, delimiter, and data consisting of list items separated by delimiters. The structure of each list item is determined by the template. The generated list is in Markdown format and can be used as the body of a Page. Lists are stored on the database using the `List `_ model. Example ------- Prefix (written in Markdown): .. literalinclude:: _static/list_prefix.txt :language: text :linenos: Template: .. literalinclude:: _static/list_template.txt :language: text :linenos: The delimiter is ";". Data: .. literalinclude:: _static/list_data.txt :language: text :linenos: Suffix (written in Markdown): .. literalinclude:: _static/list_suffix.txt :language: text :linenos: Give the following generated List: .. literalinclude:: _static/list_body.txt :language: text :linenos: .. index:: Blog Page (Structure) .. _blog_page_structure: Blog Pages ========== Each Blog Page holds a single Blog Entry in Markup text. Blog Pages are stored on the database using the `BlogPage `_ model. Example ------- The Banner, Menu and Footer sections are from the same template as the :ref:`Page `. The Blog Entry Title and Date are written separately. The Markdown body makes up the bulk of the entry. The Comment Section is handled by Javascript from by `Disqus `_: .. _image-published-blog-page: .. image:: _static/published_blog_page.png :alt: blog entry Here is the Markdown: .. literalinclude:: _static/blog_entry_source.txt :language: text :linenos: .. todo:: Add additional structures. E.g. one similar to List but which gen­er­ates mul­ti­ple web pages.