1
0

conf.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. """
  2. Blogit configuration module.
  3. Following projects like sphinx or django this project, chooses
  4. python code as a configuration language instead of choosing the
  5. ini, yaml, or what ever DSL for configuration.
  6. """
  7. import datetime
  8. import os
  9. from collections import namedtuple
  10. import tinydb
  11. CONFIG = {
  12. 'content_root': 'content', # where the markdown files are
  13. 'output_to': 'oz123.github.com',
  14. 'raw_content': 'oz123.github.com/writings_raw/content',
  15. 'templates': 'templates',
  16. 'date_format': '%Y-%m-%d',
  17. 'base_url': 'http://oz123.github.com',
  18. 'http_port': 3030,
  19. 'content_encoding': 'utf-8',
  20. 'author': 'Oz Nahum Tiram',
  21. 'editor': 'editor'
  22. }
  23. if not os.path.exists(os.path.join(CONFIG['content_root'])):
  24. os.makedirs(os.path.join(CONFIG['content_root']))
  25. # EDIT THIS PARAMETER TO CHANGE ARCHIVE SIZE
  26. # 0 Means that all the entries will be in the archive
  27. # 10 meas that all the entries except the last 10
  28. ARCHIVE_SIZE = 0
  29. GLOBAL_TEMPLATE_CONTEXT = {
  30. 'media_base': '/media/',
  31. 'media_url': '../media/',
  32. 'site_url': 'http://oz123.github.com',
  33. 'last_build': datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ"),
  34. 'twitter': 'https://twitter.com/#!/OzNTiram',
  35. 'stackoverflow': "http://stackoverflow.com/users/492620/oz123",
  36. 'github': "https://github.com/oz123",
  37. }
  38. # with this config, pages are rendered to the location of their title
  39. KINDS = {
  40. 'writing': {
  41. 'name': 'writing', 'name_plural': 'writings',
  42. },
  43. 'note': {
  44. 'name': 'note', 'name_plural': 'notes',
  45. },
  46. 'link': {
  47. 'name': 'link', 'name_plural': 'links',
  48. },
  49. 'photo': {
  50. 'name': 'photo', 'name_plural': 'photos',
  51. },
  52. }