From ba9c42c7594aec80a819b774fb2cf0635cf3aa5a Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 16 Oct 2015 00:08:13 -0700 Subject: strip trailing whitespace --- docs/narr/assets.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'docs/narr') diff --git a/docs/narr/assets.rst b/docs/narr/assets.rst index 4c0013298..020794062 100644 --- a/docs/narr/assets.rst +++ b/docs/narr/assets.rst @@ -30,7 +30,7 @@ The use of assets is quite common in most web development projects. For example, when you create a :app:`Pyramid` application using one of the available scaffolds, as described in :ref:`creating_a_project`, the directory representing the application contains a Python :term:`package`. Within that -Python package, there are directories full of files which are static assets. +Python package, there are directories full of files which are static assets. For example, there's a ``static`` directory which contains ``.css``, ``.js``, and ``.gif`` files. These asset files are delivered when a user visits an application URL. @@ -123,7 +123,7 @@ The ``name`` represents a URL *prefix*. In order for files that live in the ``path`` directory to be served, a URL that requests one of them must begin with that prefix. In the example above, ``name`` is ``static`` and ``path`` is ``/var/www/static``. In English this means that you wish to serve the files -that live in ``/var/www/static`` as sub-URLs of the ``/static`` URL prefix. +that live in ``/var/www/static`` as sub-URLs of the ``/static`` URL prefix. Therefore, the file ``/var/www/static/foo.css`` will be returned when the user visits your application's URL ``/static/foo.css``. @@ -176,7 +176,7 @@ For example, :meth:`~pyramid.config.Configurator.add_static_view` may be fed a :linenos: # config is an instance of pyramid.config.Configurator - config.add_static_view(name='http://example.com/images', + config.add_static_view(name='http://example.com/images', path='mypackage:images') Because :meth:`~pyramid.config.Configurator.add_static_view` is provided with a @@ -256,7 +256,7 @@ a *URL* instead of a view name. For example, the ``name`` argument may be .. code-block:: python :linenos: - config.add_static_view(name='http://example.com/images', + config.add_static_view(name='http://example.com/images', path='mypackage:images') Under such a configuration, the URL generated by ``static_url`` for assets @@ -391,7 +391,7 @@ URL. Supplying the ``cachebust`` argument also causes the static view to set headers instructing clients to cache the asset for ten years, unless the ``cache_max_age`` argument is also passed, in which case that value is used. -.. note:: +.. note:: md5 checksums are cached in RAM, so if you change a static resource without restarting your application, you may still generate URLs with a stale md5 @@ -472,7 +472,7 @@ the hash of the currently checked out code: def tokenize(self, pathspec): return self.sha1 - + Choosing a Cache Buster ~~~~~~~~~~~~~~~~~~~~~~~ @@ -504,7 +504,7 @@ time at start up as a cachebust token: from pyramid.static import QueryStringConstantCacheBuster config.add_static_view( - name='http://mycdn.example.com/', + name='http://mycdn.example.com/', path='mypackage:static', cachebust=QueryStringConstantCacheBuster(str(time.time()))) -- cgit v1.2.3