2.13.0: configuring an absolute “baseUrl” for your site to improve facebook og:meta tags, newsletter generation by tasks, etc. works better.
-
req.baseUrl
is now also available asreq.data.baseUrl
, and thus available in templates. This is great if you need to link to your own assets at hardcoded relative paths. However see alsobaseUrlWithPrefix
below. -
req.baseUrlWithPrefix
andreq.data.baseUrlWithPrefix
have been added. If your site uses or might use a prefix and your assets with hardcoded paths are served by Apostrophe, these are more suitable. -
req.absoluteUrl
is also available asreq.data.absoluteUrl
and thus in page templates. - The
apostrophe-express
module correctly readsbaseUrl
from the global options of Apostrophe, not its own options; it is accepted from its own options for bc but for the full benefit you should set it globally. A warning is displayed if you set it the other way. - The
req
objects returned byapos.tasks.getReq()
now include these properties, and you can pass{ url: '/some-relative-url' }
if you want theabsoluteUrl
property to be based on a particular URL within the site. This is also used for unit testing. - Unit tests no longer pass the meaningless
hostName
global option. - Unit tests added for the above.