seitime-frappe/frappe/www/website_script.py
Rushabh Mehta c519122929 [docs] Build docs in an app (#3796)
* [docs] to be rendered in website

* [docs] generating-docs.md

* [fix] codacy

* [docs] minor updates

* [fix] routing
2017-07-28 11:43:16 +05:30

23 lines
751 B
Python

# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import strip
from frappe.website.doctype.website_theme.website_theme import get_active_theme
no_sitemap = 1
base_template_path = "templates/www/website_script.js"
def get_context(context):
context.javascript = frappe.db.get_single_value('Website Script',
'javascript') or ""
theme = get_active_theme()
js = strip(theme and theme.js or "")
if js:
context.javascript += "\n" + js
if not frappe.conf.developer_mode:
context["google_analytics_id"] = (frappe.db.get_single_value("Website Settings", "google_analytics_id")
or frappe.conf.get("google_analytics_id"))