conf.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 tinydb
  9. db = tinydb.TinyDB('blogit.db')
  10. CONFIG = {
  11. 'content_root': 'content', # where the markdown files are
  12. 'output_to': 'oz123.github.com',
  13. 'raw_content': 'oz123.github.com/writings_raw/content',
  14. 'templates': 'templates',
  15. 'date_format': '%Y-%m-%d',
  16. 'base_url': 'http://oz123.github.com',
  17. 'http_port': 3030,
  18. 'content_encoding': 'utf-8',
  19. 'author': 'Oz Nahum Tiram',
  20. 'editor': 'editor'
  21. }
  22. DB = {'posts': db.table('posts'), 'tags': db.table('tags'),
  23. 'pages': db.table('pages'), 'templates': db.table('templates') }
  24. # EDIT THIS PARAMETER TO CHANGE ARCHIVE SIZE
  25. # 0 Means that all the entries will be in the archive
  26. # 10 meas that all the entries except the last 10
  27. ARCHIVE_SIZE = 0
  28. GLOBAL_TEMPLATE_CONTEXT = {
  29. 'media_base': '/media/',
  30. 'media_url': '../media/',
  31. 'site_url': 'http://oz123.github.com',
  32. 'last_build': datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ"),
  33. 'twitter': 'https://twitter.com/#!/OzNTiram',
  34. 'stackoverflow': "http://stackoverflow.com/users/492620/oz123",
  35. 'github': "https://github.com/oz123",
  36. }
  37. KINDS = {
  38. 'writing': {
  39. 'name': 'writing', 'name_plural': 'writings',
  40. },
  41. 'note': {
  42. 'name': 'note', 'name_plural': 'notes',
  43. },
  44. 'link': {
  45. 'name': 'link', 'name_plural': 'links',
  46. },
  47. 'photo': {
  48. 'name': 'photo', 'name_plural': 'photos',
  49. },
  50. 'page': {
  51. 'name': 'page', 'name_plural': 'pages',
  52. },
  53. }