#!/usr/bin/python
# -*- coding: utf-8 -*-

from __future__ import unicode_literals

import os

AUTHOR = u'Chih-Cheng Liang'

SITENAME = u'LaiHangE'
SITESUBTITLE = u"Yet another noob programmer's blog"

# Change in publishconf.py and ignore the WARNING.  This is needed so you
# can inspect the site using a web-server at locahost.

SITEURL = 'http://chihchengliang.github.io/blog'

# Times and dates.

DEFAULT_DATE_FORMAT = '%b %d, %Y'
TIMEZONE = 'Asia/Taipei'
DEFAULT_LANG = u'en'

# Set the article URL.

ARTICLE_URL = '{date:%Y}/{date:%m}/{date:%d}/{slug}/'
ARTICLE_SAVE_AS = '{date:%Y}/{date:%m}/{date:%d}/{slug}/index.html'

# Title menu options.

uri = SITEURL
MENUITEMS = [('Blog', '%s/' % uri), ('Archives', '%s/archives.html'
             % uri)]  # ('About', '%s/pages/about.html' % uri)
NEWEST_FIRST_ARCHIVES = True

# Github include settings.
# GITHUB_USER = 'ocefpaf'
# GITHUB_REPO_COUNT = 0
# GITHUB_SKIP_FORK = True
# GITHUB_SHOW_USER_LINK = True

# Blogroll.

LINKS = (("Gilbert's Data Lab", 'http://weichengliou.github.io/blog/'),
         )

# Social widget.
# SOCIAL = (('You can add links in your config file', '#'),
          # ('Another social link', '#'),)

DEFAULT_PAGINATION = 10

# STATIC_OUT_DIR requires pelican 3.3+.

STATIC_PATHS = ['images', 'figures', 'downloads', 'favicon.png']
CODE_DIR = 'downloads/code'
NOTEBOOK_DIR = 'downloads/notebooks'

# Theme and plug-ins.

path = os.path.join(os.environ.get('HOME'), 'pelican')
THEME = '%s/pelican-octopress-theme' % path
PLUGIN_PATHS = ['%s/pelican-plugins' % path]
PLUGINS = [
    'summary',
    'liquid_tags.img',
    'liquid_tags.video',
    'liquid_tags.include_code',
    'liquid_tags.notebook',
    'liquid_tags.literal',
    'sitemap',
    ]

DISPLAY_CATEGORIES_ON_MENU = False

# The theme file should be updated so that the base header contains the line:
# {% if EXTRA_HEADER %}
# {{ EXTRA_HEADER }}
# {% endif %}

# This header file is automatically generated by the notebook plugin.

if not os.path.exists('_nb_header.html'):
    import warnings
    warnings.warn('_nb_header.html not found.  Rerun make html to finalize build.'
                  )
else:
    EXTRA_HEADER = open('_nb_header.html').read().decode('utf-8')

# Sharing

# TWITTER_USER = 'ocefpaf'

GOOGLE_PLUS_USER = '+ChihChengLiang'
GOOGLE_PLUS_ONE = True
GOOGLE_PLUS_HIDDEN = False
FACEBOOK_LIKE = True

# TWITTER_TWEET_BUTTON = True
# TWITTER_LATEST_TWEETS = True
# TWITTER_FOLLOW_BUTTON = True
# TWITTER_TWEET_COUNT = 3
# TWITTER_SHOW_REPLIES = 'false'
# TWITTER_SHOW_FOLLOWER_COUNT = 'true'

# RSS/Atom feeds

FEED_DOMAIN = SITEURL
FEED_ATOM = 'atom.xml'

# Search

SEARCH_BOX = True

SITEMAP = {'format': 'xml', 'priorities': {'articles': 0.5,
           'indexes': 0.5, 'pages': 0.5},
           'changefreqs': {'articles': 'monthly', 'indexes': 'daily',
           'pages': 'monthly'}}

