Package: mambo
MamboMambo is an elegant static site generator built in Python.It’s a great choice for website, blogs and documentation. Content can be written in HTML and Markdown, oganized however you want with any URL structure, and metadata can be defined in front-matter.[TOC]Command Line APIMambo aims to be simple with a simple API.Installpip install mamboSetup a siteTo setup a site, the command below will create a new directory name/mysitename.com/. All the necessary files and folders will be created in there.cd ~
 mambo setup mysitename.comOr initialize in an existing folderAll the necessary files and folders will be created in there.cd ./mysitename.com
mambo initCreate a pageThe command below will create ahello-world.htmlby default. To create it as markdown, add the.mdas file extension. Page can only be eitherhtmlormarkdown, any other format will be ignored.mambo create hello-worldCreate multiple pagesTo create multiples pages, separate them by spacemambo create hello-world page1.md pag2.html another-pageServe site in dev modeTo serve the site in evelopment mode, cd into the directory and run, a browser window will be open. By default it uses port 8000mambo serveOptions-p | --port [ -p 8001 ]: Use the specified port. Default 8000
--env [ --env prod ] : Select the environment to build
--no-livereload [ --no-livereload ]
--open-url [ --open-url ]Build site for productionBuild the site to be deployed to production. The content will be placed in.builddirectory, which can be uploaded to any servers.mambo buildOptions-i | --info [ -i ] boolean, default False: To display build information
--env [ --env prod ] : Select the environment to buildClean the build directoryTo cleanup the.builddirectorymambo cleanStructure|
    |-- /.build
        |
    |-- /static
        |
    |-- /data
        |
    |-- /pages
        |
    |-- /content
        |
    |-- /templates/pages:
Contains all the pages to be built
If the pages contain local context -> {{ page.title }}/static: Hold the assets static files. This directory will be copied to thebuildas is/data:
Contains JSON data context to inject in the templates.
To access the data, use the file name as as the namespace -> mydata.json -> {{ data.mydata }}/content:
Contains page content to be included on the page.
This can be an .md file, .html
This is created for organization of the site. But it is
identical totemplatesfolder.
However, when including files from content, the path must be prefixed withcontent,
ie:{% include "content/my-file.md" %}/templates:
Contains all the templates to be included, including layouts, partials, macros. Anything related to templates should be placed in here. If you want to create a content file to include, it is recommended to place it in thecontentfolder./.build: This where the build sites will be created. The content of this dir is ready for uploadConfigurationMambo createsmambo.ymlwhich contains the configurations.# Site: Global site context
# Variables under [site] will be available in the page as ie: {{ site.name }}
site:

  # base_url: REQUIRED - Site base url, the canonical url to build
  base_url: /

  # static_url: REQUIRED - Site static. If static files are placed somewhere else, you can put the path there
  static_url: /static/

  # Site name
  name: "MySiteName.com"

  # The site url
  url: 

  # Google Analytics code
  google_analytics:

  # Site Favicon
  favicon:

  # Global meta tags. They can be overwritten by page meta tags
  meta:
    keywords:
    language: en-us
    rating: General
    robots: index, follow


# Site environment: environment data will be merged with the global site settings
# ie: 'env.prod.base_url' will use the prod base_url
# At build: 'mambo build --env prod', or serve 'mambo serve --env prod'
env: 
  prod:
    base_url: /
    static_url: /static/


# Configuration when serving
serve:
  port: 8000
  livereload: True
  openwindow: True
  env: 
  generate_sitemap: True
  minify_html: False  


# Build configuration, could be the final product
build:
  # env: The site_env to build. Leave blank to have the option in the command line
  env: prod
  generate_sitemap: True
  minify_html: True 

# Global settings
globals:
  # layout: **REQUIRED - The default site layout
  layout: "layouts/default.html"

  sitemap

  assetsGlobal Contextpage_url($page_name)To get the url of a page.{{ page_url('home') }}page_link($page_name, $text, $title, $id, $class)To build a page ahref{{ page_link('about.html', title='About Us') }}page_info($page_name, $key)Return a page meta infoTitle: {{ page_info('home', 'title')}}static_url($file_path)Return the  url of a static asset{{ static_url('imgs/img.png') }}script_tag($file_path)Create a script tag for a static file{{ script_tag('js/main.js') }}stylesheet_tag($file_path)Create a stylesheet tag for a static file{{ stylesheet_tag('css/style.css') }}format_date($date, $format)Format a date{{ format_date('2019-09-01', 'MM/DD/YYYY h:mm a') }}__STATIC_URL__Return the static urlconst static_url = "{{ __STATIC_URL__ }}"[[__STATIC_URL__]]Same as __STATIC_URL__ but to be used SFC javasiptSite ContextsiteAll the context under the site configname
base_url
static_url
...
__env__: the environment (Prod, Dev etc)
__generator__: info of the generator
    timestamp
    name
    versionPage ContextpageAll the page context and data set in the frontmattertitle
description
url
...Writing PagesSupported format:Mambo support.htmland.mdfiles. It will ignore all other extensions in the/pagesdirectoryFiles starting with_(underscore) will be ignoredOrganization:The pages in Mambo should be arranged in the same way they are intended for the rendered website.
Without any additional configuration, the following will just work. Mambo supports content nested at any level./pages
    |
    |- index.html               // <- http://a.com/
    |
    |- about-us.md              // <- http://a.com/about-us
    |
    |- /post
        |
        |- my-awesome-post.html // <- http://a.com/post/my-awesome-post.htmlFront Matter & Page ContextIt enables you to include the meta data and context of the content right with it.
It only supports the Yaml format, it is placed on top of the page.---
title: My site title
slug: /a-new-path/
description: 

---Your front matter data get parsed as a local object, ie: {{ page.title }}You can also include your own contextSimple PagesSingle File Component PageTemplateScriptStyleOptionally you can use SCSSWriting Dynamic PagesAboutMambo is built in Python, and features the powerful templating language Jinja2.Mambo allows you to write your content in either Markdown or plain HTML.HTML gives you full independence. Markdown, for simply writing article.To get creative, Mambo allows you to write your HTML/JS/CSS in a single file component style. All three are powered by the powerful Jinja2 template language.Features:Friendly UrlJinjaHTMLMarkdownSCSSSingle file componentTechnology uses:Jinja2: Powerful templating languageFront Matter, to add context to the pageArrow to write date and timeContent:AdvancedData DrivenIn addition to data files, you can load a resource from any api endpoint.The data returned must be in the json format.GeneratorsTo generate pages dynamically from a data sourcecontextGenerators return acontextkey in the page variable.Forsingletype, the context is the data for that pageForpaginationtype, the context is a list (array) of data chunkpaginatorGenerators returnspaginatorkey in the page variable, if thetypeis 'pagination'paginationcontains:total_pages,current_pages,page_slug,index_slugGenerator: SingleGenerate single pages from a source containing list (array) of data---

_generator:
    type: single
    data_source: posts
    slug: /
---data_source:  Dot notation can be use to
access other node of the data: ie:// data/posts.json

{
    "all": [
        {},
        ...
    ],
    "archived": [
        {},
        ...
    ]
}You can access the data as:data_source: posts.archivedslug: Will dynamically build the slug. Having theslugwill overwrite the
data slug if it has one.slugformat based on the data, so data token must be providedie:/{post_type}/{id}/{post_slug}Generator: PaginationWill generated a paginated---

_generator:
    type: pagination
    data_source: posts
    per_page: 20
    limit: 100
    slug: /all/page/{page_num}
    index_slug: /all
---Single File ComponentSingle file component allows you to put together HTML, CSS, and JS into one file.Upon building, Mambo will separate them and
place them into their respective files to be
included in the page.---
title: My Page Title
---

{# Page body #}
<template>
    <h1>Hello</h1>
    <button id="myButton">My Button</button>
</template>


{# Page style #}
<style>
    .color-button {
        color: blue;
    }
</style>


{# Page script #}
<script>
    const button = document.querySelector('#myButton');
    button.addEventListener('click', () => {
        button.classList.toggle('color-button');
    });

</script>TODORSSWIPContext VariablessitepageThis variable holds the current page or tag object.datainfoMethodsFeaturesSitemapCollectionsAssetsCache bustingFront mattertitle:
url:
description:
collections:
 url: /post/{url}
 data_file
 content_dir
assets:
 scripts:
    -
 stylesheets:
    -