1
0
Fork 0
forked from github/pelican

Merge branch 'master' of github.com:ametaireau/pelican

This commit is contained in:
Alexis Metaireau 2011-06-13 15:01:10 +02:00
commit d366fd376e
4 changed files with 24 additions and 1 deletions

View file

@ -208,6 +208,12 @@ Setting name what does it do ?
`GITHUB_URL` Your github URL (if you have one), it will then
use it to create a github ribbon.
`GOOGLE_ANALYTICS` 'UA-XXXX-YYYY' to activate google analytics.
`PIWIK_URL` URL to your Piwik server - without 'http://' at the
beginning.
`PIWIK_SSL_URL` If the SSL-URL differs from the normal Piwik-URL
you have to include this setting too. (optional)
`PIWIK_SITE_ID` ID for the monitored website. You can find the ID
in the Piwik admin interface > settings > websites.
`LINKS` A list of tuples (Title, Url) for links to appear on
the header.
`SOCIAL` A list of tuples (Title, Url) to appear in the "social"

View file

@ -77,7 +77,7 @@ def read_settings(filename):
# Make the paths relative to the settings file
for path in ['PATH', 'OUTPUT_PATH']:
if path in context:
if not os.path.isabs(context[path]):
if context[path] is not None and not os.path.isabs(context[path]):
context[path] = os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(filename), context[path])))
# set the locale

View file

@ -81,6 +81,7 @@
</footer><!-- /#contentinfo -->
{% include 'analytics.html' %}
{% include 'piwik.html' %}
{% include 'disqus_script.html' %}
</body>
</html>

View file

@ -0,0 +1,16 @@
{% if PIWIK_URL and PIWIK_SITE_ID %}
<script type="text/javascript">
{% if PIWIK_SSL_URL %}
var pkBaseURL = (("https:" == document.location.protocol) ? "https://{{ PIWIK_SSL_URL }}/" : "http://{{ PIWIK_URL }}/");
{% else %}
var pkBaseURL = (("https:" == document.location.protocol) ? "https://{{ PIWIK_URL }}/" : "http://{{ PIWIK_URL }}/");
{% endif %}
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {{ PIWIK_SITE_ID }});
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://{{ PIWIK_URL }}/piwik.php?idsite={{ PIWIK_SITE_ID }}" style="border:0" alt="" /></p></noscript>
{% endif %}