From aeec4d5bf690a1112e94d7b847755cdfb9857658 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 3 Dec 2017 14:39:29 +0100 Subject: [PATCH] doc: clean up the CSS style docs and make them consistent. --- doc/css/themes.rst | 4 ++-- doc/pelican/theme.rst | 29 +++++++++++++++++------------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/doc/css/themes.rst b/doc/css/themes.rst index f1f22187..e8aafdf1 100644 --- a/doc/css/themes.rst +++ b/doc/css/themes.rst @@ -107,8 +107,8 @@ together and it will create a ``*.compiled.css`` file in the same directory: .. code:: sh - # Creates a m-dark.compiled.css file - ./postprocess.py m-dark.css + cd css + ./postprocess.py m-dark.css # Creates a m-dark.compiled.css file If you want to modify the Pygments style, it's a bit more involved. You need to edit the ``*.py`` file instead of the ``*.css``: diff --git a/doc/pelican/theme.rst b/doc/pelican/theme.rst index c0255b70..d05012a7 100644 --- a/doc/pelican/theme.rst +++ b/doc/pelican/theme.rst @@ -59,18 +59,22 @@ subdir of your m.css submodule), then you tell it to put the static contents of the theme into a ``static/`` directory in the root of your webserver; the :py:`M_CSS_FILES` variable is a list of CSS files that the theme needs. You can put there any files you need, but there need to be at least the files mentioned -on the `CSS themes <{filename}/css/themes.rst>`_ page. Lastly, the theme uses -some Jinja2 filters from the `m.htmlsanity <{filename}/plugins/htmlsanity.rst>`_ +on the `CSS themes <{filename}/css/themes.rst>`_ page. The :py:`M_THEME_COLOR` +specifies color used for the :html:`` tag +corresponding to given theme; if not set, it's simply not present. Lastly, the +theme uses some Jinja2 filters from the `m.htmlsanity <{filename}/plugins/htmlsanity.rst>`_ plugin, so that plugin needs to be loaded as well. .. code:: py THEME = 'm.css/pelican-theme' THEME_STATIC_DIR = 'static' - M_CSS_FILES = ['https://fonts.googleapis.com/css?family=Source+Code+Pro:400,400i,600,600i%7CSource+Sans+Pro:400,400i,600&subset=latin-ext', - '/static/m-dark.css'] DIRECT_TEMPLATES = ['index'] + M_CSS_FILES = ['https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600', + '/static/m-dark.css'] + M_THEME_COLOR = '#22272e' + PLUGIN_PATHS += ['m.css/pelican-plugins'] PLUGINS += ['m.htmlsanity'] @@ -79,6 +83,15 @@ distinction --- use ``m-dark.css`` for local development and override the :py:`M_CSS_FILES` to use the smaller, faster and more compatible ``m-dark.compiled.css`` for publishing. +If you would want to use the light theme instead, the configuration is this +(again with ``m-light.css`` possibly replaced with ``m-light.compiled.css``): + +.. code:: py + + M_CSS_FILES = ['https://fonts.googleapis.com/css?family=Libre+Baskerville:400,400i,700,700i%7CSource+Code+Pro:400,400i,600', + '/static/m-light.css'] + M_THEME_COLOR = '#cb4b16' + .. note-info:: To reduce confusion, new configuration variables specific to m.css theme @@ -112,14 +125,6 @@ can be either absolute or relative to :py:`SITEURL`. M_BLOG_NAME = 'Your Brand Blog' M_BLOG_URL = 'blog/' -Theme color :html:`` tag used by `CSS themes`_ can be specified with -the :py:`M_THEME_COLOR` variable. If not set, no theme color :html:`` tag -is present. Example configuration for the builtin dark theme: - -.. code:: py - - M_THEME_COLOR = '#22272e' - `Top navbar`_ ------------- -- 2.30.2