pelicanconf.py

Wed, 12 Jul 2023 21:35:29 +0200

author
David Douard <david.douard@sdf3.org>
date
Wed, 12 Jul 2023 21:35:29 +0200
changeset 149
5ce5f3046c0b
parent 148
2f87039dd0b5
permissions
-rwxr-xr-x

Add a blog entry for the Numworks N0110 repair

0
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
1 #!/usr/bin/env python
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
2 # -*- coding: utf-8 -*- #
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
3 from __future__ import unicode_literals
40
2a30ebfd851f [base] add piwik js stuff
David Douard <david.douard@logilab.fr>
parents: 36
diff changeset
4 import socket
113
0bcf355064e5 few fixes in pelicanconf
David Douard <david.douard@sdfa3.org>
parents: 108
diff changeset
5
146
11e6db4102f1 Better fix for matomo integration
David Douard <david.douard@sdf3.org>
parents: 142
diff changeset
6 isprod = socket.gethostname() == 'sdfa3'
0
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
7
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
8 AUTHOR = u'David Douard'
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
9 SITENAME = u'Whatever'
34
871fcc94f63e [config] add twitter stuff an links to eevblog and elo
David Douard <david.douard@logilab.fr>
parents: 26
diff changeset
10 SITESUBTITLE = u"A blog, sort of"
871fcc94f63e [config] add twitter stuff an links to eevblog and elo
David Douard <david.douard@logilab.fr>
parents: 26
diff changeset
11 TWITTER_USERNAME = u'douardda'
113
0bcf355064e5 few fixes in pelicanconf
David Douard <david.douard@sdfa3.org>
parents: 108
diff changeset
12 CONTACTS = (('twitter', 'https://twitter.com/douardda'),
142
6faac5ee8017 Disable deprecated feed_summary plugin and update SOCIAL var
David Douard <david.douard@sdf3.org>
parents: 122
diff changeset
13 ('mastodon', 'https://pouet.chapril.org/@douardda'))
40
2a30ebfd851f [base] add piwik js stuff
David Douard <david.douard@logilab.fr>
parents: 36
diff changeset
14
96
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
15
113
0bcf355064e5 few fixes in pelicanconf
David Douard <david.douard@sdfa3.org>
parents: 108
diff changeset
16 if isprod:
40
2a30ebfd851f [base] add piwik js stuff
David Douard <david.douard@logilab.fr>
parents: 36
diff changeset
17 SITEURL = 'https://whatever.sdfa3.org'
146
11e6db4102f1 Better fix for matomo integration
David Douard <david.douard@sdf3.org>
parents: 142
diff changeset
18 MATOMO_JS = '''
122
08b9a05b3d8d upgrade piwik code for matomo
David Douard <david.douard@sdfa3.org>
parents: 117
diff changeset
19 <!-- Matomo -->
146
11e6db4102f1 Better fix for matomo integration
David Douard <david.douard@sdf3.org>
parents: 142
diff changeset
20 <script>
11e6db4102f1 Better fix for matomo integration
David Douard <david.douard@sdf3.org>
parents: 142
diff changeset
21 var _paq = window._paq = window._paq || [];
122
08b9a05b3d8d upgrade piwik code for matomo
David Douard <david.douard@sdfa3.org>
parents: 117
diff changeset
22 /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
40
2a30ebfd851f [base] add piwik js stuff
David Douard <david.douard@logilab.fr>
parents: 36
diff changeset
23 _paq.push(['trackPageView']);
2a30ebfd851f [base] add piwik js stuff
David Douard <david.douard@logilab.fr>
parents: 36
diff changeset
24 _paq.push(['enableLinkTracking']);
2a30ebfd851f [base] add piwik js stuff
David Douard <david.douard@logilab.fr>
parents: 36
diff changeset
25 (function() {
146
11e6db4102f1 Better fix for matomo integration
David Douard <david.douard@sdf3.org>
parents: 142
diff changeset
26 var u="//matomo.sdfa3.org/";
122
08b9a05b3d8d upgrade piwik code for matomo
David Douard <david.douard@sdfa3.org>
parents: 117
diff changeset
27 _paq.push(['setTrackerUrl', u+'matomo.php']);
08b9a05b3d8d upgrade piwik code for matomo
David Douard <david.douard@sdfa3.org>
parents: 117
diff changeset
28 _paq.push(['setSiteId', '2']);
40
2a30ebfd851f [base] add piwik js stuff
David Douard <david.douard@logilab.fr>
parents: 36
diff changeset
29 var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
146
11e6db4102f1 Better fix for matomo integration
David Douard <david.douard@sdf3.org>
parents: 142
diff changeset
30 g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
40
2a30ebfd851f [base] add piwik js stuff
David Douard <david.douard@logilab.fr>
parents: 36
diff changeset
31 })();
2a30ebfd851f [base] add piwik js stuff
David Douard <david.douard@logilab.fr>
parents: 36
diff changeset
32 </script>
122
08b9a05b3d8d upgrade piwik code for matomo
David Douard <david.douard@sdfa3.org>
parents: 117
diff changeset
33 <!-- End Matomo Code -->
08b9a05b3d8d upgrade piwik code for matomo
David Douard <david.douard@sdfa3.org>
parents: 117
diff changeset
34 '''
146
11e6db4102f1 Better fix for matomo integration
David Douard <david.douard@sdf3.org>
parents: 142
diff changeset
35 MATOMO_IMG = '''
11e6db4102f1 Better fix for matomo integration
David Douard <david.douard@sdf3.org>
parents: 142
diff changeset
36 <img referrerpolicy="no-referrer-when-downgrade" src="https://matomo.sdfa3.org/matomo.php?idsite=2&amp;rec=1" style="border:0" alt="" />
11e6db4102f1 Better fix for matomo integration
David Douard <david.douard@sdf3.org>
parents: 142
diff changeset
37 '''
40
2a30ebfd851f [base] add piwik js stuff
David Douard <david.douard@logilab.fr>
parents: 36
diff changeset
38 else:
2a30ebfd851f [base] add piwik js stuff
David Douard <david.douard@logilab.fr>
parents: 36
diff changeset
39 SITEURL = ''
146
11e6db4102f1 Better fix for matomo integration
David Douard <david.douard@sdf3.org>
parents: 142
diff changeset
40 MATOMO_JS = ''
11e6db4102f1 Better fix for matomo integration
David Douard <david.douard@sdf3.org>
parents: 142
diff changeset
41 MATOMO_IMG = ''
0
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
42
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
43 PATH = 'content'
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
44
36
9507107a1133 [theme] use a personalized bricks theme
David Douard <david.douard@logilab.fr>
parents: 34
diff changeset
45 THEME = 'theme'
0
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
46 TIMEZONE = 'Europe/Paris'
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
47
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
48 DEFAULT_LANG = u'en'
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
49
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
50 # Feed generation is usually not desired when developing
26
acdf2e764a88 minor updates
David Douard <david.douard@logilab.fr>
parents: 24
diff changeset
51 #FEED_ALL_ATOM = None
acdf2e764a88 minor updates
David Douard <david.douard@logilab.fr>
parents: 24
diff changeset
52 #CATEGORY_FEED_ATOM = None
113
0bcf355064e5 few fixes in pelicanconf
David Douard <david.douard@sdfa3.org>
parents: 108
diff changeset
53 CATEGORY_FEED_ATOM_URL = 'feeds/%s.atom.xml'
26
acdf2e764a88 minor updates
David Douard <david.douard@logilab.fr>
parents: 24
diff changeset
54 #TRANSLATION_FEED_ATOM = None
acdf2e764a88 minor updates
David Douard <david.douard@logilab.fr>
parents: 24
diff changeset
55 #AUTHOR_FEED_ATOM = None
acdf2e764a88 minor updates
David Douard <david.douard@logilab.fr>
parents: 24
diff changeset
56 #AUTHOR_FEED_RSS = None
113
0bcf355064e5 few fixes in pelicanconf
David Douard <david.douard@sdfa3.org>
parents: 108
diff changeset
57
26
acdf2e764a88 minor updates
David Douard <david.douard@logilab.fr>
parents: 24
diff changeset
58 FEED_RSS = 'feeds/rss.xml'
acdf2e764a88 minor updates
David Douard <david.douard@logilab.fr>
parents: 24
diff changeset
59 FEED_ALL_RSS = 'feeds/all.rss.xml'
36
9507107a1133 [theme] use a personalized bricks theme
David Douard <david.douard@logilab.fr>
parents: 34
diff changeset
60 FEED_ATOM = 'feeds/atom.xml'
9507107a1133 [theme] use a personalized bricks theme
David Douard <david.douard@logilab.fr>
parents: 34
diff changeset
61 FEED_ALL_ATOM = 'feeds/all.atom.xml'
0
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
62
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
63 # Blogroll
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
64 LINKS = (('Pelican', 'http://getpelican.com/'),
34
871fcc94f63e [config] add twitter stuff an links to eevblog and elo
David Douard <david.douard@logilab.fr>
parents: 26
diff changeset
65 ('EEVBlog', 'https://www.eevblog.com/'),
66
70aad9a1272b [hp34970a] part 4
David Douard <david.douard@logilab.fr>
parents: 41
diff changeset
66 )
0
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
67
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
68 # Social widget
113
0bcf355064e5 few fixes in pelicanconf
David Douard <david.douard@sdfa3.org>
parents: 108
diff changeset
69 SOCIAL = (('twitter', 'https://twitter.com/douardda'),
0bcf355064e5 few fixes in pelicanconf
David Douard <david.douard@sdfa3.org>
parents: 108
diff changeset
70 ('mastodon', 'https://social.logilab.org/@david'))
0bcf355064e5 few fixes in pelicanconf
David Douard <david.douard@sdfa3.org>
parents: 108
diff changeset
71
0
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
72
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
73 DEFAULT_PAGINATION = 10
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
74
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
75 # Uncomment following line if you want document-relative URLs when developing
e7f601f9db69 initial setup
David Douard <david.douard@logilab.fr>
parents:
diff changeset
76 #RELATIVE_URLS = True
24
89689c6e9cf4 [hp8904a] add two blogs about the HP8904A and a small update of the about page
David Douard <david.douard@logilab.fr>
parents: 0
diff changeset
77
117
6d0820cef446 new post on the eip545b fw
David Douard <david.douard@sdfa3.org>
parents: 116
diff changeset
78 STATIC_PATHS = ['images', 'pdfs', 'json', 'data']
24
89689c6e9cf4 [hp8904a] add two blogs about the HP8904A and a small update of the about page
David Douard <david.douard@logilab.fr>
parents: 0
diff changeset
79
116
dad9b39691de move custom plugins in a dedicated directory local-plugins
David Douard <david.douard@sdfa3.org>
parents: 113
diff changeset
80 PLUGIN_PATHS = ['local-plugins/pelican-peertube',
dad9b39691de move custom plugins in a dedicated directory local-plugins
David Douard <david.douard@sdfa3.org>
parents: 113
diff changeset
81 'local-plugins',
dad9b39691de move custom plugins in a dedicated directory local-plugins
David Douard <david.douard@sdfa3.org>
parents: 113
diff changeset
82 'pelican-plugins',
68
4fa6621fec0f [hp34970a] an article dedicted to the protocol
David Douard <david.douard@logilab.fr>
parents: 66
diff changeset
83 ]
36
9507107a1133 [theme] use a personalized bricks theme
David Douard <david.douard@logilab.fr>
parents: 34
diff changeset
84 PLUGINS = ['better_figures_and_images',
9507107a1133 [theme] use a personalized bricks theme
David Douard <david.douard@logilab.fr>
parents: 34
diff changeset
85 'sitemap',
142
6faac5ee8017 Disable deprecated feed_summary plugin and update SOCIAL var
David Douard <david.douard@sdf3.org>
parents: 122
diff changeset
86 #'feed_summary',
113
0bcf355064e5 few fixes in pelicanconf
David Douard <david.douard@sdfa3.org>
parents: 108
diff changeset
87 # 'assets',
36
9507107a1133 [theme] use a personalized bricks theme
David Douard <david.douard@logilab.fr>
parents: 34
diff changeset
88 'series',
9507107a1133 [theme] use a personalized bricks theme
David Douard <david.douard@logilab.fr>
parents: 34
diff changeset
89 'related_posts',
41
376692051823 [config] activate the filetime_from_hg plugin
David Douard <david.douard@logilab.fr>
parents: 40
diff changeset
90 'filetime_from_hg',
108
08c0c0d695e8 [hp34970] replace dailymotion by peertube for embedded video
David Douard <david.douard@logilab.fr>
parents: 101
diff changeset
91 'pelican_peertube',
68
4fa6621fec0f [hp34970a] an article dedicted to the protocol
David Douard <david.douard@logilab.fr>
parents: 66
diff changeset
92 'pelican_javascript',
4fa6621fec0f [hp34970a] an article dedicted to the protocol
David Douard <david.douard@logilab.fr>
parents: 66
diff changeset
93 'wavedrom',
101
4a94e81bff74 [hp8662a] part 3: fixing error 04 and unlocked loops
David Douard <david.douard@logilab.fr>
parents: 96
diff changeset
94 'plotly',
147
6b6c2254dac1 Enable image_process pugins again
David Douard <david.douard@sdf3.org>
parents: 146
diff changeset
95 'image_process',
66
70aad9a1272b [hp34970a] part 4
David Douard <david.douard@logilab.fr>
parents: 41
diff changeset
96 ]
24
89689c6e9cf4 [hp8904a] add two blogs about the HP8904A and a small update of the about page
David Douard <david.douard@logilab.fr>
parents: 0
diff changeset
97 RESPONSIVE_IMAGES = True
34
871fcc94f63e [config] add twitter stuff an links to eevblog and elo
David Douard <david.douard@logilab.fr>
parents: 26
diff changeset
98 TYPOGRIPFY = True
36
9507107a1133 [theme] use a personalized bricks theme
David Douard <david.douard@logilab.fr>
parents: 34
diff changeset
99 SINGLE_AUTHOR = True
66
70aad9a1272b [hp34970a] part 4
David Douard <david.douard@logilab.fr>
parents: 41
diff changeset
100 MINT = True
36
9507107a1133 [theme] use a personalized bricks theme
David Douard <david.douard@logilab.fr>
parents: 34
diff changeset
101 SITEMAP = {'format': 'xml'}
96
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
102
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
103 IMAGE_PROCESS = {
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
104 'crisp': {'type': 'responsive-image',
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
105 'srcset': [('1x', ['scale_in 800 600 True']),
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
106 ('2x', ['scale_in 1600 1200 True']),
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
107 ('3x', ['scale_in 3200 2400 True']),
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
108 ],
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
109 'default': '1x',
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
110 },
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
111 'large-photo': {'type': 'responsive-image',
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
112 'sizes': '(min-width: 1200px) 800px, (min-width: 992px) 650px, \
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
113 (min-width: 768px) 718px, 100vw',
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
114 'srcset': [('600w', ["scale_in 600 450 True"]),
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
115 ('800w', ["scale_in 800 600 True"]),
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
116 ('1600w', ["scale_in 1600 1200 True"]),
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
117 ],
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
118 'default': '800w',
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
119 },
11b306ba3468 [conf] attempt to use image_process plugin
David Douard <david.douard@logilab.fr>
parents: 94
diff changeset
120 }
108
08c0c0d695e8 [hp34970] replace dailymotion by peertube for embedded video
David Douard <david.douard@logilab.fr>
parents: 101
diff changeset
121
148
2f87039dd0b5 Replace video links with working ones from new peertube instance
David Douard <david.douard@sdf3.org>
parents: 147
diff changeset
122 PEERTUBE_URL = "https://diode.zone"

mercurial