7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
10 # FOR A PARTICULAR PURPOSE. |
10 # FOR A PARTICULAR PURPOSE. |
11 # |
11 # |
12 from pyams_i18n.interfaces import II18n |
|
13 from pyams_skin.interfaces.configuration import IConfiguration |
|
14 from pyams_utils.interfaces.site import ISiteRoot |
|
15 |
12 |
16 __docformat__ = 'restructuredtext' |
13 __docformat__ = 'restructuredtext' |
17 |
14 |
|
15 from pyramid.interfaces import IRequest |
|
16 from zope.interface import Interface, implementer |
18 |
17 |
19 # import standard library |
18 from pyams_i18n.interfaces import II18n |
20 |
19 from pyams_skin.interfaces.configuration import IConfiguration |
21 # import interfaces |
|
22 from pyams_skin.interfaces.extension import IGoogleAnalyticsInfo |
20 from pyams_skin.interfaces.extension import IGoogleAnalyticsInfo |
23 from pyams_skin.interfaces.metas import IHTMLContentMetas, IMetaHeader |
21 from pyams_skin.interfaces.metas import IHTMLContentMetas, IMetaHeader |
|
22 from pyams_utils.adapter import ContextRequestViewAdapter, adapter_config |
|
23 from pyams_utils.interfaces.site import ISiteRoot |
24 from pyams_utils.interfaces.tales import ITALESExtension |
24 from pyams_utils.interfaces.tales import ITALESExtension |
25 from pyramid.interfaces import IRequest |
|
26 |
|
27 # import packages |
|
28 from pyams_utils.adapter import adapter_config, ContextRequestViewAdapter |
|
29 from zope.interface import implementer, Interface |
|
30 |
25 |
31 |
26 |
32 # |
27 # |
33 # 'metas' TALES extension |
28 # 'metas' TALES extension |
34 # |
29 # |
170 order = 1 |
165 order = 1 |
171 |
166 |
172 def get_metas(self): |
167 def get_metas(self): |
173 config = IConfiguration(self.context) |
168 config = IConfiguration(self.context) |
174 yield HTMLTagMeta('title', config.title) |
169 yield HTMLTagMeta('title', config.title) |
|
170 yield ContentMeta('description', config.description) |
175 |
171 |
176 |
172 |
177 @adapter_config(name='content-type', context=(Interface, Interface, Interface), provides=IHTMLContentMetas) |
173 @adapter_config(name='content-type', context=(Interface, Interface, Interface), provides=IHTMLContentMetas) |
178 class ContentTypeMetasAdapter(ContextRequestViewAdapter): |
174 class ContentTypeMetasAdapter(ContextRequestViewAdapter): |
179 """Content-type metas adapter""" |
175 """Content-type metas adapter""" |