|
3 | 3 | import zlib
|
4 | 4 | import pymdownx.superfences
|
5 | 5 |
|
6 |
| -PORT = 8080 |
7 |
| -BIND = '192.168.1.158' |
8 |
| -SITEURL = f'http://{BIND}:{PORT}' |
9 |
| - |
10 |
| -AUTHOR = 'dragoncoder047' |
11 |
| -SITENAME = 'Armdroid 1000' |
12 |
| -SITEURL = 'https://dragoncoder047.github.io/armdroid' |
13 |
| -LOGO = '/armdroid/armdroid.png' |
14 |
| -LOGO_AREA_HTML = f'<a href="/armdroid"><div class="flex-row"><img src="{LOGO}" width="145" height="115" /><div id="sitename-text" class="flex-column"><h1>{SITENAME}</h1><!-- h2>SITESUBTITLE</h2 --></div></div></a>' |
15 |
| -ICON = '/armdroid/armdroid_sm.png' |
16 |
| -ICON_MIMETYPE = 'image/png' |
17 |
| -THEME_CSS_FILE = '/armdroid/theme.css' |
18 |
| -THEME_MAIN_CSS = '/static/css/main.css' |
19 |
| -EXTRA_JS = '/static/misc.js' |
20 |
| -THEME_STATIC_DIR = 'static/' |
| 6 | +# PORT = 8080 |
| 7 | +# BIND = "192.168.1.158" |
| 8 | +# SITEURL = f"http://{BIND}:{PORT}" |
| 9 | + |
| 10 | +AUTHOR = "dragoncoder047" |
| 11 | +SITENAME = "Armdroid 1000" |
| 12 | +SITEURL = "https://dragoncoder047.github.io/armdroid" |
| 13 | +LOGO = "/armdroid/armdroid.png" |
| 14 | +LOGO_AREA_HTML = ('<a href="/armdroid">' |
| 15 | + '<div class="flex-row">' |
| 16 | + f'<img src="{LOGO}" width="145" height="115" />' |
| 17 | + '<div id="sitename-text" class="flex-column">' |
| 18 | + f'<h1>{SITENAME}</h1><!-- h2>SITESUBTITLE</h2 -->' |
| 19 | + f'</div></div></a>') |
| 20 | +ICON = "/armdroid/armdroid_sm.png" |
| 21 | +ICON_MIMETYPE = "image/png" |
| 22 | +THEME_CSS_FILE = "/armdroid/theme.css" |
| 23 | +THEME_MAIN_CSS = "/static/css/main.css" |
| 24 | +EXTRA_JS = "/static/misc.js" |
| 25 | +THEME_STATIC_DIR = "static/" |
21 | 26 | USE_FOLDER_AS_CATEGORY = False
|
22 | 27 |
|
23 |
| -PATH = 'aaaa/' |
24 |
| -OUTPUT_PATH = './' |
| 28 | +GOOGLE_TAG = "G-XR0F89CCGK" # cSpell: ignore ccgk |
25 | 29 |
|
26 |
| -TIMEZONE = 'America/New_York' |
| 30 | +PATH = "aaaa/" |
| 31 | +OUTPUT_PATH = "./" |
27 | 32 |
|
28 |
| -DEFAULT_LANG = 'en_US' |
| 33 | +TIMEZONE = "America/New_York" |
| 34 | + |
| 35 | +DEFAULT_LANG = "en_US" |
29 | 36 |
|
30 | 37 | # maybe later...
|
31 | 38 | FEED_ALL_ATOM = None
|
|
38 | 45 |
|
39 | 46 | DISPLAY_PAGES_ON_MENU = True
|
40 | 47 | DISPLAY_CATEGORIES_ON_MENU = False
|
41 |
| -AUTHOR_SAVE_AS = AUTHORS_SAVE_AS = TAG_SAVE_AS = TAGS_SAVE_AS = CATEGORY_SAVE_AS = CATEGORIES_SAVE_AS = '' |
42 |
| -ARTICLE_SAVE_AS = ARTICLE_URL = 'updates/{date:%Y}/{slug}.html' |
43 |
| -ARCHIVES_SAVE_AS = 'updates/archive.html' |
44 |
| -PATH_METADATA = r'(?P<path_no_ext>.*)\.[^.]*' |
45 |
| -PAGE_URL = PAGE_SAVE_AS = '{path_no_ext}.html' |
46 |
| -FILENAME_METADATA = '' |
| 48 | +AUTHOR_SAVE_AS = AUTHORS_SAVE_AS = "" |
| 49 | +TAG_SAVE_AS = TAGS_SAVE_AS = "" |
| 50 | +CATEGORY_SAVE_AS = CATEGORIES_SAVE_AS = "" |
| 51 | +ARTICLE_SAVE_AS = ARTICLE_URL = "updates/{date:%Y}/{slug}.html" |
| 52 | +ARCHIVES_SAVE_AS = "updates/archive.html" |
| 53 | +PATH_METADATA = r"(?P<path_no_ext>.*)\.[^.]*" |
| 54 | +PAGE_URL = PAGE_SAVE_AS = "{path_no_ext}.html" |
| 55 | +FILENAME_METADATA = "" |
47 | 56 |
|
48 | 57 | # Blogroll
|
49 | 58 | LINKS = (
|
50 |
| - ('Armdroid 1000 site', 'https://armdroid1000.wordpress.com'), |
51 |
| - ('Dan Kohn's LabVolt 5100', 'http://www.dankohn.info/projects/armdroid.html'), |
52 |
| - ('Richard Morris' Armdroid 1', 'https://armdroid1.blogspot.com/'), |
53 |
| - ('Alex Zivanovic's Armdroid 1', 'http://www.senster.com/alex_zivanovic/armdroid/index.htm'), |
| 59 | + ("Armdroid 1000 site", "https://armdroid1000.wordpress.com"), |
| 60 | + ("Dan Kohn's LabVolt 5100", |
| 61 | + "http://www.dankohn.info/projects/armdroid.html"), |
| 62 | + ("Richard Morris' Armdroid 1", "https://armdroid1.blogspot.com/"), |
| 63 | + ("Alex Zivanovic's Armdroid 1", |
| 64 | + "http://www.senster.com/alex_zivanovic/armdroid/index.htm"), |
54 | 65 | )
|
55 | 66 |
|
56 | 67 | # Social
|
57 | 68 | SOCIAL = (
|
58 |
| - (f'{AUTHOR} on GitHub', f'https://github.com/{AUTHOR}'), |
| 69 | + (f"{AUTHOR} on GitHub", f"https://github.com/{AUTHOR}"), |
59 | 70 | )
|
60 | 71 |
|
61 | 72 | MENUITEMS = (
|
62 |
| - ('Site root', '/'), |
63 |
| - ('Updates', '/armdroid/updates/archive.html'), |
| 73 | + ("Site root", "/"), |
| 74 | + ("Updates", "/armdroid/updates/archive.html"), |
64 | 75 | )
|
65 | 76 |
|
66 | 77 | DEFAULT_PAGINATION = 10
|
67 | 78 | DEFAULT_ORPHANS = 3
|
68 | 79 | PAGINATION_PATTERNS = (
|
69 |
| - (1, '{name}{extension}', '{name}{extension}'), |
70 |
| - (2, '{name}_{number}{extension}', '{name}_{number}{extension}'), |
| 80 | + (1, "{name}{extension}", "{name}{extension}"), |
| 81 | + (2, "{name}_{number}{extension}", "{name}_{number}{extension}"), |
71 | 82 | )
|
72 | 83 |
|
73 |
| -PAGE_PATHS = ['info/'] |
74 |
| -ARTICLE_PATHS = ['updates/'] |
75 |
| -STATIC_PATHS = [] # everything is attached |
| 84 | +PAGE_PATHS = ["info/"] |
| 85 | +ARTICLE_PATHS = ["updates/"] |
| 86 | +STATIC_PATHS = [] # everything is attached |
76 | 87 |
|
77 |
| -THEME = './pelicantheme' |
| 88 | +THEME = "./pelicantheme" |
78 | 89 |
|
79 | 90 | RELATIVE_URLS = False
|
80 | 91 |
|
81 |
| -READERS = {'html': None} |
| 92 | +READERS = {"html": None} |
82 | 93 |
|
83 | 94 |
|
84 | 95 | def kroki_fence(source, language, css_class, options, md, **kwargs):
|
85 | 96 | data = base64.urlsafe_b64encode(zlib.compress(
|
86 |
| - source.encode('utf-8'), 9)).decode('ascii') |
87 |
| - lang = options.get('type', options.get('name', 'svgbob')) |
88 |
| - attr = '' |
89 |
| - if 'width' in options and 'height' in options: |
| 97 | + source.encode("utf-8"), 9)).decode("ascii") |
| 98 | + lang = options.get("type", options.get("name", "svgbob")) |
| 99 | + attr = "" |
| 100 | + if "width" in options and "height" in options: |
90 | 101 | attr = f' width="{options["width"]}" height="{options["height"]}"'
|
91 | 102 | return f'<img src="https://kroki.io/{lang}/svg/{data}"{attr} />'
|
92 | 103 |
|
93 | 104 |
|
94 |
| - |
95 | 105 | MARKDOWN = {
|
96 |
| - 'extension_configs': { |
97 |
| - 'meta': {}, |
98 |
| - 'pymdownx.extra': {}, |
99 |
| - 'pymdownx.caret': {}, |
100 |
| - 'pymdownx.details': {}, |
101 |
| - 'pymdownx.highlight': { |
102 |
| - 'use_pygments': False, # I use Prism.js |
| 106 | + "extension_configs": { |
| 107 | + "meta": {}, |
| 108 | + "pymdownx.extra": {}, |
| 109 | + "pymdownx.caret": {}, |
| 110 | + "pymdownx.details": {}, |
| 111 | + "pymdownx.highlight": { |
| 112 | + "use_pygments": False, # I use Prism.js |
103 | 113 | },
|
104 |
| - 'pymdownx.inlinehilite': {}, |
| 114 | + "pymdownx.inlinehilite": {}, |
105 | 115 | "pymdownx.superfences": {
|
106 | 116 | "custom_fences": [
|
107 | 117 | {
|
108 |
| - 'name': 'mermaid', |
109 |
| - 'class': 'mermaid', |
110 |
| - 'format': pymdownx.superfences.fence_div_format |
111 |
| - }, # covered by kroki, but needed for compatibility with github |
| 118 | + "name": "mermaid", |
| 119 | + "class": "mermaid", |
| 120 | + "format": pymdownx.superfences.fence_div_format |
| 121 | + }, |
| 122 | + # covered by kroki, but needed for compatibility |
| 123 | + # with github |
112 | 124 | {
|
113 |
| - 'name': 'kroki', |
114 |
| - 'class': 'kroki', |
115 |
| - 'format': kroki_fence |
| 125 | + "name": "kroki", |
| 126 | + "class": "kroki", |
| 127 | + "format": kroki_fence |
116 | 128 | }
|
117 | 129 | ]
|
118 | 130 | },
|
119 |
| - 'pymdownx.saneheaders': {}, |
120 |
| - 'pymdownx.magiclink': {}, |
121 |
| - 'pymdownx.smartsymbols': {}, |
122 |
| - 'smarty': {}, |
123 |
| - 'pymdownx.tabbed': {}, |
124 |
| - 'pymdownx.tasklist': {}, |
125 |
| - 'pymdownx.tilde': {}, |
126 |
| - 'sane_lists': {}, |
127 |
| - 'admonition': {}, |
128 |
| - 'abbr': {}, |
129 |
| - 'def_list': {}, |
130 |
| - 'toc': {}, |
131 |
| - 'footnotes': {}, |
132 |
| - 'attr_list': {}, |
133 |
| - 'markdown_figcap': {}, |
134 |
| - 'python_markdown_comments:CommentsExtension': {}, |
| 131 | + "pymdownx.saneheaders": {}, |
| 132 | + "pymdownx.magiclink": {}, |
| 133 | + "pymdownx.smartsymbols": {}, |
| 134 | + "smarty": {}, |
| 135 | + "pymdownx.tabbed": {}, |
| 136 | + "pymdownx.tasklist": {}, |
| 137 | + "pymdownx.tilde": {}, |
| 138 | + "sane_lists": {}, |
| 139 | + "admonition": {}, |
| 140 | + "abbr": {}, |
| 141 | + "def_list": {}, |
| 142 | + "toc": {}, |
| 143 | + "footnotes": {}, |
| 144 | + "attr_list": {}, |
| 145 | + "markdown_figcap": {}, |
| 146 | + "python_markdown_comments:CommentsExtension": {}, |
135 | 147 | },
|
136 |
| - 'output_format': 'html5', |
| 148 | + "output_format": "html5", |
137 | 149 | }
|
138 | 150 |
|
139 | 151 | PLUGINS = [
|
140 |
| - # 'seo', |
141 |
| - 'pelican.plugins.share_post', |
142 |
| - # 'sitemap', |
143 |
| - 'pelican.plugins.related_posts', |
144 |
| - 'minchin.pelican.plugins.nojekyll', |
145 |
| - 'pelican.plugins.read_more', |
146 |
| - 'jinja2content', |
147 |
| - 'series', |
148 |
| - 'pelican.plugins.more_categories' |
| 152 | + # "seo", |
| 153 | + "pelican.plugins.share_post", |
| 154 | + # "sitemap", |
| 155 | + "pelican.plugins.related_posts", |
| 156 | + "minchin.pelican.plugins.nojekyll", |
| 157 | + "pelican.plugins.read_more", |
| 158 | + "jinja2content", |
| 159 | + "series", |
149 | 160 | ]
|
150 | 161 |
|
151 |
| -if __name__ == '__main__': |
| 162 | +if __name__ == "__main__": |
152 | 163 | import os
|
153 |
| - os.system(f'pelican {PATH} -o {OUTPUT_PATH} -s {__file__}') |
| 164 | + os.system(f"pelican {PATH} -o {OUTPUT_PATH} -s {__file__}") |
0 commit comments