-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* doc: Move template icons to cookbook chapter * doc: Improve docs for 1.0 * Add introduction to docs organization. * Make font for code samples a little larger. * Add introductions to reference guides. * Replace 'Installation' With 'Getting Started'. * Clean up developer guide chapters: Templates. * Clean up reference: config and other sections.
- Loading branch information
Showing
44 changed files
with
1,378 additions
and
1,025 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Media Best Practices | ||
==================== | ||
|
||
* Use :ref:`guide-media-classes` to define image properties. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _cookbook-custom-filter: | ||
|
||
Create a custom filter | ||
====================== | ||
|
||
.. todo:: this chapter |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. _cookbook-overriding: | ||
|
||
Overriding Zotonic | ||
================== | ||
|
||
This chapter describes how to override the templates, styling and logic | ||
provided by Zotonic. | ||
|
||
Overriding works by adding a site or module that has a higher | ||
:ref:`priority <module-priority>` than Zotonic’s built-in modules. In your | ||
module/site, you add templates, assets and create notification observers. | ||
|
||
Overriding templates | ||
-------------------- | ||
|
||
:ref:`Override templates <overriding-templates>` by adding a template with | ||
the same name to your module/site. | ||
|
||
Overriding assets | ||
----------------- | ||
|
||
If you wish to fully override a CSS or JavaScript file, do so in the same way | ||
as you do templates: create a file with the same name in your module/site. | ||
Alternatively, *add* your own CSS file and selectively override CSS styles. | ||
|
||
Overriding logic | ||
---------------- | ||
|
||
:ref:`Observe notifications <guide-notifications-observe>` to influence the | ||
decisions that Zotonic makes. You can change or add properties before a resource | ||
is persisted, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Icons in templates | ||
================== | ||
|
||
Zotonic provides a couple of ways to show icons in templates: | ||
|
||
* :ref:`mod_artwork` gives access to FontAwesome and Material Design icons. | ||
It also has a number of other icon collections, mostly PNG images. Activate | ||
the module and follow the instructions on the doc page. | ||
* Zotonic icons provided by `mod_base`. This is explained on the current page. | ||
|
||
To create a certain amount of consistency across modules, Zotonic comes with a | ||
small set of commonly used icons and CSS classes (edit, help, close, etcetera) | ||
plus the Zotonic logo. | ||
|
||
Use cases: | ||
|
||
* You create your frontend from scratch, but you also have pages in your site | ||
that are provided by other modules, for instance the login screens. It would | ||
be good if the social login icons show up. | ||
* You are writing a template or module and like to take advantage of ready | ||
available icons. | ||
* You are writing frontend styles in LESS and you would like to extend Zotonic | ||
/ FontAwesome / Material Design icons. | ||
|
||
Include the Zotonic icons CSS file in your template:: | ||
|
||
{% lib | ||
"css/z.icons.css" | ||
%} | ||
|
||
Then use this syntax in your template HTML:: | ||
|
||
z-icon z-icon-<name> | ||
|
||
For instance:: | ||
|
||
<span class="z-icon z-icon-off"></span> | ||
|
||
.. seealso:: :ref:`ref-icons` reference | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _cookbook-custom-module: | ||
|
||
Writing your own module | ||
======================= | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
.. highlight:: django | ||
.. _guide-media: | ||
|
||
Media | ||
===== | ||
|
||
Images, video | ||
|
||
|
||
In templates | ||
------------ | ||
|
||
.. _guide-media-classes: | ||
|
||
Media classes | ||
------------- | ||
|
||
Media classes | ||
^^^^^^^^^^^^^ | ||
|
||
Instead of inline image tag parameters, you can use media classes to define | ||
image transformations. The advantage is that this image definition can then be | ||
reused amongst templates. | ||
|
||
Create a ``templates/mediaclass.config`` file in your site directory: | ||
|
||
.. code-block:: erlang | ||
[ | ||
{"thumb", [ | ||
{width, 200}, | ||
{height, 200}, | ||
crop | ||
]} | ||
]. | ||
This defines a media class called ‘thumb’, which can be used to display a | ||
120x120 cropped square image. You then only need to refer to this media class in | ||
your image tag:: | ||
|
||
{% image id mediaclass="thumb" %} | ||
|
||
The image URL will have a checksum embedded in it so that when the contents of | ||
the media class is changed, all images which use that media class will be | ||
regenerated to reflect the new media class. | ||
|
||
Raw ImageMagick options | ||
""""""""""""""""""""""" | ||
|
||
Besides the normal image processing options, as described in :ref:`tag-image`, | ||
it is possible to add literal ImageMagick convert commands to the mediaclass | ||
definition. | ||
|
||
For example:: | ||
|
||
{magick, "-level 90%,100% +level-colors \\#FE7D18,\\#331575"} | ||
|
||
(Note that you have to double any backslashes that were needed for the | ||
``convert`` command line.) | ||
|
||
This command is given *as-is* to the ImageMagick `convert` command, therefore it | ||
is best to first try it with the command-line `convert` command to find the | ||
correct options and command line escapes needed. | ||
|
||
There are three variations: ``pre_magick``, ``magick``, and ``post_magick``. | ||
The only difference is that the ``pre_magick`` is added before any other filter | ||
argument, ``magick`` somewhere between, and `post_magick` after the last filter. | ||
|
||
In this way it is possible to pre- or post-process an image before or after | ||
resizing. | ||
|
||
See http://www.imagemagick.org/Usage/ for examples of using ImageMagick from the | ||
command line. |
Oops, something went wrong.