[fix] tests + add google analytics id in docs

This commit is contained in:
Rushabh Mehta 2016-12-09 16:39:38 +05:30
parent 2bf66a6bcb
commit ca97204bdb
4 changed files with 19 additions and 4 deletions

View file

@ -2,6 +2,8 @@
from __future__ import unicode_literals
docs_version = "7.x.x"
source_link = "https://github.com/frappe/frappe"
docs_base_url = "https://frappe.github.io/frappe"
headline = "Superhero Web Framework"
@ -25,7 +27,7 @@ ERP for managing small and medium sized businesses.
[Get started with the Tutorial](https://frappe.github.io/frappe/user/)
"""
docs_version = "7.x.x"
google_analytics_id = 'UA-8911157-23'
def get_context(context):
context.brand_html = ('<img class="brand-logo" src="'+context.docs_base_url

View file

@ -92,7 +92,7 @@ class DocType(Document):
target.`{fieldname}` = source.`{source_fieldname}`
where
target.`{link_fieldname}` = source.name
and ifnull(target.`{link_fieldname}`, '')="" '''.format(
and ifnull(target.`{fieldname}`, '')="" '''.format(
link_doctype = link_df.options,
source_fieldname = source_fieldname,
doctype = self.name,

View file

@ -106,6 +106,18 @@
</script>
{%- block script %}{%- endblock %}
{% if app.google_analytics_id %}
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ app.google_analytics_id }}', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
<!-- csrf_token -->
{%- block body_include %}{{ body_include or "" }}{% endblock -%}
</body>

View file

@ -47,7 +47,8 @@ class setup_docs(object):
"long_description": markdown(getattr(self.docs_config, "long_description", "")),
"license": self.hooks.get("app_license")[0],
"branch": getattr(self.docs_config, "branch", None) or "develop",
"style": getattr(self.docs_config, "style", "")
"style": getattr(self.docs_config, "style", ""),
"google_analytics_id": getattr(self.docs_config, "google_analytics_id", "")
}),
"metatags": {
"description": self.hooks.get("app_description")[0],
@ -408,7 +409,7 @@ class setup_docs(object):
"css/font-awesome.css": "css/font-awesome.css",
"css/docs.css": "css/docs.css",
"css/hljs.css": "css/hljs.css",
"css/font": "css/font",
"css/fonts": "css/fonts",
"css/octicons": "css/octicons",
# always overwrite octicons.css to fix the path
"css/octicons/octicons.css": "css/octicons/octicons.css",