#include "App.hpp" #include "../fw/Templates.hpp" namespace molo::example::app { namespace { const char kBase[] = R"BASE( {{ title }}
{{ site }}
{% block content %}{% endblock %}
)BASE"; const char kIndex[] = R"INDEX({% extends "base.html" %} {% block content %}

Living example

Every framework feature, one click away. Mobile-first: narrow the window and the top nav collapses into a dropdown menu.

{% if show_matrix %} {% for row in matrix %} {% endfor %}
FeatureRoute
{{ row.feature }}{{ row.route }}
{% else %}

Matrix hidden.

{% endif %} {% include "nav_hint.html" %} {% endblock %} )INDEX"; const char kPage[] = R"PAGE({% extends "base.html" %} {% block content %}

{{ heading }}

Author: {{ author|upper }}

Raw (escaped): {{ snippet }}

Trusted (safe): {{ snippet|safe }}

{% endblock %} )PAGE"; const char kContact[] = R"CONTACT({% extends "base.html" %} {% block content %}

Contact

{% if posted %}

Thanks {{ name }}, message received.

{% else %}
{% endif %} {% if error %}

{{ error }}

{% endif %} {% endblock %} )CONTACT"; const char kDocs[] = R"DOCS({% extends "base.html" %} {% block content %}

API docs

OpenAPI JSON: /openapi.json

{% endblock %} )DOCS"; const char kError[] = R"ERROR({% extends "base.html" %} {% block content %}

Error {{ status }}

{{ message }}

{% endblock %} )ERROR"; const char kNavHint[] = "

Tip: this page works on a 360px phone.

\n"; } // namespace void load_templates(Services& services) { services.templates->add_template("base.html", kBase); services.templates->add_template("index.html", kIndex); services.templates->add_template("page.html", kPage); services.templates->add_template("contact.html", kContact); services.templates->add_template("docs.html", kDocs); services.templates->add_template("error.html", kError); services.templates->add_template("nav_hint.html", kNavHint); services.templates->add_global("site", "MoloApp living example"); services.templates->add_global("backend", "skeleton"); } } // namespace molo::example::app