pelicanconf.py 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*- #
  3. SITENAME = u'MediaGoblin'
  4. SITEURL = 'http://mediagoblin.org'
  5. FEED_DOMAIN = 'http://mediagoblin.org'
  6. TIMEZONE = 'America/Chicago'
  7. DEFAULT_LANG = u'en'
  8. MARKUP = ('md', 'rst', 'html')
  9. AUTHOR = u'Christopher Allan Webber'
  10. TYPOGRIFY = (True)
  11. # Content dirs
  12. #ARTICLE_DIR = ('entries/news')
  13. #PATH = ('entries/news')
  14. OUTPUT_PATH = ('output')
  15. DELETE_OUTPUT_DIRECTORY = (True)
  16. ARTICLE_EXCLUDES = (('pages',))
  17. THEME = ('theme')
  18. DEFAULT_PAGINATION = 10
  19. STATIC_PATHS = (['static/blog_images', 'static/download', 'static/images', 'static/irclogs', 'static/videos', 'pages',])
  20. TEMPLATE_PAGES = {"pages/404.html": "pages/404.html",
  21. "pages/about.html": "pages/about.html",
  22. "pages/campaign.html": "pages/campaign.html",
  23. "pages/video_iframe.html": "pages/video_iframe.html",
  24. "pages/campaign.es.html": "pages/campaign.es.html",
  25. "pages/join.html": "pages/join.html",
  26. "pages/logo.html": "pages/logo.html",
  27. "pages/tour.html": "pages/tour.html"}
  28. PLUGIN_PATH = "plugins"
  29. PLUGINS = ["html_rst_directive",]
  30. ARTICLE_URL = "news/{slug}.html"
  31. ARTICLE_SAVE_AS = "news/{slug}.html"
  32. DIRECT_TEMPLATES = ('index', 'blog')
  33. PAGINATED_DIRECT_TEMPLATES = ('index', 'blog')
  34. BLOG_SAVE_AS = 'news/index.html'
  35. FILENAME_METADATA = "(?P<slug>.*)"
  36. # Feeds, categories and tags
  37. FEED_ALL_ATOM = 'news/index.xml'
  38. CATEGORY_SAVE_AS = ('category/{slug}.html')
  39. DEFAULT_CATEGORY = 'entry'
  40. TAG_URL = ('tag/{slug}.html')
  41. TAG_SAVE_AS = ('tag/{slug}.html')
  42. # ONLY ENABLE RELATIVE URLS TO TEST - IT WILL HELP TO LOCALLY TEST THE THEME
  43. # SET RELATIVE URLS TO FALSE BEFORE PUSHING TO PRODUCTION
  44. RELATIVE_URLS = (False)
  45. # External Links - these can be used to generate the menus
  46. LINKS = (('news', 'http://mediagoblin.org/news/index.html'),
  47. ('tour', 'http://mediagoblin.org/pages/tour.html'),
  48. ('community', 'http://mediagoblin.org/pages/join.html'),
  49. ('bug tracker', 'http://issues.mediagoblin.org'),
  50. ('git repository', 'https://savannah.gnu.org/projects/mediagoblin'))
  51. # Blogroll
  52. # LINKS = (('Pelican', 'http://docs.notmyidea.org/alexis/pelican/'),
  53. # ('Python.org', 'http://python.org'),
  54. # ('Jinja2', 'http://jinja.pocoo.org'),
  55. # ('You can modify those links in your config file', '#'),)
  56. # Social widget
  57. SOCIAL = (('Identi.ca', 'http://identi.ca/mediagoblin'),
  58. ('Twitter', 'http://twitter.com/mediagoblin'),)
  59. def CAMPAIGN_DAYS_LEFT():
  60. import datetime
  61. daysleft = (datetime.date(2014, 4, 18) - datetime.date.today()).days
  62. if daysleft == 1:
  63. return "Only 1 day left... Support MediaGoblin!"
  64. elif daysleft == 0:
  65. return "Last day to donate... Support MediaGoblin!"
  66. elif daysleft > 0:
  67. return "%s days left... Support MediaGoblin!" % daysleft
  68. else:
  69. return "0 days left! Thanks for your support!"