Welcome to themeZ’s documentation!

Warning

Beta software You are using a software that has not reached a stable version yet. Please beware that interfaces might change, APIs might disappear and general breakage can occur before 1.0.

If you plan to use this software for something important, please read the roadmap, and the issue tracker in Github. If you are unsure about the future of this project, please talk to the developers, or (better yet) get involved with the development of themeZ!

ThemeZ is target to be a multi purpose theme for for https://wagtail.io based on Bootstrap 4. It’s designed to use with https://bootswatch.com for fast developing a site.

It will integrated:

Right now, it’s just a really early version and should not be used in production.

Installation instructions

themeZ can be installed using pip:

$ python -m pip install themez

This command will fetch the archive and its dependencies from the internet and install them.

If you’ve downloaded the tarball, unpack it, and execute:

$ python setup.py install --user

You might prefer to install it system-wide. In this case, skip the --user option and execute as superuser by prepending the command with sudo.

Add in Settings

include example pictures of each theme:

INSTALLED_APPS = [
...
'wagtail.contrib.modeladmin',  # Don't repeat if it's there already
'wagtailmenus',
]


TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        '   DIRS': [
            os.path.join(PROJECT_ROOT, 'templates'),
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.contrib.auth.context_processors.auth',
                'django.template.context_processors.debug',
                'django.template.context_processors.i18n',
                'django.template.context_processors.media',
                'django.template.context_processors.request',
                'django.template.context_processors.static',
                'django.template.context_processors.tz',
                'django.contrib.messages.context_processors.messages',
                'wagtail.contrib.settings.context_processors.settings',
                'wagtailmenus.context_processors.wagtailmenus',
            ],
        },
    },
]

Troubleshoot

Windows users may find that these command will only works if typed from Python’s installation directory.

Some Linux distributions (e.g. Ubuntu) install Python without installing pip. Please install it before. If you don’t have root privileges, download the get-pip.py script at https://bootstrap.pypa.io/get-pip.py and execute it as python get-pip.py --user.

Development

If you want to develop for themeZ, first clone the git repository with the command

$ git clonte

After cloning, install the dependencies with:

$ pip install -e .[dev]

It may also be convenient to install themeZ in your system. For doing so, please use the command

$ python setup.py develop

Usage

Bootswatch

The theme will include a bootstrap css theme from https://bootswatch.com

Settings

Theme

BOOTWATCH_THEME = 'minty'

For detail instruction about bootwatch check out Bootswatch.

COPYRIGHT_BEGIN_YEAR = None

The starting year of the website for the copyright text. If this will not be set, it will render just the current year.

Google Analytics

GOOGLE_ANALYTICS_KEY = None

Google Analytics can be setup through the settings or as enviroment var. Only if GOOGLE_ANALYTICS_KEY is set, the tag will be include in the theme.

Customizing Theme

Templatetags

themeZ_tags

{% load themeZ_tags %}

google_analytics

Add Google Analytics when a enviroment var or settings var is set with the name GOOGLE_ANALYTICS_KEY.

  • Usage: {% google_analytics %}
  • Include Template: themeZ/include/google-analytics.html
get_bootswatch_theme

Get a string with a https://bootswatch.com theme. To setup set BOOTWATCH_THEME in your settings with your theme. If BOOTWATCH_THEME is not set, it will return the default theme.

  • Usage: {% get_bootswatch_theme %}
get_site_root

Get the Wagtail root site for the current Wagtail site.

Example:

{% get_site_root as site_root %}

<a href="{% pageurl site_root %}">Home Page</a>
get_site_name

Get the Wagtail site name witch is set in https://example.com/admin/sites/

Example 1:

{% get_site_name %}

Example 2:

{% get_site_name as site_name %}

{% if site_name %}
    {{ site_name }}
{% endif %}

Changelog

Version Content
0.1
  • Init project

License

MIT License

Copyright (c) 2017 Steffen Exler

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Indices and tables