diff --git a/.yaspeller.json b/.yaspeller.json index 6d9ad479..5a89eec8 100644 --- a/.yaspeller.json +++ b/.yaspeller.json @@ -94,7 +94,9 @@ "https", "Iconifier.net", "ijvxwtg", + "ImageOptim", "imgur", + "Inkscape", "io", "iOS", "iranzo", @@ -136,6 +138,7 @@ "metatag", "metatags", "Miguel", + "minification", "Mohamed", "Mohanan", "monetization", @@ -187,11 +190,14 @@ "sidebars", "silverhook", "sitemap", + "Smalllike", "solarized", "SourceCodePro", "StatCounter", "statcounter", "sudo", + "svgexport", + "svgo", "takeaways", "talha", "Talha's", @@ -210,6 +216,7 @@ "tshepang", "tshepang_dev", "uncollapsed", + "understandability", "unhide", "unordered", "validator", diff --git a/documentation/content/Appearance and Style/table-of-contents.md b/documentation/content/Appearance and Style/table-of-contents.md index 5d56f8ab..9e029bfd 100644 --- a/documentation/content/Appearance and Style/table-of-contents.md +++ b/documentation/content/Appearance and Style/table-of-contents.md @@ -141,7 +141,8 @@ I will end my example here. ### Hide Default Title Text !!! note "Possibly Deprecated" -We couldn't not reproduce this issue in our testing. This should be considered deprecated, but is retained in this document in case someone encounters this. + + We couldn't not reproduce this issue in our testing. This should be considered deprecated, but is retained in this document in case someone encounters this. Using the default configuration, reStructuredText will generate a default title for the table of contents. According to the [official diff --git a/documentation/content/Appearance and Style/warnings-admonitions.md b/documentation/content/Appearance and Style/warnings-admonitions.md index 76ad2e09..fe7c47de 100644 --- a/documentation/content/Appearance and Style/warnings-admonitions.md +++ b/documentation/content/Appearance and Style/warnings-admonitions.md @@ -50,40 +50,48 @@ Let's see some examples! You can use either `danger` or `error` to get a red admonition box. !!! danger + This is a danger or error admonition !!! danger -This is a danger or error admonition + + This is a danger or error admonition ## Default Attention, Caution, Warning An `attention`, `caution` or `warning` admonition will be yellow. !!! warning + This is an attention, caution or warning admonition !!! warning -This is an attention, caution or warning admonition + + This is an attention, caution or warning admonition ## Default Important, Note Use `important` or `note` to get a green admonition box. !!! important + This is an important or note admonition !!! important -This is an important or note admonition + + This is an important or note admonition ## Default Hint, Tip Use either `hint` or `tip` to get a blue admonition box. !!! hint + This is a hint or tip admonition !!! hint -This is a hint or tip admonition + + This is a hint or tip admonition ## Custom Titles @@ -93,12 +101,12 @@ If you want to use a custom title, you pass the title in double quotes after the type of admonition you are utilizing. !!! hint "Use double quotes to change the title" - This admonition box contains a custom tile because I placed it in double - quotes after the `hint`. + + This admonition box contains a custom tile because I placed it in double quotes after the `hint`. !!! hint "Use double quotes to change the title" -This admonition box contains a custom tile because I placed it in double -quotes after the `hint`. + + This admonition box contains a custom tile because I placed it in double quotes after the `hint`. ## No title @@ -106,9 +114,10 @@ There are times when you don't need a title in your boxes. This can be done by passing an empty string (`""`) after the admonition type. !!! important "" + This box doesn't require a title, but is still an `important` admonition and will be highlighted as such. !!! important "" -This box doesn't require a title, but is still an `important` admonition -and will be highlighted as such. + + This box doesn't require a title, but is still an `important` admonition and will be highlighted as such. diff --git a/documentation/content/Appearance and Style/why-look-and-feel.md b/documentation/content/Appearance and Style/why-look-and-feel.md index b87f9b8e..0c75a1cb 100644 --- a/documentation/content/Appearance and Style/why-look-and-feel.md +++ b/documentation/content/Appearance and Style/why-look-and-feel.md @@ -45,6 +45,13 @@ article's [Table of Contents]({filename}./table-of-contents.md) to the left sidebar and displaying it in a smaller font. This allows the table to retain it's usefulness to the reader while not intruding on the article. In a similar fashion, the right sidebar is used to relate any other extra information about the article to the user. Elements -that regularly appear in the right sidebar include: Published time, Last Updated time, -Category, Tags, "Stay in Touch" icons, "Monthly Updates" opt-in, and -[Reading Time]({filename}../Supported Plugins/reading-time.md). +that regularly appear in the right sidebar include: + +- Category +- Last Updated time +- "Monthly Updates" opt-in +- Published time +- [Reading Time]({filename}../Supported Plugins/reading-time.md) +- [Series section]({filename}../Supported Plugins/multi-part-plugin.md) +- ["Stay in Touch" icons]({filename}../SEO and SMO/social-profiles-sidebar.md) +- Tags diff --git a/documentation/content/Comments/disqus-comments.md b/documentation/content/Comments/disqus-comments.md index 53dd934b..f8e40aea 100644 --- a/documentation/content/Comments/disqus-comments.md +++ b/documentation/content/Comments/disqus-comments.md @@ -8,9 +8,49 @@ comment_id: 9jgwmy8-how-to-use-disqus-comments-elegantly Subtitle: Summary: Elegant offers Disqus comments out of the box with few unique features authors: Talha Mansoor +comment_id: aa8pfjdv5f +disqus_filter: off --- You can use Disqus for comments. You have to set `DISQUS_SITENAME` to Disqus site name identifier in configuration to enable comments. That's it. Elegant will take care of the rest. + +You can see a working example of Disqus comments in this article. + +## Show Disqus comments by default + +Just set `DISQUS_SITENAME` variable. + +## Hide Disqus comments by default + +Unset `DISQUS_SITENAME` variable. + +This is the default setting. + +## Hide Disqus comments by default. Show on Selected + +1. Set `DISQUS_SITENAME` +1. Set `DISQUS_FILTER` to `True` + +This will hide Disqus form on all pages. + +Now to show Disqus form on selected posts, in article metadata set + +```yaml +disqus_filter: off +``` + +## Show Disqus comments by default. Hide on Selected + +1. Set `DISQUS_SITENAME` +1. Remove `DISQUS_FILTER` or set it to `False` which is its default value + +This will hide Disqus form on all pages. + +Now to hide Disqus form on selected posts, in article metadata set + +```yaml +disqus_filter: on +``` diff --git a/documentation/content/Contributing/commitizen.md b/documentation/content/Contributing/commitizen.md index cc99432c..bf67c282 100644 --- a/documentation/content/Contributing/commitizen.md +++ b/documentation/content/Contributing/commitizen.md @@ -17,7 +17,7 @@ Install [Node.js](https://nodejs.org/en/download/) and [Yarn](https://yarnpkg.co If you are on Windows then try installing them with [scoop.sh](https://scoop.sh/). It saves time and makes update easier. -### Step 2: Install gulp +### Step 2: Install Commitizen Run this command from your command line terminal. @@ -25,6 +25,14 @@ Run this command from your command line terminal. yarn global add commitizen ``` +### Step 3: Initialize the Project + +In the root of Elegant repository, run + +```bash +yarn install +``` + ## Use Commitizen We have already gone through the trouble of making Elegant repository [Commitizen friendly](https://github.com/commitizen/cz-cli#making-your-repo-commitizen-friendly). diff --git a/documentation/content/Contributing/elegant-logo.md b/documentation/content/Contributing/elegant-logo.md new file mode 100644 index 00000000..21db913a --- /dev/null +++ b/documentation/content/Contributing/elegant-logo.md @@ -0,0 +1,51 @@ +--- +Title: Elegant Logo +Date: 2019-07-22 21:17 +Slug: elegant-logo +Category: Contributing +Authors: Talha Mansoor +--- + +Elegant community held a [discussion](https://github.com/Pelican-Elegant/elegant/issues/190) to decide a Logo for the project. We settled on following icon from [Pelican by Smalllike from the Noun Project](https://thenounproject.com/search/?q=pelican&i=2213839). + +Created by Smalllikefrom the Noun Project + +Building on top of it, some modifications were made to it using [Inkscape](https://inkscape.org/). + + + + + + + + + + + + + + + + + +The we cleaned it using [svgo](https://github.com/svg/svgo) tool. It reduced file size by around 50%. + +```bash +$ svgo -i elegant_logo.svg --pretty + +elegant_logo.svg: +Done in 80 ms! +8.029 KiB - 52.5% = 3.815 KiB +``` + +Then, we converted SVG to PNG using [svgexport](https://github.com/shakiba/svgexport). + +```bash +$ svgexport elegant_logo.svg elegant_logo.png 100% +``` + +The resultant file was around 1MB is size. So we optimized it using [ImageOptim](https://imageoptim.com/mac), which reduced the file size by 98%. + +Your can download the files from our Git repository. + + diff --git a/documentation/content/Contributing/live-reload-python.md b/documentation/content/Contributing/live-reload-python.md index aa768795..144edbec 100644 --- a/documentation/content/Contributing/live-reload-python.md +++ b/documentation/content/Contributing/live-reload-python.md @@ -29,7 +29,8 @@ pip install invoke ### Known Issue !!! Danger "Pretty URLs Do Not Work" -Remove or comment out `ARTICLE_URL = "{slug}"` from Pelican configuration to make LiveReload work + + Remove or comment out `ARTICLE_URL = "{slug}"` from Pelican configuration to make LiveReload work Unfortunately, Pelican LiveReload depends on [Python-LiveReload](https://github.com/lepture/python-livereload), which [does not support extension less files](https://github.com/lepture/python-livereload/pull/131). diff --git a/documentation/content/Development/documentation-status.md b/documentation/content/Development/documentation-status.md index 39224f86..1c03fe5a 100644 --- a/documentation/content/Development/documentation-status.md +++ b/documentation/content/Development/documentation-status.md @@ -1,5 +1,6 @@ --- Title: Document Status +Date: 2019-07-01 10:49 Tags: Category: Development Subtitle: @@ -11,66 +12,66 @@ Status: draft -| Category/Directory | File Name | Status | Title | -| ----------------------- | ---------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------- | -| Analytics | google-analytics.md | - | - | -| Analytics | heap-analytics.md | - | - | -| Analytics | stat-counter.md | - | - | -| Appearance and Style | article-subtitle.md | - | - | -| Appearance and Style | modified-date.md | - | - | -| Appearance and Style | page-title.md | - | - | -| Appearance and Style | table-of-contents.md | Rewritten, [301](https://github.com/Pelican-Elegant/elegant/issues/301) | Add A Table Of Contents to Your Pages | -| Appearance and Style | warnings-admonitions.md | - | - | -| Appearance and Style | web-safe-fonts.md | - | - | -| Appearance and Style | why-look-and-feel.md | New, Pending [312](https://github.com/Pelican-Elegant/elegant/issues/312) | - | -| Code Snippets | code-style.md | - | - | -| Code Snippets | custome-syntax-theme.md | - | - | -| Code Snippets | line-numbers-code-snippet.md | - | - | -| Comments | collapsible-comments.md | - | - | -| Comments | comment-id.md | - | - | -| Comments | disable-comments.md | - | - | -| Comments | disqus-comments.md | - | - | -| Comments | invite-comments.md | - | - | -| Contributing | not listed | - | - | -| Development | not listed | - | - | -| Elegant - Pelican Theme | article-redirect.md | - | - | -| Elegant - Pelican Theme | author-blurbs.md | Rewritten, Pending | Add Author Blurbs to Your Articles | -| Elegant - Pelican Theme | Elegant-Quickstart.md | - | - | -| Elegant - Pelican Theme | favicons-speed-dial-icons.md | - | - | -| Elegant - Pelican Theme | testimonials.md | - | - | -| Extra Customization | change-labels.md | - | - | -| Extra Customization | custom-404.md | Rewritten | Add A Custom 404 Error Page to Your Site | -| Extra Customization | custom-style.md | - | - | -| Extra Customization | customize-elegant.md | - | - | -| Extra Customization | meta-data.md | - | - | -| Extra Customization | reading-time.md | Rewritten, Pending, [302](https://github.com/Pelican-Elegant/elegant/issues/302) | Add A Reading Time Estimate to Your Articles | -| Footer | add-license.md | - | - | -| Footer | hosted-on.md | - | - | -| Footer | site-subtitle.md | - | - | -| Landing Page | about-me.md | - | - | -| Landing Page | landing-page.md | - | - | -| Landing Page | projects-list.md | - | - | -| Landing Page | recent-articles.md | - | - | -| Landing Page | welcome.md | - | - | -| Mailing List | freelists.md | - | - | -| Mailing List | mailchimp.md | - | - | -| Monetization | amazon-one-link.md | - | - | -| Monetization | bestazon.md | - | - | -| Search | tipue-search.md | Rewritten, [392](https://github.com/Pelican-Elegant/elegant/issues/392) | Add Search to Your Site | -| SEO and SMO | claim-site.md | - | - | -| SEO and SMO | rss-feeds.md | - | - | -| SEO and SMO | seo-social-media-tags.md | - | - | -| SEO and SMO | social-profiles-sidebar.md | - | - | -| Supported Plugins | assets-plugin.md | - | - | -| Supported Plugins | multi-part-plugin.md | Abandoned?, Pri-1, [308](https://github.com/Pelican-Elegant/elegant/issues/308) | - | -| Supported Plugins | photogallery.md | - | - | -| Supported Plugins | previous-and-next-article.md | - | - | -| Supported Plugins | share-post-plugin.md | - | - | -| Taxonomy | article-count.md | - | - | -| Taxonomy | filter-tags.md | - | - | -| Taxonomy | zero-clutter-category.md | - | - | -| Unknown | | Jack, Pri-1, [363](https://github.com/Pelican-Elegant/elegant/issues/363) | - | -| Unknown | | Ongoing discussion, [314](https://github.com/Pelican-Elegant/elegant/issues/314) | -| Unknown | | Not Assigned, [311](https://github.com/Pelican-Elegant/elegant/issues/311) | +| Category/Directory | File Name | Status | Title | Notes | +| ----------------------- | ---------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ------------------------------- | +| Analytics | google-analytics.md | - | **Proposed** How To Setup Google Analytics for Website Analytics | - | +| Analytics | heap-analytics.md | - | **Proposed** How To Setup Heap Analytics for Website Analytics | - | +| Analytics | stat-counter.md | - | **Proposed** How To Setup Stat Counter for Website Analytics | - | +| Appearance and Style | article-subtitle.md | - | **Proposed** Add a Subtitle To Your Articles | - | +| Appearance and Style | modified-date.md | - | **Proposed** Adding Modified Dates to Your Articles | - | +| Appearance and Style | page-title.md | - | **Proposed** How Elegant Titles Your Pages | - | +| Appearance and Style | table-of-contents.md | Rewritten, [301](https://github.com/Pelican-Elegant/elegant/issues/301) | Add A Table Of Contents to Your Pages | - | +| Appearance and Style | warnings-admonitions.md | - | **Proposed** How To Add Admonitions To Your Pages | - | +| Appearance and Style | web-safe-fonts.md | - | **Proposed** How Elegant Uses Web-Safe Fonts for Your Pages | - | +| Appearance and Style | why-look-and-feel.md | New, Pending [312](https://github.com/Pelican-Elegant/elegant/issues/312) | Why Does Elegant Look The Way It Does? | - | +| Code Snippets | code-style.md | - | Change Syntax Highlight Theme | - | +| Code Snippets | custome-syntax-theme.md | - | Code Snippets Theme | - | +| Code Snippets | line-numbers-code-snippet.md | old? remove? | Display Line Numbers in Code Snippets | - | +| Comments | collapsible-comments.md | - | Collapsible Comments | rethink this section | +| Comments | comment-id.md | - | Comments Thread ID | - | +| Comments | disable-comments.md | - | Disable Comments - articles | - | +| Comments | disqus-comments.md | - | Enable Disqus Comments | - | +| Comments | invite-comments.md | - | Invite Visitors To Comment | - | +| Contributing | not listed | - | - | - | +| Development | not listed | - | - | - | +| Elegant - Pelican Theme | article-redirect.md | - | Article redirection | - | +| Elegant - Pelican Theme | author-blurbs.md | Rewritten, Pending | Add Author Blurbs to Your Articles | - | +| Elegant - Pelican Theme | Elegant-Quickstart.md | - | Quickly get a GitHub hosted blog with Pelican... | - | +| Elegant - Pelican Theme | favicons-speed-dial-icons.md | - | How to set Shortcut Icons | - | +| Elegant - Pelican Theme | testimonials.md | - | What People Say About Elegant | - | +| Extra Customization | change-labels.md | - | Change Labels | - | +| Extra Customization | custom-404.md | Rewritten | Add A Custom 404 Error Page to Your Site | - | +| Extra Customization | custom-style.md | - | Customize Style | - | +| Extra Customization | customize-elegant.md | old? | How to Customize Elegant | - | +| Extra Customization | meta-data.md | - | Metadata | - | +| Extra Customization | reading-time.md | Rewritten, Pending, [302](https://github.com/Pelican-Elegant/elegant/issues/302) | Add A Reading Time Estimate to Your Articles | - | +| Footer | add-license.md | - | Add License to your Site | - | +| Footer | hosted-on.md | - | Show Your Host Information | - | +| Footer | site-subtitle.md | - | Add Site Subtitle | - | +| Landing Page | about-me.md | - | Write About Me | - | +| Landing Page | landing-page.md | - | Unique Home Page Features | really a jump page for category | +| Landing Page | projects-list.md | - | Projects List | - | +| Landing Page | recent-articles.md | - | Recent Articles List | - | +| Landing Page | welcome.md | - | Write Welcome Message | - | +| Mailing List | freelists.md | - | Add FreeLists | - | +| Mailing List | mailchimp.md | - | Add Mailchimp | - | +| Monetization | amazon-one-link.md | - | Amazon OneLink Support | - | +| Monetization | bestazon.md | - | BestAzon Support | - | +| Search | tipue-search.md | Rewritten, [392](https://github.com/Pelican-Elegant/elegant/issues/392) | Add Search to Your Site | - | +| SEO and SMO | claim-site.md | - | Claim website on Google and Bing | - | +| SEO and SMO | rss-feeds.md | - | How to show RSS feeds icon | - | +| SEO and SMO | seo-social-media-tags.md | - | Search Engine and Social Media Optimization | - | +| SEO and SMO | social-profiles-sidebar.md | - | How to display your Social Media Profiles | - | +| Supported Plugins | assets-plugin.md | New | How To Improve the Download Time For Your Pages | - | +| Supported Plugins | multi-part-plugin.md | New [308](https://github.com/Pelican-Elegant/elegant/issues/308) | Add a Series Indicator to Your Multipart Articles | - | +| Supported Plugins | photogallery.md | - | Photo gallery plugin | - | +| Supported Plugins | previous-and-next-article.md | New | Add Previous and Next Article Links to Your Articles | - | +| Supported Plugins | share-post-plugin.md | New | Add Social Sharing Links to Your Articles | - | +| Taxonomy | article-count.md | - | Articles Count With Every Tag & Category | Reassign to Look and Feel | +| Taxonomy | filter-tags.md | - | Live Filter for Tags | Reassign to Look and Feel | +| Taxonomy | zero-clutter-category.md | - | Zero Clutter Categories | Reassign to Look and Feel | +| Unknown | | Jack, Pri-1, [363](https://github.com/Pelican-Elegant/elegant/issues/363) | - | - | +| Unknown | | Ongoing discussion, [314](https://github.com/Pelican-Elegant/elegant/issues/314) | - | +| Unknown | | Not Assigned, [311](https://github.com/Pelican-Elegant/elegant/issues/311) | - | diff --git a/documentation/content/Mailing List/freelists.md b/documentation/content/Mailing List/freelists.md index c94e11a0..926d7172 100644 --- a/documentation/content/Mailing List/freelists.md +++ b/documentation/content/Mailing List/freelists.md @@ -1,12 +1,13 @@ --- Title: Add FreeLists Tags: marketing, network, subscriber -layout: post Date: 2018-07-05 23:20 comments: false Slug: add-freelists Category: Mailing List authors: Talha Mansoor +freelists_filter: off +mailchimp_filter: on --- Elegant shows a form to subscribe to your newsletter, above the fold, in the right section of every article. @@ -19,10 +20,40 @@ To customize user experience you can also define, 1. `EMAIL_FIELD_PLACEHOLDER` and 1. `SUBSCRIBE_BUTTON_TITLE` -!!! Warning +The "Notify me" button you see in the sidebar of this page is an example of FreeLists subscription form. It links to Oracle database discussion list to demonstrate the function. - FreeLists has deprecated the form Elegant used. Due to which, - user is redireced to FreeLists [deprecation notice page](https://www.freelists.org/cgi-bin/subscription.cgi). - If your `FREELISTS_NAME` is correct then their notice page has a link to their new form. +## Show FreeLists Form by default - Fixing this issue is on our roadmap. You can track it [here](https://github.com/Pelican-Elegant/elegant/issues/412). +Just set `FREELISTS_NAME` variable. + +## Hide FreeLists Form by default + +Unset `FREELISTS_NAME` variable. + +This is the default setting. + +## Hide FreeLists Form by default. Show on Selected + +1. Set `FREELISTS_NAME` +1. Set `FREELISTS_FILTER` to `True` + +This will hide FreeLists form on all pages. + +Now to show FreeLists form on selected posts, in article metadata set + +```yaml +freelists_filter: off +``` + +## Show FreeLists Form by default. Hide on Selected + +1. Set `FREELISTS_NAME` +1. Remove `FREELISTS_FILTER` or set it to `False` which is its default value + +This will hide FreeLists form on all pages. + +Now to hide FreeLists form on selected posts, in article metadata set + +```yaml +freelists_filter: on +``` diff --git a/documentation/content/Mailing List/mailchimp.md b/documentation/content/Mailing List/mailchimp.md index a8798f08..e25a8c51 100644 --- a/documentation/content/Mailing List/mailchimp.md +++ b/documentation/content/Mailing List/mailchimp.md @@ -7,6 +7,8 @@ comments: false Slug: add-mailchimp Category: Mailing List authors: Talha Mansoor +mailchimp_filter: off +freelists_filter: on --- Elegant shows a form to subscribe to your newsletter, above the fold, in the right section of every article. Increased visibility is said to increase number of subscribers. @@ -21,3 +23,41 @@ To customize user experience you can also define, 1. `EMAIL_SUBSCRIPTION_LABEL`, 1. `EMAIL_FIELD_PLACEHOLDER` and 1. `SUBSCRIBE_BUTTON_TITLE` + +You can see Mailchimp Form in action in the sidebar. It's a working example. Enter your email address so that we can send you news of new Elegant releases in your inbox. + +## Show Mailchimp Form by default + +Just set `MAILCHIMP_FORM_ACTION` variable. + +## Hide Mailchimp Form by default + +Unset `MAILCHIMP_FORM_ACTION` variable. + +This is the default setting. + +## Hide Mailchimp Form by default. Show on Selected + +1. Set `MAILCHIMP_FORM_ACTION` +1. Set `MAILCHIMP_FILTER` to `True` + +This will hide Mailchimp form on all pages. + +Now to show Mailchimp form on selected posts, in article metadata set + +```yaml +mailchimp_filter: off +``` + +## Show Mailchimp Form by default. Hide on Selected + +1. Set `MAILCHIMP_FORM_ACTION` +1. Remove `MAILCHIMP_FILTER` or set it to `False` which is its default value + +This will hide Mailchimp form on all pages. + +Now to hide Mailchimp form on selected posts, in article metadata set + +```yaml +mailchimp_filter: on +``` diff --git a/documentation/content/Supported Plugins/assets-plugin.md b/documentation/content/Supported Plugins/assets-plugin.md index 44ab2994..2f3374ed 100644 --- a/documentation/content/Supported Plugins/assets-plugin.md +++ b/documentation/content/Supported Plugins/assets-plugin.md @@ -1,41 +1,108 @@ -Title: Avoid Unnecessary HTTP Requests +Title: How To Improve the Download Time For Your Pages Tags: pelican-theme, pelican-plugin, page-speed Category: Supported Plugins Date: 2014-03-24 14:09 Slug: avoid-unnecessary-http-requests Comment_id: hk9m5eq-avoid-unnecessary-http-requests Subtitle: -Summary: Use Pelican assets plugin to improve your website load speed +Summary: Pelican can be configured to compile multiple assets for your website into one single asset. When these assets are combined together, they are reduce to only their necessary components, and can be fetched by the browser in a single call. Keywords: +Authors: Talha Mansoor, Jack De Winter -Visitor's browser will make separate HTTP requests to fetch `elegent.css`, -`custom.css`, `pygments.css`, `admonition.css` and `tipuesearch.css`. These separate requests can -be avoided using [Pelican plugin -`assets`](https://github.com/getpelican/pelican-plugins/tree/master/assets). +When a webpage is created, webpage authors and static page generators will often grab +low-level asset files from a trusted location. Between Pelican and Elegant, these files will +often number between 8 and 15 CSS or JavaScript files. While these files are +essential to the proper look and feel of a properly designed website, the overhead of this +content being in separate files is that separate requests are made for each of them to the +server. -Install the required packages +Pelican provides a plugin that takes the various CSS and JavaScript files and compiles each +group of them into a single file. Not only does this process reduce the number of calls to +retrieve files from the server, but it minifies or reduces the overall size of +those files as well. - :::bash - pip install webassets cssmin +## Configuration -Then enable `assets` plugin in your configuration. +To enable Asset Management for your website, add `assets` to the `PLUGINS` configuration +variable in your Pelican configuration. - :::python - PLUGINS = ['assets'] +```python +PLUGINS = ['assets'] +``` -This minor fix will improve the load speed of your website. All style -sheets will be merged and minified into one style sheet, `style.min.css`. +!!! note -Compact CSS will save many bytes of data which in turn will improve page speed -and parse time. + The [assets plugin](https://github.com/getpelican/pelican-plugins/blob/master/assets/Readme.rst) requires the Python `webassets` and `cssmin` packages to be installed. -# Hacking Elegant Source Code +## Debugging Notes -If you add a new CSS file to the theme while developing the Elegant theme, you -will need to add it to the list of files that are automatically minified. +Note that you will not see the full power of the Assets Management plugin if you are working in +debug mode, that is building the website while using `--debug` on the Pelican command line. +In debug mode, some of the files may be minified into the `style.min.css` file, but the +original files will be included in the HTML page they are referenced from. -Find the file `templates/_includes/minify_css.html`. You will need to add your -new CSS file to Line 1, _before_ `css/custom.css`. +This will look something like the following: -We recommend you add custom CSS to `custom.css` for personal use. If you add to -`custom.css` you will not need to modify the `minify_css.html` file. +```html + + + + + +``` + +When the `--debug` command line option is removed, the lines described above will be +replaced with a line like: + +```html + +``` + +## Improving Elegant + +If you are developing a new feature (for the theme or for your own website), you may need to +add a new CSS file to make sure that it renders properly on the webpage. Elegant ships with +the ability support minification of CSS files through the `minify_css.html` file. This file +is located in the `templates/_includes` directory of the theme and has the following +contents: + +```text +{% assets filters="cssmin", output="css/style.min.css", "css/pygments.css", "tipuesearch/tipuesearch.css","css/elegant.css", "css/admonition.css", "css/custom.css" %} + +{% endassets %} +``` + +To ensure that your new CSS file is minified, we advise you to follow one of these two +suggestions. + +If you are planning to add a new feature to your own website, consider placing the changes in +the Elegant theme's `custom.css` file. This file is also located in the `templates/_includes` +directory, and is blank in a standard Elegant theme. As the `custom.css` file is already in +the list of files to minify, no addition modifications are required. If you are not sure +whether or not the feature will be submitted as part of Elegant, this is a good place to +start at. + +If you are planning to add a new feature to Elegant and share it with others, you will be asked +to place any CSS changes for your feature in a new CSS file. This new file should be saved in +the theme's `templates/_includes` directory with the other CSS files. To ensure that the new +file is minified, a reference to it must be added to the first line of the `minify_css.html` +file, after the `css/admonition.css` file reference and before the `css/custom.css` file +reference. diff --git a/documentation/content/Supported Plugins/multi-part-plugin.md b/documentation/content/Supported Plugins/multi-part-plugin.md index 4e59f160..7b8e3516 100644 --- a/documentation/content/Supported Plugins/multi-part-plugin.md +++ b/documentation/content/Supported Plugins/multi-part-plugin.md @@ -1,69 +1,64 @@ -Title: How to use Multi Part plugin -Tags: pelican-theme, pelican-plugin, navigation, web-design +Title: Displaying a Series Information for Your Multipart Articles +Tags: pelican-plugin, navigation, web-design Category: Supported Plugins Date: 2014-04-20 18:18 Slug: how-to-use-multi-part-plugin Comment_id: 3ws2xke-how-to-use-multi-part-plugin Subtitle: -Summary: Elegant integrates with Multi Part plugin out of the box +Summary: Elegant can be configured to provide a series section on the right sidebar. Only visible in articles that are labelled as part of a series, this indicator allows navigation between the articles in the series. Keywords: +Authors: Talha Mansoor, Jack De Winter -[Multi -parts](https://github.com/getpelican/pelican-plugins/tree/master/multi_part) is -a useful plugin that lets you write "multi-part" articles. +When writing articles about certain topics, it is advantageous to split a single article into +multiple articles. Without splitting the article up, the author would be forced to cram all +of the content into a denser and much longer article, reducing its effectiveness and +readability in the process. Splitting the article allows the author to focus on a specific +concept of the larger article, thereby increasing the overall appearance and readability. -To mark articles that belong to the same series, define `parts` metadata. +Elegant provides the ability to present a view of the articles in the series in the middle of +the right sidebar. This section starts with the name of the series, followed by one bullet +point for each of the articles in the series. The text for the article is prefaced with +"Part N: " (where N is the index of the article) and then the title for the article. To make +navigation easier, the current article is presented in italics, with the other articles being +presented as links to their respective articles. - :::rest - :parts: iCloud 101 Series +Here is an example of what the Series section may look like: -Elegant shows the multi-part series in the sidebar. +![series example in the sidebar]({static}/images/elegant-theme_multi-part-sidebar.png) -![multi-part example in the -sidebar]({static}/images/elegant-theme_multi-part-sidebar.png) +## Configuration -Articles are sorted by their date in ascending order. The oldest article is -considered "Part 1" and so on. +To enable the reading time for your articles, you need to add `series` to the `PLUGINS` +configuration variable in your Pelican configuration. -The currently opened article is displayed in italics. In the above example, -"Part 2" is opened in the browser tab. +```python +PLUGINS = ['series'] +``` -Title attribute of HTML anchor tag `` is set for each "Part" to its article -title; it is displayed when user hovers over the link. +In addition, the `SERIES_TITLE` configuration variable can be set to specify the title used for +the Series section, regardless of the series. -![multi-part example with title of the -links]({static}/images/elegant-theme_multi-part-title-attribute.png) +```python +SERIES_TITLE = "More In This Series" +``` -As all other features, Elegant has some tricks up its sleeve. +## Article Metadata -## Series Title +Once the configuration for Series is enabled in the configuration file, using this feature for +a given set of articles requires that the article contains the `series` +[metadata]({filename}../Extra Customization/meta-data.md) field value. -By default Elegant uses value of `parts` as the title of the series. You can -define series title for your multi-part articles series. Define `series_title` -in your articles metadata, like, +The text assigned to the `series` metadata field is the title of the series. When the page is +created, Pelican provides Elegant with a list of all pages that have the same value for the +`series` metadata field. By default, Elegant sorts that list according to the publish date for +each article. The titles for those pages is then displayed in sorted order, with the current +page presented in _italics_ and the other pages presented as a link to those pages. - :::rest - :parts: iCloud 101 Series - :series_title: iCloud for Dummies +```Markdown +series: Maximizing Elegant +series_index: 2 +``` -And this will give you, - -![multi-part example with custom series title]({static}/images/elegant-theme_multi-part-custom-label.png) - -You have to make sure `series_title` metadata is set for every article in the -series. - -You can also define `SERIES_TITLE` in your Pelican configuration to set a -default value for `multi_part` widget label. - -Elegant first looks for `SERIES_TITLE` in configuration, then `series_title` in -the article metadata, then `parts` metadata which it uses as the last resort. - -I recommend you to let Elegant use `parts` instead of `series_title` and -`SERIES_TITLE`. - -With `series_title` you will have to deal with the hassle of making sure all -articles in the series have it, which you are already doing for `parts`. So why -double the hassle? - -With `SERIES_TITLE` you won't be able to have custom titles for the series'. +If there is a reason to override the ordering of the articles, the `series_index` metadata +field is required. It is recommended that you use the part number you want displayed for the +article as the value to assign to the field. diff --git a/documentation/content/Supported Plugins/photo-gallery-advanced.md b/documentation/content/Supported Plugins/photo-gallery-advanced.md new file mode 100644 index 00000000..eb2a8333 --- /dev/null +++ b/documentation/content/Supported Plugins/photo-gallery-advanced.md @@ -0,0 +1,158 @@ +Title: Advanced Configuration for an Image Gallery Article +Tags: pelican-theme, pelican-plugin, photo gallery +Category: Supported Plugins +Date: 2019-06-09 10:49 +Slug: how-to-use-photos-plugin-advanced +Subtitle: +Summary: Elegant can be configured to provide a simple display of a series of images, usually photos. Instead of asking the author to manually add a link for each photo, this feature provides basic gallery behavior at low cost to the author. +Keywords: photos, gallery, photogallery + +[TOC] + +## Introduction + +This article continues the documentation of the Photo Gallery configuration documented in the +article [Creating a Photo Gallery Article]({filename}./photogallery.md). + +While getting started with a default photo gallery is relatively easy (one configuration +variable and a metadata field per article), enabling some of the more advanced features +requires a little more effort. This effort will allow for the inclusion of single gallery +photos into articles and the fine tuning of the image transformations used to render the +photos for the photo galleries and articles. Together these changes will give you the power +to customize your photo gallery to your requirements. + +## Including Gallery Photos in Articles + +Prior to including single gallery photos in articles, the `PHOTO_LIBRARY` configuration +variable must first be set to the full path of the directory containing all of the galleries. +For example, in the previous article, +[Creating a Photo Gallery Article]({filename}./photogallery.md#article-metadata), +the gallery was added to the article as follows: + +```yaml +gallery: {filename}../gallery-source/dragondance +``` + +Assuming that you have installed a standard installation of Pelican in the directory +`/home/stuff/blog-content` and inferring from the above metadata that all photo galleries are +located in the `content/gallery-source` directory, the full path to the galleries should be as +follows: + +```Python +PHOTO_LIBRARY = '/home/stuff/blog-content/website/content/gallery-source' +``` + +### Adding a Single Photos to an Article + +Once the above configuration has been completed, add a photo into the body of an article using +the following format: `{photo}folder/image.jpg`. The `{photo}` part of the format calls out +this image as part of a gallery, and instructs the `Photos` plugin to resize a photo +specifically for use in articles. The `folder` part refers to the folder representing the +gallery, and the `image.jpg` is the filename of the photo within the `folder` directory. + +For example, say you want to highlight one of the photos, `photo-1.jpg`, that was contained +within the `dragondance` gallery presented in your article. To include it in a Markdown +article, add the following text to the article: + +```Markdown +![first image]({photo}dragondance/photo-1.jpg) +``` + +In addition, using the prefix `{lightbox}` instead of `{photo}` will cause the thumbnail of the +photo to be displayed in the article. Clicking on the thumbnail will bring up the full sized +image from the photo gallery, similar to how it was displayed in the photo gallery. + +## Modifying Image Display in Galleries + +There is a small amount of configuration that is available to modify how a single photo is +displayed in the galleries. These modifications include specifying captions for one or more +photos, specifying EXIF information for one or more photos, and specifying one or more photos +to not display as part of the gallery. + +All three of these modifications are controlled by text files that are located in the same +source directory as the photos. These text files provide extra information that is used when +the article containing the specified photo gallery is being generated. + +For the first two choices, there are two distinct files: `exif.txt` and `captions.txt`. In +both cases, the file format is simply the name of the image, a colon, and the information to +associate with the photo. + +For example, the information in the `exif.txt` may be: + +```text +best.jpg: Canon EOS 5D Mark II - 20mm f/8 1/250s ISO 100 +``` + +and the information in the `captions.txt` file may be: + +```text +best.jpg: My best photo ever! How lucky of me! +``` + +Elegant will display both of these pieces of information at the bottom of the popup for an +individual image. + +To remove keep the photo file in a gallery, but not show it as part of the gallery, the +`blacklist.txt` file is used. Even simpler than the previous two files, the file format is +simply the name of the photo to exclude, one photo to a line. + +For example, to keep the file `this-file-will-be-skipped.jpg` in the gallery directory but not +display it as part of the gallery, the `blacklist.txt` file would look like this: + +```text +this-file-will-be-skipped.jpg +``` + +## Caching Processed Images + +To reduce the need to reprocess images to fit into the gallery, article, and thumbnail sizes, +the `Photo` plugin only processes images if the output file is not already present in the +destination directory. As such, to apply any configuration changes to images that have already +been processed, their destination images need to deleted from the relevant directories under +the `photos` directory from the Pelican output. + +As both of the following sections change configuration variables that affect how the images +are processed, this note on caching applies to any changes of configuration variables +specified in the following sections. + +## Advanced Configuration Values + +The definitive list of the values and their defaults is located on the +[Photos Plugins](https://github.com/getpelican/pelican-plugins/blob/master/photos/README.md) +webpage. + +The definitive list has been pared down, tested, and documented with specific focus on the +Elegant theme. Testing was performed using the list from the Photos Plugin webpage along +with the source code for the Photos Plugin. Any significant difference between the behavior +documented below and the definitive list is usually attributed to differences between the +source code and the documentation for the Photos Plugin. + +As a decent part of this information is presented after testing and research, please feel free +to contact us if you see different behavior than is documented here. + +| Configuration Name | Default Value | Description | +| ---------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `PHOTO_GALLERY` | `(1024, 768, 80)` | Three attributes, describing the maximum width, the maximum height, and the quality of the resized image. The specific set of attributes applies to the maximum size of the photo displayed when the reader clicks on a gallery's thumbnail image in the article. Note that the quality of the resized image only applies to JPG images. | +| `PHOTO_ARTICLE` | `(760, 506, 80)` | The same attributes as `PHOTO_GALLERY`, but for the size of a photo from a gallery used in an article. | +| `PHOTO_THUMB` | `(192, 144, 60)` | The same attributes as `PHOTO_GALLERY`, but for the size of the thumbnails used to show the contents of the gallery. | +| `PHOTO_SQUARE_THUMB` | `False` | This setting controls whether or not the thumbnails retain their aspect ratio when resized. If this setting is `True`, the thumbnails will not retain their aspect ratio and will be cropped to fit into the rectangle defined by the `PHOTO_THUMB` configuration variable. | +| `PHOTO_RESIZE_JOBS` | `1` | Number of resize jobs to be run in parallel. If installed on a Windows machine, [read this](photo-gallery-advanced.md#boo). | +| `PHOTO_WATERMARK` | `True` | Add a watermark to all photos in articles and pages. The watermarks added are controlled by the `PHOTO_WATERMARK_TEXT` and `PHOTO_WATERMARK_IMG` configuration variables described below. Note that if both are specified, both will be used. | +| `PHOTO_WATERMARK_TEXT` | `SITENAME` | Text to use for the watermark. | +| `PHOTO_WATERMARK_TEXT_COLOR` | `(255, 255, 255)` | Color of the text used for the watermark. | +| `PHOTO_WATERMARK_IMG` | `''` | Full path to the image to use as a watermark. | +| `PHOTO_WATERMARK_IMG_SIZE` | `False` | Size to apply to the watermark image, expressed as `(width,height)`. | + +### JPG Specific EXIF Configuration Values + +!!! note + + The [photos plugin](https://github.com/getpelican/pelican-plugins/blob/master/photos/README.md) requires the Python `piexif` package to provide control over any [EXIF](https://photographylife.com/what-is-exif-data) information in the images. + +| Configuration Name | Default Value | Description | +| ----------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `PHOTO_EXIF_KEEP` | `False` | Keep the EXIF information from the input photo. | +| `PHOTO_EXIF_REMOVE_GPS` | `False` | Remove any EXIF GPS information from the photos. | +| `PHOTO_EXIF_AUTOROTATE` | `True` | Use the EXIF orientation field to determine how to rotate the photo so all photos are in a standard orientation. | +| `PHOTO_EXIF_COPYRIGHT` | `False` | If not `False` and no existing copyright information is provided in the image, attach an author and license to the file. Choices include: - COPYRIGHT, [CC0](https://creativecommons.org/share-your-work/public-domain/cc0/), [CC-BY-NC-ND](https://creativecommons.org/licenses/by-nc-nd/2.0/), [CC-BY-NC-SA](https://creativecommons.org/licenses/by-nc-sa/3.0/), [CC-BY](https://creativecommons.org/licenses/by/4.0), [CC-BY-SA](https://creativecommons.org/licenses/by-sa/4.0), [CC-BY-NC](https://creativecommons.org/licenses/by-nc/4.0/), [CC-BY-ND](https://creativecommons.org/licenses/by-nd/4.0) | +| `PHOTO_EXIF_COPYRIGHT_AUTHOR` | `SITENAME` | If `PHOTO_EXIF_COPYRIGHT` is not `False` and no copyright author is present in the image, use this value as the author. | diff --git a/documentation/content/Supported Plugins/photogallery.md b/documentation/content/Supported Plugins/photogallery.md index 1d984c0f..c0e2eb4d 100644 --- a/documentation/content/Supported Plugins/photogallery.md +++ b/documentation/content/Supported Plugins/photogallery.md @@ -1,83 +1,122 @@ -Title: Photo gallery plugin -Tags: pelican-theme, pelican-plugin, photo-gallery +Title: Creating a Photo Gallery Article +Tags: pelican-theme, pelican-plugin, photo gallery Category: Supported Plugins Date: 2019-06-09 10:49 Slug: how-to-use-photos-plugin Subtitle: -Summary: Elegant integrates 'photos' gallery plugin of Pelican out of the box +Summary: Elegant can be configured to provide a simple display of a series of images, usually photos. Instead of asking the article's author to manually add a link for each photo, this feature provides basic gallery behavior with almost no cost to the author. Keywords: photos, gallery, photogallery -In order to easily work with Photos, Pelican has a plugin for [photos](https://github.com/getpelican/pelican-plugins/tree/master/photos) that allows to easily show folders of pictures inside an article. +[TOC] -The relevant template for article has been already incorporated in Pelican, so last steps are to add to you requirements the ones for this plugin `Pillow` and optionally `Piexif`. +In many cases, when an author writes an article and includes an image, there is a specific +reason that the image needs to be in that exact place. A good example of this is the image +at the end of this section, specifically part of this first section to give an early visual +on what visual change is contained within the article. However, in some cases, the author +wishes to provide a bit of preamble to a series of pictures, and then wants those pictures to +be displayed with little effort. This action is most frequently performed when an author +wants to share a series of photos on a given subject, similar to how they would display them +in a brick and mortar art gallery. -## Setup +Elegant provides for a simple, yet effective photo gallery that displays thumbnails, one for +each member of a set of images. These sets of images are defined by specifying a directory +containing the set of images to present to the reader. If that reader is then interested in +viewing one or more of the full images, clicking on the respective thumbnail creates a window +the size of the browser to display the image in. That window has a number of simple controls, +such as a close button, a previous image button and a next image button. -Elegant supports it out of the box. You just have to enable it in your Pelican -configuration, +Here is an example of what the Image Gallery section of such an article may look like: - :::python - PLUGINS = ['photos'] +![Photo Gallery Demonstration]({static}../images/elegant-theme_photo-gallery.png) -Refer to the plugin documentation for configuration, but at the time of this writing, the settings are: +Note that the photo gallery itself will be placed at the end of any text presented for the +article. -`PHOTO_LIBRARY = "~/Pictures"` -: Absolute path to the folder where the original photos are kept, organized in sub-folders. +## Configuration -`PHOTO_GALLERY = (1024, 768, 80)` -: For photos in galleries, maximum width and height, plus JPEG quality as a percentage. This would typically be the size of the photo displayed when the reader clicks a thumbnail. +To enable the Photo Gallery plugin, add `photos` to the `PLUGINS` configuration variable in +your Pelican configuration. -`PHOTO_ARTICLE = (760, 506, 80)` -: For photos associated with articles, maximum width, height, and quality. The maximum size would typically depend on the needs of the theme. 760px is suitable for the theme `notmyidea`. +```python +PLUGINS = ['photos'] +``` -`PHOTO_THUMB = (192, 144, 60)` -: For thumbnails, maximum width, height, and quality. +!!! note -`PHOTO_SQUARE_THUMB = False` -: Crops thumbnails to make them square. + The [photos plugin](https://github.com/getpelican/pelican-plugins/blob/master/photos/README.md) requires the Python `pillow` package to be installed. -`PHOTO_RESIZE_JOBS = 5` -: Number of parallel resize jobs to be run. Defaults to 1. +### Pelican on Windows -`PHOTO_WATERMARK = True` -: Adds a watermark to all photos in articles and pages. Defaults to using your site name. +If you are running Pelican on a Windows machine, include the following configuration in your +`pelicanconf.py` file: -`PHOTO_WATERMARK_TEXT' = SITENAME` -: Allow the user to change the watermark text or remove it completely. By default it uses [SourceCodePro-Bold](http://www.adobe.com/products/type/font-information/source-code-pro-readme.html) as the font. +```Python +PHOTO_RESIZE_JOBS = -1 +``` -`PHOTO_WATERMARK_IMG = ''` -: Allows the user to add an image in addition to or as the only watermark. Set the variable to the location. +Due to known issues in the +[Windows implementation of Python](https://stackoverflow.com/questions/41385708/multiprocessing-example-giving-attributeerror) +dealing with multiprocessing, a function being called within a multiprocessing context must be +written to a specific pattern. Currently, the Photo Plugins has not been written to that +pattern. Setting the `PHOTO_RESIZE_JOBS` configuration variable to `-1` +circumvents this issue by forcing the photo processing code to work in debug mode on a single +thread without invoking any of the multiprocessing code. -**The following features require the piexif library** -`PHOTO_EXIF_KEEP = True` -: Keeps the exif of the input photo. +## Article Metadata -`PHOTO_EXIF_REMOVE_GPS = True` -: Removes any GPS information from the files exif data. +Once the configuration for Photo Gallery is enabled in the configuration file, using this +feature for a given article requires that the article contains the `gallery` +[metadata]({filename}../Extra Customization/meta-data.md) field value. -`PHOTO_EXIF_COPYRIGHT = 'COPYRIGHT'` -: Attaches an author and a license to the file. Choices include: - `COPYRIGHT`: Copyright - `CC0`: Public Domain - `CC-BY-NC-ND`: Creative Commons Attribution-NonCommercial-NoDerivatives - `CC-BY-NC-SA`: Creative Commons Attribution-NonCommercial-ShareAlike - `CC-BY`: Creative Commons Attribution - `CC-BY-SA`: Creative Commons Attribution-ShareAlike - `CC-BY-NC`: Creative Commons Attribution-NonCommercial - `CC-BY-ND`: Creative Commons Attribution-NoDerivatives +The text assigned to the `gallery` metadata field is the location of the directory where the +images to be displayed resides. This location is relative to the article in which the +`gallery` metadata field is placed. -`PHOTO_EXIF_COPYRIGHT_AUTHOR = 'Your Name Here'` -: Adds an author name to the photo's exif and copyright statement. Defaults to `AUTHOR` value from the `pelicanconf.py` +```yaml +gallery: {filename}../gallery-source/dragondance +``` -Lightbox is enabled by default. You can disable it with `PHOTOS_LIGHTBOX` variable. Set it to `FALSE` in your configuration to disable. +In the above example, the actual directory containing the images to display is the +`dragondance` directory. While not specified in the example, the directory `articles` and the +directory `gallery-source` are at the same directory depth, one directory to contain articles +and one directory to contain galleries. By that convention, the article containing the +`gallery` metadata is located in the the `articles` directory. Therefore, the path to the +directory containing the `dragondance` directory is `../gallery-source/`. Together, the entire +path to the `dragondance` directory from the article becomes `../gallery-source/dragondance`. -``` -PHOTOS_LIGHTBOX = False +### Photo Gallery Titles + +Titles for a photo gallery are displayed in a large font directly above the first row of the +photo gallery. To specify the title for a gallery, add the required title to the metadata in +the `gallery` metadata field within curly braces ('{' and '}') as follows: + +```yaml +gallery: {filename}../gallery-source/dragondance{Dragon Dance} ``` -## How to use it in your articles +### Multiple Photo Galleries in the Same Article -In order to use it, in your `YAML` preamble of articles, add a line like this: +Multiple photo galleries can be display, in order, within a single article. This is +accomplished by specify a comma separated list of photo galleries to display in the `gallery` +metadata field. For example: + +```yaml +gallery: {filename}../gallery-source/dragondance{Dragon Dance}, {filename}../gallery-source/hamsterdance{Hamster Dance} +``` -`gallery: {filename}gallery-source/foldername` +will display the title `Dragon Dance`, the Dragon Dance photo gallery, the title +`Hamster Dance`, and finally the Hamster Dance photo gallery. The title of the specific +photo gallery is not required, but when including multiple galleries, is often desired. -In order for the plugin to work, place your pictures in the folder defined by `PHOTO_LIBRARY`, for example: -`~/www/content/gallery-source/foldername` +# Advanced Configuration -The `photos` plugin will process the images, resize, include the watermark, etc and store in the output folder. Images will only be reprocessed if those are removed from the `output` folder, this allows to save time when processing big galleries. +!!! warning -This is an example of the final result: + Processing a quantity of photos in the 10,000s range can take multiple hours to complete. To reduce the effort needed to publish photo galleries, the `Photo` plugin will only process images if the output file is not already present in the destination directory. For more information, please refer to the [Caching Image Processing]({filename}./photo-gallery-advanced.md#caching-processed-images). -![Photo Gallery Demonstration]({static}../images/photogallery.png) +Using the above configuration, a photo gallery will be added to the end of the article +containing the `gallery` metadata using default settings. For additional ways to use photo +galleries and for modifications to those default settings, please consult the sibling article +on +[Advanced Configuration]({filename}./photo-gallery-advanced.md) +. diff --git a/documentation/content/Supported Plugins/previous-and-next-article.md b/documentation/content/Supported Plugins/previous-and-next-article.md index ba157874..b2877093 100644 --- a/documentation/content/Supported Plugins/previous-and-next-article.md +++ b/documentation/content/Supported Plugins/previous-and-next-article.md @@ -1,26 +1,37 @@ -Title: How to show Previous and Next Articles -Tags: pelican-theme, pelican-plugin, navigation, web-design +Title: Add Previous and Next Article Links +Tags: pelican-plugin, navigation, web-design Category: Supported Plugins Date: 2014-01-27 00:02 Slug: how-to-show-previous-and-next-article Comment_id: p9ot4uz-how-to-show-previous-and-next-article Subtitle: -Summary: Elegant theme shows Previous and Next article link to make navigation of the site easier +Summary: Elegant can be configured to provide a Previous and Next article link at the bottom of your articles. This allows for easier navigation through the site if you are looking at articles in published date order. Keywords: +Authors: Talha Mansoor, Jack De Winter -The Previous and Next post links are a powerful way to keep visitors engaged -and to guide them through your site. +When reading a series of articles on a website, a reader often desires to view the articles in +chronological order by publish date. -Elegant requires [Neighbor Articles -plugin](https://github.com/getpelican/pelican-plugins/tree/master/neighbors) to -show these navigational links. +Elegant provides the ability to provide navigation links to the previous and next articles at +the bottom of each article. These links provide a powerful way to keep visitors engaged +and guide them through your site. -![Show next and previous -articles]({static}/images/elegant-theme_previous-next-article.png) +Here is an example of what the Previous and Next Articles section may look like: -Elegant shows newer article on the right hand side and older article on the -left hand side at the bottom of every article. +![Show next and previous articles]({static}/images/elegant-theme_previous-next-article.png) -Most of the content on web is written in left to right languages. In these -languages pages are placed from left to right. It seemed natural to use the -same order in Elegant. +## Configuration + +To enable the Previous and Next Article links for your articles, add `neighbors` to the +`PLUGINS` configuration variable in your Pelican configuration. + +```python +PLUGINS = ['neighbors'] +``` + +When enabled, Elegant will show the links for Previous and Next articles at the very bottom of +every article, after any footnotes for the article, but before the footer for the website. The +link for the next oldest or Previous article is displayed on the left side and the next +youngest or Next article on the right side, being consistent with most languages being +Left-to-Right language. If there is no article that is newer or older than the current article, +the respective link will not be shown. diff --git a/documentation/content/Supported Plugins/reading-time.md b/documentation/content/Supported Plugins/reading-time.md index e4448378..45b96a4d 100644 --- a/documentation/content/Supported Plugins/reading-time.md +++ b/documentation/content/Supported Plugins/reading-time.md @@ -13,25 +13,25 @@ to the reader on the amount of time it will take to read the article. This estim typically based on the average reading speed of an adult being roughly 265 words per minute while retaining comprehension. -Elegant provides this feature, adding a `Reading Time` section -at the top of the text on the right side of the article with the estimate for the current -article. +Elegant provides this feature, adding a `Reading Time` section at the top of the right sidebar +with the estimate for the current article. -Here is an example of what the Reading Time estimate may look like: +Here is an example of what the Reading Time Estimate section may look like: ![Reading Time Section]({static}/images/elegant-theme_reading-time.png) ## Configuration -To enable the reading time for your articles, you need to add `post_stats` to `PLUGINS` in -your Pelican configuration. +To enable the reading time for your articles, you need to add `post_stats` to the `PLUGINS` +configuration variable in your Pelican configuration. ```python PLUGINS = ['post_stats'] ``` -Note that these values must be added to any existing values present for the `PLUGINS` -configuration variables. +!!! note + + The [post_stats plugin](https://github.com/getpelican/pelican-plugins/blob/master/post_stats/readme.rst) requires the Python `beautifulsoup4` package to be installed. In addition, the `READING_TIME_LOWER_LIMIT` configuration variable can be set to specify a lower limit for this feature. If not supplied, the default value for this variable is 4 min. diff --git a/documentation/content/Supported Plugins/share-post-plugin.md b/documentation/content/Supported Plugins/share-post-plugin.md index dcbd4c13..90d38e02 100644 --- a/documentation/content/Supported Plugins/share-post-plugin.md +++ b/documentation/content/Supported Plugins/share-post-plugin.md @@ -1,56 +1,90 @@ -Title: How to use Social Sharing Plugin +Title: Add Social Sharing Links Tags: pelican-theme, pelican-plugin, social-media Category: Supported Plugins Date: 2014-03-24 20:14 Slug: how-to-use-social-sharing-plugin Comment_id: x4jitcv-how-to-use-social-sharing-plugin Subtitle: -Summary: Elegant integrates with Share Post plugin of Pelican out of the box +Summary: Elegant can be configured to provide Social Media sharing links for each of your articles. These links provide a simple way to share on various Social Media platforms while endeavoring to not track users in the process. Keywords: social networks, share posts, +Authors: Talha Mansoor, Jack De Winter -No blog is complete without a social sharing plugin, that invites visitors to -share your post on popular social networks. +No blog is complete without buttons or links that invites a reader to share your articles +with the friend and colleagues on various social media sites. The problem with these buttons +on many sites is that the buttons are used by big companies to track your web usage, sharing +that information with various companies. (For a more in-depth talk on this subject, please +read the [Online Trackers and Links](#Online-Trackers-and-Links) section at the end of this +page.) -There are plethora of social sharing widgets available online. Unfortunately -most of these widgets are used to track users. [Technology -watchdogs](http://techliberation.com/2011/05/20/privacy-solutions-how-to-block-facebooks-like-button-and-other-social-widgets/) -have been [raising a hue and -cry](http://online.wsj.com/news/articles/SB10001424052748704281504576329441432995616#printMode) -since as [early as -2009](https://www.eff.org/deeplinks/2009/09/online-trackers-and-social-networks). +Elegant provides a simple solution to this, using the `Share Post` plugin from pelican to +provide simple and plain old-school URLs to provide the social media links. These have the +benefit of not having any ability to be used for online tracking. -Developers have come up with [different ways](http://fixtracking.com/) to cope -this issue. Solutions ranging from [browser plugins](https://disconnect.me/) to -totally [reinventing share -widgets](http://panzi.github.io/SocialSharePrivacy/). +Here is an example of what the Social Media Sharing section may look like: -Obviously, you cannot expect that all your visitors to use a privacy plugin. -Most browsers on mobile platforms do not let user install any sort of plugin. +![Share Post plugin in Elegant]({static}/images/elegant-theme-share-post-plugin.png) -Reinventing social widget will require educating users about it. The new style -will be alien to them and may result in a decrease in number of _shares_ on -social networks. +## Configuration -Elegant has a far simpler solution. It uses Pelican's [Share -Post](https://github.com/getpelican/pelican-plugins/tree/master/share_post) -plugin. This plugin generates old school URLs that cannot be used for online -tracking at all. +To enable the Social Media Sharing links for your articles, add `share_post` to the `PLUGINS` +configuration variable in your Pelican configuration. -Elegant supports it out of the box. You just have to enable it in your Pelican -configuration, +```python +PLUGINS = ['share_post'] +``` - :::python - PLUGINS = ['share_post'] +!!! note -And viola! + The [share_post plugin](https://github.com/getpelican/pelican-plugins/blob/master/share_post/README.md) requires the Python `beautifulsoup4` package to be installed. -![Share Post plugin in Elegant]({static}/images/elegant-theme-share-post-plugin.png) +The default text used to lead into the Social Media Sharing links is "Share On:". This can +be overridden by defining the `SHARE_POST_INTRO` configuration variable with the text you +want to replace it. + +```Python +SHARE_POST_INTRO = "Share me with your friends on" +``` + +## Article Metadata + +Once the configuration for Sharing Media Links is enabled in the configuration file, using +this feature to provide links for your readers to share your articles on social media is +completed. + +The only effect any [metadata]({filename}../Extra Customization/meta-data.md) field will have +on Sharing Media links is to change the text to lead into the Social Media Sharing links. +As documented above, the `SHARE_POST_INTRO` can be used to provide an alternate lead in text +for the Social Media Sharing links. This text can be further overridden on an +article-by-article basis by specifying the `share_post_intro` metadata field value for an +article as follows: + +```yaml +share_post_intro: Share this article on Elegant with +``` + +## Online Trackers and Links + +There are a plethora of social sharing widgets available online. The unfortunate problem with +most of the widgets is that they are used to track users and their browsing habits. +[Technology watchdogs](http://techliberation.com/2011/05/20/privacy-solutions-how-to-block-facebooks-like-button-and-other-social-widgets/) +have been +[raising a hue and cry](http://online.wsj.com/news/articles/SB10001424052748704281504576329441432995616#printMode) +since as +[early as 2009](https://www.eff.org/deeplinks/2009/09/online-trackers-and-social-networks). -Like [rest of the Elegant](how-to-customize-elegant) you can customize this -widget too. +Developers have responded to these concerned by coming up with +[different ways](http://fixtracking.com/) to cope with this issue. The solutions range from +custom [browser plugins](https://disconnect.me/) to completely totally +[reinventing share widgets](http://panzi.github.io/SocialSharePrivacy/) for a given browser. +However, it is unreasonable to expect that each of your visitors uses a privacy plugin. +Depending on your setup, your computer's browser or mobile phone's browser may not let your +users install any kind of plugin. -You can define `SHARE_POST_INTRO` in your Pelican configuration to override the -default "Share on:" text. +Reinventing a social widget that respects the user's concerns will certainly requiring the more +educated readers about it. For other readers, the "new" or "changed" social widget will seem +alien to them, and will make them hesitant to use it. In turn, that will almost definitely +result in a decrease in the number of shares of your articles on social networks. -You can also define it on per article basis by defining `share_post_intro` in -your article metadata. +Pelican (and therefore Elegant) uses a simple approach to work around this issue. By using +plain URLs to provide it's ability to share with social media sites, the entire widget issue +is avoided. diff --git a/documentation/content/images/elegant-theme_multi-part-sidebar.png b/documentation/content/images/elegant-theme_multi-part-sidebar.png index 7ed2019e..3fb8db24 100644 Binary files a/documentation/content/images/elegant-theme_multi-part-sidebar.png and b/documentation/content/images/elegant-theme_multi-part-sidebar.png differ diff --git a/documentation/content/images/elegant-theme_photo-gallery.png b/documentation/content/images/elegant-theme_photo-gallery.png new file mode 100644 index 00000000..6b165959 Binary files /dev/null and b/documentation/content/images/elegant-theme_photo-gallery.png differ diff --git a/documentation/content/pages/landing-page-about-me.md b/documentation/content/pages/landing-page-about-me.md index a5293375..f351ec41 100644 --- a/documentation/content/pages/landing-page-about-me.md +++ b/documentation/content/pages/landing-page-about-me.md @@ -15,6 +15,22 @@ Every feature and style of Elegant is the result of a long thought process. ## What Makes Elegant So Special? + + + + + + + + + + + + + + + + Elegant is the only Pelican theme that search, live filter tags, zero clutter categories, lazy load comments, Mailchimp, FreeLists support and a customizable landing page. That's not all. Go through our documentation, you will find several unique features and nuances that you will not find in any other theme. diff --git a/documentation/content/theme/images/apple-touch-icon-114x114.png b/documentation/content/theme/images/apple-touch-icon-114x114.png old mode 100755 new mode 100644 index 0136eaa8..64f4fee9 Binary files a/documentation/content/theme/images/apple-touch-icon-114x114.png and b/documentation/content/theme/images/apple-touch-icon-114x114.png differ diff --git a/documentation/content/theme/images/apple-touch-icon-120x120.png b/documentation/content/theme/images/apple-touch-icon-120x120.png old mode 100755 new mode 100644 index e7893a86..f9925260 Binary files a/documentation/content/theme/images/apple-touch-icon-120x120.png and b/documentation/content/theme/images/apple-touch-icon-120x120.png differ diff --git a/documentation/content/theme/images/apple-touch-icon-144x144.png b/documentation/content/theme/images/apple-touch-icon-144x144.png old mode 100755 new mode 100644 index 6a496504..641a5634 Binary files a/documentation/content/theme/images/apple-touch-icon-144x144.png and b/documentation/content/theme/images/apple-touch-icon-144x144.png differ diff --git a/documentation/content/theme/images/apple-touch-icon-152x152.png b/documentation/content/theme/images/apple-touch-icon-152x152.png old mode 100755 new mode 100644 index f888a57d..c9750435 Binary files a/documentation/content/theme/images/apple-touch-icon-152x152.png and b/documentation/content/theme/images/apple-touch-icon-152x152.png differ diff --git a/documentation/content/theme/images/apple-touch-icon-180x180.png b/documentation/content/theme/images/apple-touch-icon-180x180.png new file mode 100644 index 00000000..e36a05aa Binary files /dev/null and b/documentation/content/theme/images/apple-touch-icon-180x180.png differ diff --git a/documentation/content/theme/images/apple-touch-icon-57x57.png b/documentation/content/theme/images/apple-touch-icon-57x57.png old mode 100755 new mode 100644 index 64f0b300..7e5f0f00 Binary files a/documentation/content/theme/images/apple-touch-icon-57x57.png and b/documentation/content/theme/images/apple-touch-icon-57x57.png differ diff --git a/documentation/content/theme/images/apple-touch-icon-72x72.png b/documentation/content/theme/images/apple-touch-icon-72x72.png old mode 100755 new mode 100644 index 55a20d45..180ddbca Binary files a/documentation/content/theme/images/apple-touch-icon-72x72.png and b/documentation/content/theme/images/apple-touch-icon-72x72.png differ diff --git a/documentation/content/theme/images/apple-touch-icon-76x76.png b/documentation/content/theme/images/apple-touch-icon-76x76.png old mode 100755 new mode 100644 index eeb79e6e..65ca037c Binary files a/documentation/content/theme/images/apple-touch-icon-76x76.png and b/documentation/content/theme/images/apple-touch-icon-76x76.png differ diff --git a/documentation/content/theme/images/apple-touch-icon.png b/documentation/content/theme/images/apple-touch-icon.png old mode 100755 new mode 100644 index 64f0b300..7e5f0f00 Binary files a/documentation/content/theme/images/apple-touch-icon.png and b/documentation/content/theme/images/apple-touch-icon.png differ diff --git a/documentation/content/theme/images/favicon.ico b/documentation/content/theme/images/favicon.ico old mode 100755 new mode 100644 index 8923420a..e16b89a0 Binary files a/documentation/content/theme/images/favicon.ico and b/documentation/content/theme/images/favicon.ico differ diff --git a/documentation/pelicanconf.py b/documentation/pelicanconf.py index 733e4b6e..eda3f023 100644 --- a/documentation/pelicanconf.py +++ b/documentation/pelicanconf.py @@ -94,11 +94,13 @@ SHARE_POST_INTRO = "Like this post? Share on:" COMMENTS_INTRO = "So what do you think? Did I miss something? Is any part unclear? Leave your comments below." -# Mailchimp -EMAIL_SUBSCRIPTION_LABEL = "Get Monthly Updates" +# Email Subscriptions +EMAIL_SUBSCRIPTION_LABEL = "Get New Release Alert" EMAIL_FIELD_PLACEHOLDER = "Enter your email..." -SUBSCRIBE_BUTTON_TITLE = "Send me Free updates" -MAILCHIMP_FORM_ACTION = "empty" +SUBSCRIBE_BUTTON_TITLE = "Notify me" + +FREELISTS_NAME = "oracle-l" +FREELISTS_FILTER = True # SMO TWITTER_USERNAME = "" @@ -133,6 +135,11 @@ "url": "https://github.com/Pelican-Elegant/elegant/milestones", "description": "See planned features and estimated release dates", }, + { + "name": "Press Kit", + "url": "https://github.com/Pelican-Elegant/elegant/tree/master/elegant-logo", + "description": "Writing an article on Elegant? Get Elegant logo from here", + }, { "name": "onCrashReboot", "url": "https://www.oncrashreboot.com/", @@ -172,3 +179,4 @@ "blurb": "FOSS lawyer by trade, hacker by heart.", }, } +DISQUS_FILTER = True diff --git a/documentation/publishconf.py b/documentation/publishconf.py index 07579447..6d583812 100644 --- a/documentation/publishconf.py +++ b/documentation/publishconf.py @@ -14,17 +14,20 @@ # Important: Changing SITEURL may break links in deploy-previews if os.environ.get("CONTEXT") == "production": SITEURL = "https://elegant.oncrashreboot.com" + FEED_DOMAIN = SITEURL FEED_ALL_ATOM = "feeds/all.atom.xml" CATEGORY_FEED_ATOM = "feeds/{slug}.atom.xml" CLAIM_BING = os.environ.get("CLAIM_BING_PROD") STAT_COUNTER_PROJECT = os.environ.get("STAT_COUNTER_PROJECT_PROD") STAT_COUNTER_SECURITY = os.environ.get("STAT_COUNTER_SECURITY_PROD") GOOGLE_ANALYTICS = os.environ.get("GOOGLE_ANALYTICS_PROD") + DISQUS_SITENAME = os.environ.get("DISQUS_SITENAME") elif os.environ.get("CONTEXT") == "branch-deploy" and os.environ.get("HEAD") == "next": SITENAME = "Elegant (Next)" SITESUBTITLE = "Pre Release Documentation of The Best Pelican Theme" SITEURL = "https://next.elegant.oncrashreboot.com" + FEED_DOMAIN = SITEURL LANDING_PAGE_TITLE = "Elegant (Next) – Why it is the Best Pelican Theme" STAT_COUNTER_PROJECT = os.environ.get("STAT_COUNTER_PROJECT_NEXT") STAT_COUNTER_SECURITY = os.environ.get("STAT_COUNTER_SECURITY_NEXT") @@ -33,6 +36,8 @@ else: SITEURL = "" +MAILCHIMP_FORM_ACTION = os.environ.get("MAILCHIMP_FORM_ACTION") + RELATIVE_URLS = False # filetime_from_git is very slow. Use it in production only # to avoid slow build times during development diff --git a/elegant-logo/elegant_logo.png b/elegant-logo/elegant_logo.png new file mode 100644 index 00000000..a718e99f Binary files /dev/null and b/elegant-logo/elegant_logo.png differ diff --git a/elegant-logo/elegant_logo.svg b/elegant-logo/elegant_logo.svg new file mode 100644 index 00000000..a3d64086 --- /dev/null +++ b/elegant-logo/elegant_logo.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 4d681cd6..8a75d80c 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -27,6 +27,8 @@ const watchFiles = () => { [ "documentation/content/**/*.md", "documentation/content/**/*.rest", + "documentation/pelicanconf.py", + "documentation/publishconf.py", "templates/**/*.html", "static/**/*.css", "static/**/*.js" diff --git a/templates/_includes/_defaults.html b/templates/_includes/_defaults.html index 740a1ef5..3f2db2d5 100644 --- a/templates/_includes/_defaults.html +++ b/templates/_includes/_defaults.html @@ -61,6 +61,12 @@ {% set COMMENTS_INTRO = COMMENTS_INTRO %} {% endif %} +{% if not DISQUS_FILTER %} +{% set DISQUS_FILTER = False %} +{% else %} +{% set DISQUS_FILTER = DISQUS_FILTER %} +{% endif %} + {# Author's twitter handle. Used in Twitter card meta data #} {% if not TWITTER_USERNAME %} {% set TWITTER_USERNAME = '' %} @@ -98,11 +104,23 @@ {% set MAILCHIMP_FORM_ACTION = MAILCHIMP_FORM_ACTION %} {% endif %} +{% if not MAILCHIMP_FILTER %} +{% set MAILCHIMP_FILTER = False %} +{% else %} +{% set MAILCHIMP_FILTER = MAILCHIMP_FILTER %} +{% endif %} + {% if not FREELISTS_NAME %} {% set FREELISTS_NAME = '' %} {% else %} {% set FREELISTS_NAME = FREELISTS_NAME %} {% endif %} +{% if not FREELISTS_FILTER %} +{% set FREELISTS_FILTER = False %} +{% else %} +{% set FREELISTS_FILTER = FREELISTS_FILTER %} +{% endif %} + {# It is displayed along with the SITENAME in the footer of every page #} {% if not SITESUBTITLE %} {% set SITESUBTITLE = '' %} diff --git a/templates/_includes/comments.html b/templates/_includes/comments.html index 0cad056a..6b46bc91 100644 --- a/templates/_includes/comments.html +++ b/templates/_includes/comments.html @@ -1,5 +1,10 @@ -{% macro comments(article) %} - {% if DISQUS_SITENAME and SITEURL and article.status != 'draft' and article.comments != 'False' %} +{% macro comments_disqus(article) %} + {% if SITEURL and article.status != 'draft' and article.comments != 'False' %} + + {% from '_includes/_defaults.html' import DISQUS_FILTER with context %} + + {%if (not DISQUS_FILTER or article.disqus_filter == "off") and DISQUS_SITENAME and article.disqus_filter != "on" %} + {% if article.comments_intro %} {{ article.comments_intro }} @@ -19,7 +24,7 @@ data-disqus-identifier="{{ article.disqus_identifier }}" {% endif %} href="{{ SITEURL }}/{{ article.url }}#disqus_thread", - id="disqus-accordion-toggle"> + id="comment-accordion-toggle"> Comments @@ -35,11 +40,49 @@ {% endif %} + {% endif %} {% endmacro %} -{% macro comments_script(article) %} - {% if DISQUS_SITENAME and SITEURL and article.status != 'draft' %} +{% macro comments_script_disqus(article) %} + {% if SITEURL and article.status != 'draft' %} + {% from '_includes/_defaults.html' import DISQUS_FILTER with context %} + + {%if (not DISQUS_FILTER or article.disqus_filter == "off") and DISQUS_SITENAME and article.disqus_filter != "on" %} + {% from '_includes/disqus_scripts.html' import disqus_misc_scripts with context %} {{ disqus_misc_scripts() }} {% endif %} + {% endif %} +{% endmacro %} + + +{% macro comments_common_scripts() %} + + + {% endmacro %} diff --git a/templates/_includes/disqus_scripts.html b/templates/_includes/disqus_scripts.html index 8712ac32..a913d2b8 100644 --- a/templates/_includes/disqus_scripts.html +++ b/templates/_includes/disqus_scripts.html @@ -8,34 +8,6 @@ (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); - - - {% endmacro %} {% macro disqus_comments_script(article) %} diff --git a/templates/_includes/favicon_links.html b/templates/_includes/favicon_links.html index 40a217e2..91cab225 100644 --- a/templates/_includes/favicon_links.html +++ b/templates/_includes/favicon_links.html @@ -14,4 +14,5 @@ + {% endif %} diff --git a/templates/_includes/freelists.html b/templates/_includes/freelists.html index 3bd3802b..f3cb88e0 100644 --- a/templates/_includes/freelists.html +++ b/templates/_includes/freelists.html @@ -1,26 +1,24 @@ +{% macro freelists(article) %} + {% from '_includes/_defaults.html' import FREELISTS_NAME with context %} +{% from '_includes/_defaults.html' import FREELISTS_FILTER with context %} + +{%if (not FREELISTS_FILTER or article.freelists_filter == "off") and article.freelists_filter != "on" %} + {% if FREELISTS_NAME %} + {% from '_includes/_defaults.html' import EMAIL_SUBSCRIPTION_LABEL with context %} -{% from '_includes/_defaults.html' import EMAIL_FIELD_PLACEHOLDER with context %} {% from '_includes/_defaults.html' import SUBSCRIBE_BUTTON_TITLE with context %} - + {{ EMAIL_SUBSCRIPTION_LABEL }} - - - - -{{ SUBSCRIBE_BUTTON_TITLE }} -Unsubscribe -Turn Digest mode on -Turn Digest mode off -Turn Vacation mode on -Turn Vacation mode off -Get Help - - + {% endif %} + +{% endif %} + +{% endmacro %} diff --git a/templates/_includes/mailchimp.html b/templates/_includes/mailchimp.html index c21780bc..128a709a 100644 --- a/templates/_includes/mailchimp.html +++ b/templates/_includes/mailchimp.html @@ -1,5 +1,12 @@ +{% macro mailchimp(article) %} + {% from '_includes/_defaults.html' import MAILCHIMP_FORM_ACTION with context %} +{% from '_includes/_defaults.html' import MAILCHIMP_FILTER with context %} + +{%if (not MAILCHIMP_FILTER or article.mailchimp_filter == "off") and article.mailchimp_filter != "on" %} + {% if MAILCHIMP_FORM_ACTION %} + {% from '_includes/_defaults.html' import EMAIL_SUBSCRIPTION_LABEL with context %} {% from '_includes/_defaults.html' import EMAIL_FIELD_PLACEHOLDER with context %} {% from '_includes/_defaults.html' import SUBSCRIBE_BUTTON_TITLE with context %} @@ -12,4 +19,9 @@ {{ EMAIL_SUBSCRIPTION_LABEL }} + {% endif %} + +{% endif %} + +{% endmacro %} diff --git a/templates/article.html b/templates/article.html index 2885b859..9cdb2deb 100644 --- a/templates/article.html +++ b/templates/article.html @@ -77,8 +77,8 @@ {{ title }} {{ share_links(article) }} {% from '_includes/article_author.html' import article_author with context %} {{ article_author(article) }} - {% from '_includes/comments.html' import comments with context %} - {{ comments(article) }} + {% from '_includes/comments.html' import comments_disqus with context %} + {{ comments_disqus(article) }} {% include '_includes/related_posts.html' with context %} {% if article.prev_article or article.next_article %} @@ -134,8 +134,10 @@ Tags {% endif %} {% include '_includes/social_links.html' %} - {% include '_includes/mailchimp.html' %} - {% include '_includes/freelists.html' %} + {% from '_includes/mailchimp.html' import mailchimp with context %} + {{ mailchimp(article) }} + {% from '_includes/freelists.html' import freelists with context %} + {{ freelists(article) }} @@ -144,7 +146,9 @@ Tags {% block script %} {{ super() }} - {% from '_includes/comments.html' import comments_script with context %} - {{ comments_script(article) }} + {% from '_includes/comments.html' import comments_script_disqus with context %} + {{ comments_script_disqus(article) }} + {% from '_includes/comments.html' import comments_common_scripts with context %} + {{ comments_common_scripts() }} {% include '_includes/photos_footer.html' %} {% endblock script %} diff --git a/templates/page.html b/templates/page.html index 38d95e33..cb3aba2b 100644 --- a/templates/page.html +++ b/templates/page.html @@ -42,8 +42,8 @@ Contents {% endif %} {{ page.content }} - {% from '_includes/comments.html' import comments with context %} - {{ comments(page) }} + {% from '_includes/comments.html' import comments_disqus with context %} + {{ comments_disqus(page) }} @@ -58,6 +58,8 @@ Contents {% block script %} {{ super() }} - {% from '_includes/comments.html' import comments_script with context %} - {{ comments_script(page) }} + {% from '_includes/comments.html' import comments_script_disqus with context %} + {{ comments_script_disqus(page) }} + {% from '_includes/comments.html' import comments_common_scripts with context %} + {{ comments_common_scripts() }} {% endblock script %}
{{ article.comments_intro }}