├── screenshot ├── cosmo.png ├── amelia.png ├── default.png ├── united.png └── superhero.png ├── templates ├── page.html ├── twitter.html ├── taglist.html ├── translations.html ├── tag.html ├── github.html ├── category.html ├── analytics.html ├── author.html ├── disqus_script.html ├── piwik.html ├── tags.html ├── categories.html ├── article.html ├── archives.html ├── base.html ├── index.html └── macro.html ├── static └── css │ ├── code.css │ ├── solarized-dark.css │ ├── solarized-light.css │ └── main.css ├── LICENSE └── README.md /screenshot/cosmo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuex/pelican-chameleon/HEAD/screenshot/cosmo.png -------------------------------------------------------------------------------- /screenshot/amelia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuex/pelican-chameleon/HEAD/screenshot/amelia.png -------------------------------------------------------------------------------- /screenshot/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuex/pelican-chameleon/HEAD/screenshot/default.png -------------------------------------------------------------------------------- /screenshot/united.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuex/pelican-chameleon/HEAD/screenshot/united.png -------------------------------------------------------------------------------- /screenshot/superhero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuex/pelican-chameleon/HEAD/screenshot/superhero.png -------------------------------------------------------------------------------- /templates/page.html: -------------------------------------------------------------------------------- 1 | {% set name = page.title %} 2 | {% set link = page.url %} 3 | {% extends "base.html" %} 4 | 5 | {% block content %} 6 |
7 | {{ page.content }} 8 |
9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /templates/twitter.html: -------------------------------------------------------------------------------- 1 | {% if TWITTER_USERNAME %} 2 | Tweet 3 | {% endif %} -------------------------------------------------------------------------------- /templates/taglist.html: -------------------------------------------------------------------------------- 1 | {% set name = 'Tag List' %} 2 | {% set link = 'taglist.html' %} 3 | {% extends "base.html" %} 4 | 5 | {% block content %} 6 | {% if tags %} 7 | 8 | {% from 'macro.html' import taglist %} 9 | {{ taglist('tag',tags) }} 10 | 11 | {% endif %} 12 | {% endblock %} 13 | -------------------------------------------------------------------------------- /templates/translations.html: -------------------------------------------------------------------------------- 1 | {% macro translations_for(article) %} 2 | {% if article.translations %} 3 | Translations: 4 | {% for translation in article.translations %} 5 | {{ translation.lang }} 6 | {% endfor %} 7 | {% endif %} 8 | {% endmacro %} 9 | -------------------------------------------------------------------------------- /static/css/code.css: -------------------------------------------------------------------------------- 1 | @import url("solarized-light.css"); 2 | /*@import url(https://fonts.googleapis.com/css?family=Inconsolata);*/ 3 | 4 | code, 5 | pre { 6 | font-family: 'Inconsolata-g', 'Inconsolata', 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace; 7 | /*font-size: 13px;*/ 8 | /*border: 1px #ccc dotted;*/ 9 | /*background-color: #f9f9f9;*/ 10 | /*color: #586e75;*/ 11 | } 12 | 13 | /*code {*/ 14 | /*padding: 1px 4px;*/ 15 | /*}*/ 16 | -------------------------------------------------------------------------------- /templates/tag.html: -------------------------------------------------------------------------------- 1 | {% set name = ["Tag: ",tag]|join %} 2 | {% set link = tag.url %} 3 | {% extends "base.html" %} 4 | 5 | {% block content %} 6 | {% from 'macro.html' import article_panel_list with context %} 7 | {% set parent = '' %} 8 | {% set id = tag %} 9 | {% set title_left = tag %} 10 | {% set title_right = articles|count %} 11 | {% set entry_list = articles %} 12 | {{ article_panel_list(parent,id,title_left,title_right,entry_list) }} 13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /templates/github.html: -------------------------------------------------------------------------------- 1 | {% if GITHUB_URL %} 2 | 3 | {% if GITHUB_POSITION != "left" %} 4 | Fork me on GitHub 5 | {% else %} 6 | Fork me on GitHub 7 | {% endif %} 8 | 9 | {% endif %} 10 | -------------------------------------------------------------------------------- /templates/category.html: -------------------------------------------------------------------------------- 1 | {% set name = ["Category: ",category]|join %} 2 | {% set link = category.url %} 3 | {% extends "base.html" %} 4 | 5 | {% block content %} 6 | {% from 'macro.html' import article_panel_list with context %} 7 | {% set parent = '' %} 8 | {% set id = category %} 9 | {% set title_left = category %} 10 | {% set title_right = articles|count %} 11 | {% set entry_list = articles %} 12 | {{ article_panel_list(parent,id,title_left,title_right,entry_list) }} 13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /templates/analytics.html: -------------------------------------------------------------------------------- 1 | {% if GOOGLE_ANALYTICS %} 2 | 11 | {% endif %} -------------------------------------------------------------------------------- /templates/author.html: -------------------------------------------------------------------------------- 1 | {% set name = author %} 2 | {% set link = ["author/",author,".html"]|join %} 3 | {% extends "base.html" %} 4 | 5 | {% block content %} 6 | 7 | {% from 'macro.html' import article_panel_list with context %} 8 | {% set parent = '' %} 9 | {% set id = ["collapse",author]|join %} 10 | {% set title_left = author %} 11 | {% set title_right = articles|count %} 12 | {% set entry_list = articles %} 13 | {{ article_panel_list(parent,id,title_left,title_right,entry_list) }} 14 | 15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /templates/disqus_script.html: -------------------------------------------------------------------------------- 1 |
2 | 15 | 16 | -------------------------------------------------------------------------------- /templates/piwik.html: -------------------------------------------------------------------------------- 1 | {% if PIWIK_URL and PIWIK_SITE_ID %} 2 | 16 | {% endif %} -------------------------------------------------------------------------------- /templates/tags.html: -------------------------------------------------------------------------------- 1 | {% set name = "Tags" %} 2 | {% set link = "tags.html" %} 3 | {% extends "base.html" %} 4 | 5 | {% block content %} 6 | {% if tags %} 7 |

8 | {% from "macro.html" import taglist %} 9 | {{ taglist(tags, "#", "") }} 10 |

11 | 12 |
13 | {% for tag, articles in tags|sort %} 14 | 15 | {% from "macro.html" import article_panel_list with context %} 16 | {% set parent = "accordion" %} 17 | {% set id = tag %} 18 | {% set title_left = tag %} 19 | {% set title_left_link = "/%s" % (tag.url) %} 20 | {% set title_right = articles|count %} 21 | {% set entry_list = articles %} 22 | {{ article_panel_list( 23 | parent=parent, 24 | id=id, 25 | title_left=title_left, 26 | title_left_link=title_left_link, 27 | title_right=title_right, 28 | entry_list=entry_list, 29 | ) }} 30 | 31 | {% endfor %} 32 |
33 | 34 | {% endif %} 35 | {% endblock %} 36 | -------------------------------------------------------------------------------- /templates/categories.html: -------------------------------------------------------------------------------- 1 | {% set name = "Categories" %} 2 | {% set link = "categories.html" %} 3 | 4 | {% extends "base.html" %} 5 | 6 | {% block content %} 7 | {% if categories %} 8 |

9 | {% from 'macro.html' import taglist %} 10 | {{ taglist(categories, "#", "") }} 11 |

12 | 13 |
14 | {% for category, articles in categories|sort %} 15 | 16 | {% from "macro.html" import article_panel_list with context %} 17 | {% set parent = "accordion" %} 18 | {% set id = category %} 19 | {% set title_left = category %} 20 | {% set title_left_link = "/%s" % (category.url) %} 21 | {% set title_right = articles|count %} 22 | {% set entry_list = articles %} 23 | {{ article_panel_list( 24 | parent=parent, 25 | id=id, 26 | title_left=title_left, 27 | title_left_link=title_left_link, 28 | title_right=title_right, 29 | entry_list=entry_list, 30 | ) }} 31 | 32 | {% endfor %} 33 |
34 | 35 | {% endif %} 36 | {% endblock %} 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2013-2019 Pelican-Chameleon contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /templates/article.html: -------------------------------------------------------------------------------- 1 | {% set name = article.title %} 2 | {% set link = article.url %} 3 | {% extends "base.html" %} 4 | 5 | {% block left_sidebar %} 6 | {% endblock %} 7 | 8 | {% block right_sidebar %} 9 | {% endblock %} 10 | 11 | {% block content %} 12 | {% from 'macro.html' import article_info with context %} 13 | {% from 'macro.html' import genurl with context %} 14 | 15 | {{ article_info(article) }} 16 |
17 | 18 |
19 | {{ article.content }} 20 |
21 | 22 |
23 | {% if article.related_posts %} 24 | {% from 'macro.html' import article_panel_list with context %} 25 | {% set articles = article.related_posts %} 26 | {% set parent = '' %} 27 | {% set id = "collapseRelated" %} 28 | {% set title_left = "Related Posts" %} 29 | {% set title_right = articles|count %} 30 | {% set entry_list = articles %} 31 | {{ article_panel_list(parent,id,title_left,title_right,entry_list) }} 32 | {% endif %} 33 | 34 | {% for temp in dates %} 35 | {% if temp.url == article.url %} 36 | {% if not loop.first %} 37 | {% set prev = dates[loop.index0-1] %} 38 | {% endif %} 39 | {% if not loop.last %} 40 | {% set next = dates[loop.index0+1] %} 41 | {% endif %} 42 | 52 | {% endif %} 53 | {% endfor %} 54 | 55 | {% if DISQUS_SITENAME %} 56 |
57 | {% include 'disqus_script.html' %} 58 | {% endif %} 59 | 60 | {% endblock %} 61 | -------------------------------------------------------------------------------- /templates/archives.html: -------------------------------------------------------------------------------- 1 | {% set name = 'Archives' %} 2 | {% set link = 'archives.html' %} 3 | {% extends "base.html" %} 4 | 5 | {% block content %} 6 | {% if dates %} 7 | {# year list #} 8 |
9 | {% for articles_group_by_year in dates|groupby('date.year')|reverse %} 10 | {% set year = articles_group_by_year %} 11 | {% set parent = ["Year",year.grouper]|join %} 12 |
13 | {# year list heading #} 14 | 25 | {# end year list heading #} 26 | 27 | {# year list body #} 28 |
30 |
31 | 32 | {# month list #} 33 |
34 | {% for articles_group_by_month in year.list|groupby('date.month')|reverse %} 35 | 36 | {% set month = articles_group_by_month %} 37 | 38 | {% from 'macro.html' import article_panel_list with context %} 39 | {% set id = [parent,"Month",month.grouper]|join %} 40 | {% set title_left = month.list[0].date|strftime('%B') %} 41 | {% set title_right = month.list|count %} 42 | {% set entry_list = month.list %} 43 | {{ article_panel_list(parent,id,title_left,title_right,entry_list,show_date=True) }} 44 | 45 | {% endfor %} 46 |
47 | {# end month list #} 48 | 49 |
50 |
51 | {# end year list body #} 52 | 53 |
54 | {% endfor %} 55 |
56 | {# end year list #} 57 | 58 | {% endif %} 59 | {% endblock %} 60 | -------------------------------------------------------------------------------- /templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | {% from 'macro.html' import genurl with context %} 3 | 4 | 5 | 6 | 7 | 8 | 9 | {% if FAVICON and FAVICON_TYPE %} 10 | 11 | {% endif %} 12 | 13 | {% from 'macro.html' import pagetitle with context %} 14 | {{ pagetitle(name) }} 15 | 16 | 17 | 18 | {% if BS3_URL %} 19 | 20 | {% else %} 21 | 22 | {% endif %} 23 | 24 | {% if BS3_THEME %} 25 | 26 | {% endif %} 27 | 28 | 29 | 30 | {% if CODE_HIGHLIGHT %} 31 | 32 | {% else %} 33 | 34 | {% endif %} 35 | 36 | {% if CSS_OVERWRITE %} 37 | 38 | {% endif %} 39 | 40 | {% if JQUERY_JS %} 41 | 42 | {% else %} 43 | 44 | {% endif %} 45 | 46 | {% if JQUERY_MIGRATE_JS %} 47 | 48 | {% else %} 49 | 50 | {% endif %} 51 | 52 | {% if BS3_JS %} 53 | 54 | {% else %} 55 | 56 | {% endif %} 57 | 58 | 59 | 60 | 61 |
62 | {% set link = ['/',link]|join %} 63 | {% from 'macro.html' import navbar with context %} 64 | {{ navbar(link) }} 65 | 66 |
67 |
68 | {% block left_sidebar %}{% endblock %} 69 |
70 | 71 |
72 |
73 | {% from 'macro.html' import pageheader with context %} 74 | {{ pageheader(name,link) }} 75 |
76 | 77 |
78 | {% block content %}{% endblock %} 79 |
80 | 81 |
82 | {% block pagefooter %}{% endblock %} 83 |
84 | 85 |
86 | 87 |
88 | {% block right_sidebar %}{% endblock %} 89 |
90 |
91 | 92 | 93 |
94 | 95 | {% from 'macro.html' import footer with context %} 96 | {{ footer() }} 97 | 98 | {% include 'analytics.html' %} 99 | 100 | 101 | -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | {% set name = '' %} 2 | {% set link = '' %} 3 | 4 | {% extends "base.html" %} 5 | 6 | {% block content %} 7 | {% from 'macro.html' import genurl with context %} 8 | {% if articles %} 9 | {% if articles_page %} 10 | {% set articles = articles_page.object_list %} 11 | {% endif %} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | {% for article in articles %} 28 | 29 |
30 |
31 | {% set year = article.date|strftime('%Y') %} 32 | {% set month = article.date|strftime('%B') %} 33 | {% set month_index = article.date|strftime('%m') %} 34 | {{ year }} 35 | {{- ' - ' -}} 36 | {{ month }} 37 | 41 | 42 | #{{ dates|count - (articles_page.number-1)*DEFAULT_PAGINATION - loop.index0 }} 43 | 44 | 45 |
46 | 47 | 50 | 51 | {% set article_url = genurl( article.url, force=True ) %} 52 | 86 |
87 | {% endfor %} 88 |
89 | {% endif %} 90 | {% endblock content %} 91 | 92 | {% block pagefooter %} 93 | {% from 'macro.html' import pagination with context %} 94 | {{ pagination() }} 95 | {% endblock %} 96 | -------------------------------------------------------------------------------- /static/css/solarized-dark.css: -------------------------------------------------------------------------------- 1 | /* Solarized Dark 2 | 3 | For use with Jekyll and Pygments 4 | 5 | http://ethanschoonover.com/solarized 6 | 7 | SOLARIZED HEX ROLE 8 | --------- -------- ------------------------------------------ 9 | base03 #002b36 background 10 | base01 #586e75 comments / secondary content 11 | base1 #93a1a1 body text / default code / primary content 12 | orange #cb4b16 constants 13 | red #dc322f regex, special keywords 14 | blue #268bd2 reserved keywords 15 | cyan #2aa198 strings, numbers 16 | green #859900 operators, other keywords 17 | */ 18 | 19 | pre,code { background-color: #002b36; color: #93a1a1 } 20 | pre .c { color: #586e75 } /* Comment */ 21 | pre .err { color: #93a1a1 } /* Error */ 22 | pre .g { color: #93a1a1 } /* Generic */ 23 | pre .k { color: #859900 } /* Keyword */ 24 | pre .l { color: #93a1a1 } /* Literal */ 25 | pre .n { color: #93a1a1 } /* Name */ 26 | pre .o { color: #859900 } /* Operator */ 27 | pre .x { color: #cb4b16 } /* Other */ 28 | pre .p { color: #93a1a1 } /* Punctuation */ 29 | pre .cm { color: #586e75 } /* Comment.Multiline */ 30 | pre .cp { color: #859900 } /* Comment.Preproc */ 31 | pre .c1 { color: #586e75 } /* Comment.Single */ 32 | pre .cs { color: #859900 } /* Comment.Special */ 33 | pre .gd { color: #2aa198 } /* Generic.Deleted */ 34 | pre .ge { color: #93a1a1; font-style: italic } /* Generic.Emph */ 35 | pre .gr { color: #dc322f } /* Generic.Error */ 36 | pre .gh { color: #cb4b16 } /* Generic.Heading */ 37 | pre .gi { color: #859900 } /* Generic.Inserted */ 38 | pre .go { color: #93a1a1 } /* Generic.Output */ 39 | pre .gp { color: #93a1a1 } /* Generic.Prompt */ 40 | pre .gs { color: #93a1a1; font-weight: bold } /* Generic.Strong */ 41 | pre .gu { color: #cb4b16 } /* Generic.Subheading */ 42 | pre .gt { color: #93a1a1 } /* Generic.Traceback */ 43 | pre .kc { color: #cb4b16 } /* Keyword.Constant */ 44 | pre .kd { color: #268bd2 } /* Keyword.Declaration */ 45 | pre .kn { color: #859900 } /* Keyword.Namespace */ 46 | pre .kp { color: #859900 } /* Keyword.Pseudo */ 47 | pre .kr { color: #268bd2 } /* Keyword.Reserved */ 48 | pre .kt { color: #dc322f } /* Keyword.Type */ 49 | pre .ld { color: #93a1a1 } /* Literal.Date */ 50 | pre .m { color: #2aa198 } /* Literal.Number */ 51 | pre .s { color: #2aa198 } /* Literal.String */ 52 | pre .na { color: #93a1a1 } /* Name.Attribute */ 53 | pre .nb { color: #B58900 } /* Name.Builtin */ 54 | pre .nc { color: #268bd2 } /* Name.Class */ 55 | pre .no { color: #cb4b16 } /* Name.Constant */ 56 | pre .nd { color: #268bd2 } /* Name.Decorator */ 57 | pre .ni { color: #cb4b16 } /* Name.Entity */ 58 | pre .ne { color: #cb4b16 } /* Name.Exception */ 59 | pre .nf { color: #268bd2 } /* Name.Function */ 60 | pre .nl { color: #93a1a1 } /* Name.Label */ 61 | pre .nn { color: #93a1a1 } /* Name.Namespace */ 62 | pre .nx { color: #93a1a1 } /* Name.Other */ 63 | pre .py { color: #93a1a1 } /* Name.Property */ 64 | pre .nt { color: #268bd2 } /* Name.Tag */ 65 | pre .nv { color: #268bd2 } /* Name.Variable */ 66 | pre .ow { color: #859900 } /* Operator.Word */ 67 | pre .w { color: #93a1a1 } /* Text.Whitespace */ 68 | pre .mf { color: #2aa198 } /* Literal.Number.Float */ 69 | pre .mh { color: #2aa198 } /* Literal.Number.Hex */ 70 | pre .mi { color: #2aa198 } /* Literal.Number.Integer */ 71 | pre .mo { color: #2aa198 } /* Literal.Number.Oct */ 72 | pre .sb { color: #586e75 } /* Literal.String.Backtick */ 73 | pre .sc { color: #2aa198 } /* Literal.String.Char */ 74 | pre .sd { color: #93a1a1 } /* Literal.String.Doc */ 75 | pre .s2 { color: #2aa198 } /* Literal.String.Double */ 76 | pre .se { color: #cb4b16 } /* Literal.String.Escape */ 77 | pre .sh { color: #93a1a1 } /* Literal.String.Heredoc */ 78 | pre .si { color: #2aa198 } /* Literal.String.Interpol */ 79 | pre .sx { color: #2aa198 } /* Literal.String.Other */ 80 | pre .sr { color: #dc322f } /* Literal.String.Regex */ 81 | pre .s1 { color: #2aa198 } /* Literal.String.Single */ 82 | pre .ss { color: #2aa198 } /* Literal.String.Symbol */ 83 | pre .bp { color: #268bd2 } /* Name.Builtin.Pseudo */ 84 | pre .vc { color: #268bd2 } /* Name.Variable.Class */ 85 | pre .vg { color: #268bd2 } /* Name.Variable.Global */ 86 | pre .vi { color: #268bd2 } /* Name.Variable.Instance */ 87 | pre .il { color: #2aa198 } /* Literal.Number.Integer.Long */ 88 | -------------------------------------------------------------------------------- /static/css/solarized-light.css: -------------------------------------------------------------------------------- 1 | /* Solarized Light 2 | 3 | For use with Jekyll and Pygments 4 | 5 | http://ethanschoonover.com/solarized 6 | 7 | SOLARIZED HEX ROLE 8 | --------- -------- ------------------------------------------ 9 | base01 #586e75 body text / default code / primary content 10 | base1 #93a1a1 comments / secondary content 11 | base3 #fdf6e3 background 12 | orange #cb4b16 constants 13 | red #dc322f regex, special keywords 14 | blue #268bd2 reserved keywords 15 | cyan #2aa198 strings, numbers 16 | green #859900 operators, other keywords 17 | */ 18 | 19 | pre,code { background-color: #fdf6e3; color: #586e75 } 20 | pre .c { color: #93a1a1 } /* Comment */ 21 | pre .err { color: #586e75 } /* Error */ 22 | pre .g { color: #586e75 } /* Generic */ 23 | pre .k { color: #859900 } /* Keyword */ 24 | pre .l { color: #586e75 } /* Literal */ 25 | pre .n { color: #586e75 } /* Name */ 26 | pre .o { color: #859900 } /* Operator */ 27 | pre .x { color: #cb4b16 } /* Other */ 28 | pre .p { color: #586e75 } /* Punctuation */ 29 | pre .cm { color: #93a1a1 } /* Comment.Multiline */ 30 | pre .cp { color: #859900 } /* Comment.Preproc */ 31 | pre .c1 { color: #93a1a1 } /* Comment.Single */ 32 | pre .cs { color: #859900 } /* Comment.Special */ 33 | pre .gd { color: #2aa198 } /* Generic.Deleted */ 34 | pre .ge { color: #586e75; font-style: italic } /* Generic.Emph */ 35 | pre .gr { color: #dc322f } /* Generic.Error */ 36 | pre .gh { color: #cb4b16 } /* Generic.Heading */ 37 | pre .gi { color: #859900 } /* Generic.Inserted */ 38 | pre .go { color: #586e75 } /* Generic.Output */ 39 | pre .gp { color: #586e75 } /* Generic.Prompt */ 40 | pre .gs { color: #586e75; font-weight: bold } /* Generic.Strong */ 41 | pre .gu { color: #cb4b16 } /* Generic.Subheading */ 42 | pre .gt { color: #586e75 } /* Generic.Traceback */ 43 | pre .kc { color: #cb4b16 } /* Keyword.Constant */ 44 | pre .kd { color: #268bd2 } /* Keyword.Declaration */ 45 | pre .kn { color: #859900 } /* Keyword.Namespace */ 46 | pre .kp { color: #859900 } /* Keyword.Pseudo */ 47 | pre .kr { color: #268bd2 } /* Keyword.Reserved */ 48 | pre .kt { color: #dc322f } /* Keyword.Type */ 49 | pre .ld { color: #586e75 } /* Literal.Date */ 50 | pre .m { color: #2aa198 } /* Literal.Number */ 51 | pre .s { color: #2aa198 } /* Literal.String */ 52 | pre .na { color: #586e75 } /* Name.Attribute */ 53 | pre .nb { color: #B58900 } /* Name.Builtin */ 54 | pre .nc { color: #268bd2 } /* Name.Class */ 55 | pre .no { color: #cb4b16 } /* Name.Constant */ 56 | pre .nd { color: #268bd2 } /* Name.Decorator */ 57 | pre .ni { color: #cb4b16 } /* Name.Entity */ 58 | pre .ne { color: #cb4b16 } /* Name.Exception */ 59 | pre .nf { color: #268bd2 } /* Name.Function */ 60 | pre .nl { color: #586e75 } /* Name.Label */ 61 | pre .nn { color: #586e75 } /* Name.Namespace */ 62 | pre .nx { color: #586e75 } /* Name.Other */ 63 | pre .py { color: #586e75 } /* Name.Property */ 64 | pre .nt { color: #268bd2 } /* Name.Tag */ 65 | pre .nv { color: #268bd2 } /* Name.Variable */ 66 | pre .ow { color: #859900 } /* Operator.Word */ 67 | pre .w { color: #586e75 } /* Text.Whitespace */ 68 | pre .mf { color: #2aa198 } /* Literal.Number.Float */ 69 | pre .mh { color: #2aa198 } /* Literal.Number.Hex */ 70 | pre .mi { color: #2aa198 } /* Literal.Number.Integer */ 71 | pre .mo { color: #2aa198 } /* Literal.Number.Oct */ 72 | pre .sb { color: #93a1a1 } /* Literal.String.Backtick */ 73 | pre .sc { color: #2aa198 } /* Literal.String.Char */ 74 | pre .sd { color: #586e75 } /* Literal.String.Doc */ 75 | pre .s2 { color: #2aa198 } /* Literal.String.Double */ 76 | pre .se { color: #cb4b16 } /* Literal.String.Escape */ 77 | pre .sh { color: #586e75 } /* Literal.String.Heredoc */ 78 | pre .si { color: #2aa198 } /* Literal.String.Interpol */ 79 | pre .sx { color: #2aa198 } /* Literal.String.Other */ 80 | pre .sr { color: #dc322f } /* Literal.String.Regex */ 81 | pre .s1 { color: #2aa198 } /* Literal.String.Single */ 82 | pre .ss { color: #2aa198 } /* Literal.String.Symbol */ 83 | pre .bp { color: #268bd2 } /* Name.Builtin.Pseudo */ 84 | pre .vc { color: #268bd2 } /* Name.Variable.Class */ 85 | pre .vg { color: #268bd2 } /* Name.Variable.Global */ 86 | pre .vi { color: #268bd2 } /* Name.Variable.Instance */ 87 | pre .il { color: #2aa198 } /* Literal.Number.Integer.Long */ 88 | -------------------------------------------------------------------------------- /static/css/main.css: -------------------------------------------------------------------------------- 1 | /*sticky footer*/ 2 | 3 | html, 4 | body { 5 | height: 100%; 6 | font-size: 15px; 7 | } 8 | 9 | .footnote { 10 | font-size: 13px; 11 | } 12 | 13 | /* Wrapper for page content to push down footer */ 14 | #wrap { 15 | width: 100%; 16 | min-height: 100%; 17 | height: auto !important; 18 | height: 100%; 19 | /* Negative indent footer by its height */ 20 | margin: 0 auto -81px; 21 | /* Pad bottom by footer height */ 22 | padding: 0 0 81px; 23 | } 24 | 25 | .pagination { 26 | margin-top: auto; 27 | margin-bottom: auto; 28 | vertical-align: middle; 29 | } 30 | 31 | /* Set the fixed height of the footer here */ 32 | #footer { 33 | /* 34 | *firefox, 'important' highest priority, ignore following overwriting 35 | */ 36 | min-height: 60px; 37 | height: auto !important; 38 | /* 39 | *IE wont recognize 'important' and 'min-height, 40 | *it will auto adjust height 41 | */ 42 | height: 60px; 43 | border-width: 0; 44 | border-radius: 0; 45 | margin-top: 21px; 46 | margin-bottom: 0; 47 | } 48 | 49 | #footer #footer-text { 50 | font-size: 14px; 51 | float: none; 52 | margin: 20px 0; 53 | } 54 | 55 | /* 56 | *force footer-text within one line, 57 | * better display for blank page 58 | */ 59 | @media (max-width: 410px) { 60 | #footer #footer-text #bootstrap { display: none; } 61 | } 62 | 63 | @media (max-width: 290px) { 64 | #footer #footer-text #theme { display: none; } 65 | } 66 | 67 | @media (max-width: 180px) { 68 | #footer #footer-text #engine { display: none; } 69 | } 70 | 71 | #navbar { 72 | /*margin-bottom: 0;*/ 73 | border-radius: 0; 74 | font-size: 17px; 75 | border-width: 0; 76 | } 77 | 78 | #navbar .navbar-header { 79 | height: 60px; 80 | } 81 | 82 | #navbar .navbar-header .navbar-brand { 83 | font-size: 17px; 84 | line-height: 20px; 85 | padding-top: 20px; 86 | padding-bottom: 20px; 87 | height: 100%; 88 | } 89 | 90 | #navbar .navbar-header .navbar-toggle { 91 | margin-top: 13px; 92 | margin-bottom: 13px; 93 | padding-top: 9px; 94 | padding-bottom: 9px; 95 | border-width: 1px; 96 | height: 34px; 97 | } 98 | 99 | #navbar .navbar-nav > li > a { 100 | line-height: 20px; 101 | padding-top: 20px; 102 | padding-bottom: 20px; 103 | height: 100%; 104 | } 105 | @media (max-width: 767px) { 106 | #navbar .navbar-nav >li > a { 107 | font-size: 16px; 108 | padding-top: 10px; 109 | padding-bottom: 10px; 110 | } 111 | } 112 | 113 | #navbar .dropdown-menu { 114 | font-size: 15px; 115 | } 116 | 117 | #navbar .navbar-form { 118 | /*border-width: 1px 0 1px 0;*/ 119 | height: 60px; 120 | font-size: 15px; 121 | margin-top: 0; 122 | margin-bottom: 0; 123 | padding-top: 10px; 124 | padding-bottom: 10px; 125 | } 126 | 127 | #navbar .navbar-form .form-control { 128 | border-width: 2px; 129 | padding: 6px; 130 | height: 40px; 131 | width: 170px; 132 | } 133 | @media (max-width: 767px) { 134 | #navbar .navbar-form .form-control { 135 | width: 100%; 136 | } 137 | } 138 | 139 | #navbar .navbar-collapse { 140 | border-width: 0; 141 | } 142 | 143 | @media (min-width: 768px) { 144 | #menuitem-list { 145 | margin-right:0; 146 | } 147 | } 148 | 149 | #navbar .navbar-collapse .navbar-nav { 150 | border-width: 0; 151 | margin-top: 0; 152 | margin-bottom: 0; 153 | } 154 | 155 | .page-header { 156 | margin: 0; 157 | margin-bottom: 21px; 158 | padding: 0; 159 | } 160 | 161 | h1 {font-size: 1.8em;} 162 | h2 {font-size: 1.5em;} 163 | h3 {font-size: 1.3em;} 164 | h4 {font-size: 1.2em;} 165 | h5 {font-size: 1.1em;} 166 | h6 {font-size: 1.0em;} 167 | 168 | #home_article_list h1 {font-size: 1.6em} 169 | #home_article_list h2 {font-size: 1.4em} 170 | #home_article_list h3 {font-size: 1.2em} 171 | #home_article_list h4 {font-size: 1.1em} 172 | #home_article_list h5 {font-size: 1.0em} 173 | #home_article_list h6 {font-size: 1.0em} 174 | 175 | #article_info { 176 | font-size: 1.0em; 177 | } 178 | 179 | .panel-body > .panel-group:last-child { 180 | margin-bottom: 0; 181 | } 182 | 183 | blockquote { 184 | font-size: 1.0em; 185 | 186 | } 187 | 188 | blockquote p { 189 | font-size: 100%; 190 | } 191 | 192 | .pagination { 193 | font-size: 1.2em; 194 | } 195 | 196 | td.code { 197 | width:100%; 198 | } 199 | 200 | p { 201 | text-align: justify; 202 | /*margin: 20px 0 0 0;*/ 203 | /*word-break: break-all;*/ 204 | /*hyphens: auto;*/ 205 | /*-ms-hyphens: auto;*/ 206 | /*-webkit-hyphens: auto;*/ 207 | /*-moz-hyphens: auto;*/ 208 | } 209 | 210 | img { 211 | max-width: 100%; 212 | } 213 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pelican-Chameleon 2 | 3 | Pelican-chameleon, originally pelican-iliork, is a single-column blog-writing 4 | theme based on [Bootstrap][] for [pelican][]. It provides an elegant way for 5 | switching between different [Bootswatch][] themes (please see [Screen Shots][] 6 | below) like a **chameleon**. Pelican-chameleon is built on [Bootstrap][] 3. 7 | Some notable features are: 8 | 9 | - [Bootswatch][] theme support 10 | - The css of this theme can be overwritten very easily 11 | - Nestable menu items 12 | - Google custom search support 13 | - Multiple authors co-blogging 14 | 15 | # Demo 16 | 17 | Please check out 18 | 19 | * [YueX.in](http://yuex.in), using [Bootswatch][] [Flatly][], in Chinese. 20 | * [Screen Shots][], chameleon with different bootswatch theme 21 | 22 | # Congfiguration 23 | 24 | ## Bootstrap 3 Version and URL Overwriting 25 | 26 | You can overwrite the default url of boostrap css and js by setting following 27 | variables. If these variables are not defined, the theme will use the 3.0.0 28 | version of bootstrap. 29 | 30 | BS3_URL = 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css' 31 | BS3_JS = 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js' 32 | 33 | ## Use Bootstrap Theme 34 | 35 | You can change the default appearance of Bootstrap to any Bootstrap theme you 36 | like. `BS3_THEME` defines the url of the theme's css file; `BS3_THEME_NAME` and 37 | `BS3_THEME_HOMEPAGE` define the name and url of bootstrap theme, which are used 38 | in the footer text. 39 | 40 | See [Screen Shots][] for demos. For more theme to choose from, have a look at 41 | [Bootswatch][]. 42 | 43 | # using Bootswatch Flatly 44 | BS3_THEME = 'http://bootswatch.com/3/flatly/bootstrap.min.css' 45 | 46 | ## Theme CSS Overwriting 47 | 48 | You can use your own css file for code highlight. If you do not provide this 49 | value, pelican-chameleon will the default css file, `solarized-light.css`. 50 | 51 | pelican-chameleon provides a easy to way to overwrite the css style of 52 | pelican-chameleon by providing `CODE_HIGHLIGHT` and `CSS_OVERWRITE`. When 53 | switching Boostrap themes, you may find these useful. 54 | 55 | For example, if you want to use your preferred code highlight css, set the 56 | following option in your `pelicanconf.py` 57 | 58 | CODE_HIGHLIGHT = 'url to your favorite code highlight css' 59 | 60 | If you want to overwrite the css style of pelican-chameleon iteself, use 61 | 62 | CSS_OVERWRITE = 'url to your css' 63 | 64 | ## Nestable Menu Items 65 | 66 | Menu items in pelican-chameleon is nestable. `MENUITEMS` are rendered as a top 67 | navbar. Nested menu items are rendered together as a drop-down button on the 68 | top navbar. But only 1-level nesting is allowed; it's clumsy, and perhaps 69 | wrong, to nest too much items in the menu. Here's a example. 70 | 71 | MENUITEMS = [ 72 | ('Home', '/'), 73 | ('Archives', [ 74 | ('Tags', '/tags.html'), 75 | ('Categories', '/categories.html'), 76 | ('Chronological', '/archives.html'), 77 | ]), 78 | ('Social', [ 79 | ('Email', 'mailto: maurelinus@stoic.edu'), 80 | ('Github', 'http://url-to-github-page'), 81 | ('Facebook', 'http://url-to-facebook-page'), 82 | ]), 83 | ] 84 | 85 | **NOTE**: If you use absolute domain like '/foo/bar/baz', your SITEURL will be 86 | inserted at the head to work around the redirection issue when hosting under 87 | non-root domain like 'http://stoic.edu/~maurelinus/'. 88 | 89 | **NOTE**: Domains starting with `http://` and `https://`, are generated to 90 | `` tag with a `target='_blank'` attribute. For links within your site, use 91 | absolute domain like '/foo/bar/baz', they will be converted to the http style. 92 | Wish this will help to trap more readers. ;) 93 | 94 | ## Google Custom Search 95 | 96 | Put following in your MENUITEMS to have a Google custom search box on top 97 | navbar. 'Search' is the key, mandatory. 98 | 99 | MENUITEMS = [ 100 | ('Search', 'your Google custom search value'), 101 | ] 102 | 103 | ## Favicon 104 | 105 | To use your favicon, set following option in `pelicanconf.py` 106 | 107 | FAVICON = u'url to your favicon' 108 | FAVICON_TYPE = u'png or jpeg or whatever' 109 | 110 | ## Multiple Author 111 | You can direct the author link to whichever you want. It's not hard-coded in 112 | the theme. 113 | 114 | AUTHORS = { 115 | u'jack': '/about.html', 116 | u'mary': 'http://mary.info', 117 | u'tony': 'http://tony.me', 118 | } 119 | 120 | ## Final Warning 121 | 122 | If you have articles or pages written in markdown, remember to 123 | 124 | pip install markdown 125 | 126 | If you want to use Chinese in `Category` or `Tag`, remember to use `Python3` 127 | (Thanks to [@niboxy](https://github.com/niboxy)'s advice) 128 | 129 | # Screen Shots 130 | 131 | pelican-chameleon with default boostrap theme 132 | 133 | ![default](./screenshot/default.png) 134 | 135 | pelican-chameleon with [Amelia][] 136 | 137 | ![amelia](./screenshot/amelia.png) 138 | 139 | pelican-chameleon with [Cosmo][] 140 | 141 | ![cosmo](./screenshot/cosmo.png) 142 | 143 | pelican-chameleon with [Superhero][] 144 | 145 | ![superhero](./screenshot/superhero.png) 146 | 147 | pelican-chameleon with [United][] 148 | 149 | ![united](./screenshot/united.png) 150 | 151 | [pelican]: https://github.com/getpelican/pelican 152 | [Bootstrap]: http://getbootstrap.com 153 | [Bootswatch]: http://bootswatch.com 154 | [Flatly]: http://bootswatch.com/flatly/ 155 | [Amelia]: http://bootswatch.com/amelia/ 156 | [Cosmo]: http://bootswatch.com/cosmo/ 157 | [Superhero]: http://bootswatch.com/superhero/ 158 | [United]: http://bootswatch.com/united/ 159 | [Screen Shots]: #screen-shots 160 | -------------------------------------------------------------------------------- /templates/macro.html: -------------------------------------------------------------------------------- 1 | {% macro genurl(string, force=False) %} 2 | {% if (force or 3 | ( string.startswith('/') and not string.startswith('//') )) %} 4 | {% set url = '/'.join([SITEURL.rstrip('/'),string.lstrip('/')]) %} 5 | {{- url -}} 6 | {% else %} 7 | {{- string -}} 8 | {% endif %} 9 | {% endmacro %} 10 | 11 | {% macro newtab(string, force=False) %} 12 | {% if ( string.startswith('http://') or 13 | string.startswith('https://')) %} 14 | target="_blank" 15 | {% endif %} 16 | {% endmacro %} 17 | 18 | {% macro article_panel_list(parent='', id='', title_left='', title_right='', entry_list=[], show_date=False, title_left_link='') %} 19 | {% if not title_left_link %} 20 | {% set title_left_link = "#%s" % id %} 21 | {% endif %} 22 | 23 |
24 |
25 | 26 | {{- title_left -}} 27 | 28 | {% if title_right %} 29 | 33 | 34 | {{- title_right -}} 35 | 36 | 37 | {% endif %} 38 |
39 | 40 | 41 | 42 | 57 | 58 |
59 | {% endmacro %} 60 | 61 | {% macro pagetitle(name) %} 62 | {% if name and name != '' %} 63 | {{ name }} · {{ SITENAME }} 64 | {% else %} 65 | {{ SITENAME }} 66 | {% endif %} 67 | {% endmacro %} 68 | 69 | {% macro pageheader(name, link) %} 70 | {% if name and name != '' %} 71 | 78 | {% endif %} 79 | {% endmacro %} 80 | 81 | {% macro navbar(link) %} 82 | 145 | {% endmacro %} 146 | 147 | {% macro footer() %} 148 | 167 | {% endmacro %} 168 | 169 | {% macro pagination() %} 170 | {% if DEFAULT_PAGINATION %} 171 | 216 | {% endif %} 217 | {% endmacro %} 218 | 219 | {% macro article_info(article) %} 220 | 221 | 223 | {{- article.category -}} 224 | 225 | {% if article.tags %} 226 | · 227 | {% for tag in article.tags %} 228 | 230 | {{- tag -}} 231 | 232 | {% endfor %} 233 | {% endif %} 234 | 235 | {% if article.locale_date %} 236 | · 237 | {% set year = article.date|strftime('%Y') %} 238 | {% set month = article.date|strftime('%m') %} 239 | {% set day = article.date|strftime('%d') %} 240 | {{ year }} 241 | {{- '-' -}} 242 | {{ month }} 243 | {{- '-' -}} 244 | {{ day }} 245 | 246 | {% endif %} 247 | 248 | {% if article.author %} 249 | · 250 | {% if article.author.name in AUTHORS %} 251 | {% set author_url = AUTHORS[article.author.name] %} 252 | {% else %} 253 | {% set author_url = ["/author/",article.author.name,".html"]|join %} 254 | {% endif %} 255 | {{ article.author.name }} 256 | {% endif %} 257 | 258 | {% endmacro %} 259 | 260 | {% macro taglist(list,prefix='',suffix='') %} 261 | {% for tag, articles in list|sort %} 262 | 264 | {{- tag }} {{ articles|count }} 265 | {% endfor %} 266 | {% endmacro %} 267 | --------------------------------------------------------------------------------