You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pelicanconf.py 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*- #
  3. import calendar
  4. from subprocess import check_output
  5. from os.path import basename
  6. import os
  7. AUTHOR = u'Annika Backstrom'
  8. SITENAME = u'sixohthree.com'
  9. SITENAME_SHORT = u'603'
  10. SITEURL = os.environ.get("PELICAN_SITEURL", "/")
  11. ENVIRONMENT = 'development'
  12. FEED_DOMAIN = SITEURL
  13. FEED_MAX_ITEMS = 10
  14. FEED_ALL_ATOM = 'feeds/atom.xml'
  15. FEED_ALL_RSS = 'feeds/feed.rss'
  16. TRANSLATION_FEED_ATOM = None
  17. CATEGORY_FEED_ATOM = None
  18. AUTHOR_FEED_ATOM = None
  19. AUTHOR_FEED_RSS = None
  20. THEME = 'themes/bleached'
  21. CACHE_CONTENT = True
  22. LOAD_CONTENT_CACHE = True
  23. STATIC_PATHS = [
  24. 'extra/robots.txt',
  25. 'extra/favicon.ico',
  26. 'extra/apple-touch-icon-precomposed.png',
  27. 'extra/empty',
  28. 'extra/keybase.txt',
  29. ]
  30. EXTRA_PATH_METADATA = { f: { 'path': basename(f) } for f in STATIC_PATHS }
  31. # extract full path into metadata
  32. PATH_METADATA = '(?P<content_path>.*)'
  33. BLOG_VERSION = check_output(['git', 'rev-parse', '--short', 'HEAD']).strip().decode('utf-8')
  34. TIMEZONE = 'America/New_York'
  35. DEFAULT_DATE_FORMAT = '%-d %B %Y'
  36. # Don't parse html files
  37. READERS = {'html': None}
  38. DEFAULT_LANG = u'en'
  39. DISPLAY_PAGES_ON_MENU = False
  40. #LINKS = (
  41. # ('About', '/about'),
  42. # ('@abackstrom', 'https://twitter.com/abackstrom'),
  43. #)
  44. HEADER_PAGES = (
  45. ('About', 'about'),
  46. ('Blog', 'blog'),
  47. ('Projects', 'projects'),
  48. )
  49. MENUITEMS = ()
  50. MARKDOWN = {
  51. 'extension_configs': {
  52. 'markdown.extensions.extra' : {},
  53. },
  54. 'output_format': 'html5',
  55. }
  56. SOCIAL = (
  57. ('Mastodon', 'https://xoxo.zone/@annika', 'mastodon.svg'),
  58. ('Gitea', 'https://git.abackstrom.com/annika', 'gitea.svg'),
  59. ('Keybase.io', 'https://keybase.io/abackstrom', 'keybase.svg'),
  60. ('GitLab', 'https://gitlab.com/abackstrom', 'gitlab.svg'),
  61. )
  62. def num2month(index):
  63. return calendar.month_name[index]
  64. JINJA_FILTERS = {
  65. 'num2month': num2month,
  66. }
  67. DEFAULT_PAGINATION = 25
  68. USE_FOLDER_AS_CATEGORY = False
  69. CATEGORY_URL = 'category/{slug}'
  70. CATEGORY_SAVE_AS = 'category/{slug}.html'
  71. TAG_URL = 'tag/{slug}'
  72. TAG_SAVE_AS = 'tag/{slug}.html'
  73. ARTICLE_URL = '{slug}'
  74. ARTICLE_SAVE_AS = '{slug}.html'
  75. PAGE_URL = '{slug}'
  76. PAGE_SAVE_AS = '{slug}.html'
  77. INDEX_URL = '/blog'
  78. INDEX_SAVE_AS = 'blog.html'
  79. AUTHOR_SAVE_AS = ''
  80. DIRECT_TEMPLATES = ( 'index', 'categories', 'tags', 'catalog' )
  81. PAGINATED_DIRECT_TEMPLATES = ()
  82. CATALOG_SAVE_AS = 'catalog.json'
  83. PLUGIN_PATHS = [
  84. 'pelican-plugins',
  85. ]
  86. PLUGINS = [
  87. 'gzip_cache',
  88. 'replacer',
  89. 'simple_footnotes',
  90. 'sitemap',
  91. ]
  92. SITEMAP = {
  93. 'format': 'xml',
  94. 'priorities': {
  95. 'articles': 0.5,
  96. 'indexes': 0.5,
  97. 'pages': 0.5,
  98. },
  99. 'changefreqs': {
  100. 'articles': 'weekly',
  101. 'indexes': 'daily',
  102. 'pages': 'weekly'
  103. },
  104. }
  105. REPLACES = (
  106. )