20
20
BLOG_TITLE = "Python Ecuador" # (translatable)
21
21
# This is the main URL for your site. It will be used
22
22
# in a prominent link. Don't forget the protocol (http/https)!
23
- deploy_site = os .environ .get (' NIKOLA_DEPLOY' )
23
+ deploy_site = os .environ .get (" NIKOLA_DEPLOY" )
24
24
if deploy_site :
25
- SITE_URL = ' https://{}/' .format (deploy_site .rstrip ('/' ))
25
+ SITE_URL = " https://{}/" .format (deploy_site .rstrip ("/" ))
26
26
else :
27
- SITE_URL = ' http://localhost:8000/'
27
+ SITE_URL = " http://localhost:8000/"
28
28
# This is the URL where Nikola's output will be deployed.
29
29
# If not set, defaults to SITE_URL
30
30
# BASE_URL = "https://pythonecuador.github.io/"
31
31
32
- BLOG_DESCRIPTION = "Comunidad de Python, Open Source y Software Libre de Ecuador" # (translatable)
32
+ BLOG_DESCRIPTION = (
33
+ "Comunidad de Python, Open Source y Software Libre de Ecuador" # (translatable)
34
+ )
33
35
34
36
# Nikola is multilingual!
35
37
#
156
158
# Alternative navigation links. Works the same way NAVIGATION_LINKS does,
157
159
# although themes may not always support them. (translatable)
158
160
# (Bootstrap 4: right-side of navbar, Bootblog 4: right side of title)
159
- NAVIGATION_ALT_LINKS = {
160
- DEFAULT_LANG : {}
161
- }
161
+ NAVIGATION_ALT_LINKS = {DEFAULT_LANG : {}}
162
162
163
163
# Name of the theme to use.
164
164
THEME = "custom"
165
165
166
166
# Primary color of your theme. This will be used to customize your theme.
167
167
# Must be a HEX value.
168
- THEME_COLOR = ' #5670d4'
168
+ THEME_COLOR = " #5670d4"
169
169
170
170
# Theme configuration. Fully theme-dependent. (translatable)
171
171
# Examples below are for bootblog4.
175
175
THEME_CONFIG = {
176
176
DEFAULT_LANG : {
177
177
# Show the latest featured post in a large box, with the previewimage as its background.
178
- ' featured_large' : False ,
178
+ " featured_large" : False ,
179
179
# Show the first (remaining) two featured posts in small boxes.
180
- ' featured_small' : False ,
180
+ " featured_small" : False ,
181
181
# Show featured posts on mobile.
182
- ' featured_on_mobile' : True ,
182
+ " featured_on_mobile" : True ,
183
183
# Show image in `featured_large` on mobile.
184
184
# `featured_small` displays them only on desktop.
185
- ' featured_large_image_on_mobile' : True ,
185
+ " featured_large_image_on_mobile" : True ,
186
186
# Strip HTML from featured post text.
187
- ' featured_strip_html' : False ,
187
+ " featured_strip_html" : False ,
188
188
# Contents of the sidebar, If empty, the sidebar is not displayed.
189
- ' sidebar' : ''
189
+ " sidebar" : "" ,
190
190
}
191
191
}
192
192
257
257
# Date format used to display post dates. (translatable)
258
258
# Used by babel.dates, CLDR style: http://cldr.unicode.org/translation/date-time
259
259
# You can also use 'full', 'long', 'medium', or 'short'
260
- DATE_FORMAT = ' YYYY-MM-dd'
260
+ DATE_FORMAT = " YYYY-MM-dd"
261
261
262
262
# Date format used to display post dates, if local dates are used. (translatable)
263
263
# Used by moment.js: https://momentjs.com/docs/#/displaying/format/
296
296
# 'markdown' is Markdown
297
297
# 'html' assumes the file is HTML and just copies it
298
298
COMPILERS = {
299
- "rest" : (' .rst' , ' .txt' ),
300
- "markdown" : (' .md' , ' .mdown' , ' .markdown' ),
301
- "textile" : (' .textile' ,),
302
- "txt2tags" : (' .t2t' ,),
303
- "bbcode" : (' .bb' ,),
304
- "wiki" : (' .wiki' ,),
305
- "ipynb" : (' .ipynb' ,),
306
- "html" : (' .html' , ' .htm' ),
299
+ "rest" : (" .rst" , " .txt" ),
300
+ "markdown" : (" .md" , " .mdown" , " .markdown" ),
301
+ "textile" : (" .textile" ,),
302
+ "txt2tags" : (" .t2t" ,),
303
+ "bbcode" : (" .bb" ,),
304
+ "wiki" : (" .wiki" ,),
305
+ "ipynb" : (" .ipynb" ,),
306
+ "html" : (" .html" , " .htm" ),
307
307
# PHP files are rendered the usual way (i.e. with the full templates).
308
308
# The resulting files have .php extensions, making it possible to run
309
309
# them without reconfiguring your server to recognize them.
310
- "php" : (' .php' ,),
310
+ "php" : (" .php" ,),
311
311
# Pandoc detects the input from the source filename
312
312
# but is disabled by default as it would conflict
313
313
# with many of the others.
392
392
# If you do not want to display a tag publicly, you can mark it as hidden.
393
393
# The tag will not be displayed on the tag list page and posts.
394
394
# Tag pages will still be generated.
395
- HIDDEN_TAGS = [' mathjax' ]
395
+ HIDDEN_TAGS = [" mathjax" ]
396
396
397
397
# Only include tags on the tag list/overview page if there are at least
398
398
# TAGLIST_MINIMUM_POSTS number of posts or more with every tag. Every tag
538
538
"""
539
539
<a href="https://seburath.github.io">https://seburath.github.io</a>
540
540
"""
541
- )
541
+ ),
542
542
},
543
543
}
544
544
545
545
546
546
# If you do not want to display an author publicly, you can mark it as hidden.
547
547
# The author will not be displayed on the author list page and posts.
548
548
# Tag pages will still be generated.
549
- HIDDEN_AUTHORS = [' Guest' ]
549
+ HIDDEN_AUTHORS = [" Guest" ]
550
550
551
551
# Final location for the main blog page and sibling paginated pages is
552
552
# output / TRANSLATION[lang] / INDEX_PATH / index-*.html
555
555
556
556
# Optional HTML that displayed on “main” blog index.html files.
557
557
# May be used for a greeting. (translatable)
558
- FRONT_INDEX_HEADER = {
559
- DEFAULT_LANG : ''
560
- }
558
+ FRONT_INDEX_HEADER = {DEFAULT_LANG : "" }
561
559
562
560
# Create per-month archives instead of per-year
563
561
# CREATE_MONTHLY_ARCHIVE = False
651
649
# For more details, read the manual:
652
650
# https://getnikola.com/handbook.html#deploying-to-github
653
651
# You will need to configure the deployment branch on GitHub.
654
- GITHUB_SOURCE_BRANCH = ' main'
655
- GITHUB_DEPLOY_BRANCH = ' gh-pages'
652
+ GITHUB_SOURCE_BRANCH = " main"
653
+ GITHUB_DEPLOY_BRANCH = " gh-pages"
656
654
657
655
# The name of the remote where you wish to push to, using github_deploy.
658
- GITHUB_REMOTE_NAME = ' origin'
656
+ GITHUB_REMOTE_NAME = " origin"
659
657
660
658
# Whether or not github_deploy should commit to the source branch automatically
661
659
# before deploying.
820
818
# (the thumbnail has ``.thumbnail`` added before the file extension by default,
821
819
# but a different naming template can be configured with IMAGE_THUMBNAIL_FORMAT).
822
820
823
- IMAGE_FOLDERS = {' images' : ' images' }
821
+ IMAGE_FOLDERS = {" images" : " images" }
824
822
# IMAGE_THUMBNAIL_SIZE = 400
825
823
# IMAGE_THUMBNAIL_FORMAT = '{name}.thumbnail{ext}'
826
824
943
941
944
942
# A small copyright notice for the page footer (in HTML).
945
943
# (translatable)
946
- CONTENT_FOOTER = '''
944
+ CONTENT_FOOTER = """
947
945
<div class="container">
948
946
<div class="row text-center">
949
947
<div class="col">
979
977
</div>
980
978
</div>
981
979
</div>
982
- '''
980
+ """
983
981
984
982
# Things that will be passed to CONTENT_FOOTER.format(). This is done
985
983
# for translatability, as dicts are not formattable. Nikola will
995
993
# do not need formatting)
996
994
# (translatable)
997
995
def get_last_commit ():
998
- encoding = ' utf-8'
996
+ encoding = " utf-8"
999
997
command = subprocess .run (["git" , "rev-parse" , "HEAD" ], capture_output = True )
1000
998
last_hash = command .stdout .decode (encoding )
1001
999
return last_hash [0 :8 ]
1002
1000
1001
+
1003
1002
CONTENT_FOOTER_FORMATS = {
1004
1003
DEFAULT_LANG : (
1005
1004
(),
@@ -1008,15 +1007,15 @@ def get_last_commit():
1008
1007
"author" : BLOG_AUTHOR ,
1009
1008
"date" : time .gmtime ().tm_year ,
1010
1009
"license" : LICENSE ,
1011
- "commit" : get_last_commit ()
1012
- }
1010
+ "commit" : get_last_commit (),
1011
+ },
1013
1012
)
1014
1013
}
1015
1014
1016
1015
# A simple copyright tag for inclusion in RSS feeds that works just
1017
1016
# like CONTENT_FOOTER and CONTENT_FOOTER_FORMATS
1018
1017
RSS_COPYRIGHT = 'Contents © {date} <a href="mailto:{email}">{author}</a> {license}'
1019
- RSS_COPYRIGHT_PLAIN = ' Contents © {date} {author} {license}'
1018
+ RSS_COPYRIGHT_PLAIN = " Contents © {date} {author} {license}"
1020
1019
RSS_COPYRIGHT_FORMATS = CONTENT_FOOTER_FORMATS
1021
1020
1022
1021
# To use comments, you can choose between different third party comment
@@ -1131,7 +1130,11 @@ def get_last_commit():
1131
1130
# with the MarkdownExtension class and should not be added here.
1132
1131
# Defaults are markdown.extensions.(fenced_code|codehilite|extra)
1133
1132
# markdown.extensions.meta is required for Markdown metadata.
1134
- MARKDOWN_EXTENSIONS = ['markdown.extensions.fenced_code' , 'markdown.extensions.codehilite' , 'markdown.extensions.extra' ]
1133
+ MARKDOWN_EXTENSIONS = [
1134
+ "markdown.extensions.fenced_code" ,
1135
+ "markdown.extensions.codehilite" ,
1136
+ "markdown.extensions.extra" ,
1137
+ ]
1135
1138
1136
1139
# Options to be passed to markdown extensions (See https://python-markdown.github.io/reference/)
1137
1140
# Default is {} (no config at all)
@@ -1334,11 +1337,11 @@ def get_last_commit():
1334
1337
# Images displayed come from the `previewimage` meta tag.
1335
1338
# You can specify the card type by using the `card` parameter in TWITTER_CARD.
1336
1339
TWITTER_CARD = {
1337
- ' use_twitter_cards' : True , # enable Twitter Cards
1340
+ " use_twitter_cards" : True , # enable Twitter Cards
1338
1341
# Card type, you can also use 'summary_large_image',
1339
1342
# see https://dev.twitter.com/cards/types
1340
- ' card' : ' summary' ,
1341
- ' site' : ' @pyecuador' , # twitter nick for the website
1343
+ " card" : " summary" ,
1344
+ " site" : " @pyecuador" , # twitter nick for the website
1342
1345
# 'creator': '@username', # Username for the content creator / author.
1343
1346
}
1344
1347
@@ -1403,13 +1406,15 @@ def get_last_commit():
1403
1406
# those.
1404
1407
TEMPLATE_FILTERS = {}
1405
1408
1409
+
1406
1410
def time_to_date (text ):
1407
1411
import datetime
1408
1412
1409
1413
seconds = int (text ) / 1000
1410
1414
time = datetime .date .fromtimestamp (seconds )
1411
1415
return time .strftime ("%d/%m/%Y" )
1412
1416
1417
+
1413
1418
TEMPLATE_FILTERS ["time" ] = time_to_date
1414
1419
1415
1420
# Put in global_context things you want available on all your templates.
0 commit comments