Marmite will allow the rendering of subsites, a subsite is made by subfolders on the content folder.
Right now the content_folder is basically
content/
media/ (media files)
*.md (markdown files)
With subsites the structure will be
content/
media/ (media files)
*.md (markdown files)
site2/
media/ (media files)
*.md
site.yaml
site3/
media/ (media files)
*.md
site.yaml
What identifies a subsite is the presence of site.yaml
How subsites are processed?
- First marmite will collect all the sites and add to
site_data.subsites (each subsite is a complete separate structure with its own posts, pages, group mappings, galleries, generated_urls, each subsite is basically a separate instance of Data with some attributes taken from the main site.
- The
site.yaml will contain individual site config that will configure the subsite, missing keys will assume default from the main config. (in other words, the main marmite.yaml config can be optionally overriden by the individual site.yaml)
- The
site.yaml can be empty, on that case it assumes all the parent config.
- Marmite will collect content from all the sites before processing shortcodes, so shortcodes like card, tags, posts etc can refer to content on separate sites.
- The
url_for function will take a new parameter site default to current site being processed
- The other tera functions will also take
site and resolve to current site being processed (it may require dynamic registration of tera functions), this will allow the functionality of shorcodes like card, posts, pages, tags, series, streams. While also allowing the subsite to refer another site like passing `site="main" to refer to the main site.
- The result of rendering a subsite is written to
output_dir/{subsite}/ which is the matching folder name
- The subsite can define a separate
theme: on site.yaml
- The
site.yaml does not allow the user to override locations such as template_folder, static_folder etc, all those are the same as the main site, but relative to the subsite output_dir/{site}
- The subsite is independent, so the
output_dir/{site} has its own static/, media/ and all other generated files including feeds.
- The site.yaml, url: attribute is automatic resolved, to be the main url +
/{subsite_folder}, unless the user specifies differently
- If subsite does not specify a theme then it uses the main site theme and templates.
Important
- The main site (current functionality) is kept intact, acessing
localhost:8000 will open the output_dir/index.html
- The subsites are rendered as subfolders of the main site, so
localhost:8000/site1/ will open output_dir/site1/index.html
- The main site will render a
/sites.yaml listing all subsites with links pointing to each one.
- THe command
marmite --new must be updated to take --site sitename argument (default None, main site)
Marmite will allow the rendering of subsites, a subsite is made by subfolders on the content folder.
Right now the content_folder is basically
With subsites the structure will be
What identifies a subsite is the presence of
site.yamlHow subsites are processed?
site_data.subsites(each subsite is a complete separate structure with its own posts, pages, group mappings, galleries, generated_urls, each subsite is basically a separate instance ofDatawith some attributes taken from the main site.site.yamlwill contain individual site config that will configure the subsite, missing keys will assume default from the main config. (in other words, the main marmite.yaml config can be optionally overriden by the individual site.yaml)site.yamlcan be empty, on that case it assumes all the parent config.url_forfunction will take a new parametersitedefault to current site being processedsiteand resolve to current site being processed (it may require dynamic registration of tera functions), this will allow the functionality of shorcodes like card, posts, pages, tags, series, streams. While also allowing the subsite to refer another site like passing `site="main" to refer to the main site.output_dir/{subsite}/which is the matching folder nametheme:onsite.yamlsite.yamldoes not allow the user to override locations such astemplate_folder,static_folderetc, all those are the same as the main site, but relative to the subsiteoutput_dir/{site}output_dir/{site}has its own static/, media/ and all other generated files including feeds./{subsite_folder}, unless the user specifies differentlyImportant
localhost:8000will open theoutput_dir/index.htmllocalhost:8000/site1/will openoutput_dir/site1/index.html/sites.yamllisting all subsites with links pointing to each one.marmite --newmust be updated to take--site sitenameargument (default None, main site)