As the person who bifurcated the Pelican settings file in the first place, I recommend
thinking of two primary modes of operation: local development and production deployment (i.e., pelicanconf.py
and publishconf.py
, respectively).
Moving GOOGLE_ANALYTICS
from publishconf.py
to pelicanconf.py
is not recommended. When developing locally, settings for things like Google Analytics and Disqus are deliberately left out of pelicanconf.py
by design. Including those settings in local testing can have adverse effects: inaccurate site statistics, spurious comment threads, and other unanticipated side effects.
When it is time to publish your site, then of course you want those settings to be included. The way to do that is to ensure your publishconf.py
is being referenced at publish time:
pelican content -s publishconf.py
If you're using either the Fabric or Make automation framework that "wraps" the pelican
command, you could instead use:
fab publish
... or ...
make publish
I recommend taking a good look at precisely how you are publishing your site, ensuring that the appropriate settings file is being used during local development and production deployment, respectively.