Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # -*- coding: utf-8 -*- # |
| 3 | from __future__ import unicode_literals |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 4 | import os |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 5 | |
| 6 | # For an exhaustive list of available variables and how to use them refer to |
| 7 | # http://docs.getpelican.com/en/stable/settings.html |
| 8 | |
| 9 | # Reference for signing off posts |
| 10 | AUTHOR = 'Luigi' |
| 11 | |
| 12 | # Reference to the site name |
| 13 | SITENAME = 'Giggi.me' |
| 14 | |
| 15 | # Custom variable, introduced for keeping requests cosistent |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 16 | INDEX_LINK_URL = 'blog' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 17 | |
| 18 | # If set, stop treating index.html as default posts binder |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 19 | INDEX_SAVE_AS = INDEX_LINK_URL + '.html' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 20 | |
| 21 | # URL path to the root |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 22 | _SITEURL = os.getenv('PELICAN_SITEURL') |
| 23 | SITEURL = 'https://www.' + _SITEURL |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 24 | |
| 25 | # URL path to the theme folder |
| 26 | THEMEURL = SITEURL |
| 27 | |
| 28 | # Local path to the markdown source folder |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 29 | _PATH = os.getenv('PELICAN_CONTENT') |
| 30 | PATH = _PATH |
| 31 | |
| 32 | # Where to output the generated files |
| 33 | OUTPUT_PATH = 'output' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 34 | |
| 35 | # Local path to the current theme folder |
| 36 | THEME = 'theme' |
| 37 | |
| 38 | # Default time zone |
| 39 | TIMEZONE = 'Europe/London' |
| 40 | |
| 41 | # The default date format you want to use. |
| 42 | DEFAULT_DATE_FORMAT = '%a %B %d %Y' |
| 43 | |
| 44 | # The extensions to use when looking up template files from template names. |
| 45 | TEMPLATE_EXTENSION = [ '.html' ] |
| 46 | |
| 47 | # Default language |
| 48 | DEFAULT_LANG = 'en' |
| 49 | |
| 50 | # Feed generation is usually not desired when developing |
| 51 | FEED_ALL_ATOM = None |
| 52 | |
| 53 | # |
| 54 | CATEGORY_FEED_ATOM = None |
| 55 | |
| 56 | # |
| 57 | TRANSLATION_FEED_ATOM = None |
| 58 | |
| 59 | # |
| 60 | AUTHOR_FEED_ATOM = None |
| 61 | |
| 62 | # |
| 63 | AUTHOR_FEED_RSS = None |
| 64 | |
| 65 | # Social widget |
| 66 | SOCIAL = ( |
| 67 | ('Linux', 'https://www.debian.org'), |
| 68 | ('Mail', 'mailto:luigi.santivetti@gmail.com'), |
luigi | 245c037 | 2020-11-06 23:07:53 +0000 | [diff] [blame] | 69 | ('Gitiles', SITEURL + '/gitiles'), |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 70 | ) |
| 71 | |
| 72 | # |
| 73 | DEFAULT_PAGINATION = False |
| 74 | |
| 75 | # List of plugins paths utilised by this site |
| 76 | PLUGIN_PATHS = [ |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 77 | 'plugins', |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 78 | ] |
| 79 | |
| 80 | # List of plugins names |
| 81 | PLUGINS = [ |
| 82 | 'assets', |
| 83 | 'photos', |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 84 | 'videos', |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 85 | ] |
| 86 | |
| 87 | # Derive categories from the folder name |
| 88 | USE_FOLDER_AS_CATEGORY = False |
| 89 | |
| 90 | # Show shortcuts to categories |
| 91 | DISPLAY_CATEGORIES_ON_MENU = True |
| 92 | |
| 93 | # Show shortcuts to static pages (i.e. non articles) |
| 94 | DISPLAY_PAGES_ON_MENU = False |
| 95 | |
| 96 | # Use cached html |
| 97 | LOAD_CONTENT_CACHE = False |
| 98 | |
| 99 | # List of menu items |
| 100 | MENUITEMS = [ |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 101 | ('Git', 'page/git'), |
| 102 | ('Mail', 'page/mail'), |
| 103 | ('Ftp', 'page/ftp'), |
| 104 | ('Invite', 'page/invite'), |
| 105 | ('About', 'page/about'), |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 106 | ] |
| 107 | |
| 108 | # Enable line numbers |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 109 | # https://python-markdown.github.io/reference/#markdown |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 110 | MARKDOWN = { |
| 111 | 'extension_configs': { |
| 112 | 'markdown.extensions.codehilite': {'css_class': 'highlight', 'linenums' : True}, |
| 113 | 'markdown.extensions.extra': {}, |
| 114 | 'markdown.extensions.meta': {}, |
| 115 | }, |
| 116 | 'output_format': 'html5', |
| 117 | } |
| 118 | |
| 119 | # |
| 120 | # Defines whether Pelican should use document-relative URLs or not. Only set |
| 121 | # this to True when developing/testing# and only if you fully understand the |
| 122 | # effect it can have on links/feeds. |
| 123 | #RELATIVE_URLS = True |
| 124 | |
| 125 | # The URL to refer to an article. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 126 | ARTICLE_URL = 'blog/{slug}' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 127 | |
| 128 | # The place where we will save an article. |
| 129 | ARTICLE_SAVE_AS = 'blog/{slug}.html' |
| 130 | |
| 131 | # The URL to refer to an article which doesn’t use the default language. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 132 | ARTICLE_LANG_URL = 'blog/{slug}-{lang}' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 133 | |
| 134 | # The place where we will save an article which doesn’t use the default |
| 135 | # language. |
| 136 | ARTICLE_LANG_SAVE_AS = 'blog/{slug}-{lang}.html' |
| 137 | |
| 138 | # The URL to refer to an article draft. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 139 | DRAFT_URL = 'blog/draft/{slug}' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 140 | |
| 141 | # The place where we will save an article draft. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 142 | DRAFT_SAVE_AS = 'blog/draft/{slug}.html' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 143 | |
| 144 | # The URL to refer to an article draft which doesn’t use the default language. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 145 | DRAFT_LANG_URL = 'blog/draft/{slug}-{lang}' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 146 | |
| 147 | # The place where we will save an article draft which doesn’t use the default |
| 148 | # language. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 149 | DRAFT_LANG_SAVE_AS = 'blog/draft/{slug}-{lang}.html' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 150 | |
| 151 | # The URL we will use to link to a page. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 152 | PAGE_URL = 'page/{slug}' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 153 | |
| 154 | # The location we will save the page. This value has to be the same as PAGE_URL |
| 155 | # or you need to use a rewrite in your server config. |
| 156 | PAGE_SAVE_AS = 'page/{slug}.html' |
| 157 | |
| 158 | # The URL we will use to link to a page which doesn’t use the default language. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 159 | PAGE_LANG_URL = 'page/{slug}-{lang}' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 160 | |
| 161 | #The location we will save the page which doesn’t use the default language. |
| 162 | PAGE_LANG_SAVE_AS = 'page/{slug}-{lang}.html' |
| 163 | |
| 164 | # The URL used to link to a page draft. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 165 | DRAFT_PAGE_URL = 'page/draft/{slug}' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 166 | |
| 167 | # The actual location a page draft is saved at. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 168 | DRAFT_PAGE_SAVE_AS = 'page/draft/{slug}.html' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 169 | |
| 170 | # The URL used to link to a page draft which doesn’t use the default language. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 171 | DRAFT_PAGE_LANG_URL = 'page/draft/{slug}-{lang}' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 172 | |
| 173 | # The actual location a page draft which doesn’t use the default language is |
| 174 | # saved at. |
| 175 | DRAFT_PAGE_LANG_SAVE_AS = 'draft/page/{slug}-{lang}.html' |
| 176 | |
| 177 | # The URL to use for a category. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 178 | CATEGORY_URL = 'category/{slug}' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 179 | |
| 180 | # The location to save a category. |
| 181 | CATEGORY_SAVE_AS = 'category/{slug}.html' |
| 182 | |
| 183 | # The URL to use for a tag. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 184 | TAG_URL = 'tag/{slug}' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 185 | |
| 186 | # The location to save the tag page. |
| 187 | TAG_SAVE_AS = 'tag/{slug}.html' |
| 188 | |
| 189 | # The URL to use for an author. |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 190 | AUTHOR_URL = 'author/{slug}' |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 191 | |
| 192 | # The location to save an author. |
| 193 | AUTHOR_SAVE_AS = 'author/{slug}.html' |
| 194 | |
| 195 | # The location to save per-year archives of your posts. |
| 196 | YEAR_ARCHIVE_SAVE_AS = 'blog/{date:%Y}/index.html' |
| 197 | |
| 198 | # The URL to use for per-year archives of your posts. Used only if you have the |
| 199 | # {url} placeholder in PAGINATION_PATTERNS. |
| 200 | YEAR_ARCHIVE_URL = '' |
| 201 | |
| 202 | # The location to save per-month archives of your posts. |
| 203 | MONTH_ARCHIVE_SAVE_AS = 'blog/{date:%Y}/{date:%b}/index.html' |
| 204 | |
| 205 | # The URL to use for per-month archives of your posts. Used only if you have the |
| 206 | # {url} placeholder in PAGINATION_PATTERNS. |
| 207 | MONTH_ARCHIVE_URL = '' |
| 208 | |
| 209 | # The location to save per-day archives of your posts. |
| 210 | DAY_ARCHIVE_SAVE_AS = 'blog/{date:%Y}/{date:%b}/{date:%d}/index.html' |
| 211 | |
| 212 | # The URL to use for per-day archives of your posts. Used only if you have the |
| 213 | # {url} placeholder in PAGINATION_PATTERNS. |
| 214 | DAY_ARCHIVE_URL = '' |
| 215 | |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 216 | # Photos plugin |
| 217 | PHOTO_LIBRARY = os.getenv('PELICAN_PHOTO_LIBRARY') |
| 218 | PHOTO_EXCLUDE = os.getenv('PELICAN_PHOTO_EXCLUDE') |
| 219 | PHOTO_EXCLUDEALL = os.getenv('PELICAN_PHOTO_EXCLUDEALL') |
| 220 | PHOTO_SKIPTAG = os.getenv('PELICAN_PHOTO_SKIPTAG') |
Luigi Santivetti | d93cb0f | 2020-02-17 22:21:28 +0000 | [diff] [blame] | 221 | PHOTO_GALLERY = (2000, 1333, 100) |
| 222 | PHOTO_ARTICLE = (2000, 1333, 100) |
| 223 | PHOTO_THUMB = (300, 200, 100) |
| 224 | PHOTO_SQUARE_THUMB = False |
Luigi Santivetti | 6ce0e13 | 2020-10-07 23:28:00 +0100 | [diff] [blame] | 225 | PHOTO_RESIZE_JOBS = os.cpu_count() |
| 226 | |
| 227 | # Videos plugin |
| 228 | VIDEO_LIBRARY = os.getenv('PELICAN_VIDEO_LIBRARY') |
| 229 | VIDEO_EXCLUDE = os.getenv('PELICAN_VIDEO_EXCLUDE') |
| 230 | VIDEO_EXCLUDEALL = os.getenv('PELICAN_VIDEO_EXCLUDEALL') |
| 231 | VIDEO_SKIPTAG = os.getenv('PELICAN_VIDEO_SKIPTAG') |
| 232 | VIDEO_GALLERY = (720, 400, 100) |
| 233 | VIDEO_ARTICLE = (720, 400, 100) |