diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..296abc8 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,9 @@ +# Flex Blog Example + +## Build + +`pelican -s pelicanconf.py` + +## Publish + +`pelican -s publishconf.py` diff --git a/docs/content/articles/flex-pelican-theme-1-1-1.md b/docs/content/articles/flex-pelican-theme-1-1-1.md new file mode 100644 index 0000000..81ee533 --- /dev/null +++ b/docs/content/articles/flex-pelican-theme-1-1-1.md @@ -0,0 +1,16 @@ +Title: Flex 1.1.1 +Date: 2016-02-27 08:00 +Modified: 2016-02-27 08:00 +Category: News +Tags: pelican, python, theme +Slug: flex-pelican-theme-update-1-1-1 +Cover: images/flex-screenshot.png + +Today, [Flex theme](https://github.com/alexandrevicenzi/Flex) received a small update. + +Some bugs are now fixed. I think the most important fixes are: + +- [Bug in CSS with placement of "Newer Posts" button](https://github.com/alexandrevicenzi/Flex/issues/21) +- [Posts preview on main page](https://github.com/alexandrevicenzi/Flex/issues/14) + +Hope you enjoy this theme. diff --git a/docs/content/articles/flex-pelican-theme-1-1.md b/docs/content/articles/flex-pelican-theme-1-1.md new file mode 100644 index 0000000..cdb6e2f --- /dev/null +++ b/docs/content/articles/flex-pelican-theme-1-1.md @@ -0,0 +1,24 @@ +Title: New version of Flex: The responsive Pelican theme +Date: 2015-10-07 08:00 +Modified: 2015-10-07 08:00 +Category: News +Tags: pelican, python, theme +Slug: flex-pelican-theme-update-1-1 +Cover: images/flex-screenshot.png + +I've made the [Flex theme](https://github.com/alexandrevicenzi/Flex) a time ago. For my surprise, many people are using it. I feel thankful for this. + +So, after some new blogs with this theme, I got issues and PRs on GitHub from these new users. This weekend I had some free time and I release the [second version](https://github.com/alexandrevicenzi/Flex/releases/tag/v1.1) of Flex (aka v1.1). + +This new version doesn't include nothing so special, just some bug fix and a new setting to allow custom CSS stylesheets. + +The new custom setting can be used like this: + +```python +EXTRA_PATH_METADATA = { + 'extra/custom.css': {'path': 'static/custom.css'}, +} +CUSTOM_CSS = 'static/custom.css' +``` + +I would like to thank all who helped in this new version. diff --git a/docs/content/articles/flex-pelican-theme-1-2.md b/docs/content/articles/flex-pelican-theme-1-2.md new file mode 100644 index 0000000..fb8b7ae --- /dev/null +++ b/docs/content/articles/flex-pelican-theme-1-2.md @@ -0,0 +1,21 @@ +Title: Flex 1.2.0 +Date: 2016-06-10 08:00 +Modified: 2016-06-10 08:00 +Category: News +Tags: pelican, python, theme +Slug: flex-pelican-theme-update-1-2-0 +Cover: images/flex-screenshot.png + +[Flex theme](https://github.com/alexandrevicenzi/Flex) received some new features. Version 1.2.0 include new features and some updates. + +For developers there are new color styles for your code. For general purpose there is RUM support, related posts and browser color configuration. + +- [Update font-awesome](https://github.com/alexandrevicenzi/Flex/issues/31) +- [Added browser color configuration](https://github.com/alexandrevicenzi/Flex/pull/34) +- [Related posts](https://github.com/alexandrevicenzi/Flex/pull/27) +- [More Pygments Styles](https://github.com/alexandrevicenzi/Flex/issues/38) +- [Add StatusCake RUM support](https://github.com/alexandrevicenzi/Flex/issues/16) + +If you need help or want to report a bug, please open an [issue](https://github.com/alexandrevicenzi/Flex/issues). + +Hope you enjoy this theme. diff --git a/docs/content/articles/flex-pelican-theme-2.0.md b/docs/content/articles/flex-pelican-theme-2.0.md new file mode 100644 index 0000000..fd8fbb6 --- /dev/null +++ b/docs/content/articles/flex-pelican-theme-2.0.md @@ -0,0 +1,37 @@ +Title: Flex 2.0 +Date: 2016-09-13 08:00 +Modified: 2016-09-13 08:00 +Category: News +Tags: pelican, python, theme +Slug: flex-pelican-theme-update-2-0 +Cover: images/flex-screenshot.png + +[Flex theme](https://github.com/alexandrevicenzi/Flex) 2.0 comes with new features. +In fact there are two new features. + +The biggest change is localization support. +Yes, Flex now can be translated into your language. +You can read about [here](https://github.com/alexandrevicenzi/Flex/wiki/Translations). + +The biggest challege was to create a way to translate without breaking old versions. +If you use English it changes nothing for you. +But if you want to use translation you need to add new lines to your pelican configuration file. + +Here is a small example to use Flex in another language. + +```python +# Enable i18n plugin, probably you already have some others here. +PLUGINS = ['i18n_subsites'] +# Enable Jinja2 i18n extension used to parse translations. +JINJA_EXTENSIONS = ['jinja2.ext.i18n'] +# Default theme language. +I18N_TEMPLATES_LANG = 'en' +# Your language. +DEFAULT_LANG = 'de' +OG_LOCALE = 'de_DE' +LOCALE = 'de_DE' +``` + +Last but not least, Flex supports the feature "X minute read", similar [Medium](https://medium.com/). + +Hope you enjoy this version. diff --git a/docs/content/articles/flex-pelican-theme-2.1.md b/docs/content/articles/flex-pelican-theme-2.1.md new file mode 100644 index 0000000..6351114 --- /dev/null +++ b/docs/content/articles/flex-pelican-theme-2.1.md @@ -0,0 +1,34 @@ +Title: Flex 2.1 +Date: 2016-11-16 08:00 +Modified: 2016-11-16 08:00 +Category: News +Tags: pelican, python, theme +Slug: flex-pelican-theme-update-2-1 +Cover: images/flex-screenshot.png + +[Flex theme](https://github.com/alexandrevicenzi/Flex) 2.1 comes with a feature that I was delaying for so long. +Flex 2.1 adds support for Google AdSense. + +If you choose wisely, ads are a way to win some money, but if not, you may loose your users due to excessive use of ads. + +Flex has six places for ads. Google recommends up to 3 ads per page. There is ads page only, and banner that appears on all pages. +Below you can see how to enable ads in your pelican configuration file. + +```python +GOOGLE_ADSENSE = { + 'ca_id': 'ca-pub-1234567890', # Your AdSense ID + 'page_level_ads': True, # Allow Page Level Ads (mobile) + 'ads': { + 'aside': '1234561', # Side bar banner (all pages) + 'main_menu': '1234562', # Banner before main menu (all pages) + 'index_top': '1234563', # Banner after main menu (index only) + 'index_bottom': '1234564', # Banner before footer (index only) + 'article_top': '1234565', # Banner after article title (article only) + 'article_bottom': '1234566', # Banner after article content (article only) + } +} +``` + +Version 2.1 also comes with new translations. You can see available translations [here](https://github.com/alexandrevicenzi/Flex/wiki/Translations). + +Hope you enjoy this version. diff --git a/docs/content/articles/flex-pelican-theme.md b/docs/content/articles/flex-pelican-theme.md new file mode 100644 index 0000000..1c218c2 --- /dev/null +++ b/docs/content/articles/flex-pelican-theme.md @@ -0,0 +1,95 @@ +Title: Flex: Responsive Pelican theme +Date: 2015-07-22 08:00 +Modified: 2015-07-22 08:00 +Category: News +Tags: pelican, python, theme +Slug: flex-pelican-theme +Cover: images/flex-screenshot.png + +I just start a new fresh blog using [Pelican](http://getpelican.com). Sometimes choosing a theme for a new site is something difficult that takes time. + +In the Pelican [theme gallery](http://www.pelicanthemes.com/), I couldn't find anything that I really liked to feet all my needs. So in the first time of the history, I choose to create my own theme. I never did this before. + +Creating a theme for Pelican is quite easy, unlike Wordpress. You can take a look in the [Source Code of Flex](https://github.com/alexandrevicenzi/Flex). + +But how Flex looks like? Well, you can see [this screenshot](images/flex-screenshot.png), but you already know how it looks like, you're looking at it. :D + +I really care about SEO and integrations with Facebook, Google Plus and other social networks, so this theme offers some features: + +- Mobile First +- Responsive +- Semantic +- SEO Best Practices +- Open Graph +- Rich Snippets (JSON-LD) + +Maybe these features are not fully optimized, but I'll improve. + +Flex also offers integrations with multiple services. + +> **Tip:** + +> You can easyly integrate with: + +> - AddThis +> - Disqus +> - Google Analytics +> - Google Tag Manager +> - StatusCake + +Flex is a theme built by a developer for developers, but of course, you can use for any purpose. In this scenario, Flex is able to create good styles for coding, outputs and samples. + +If you need to show some program output you can use `samp` tag to look like this: + +Done: Processed 4 articles, 0 drafts, 2 pages and 0 hidden pages in 0.22 seconds. + +Or if you want multiple lines: + + + total used free shared buffers cached +Mem: 5866 4674 1192 386 0 2404 +-/+ buffers/cache: 2269 3596 +Swap: 20480 1267 19213 + + +If you like to share code snippets, you can take advantage of [Pygments](http://pygments.org/) syntax highlighting: + +```js +// Foo +var bar = 0; +``` + +```python +class Foo(object): + def __init__(self, bar) + self.bar = bar +``` + +**Note:** The code block looks like GitHub’s colors. + +You can add tables too: + +Item | Value +-------- | --- +Computer | $1600 +Phone | $12 +Pipe | $1 + +and how heading looks like? + +# This is heading 1 +## This is heading 2 +### This is heading 3 +#### This is heading 4 +##### This is heading 5 +###### This is heading 6 + +This examples are in Markdown. I'm not sure how it will look using reStructuredText. Keep in mind that Markdown allows you to add HTML tags. If you can create the same HTML syntax produced by Markdown using reStructuredText it will work. + +You can take a look in the [source code of this page](https://raw.githubusercontent.com/alexandrevicenzi/blog/master/content/News/flex-pelican-theme.md) to know how to create rich examples. + +Flex is my first attempt creating themes and there's no IE testing yet. You can check the [sources here](https://github.com/alexandrevicenzi/flex). + +As soon as possible I will add this project to Pelican gallery. + +Drop a comment if you like this theme, or [open an issue](https://github.com/alexandrevicenzi/Flex/issues) if you need a feature or found a bug. diff --git a/docs/content/extra/custom.css b/docs/content/extra/custom.css new file mode 100644 index 0000000..0f2a0c8 --- /dev/null +++ b/docs/content/extra/custom.css @@ -0,0 +1,3 @@ +.highlight { + color: #f8f8f2; +} diff --git a/docs/content/images/favicon.ico b/docs/content/images/favicon.ico new file mode 100644 index 0000000..b266085 Binary files /dev/null and b/docs/content/images/favicon.ico differ diff --git a/docs/content/images/flex-screenshot.png b/docs/content/images/flex-screenshot.png new file mode 100644 index 0000000..0ebc4c4 Binary files /dev/null and b/docs/content/images/flex-screenshot.png differ diff --git a/docs/content/pages/about.md b/docs/content/pages/about.md new file mode 100644 index 0000000..7983ac5 --- /dev/null +++ b/docs/content/pages/about.md @@ -0,0 +1,5 @@ +Title: About +Date: 2015-07-18 08:00 +Modified: 2018-01-01 08:00 + +Flex - The minimalist Pelican theme. diff --git a/docs/content/pages/contact.md b/docs/content/pages/contact.md new file mode 100644 index 0000000..49a5970 --- /dev/null +++ b/docs/content/pages/contact.md @@ -0,0 +1,6 @@ +Title: Contact +Date: 2015-07-18 08:00 +Modified: 2018-01-01 08:00 +Slug: contact + +If you want to contact about typos, grammar and other errors in this blog, you can open an issue [here](https://github.com/alexandrevicenzi/Flex/issues). diff --git a/docs/develop_server.sh b/docs/develop_server.sh new file mode 100755 index 0000000..8c2f27f --- /dev/null +++ b/docs/develop_server.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash +## +# This section should match your Makefile +## +PY=${PY:-python} +PELICAN=${PELICAN:-pelican} +PELICANOPTS= + +BASEDIR=$(pwd) +INPUTDIR=$BASEDIR/content +OUTPUTDIR=$BASEDIR/output +CONFFILE=$BASEDIR/pelicanconf.py + +### +# Don't change stuff below here unless you are sure +### + +SRV_PID=$BASEDIR/srv.pid +PELICAN_PID=$BASEDIR/pelican.pid + +function usage(){ + echo "usage: $0 (stop) (start) (restart) [port]" + echo "This starts Pelican in debug and reload mode and then launches" + echo "an HTTP server to help site development. It doesn't read" + echo "your Pelican settings, so if you edit any paths in your Makefile" + echo "you will need to edit your settings as well." + exit 3 +} + +function alive() { + kill -0 $1 >/dev/null 2>&1 +} + +function shut_down(){ + PID=$(cat $SRV_PID) + if [[ $? -eq 0 ]]; then + if alive $PID; then + echo "Stopping HTTP server" + kill $PID + else + echo "Stale PID, deleting" + fi + rm $SRV_PID + else + echo "HTTP server PIDFile not found" + fi + + PID=$(cat $PELICAN_PID) + if [[ $? -eq 0 ]]; then + if alive $PID; then + echo "Killing Pelican" + kill $PID + else + echo "Stale PID, deleting" + fi + rm $PELICAN_PID + else + echo "Pelican PIDFile not found" + fi +} + +function start_up(){ + local port=$1 + echo "Starting up Pelican and HTTP server" + shift + $PELICAN --debug --autoreload -r $INPUTDIR -o $OUTPUTDIR -s $CONFFILE $PELICANOPTS & + pelican_pid=$! + echo $pelican_pid > $PELICAN_PID + cd $OUTPUTDIR + $PY -m pelican.server $port & + srv_pid=$! + echo $srv_pid > $SRV_PID + cd $BASEDIR + sleep 1 + if ! alive $pelican_pid ; then + echo "Pelican didn't start. Is the Pelican package installed?" + return 1 + elif ! alive $srv_pid ; then + echo "The HTTP server didn't start. Is there another service using port" $port "?" + return 1 + fi + echo 'Pelican and HTTP server processes now running in background.' +} + +### +# MAIN +### +[[ ($# -eq 0) || ($# -gt 2) ]] && usage +port='' +[[ $# -eq 2 ]] && port=$2 + +if [[ $1 == "stop" ]]; then + shut_down +elif [[ $1 == "restart" ]]; then + shut_down + start_up $port +elif [[ $1 == "start" ]]; then + if ! start_up $port; then + shut_down + fi +else + usage +fi diff --git a/docs/pelicanconf.py b/docs/pelicanconf.py new file mode 100644 index 0000000..978253d --- /dev/null +++ b/docs/pelicanconf.py @@ -0,0 +1,83 @@ +# -*- coding: utf-8 -*- # + +from datetime import datetime + +AUTHOR = 'Alexandre Vicenzi' +SITEURL = 'http://localhost:8000' +SITENAME = 'Flex' +SITETITLE = 'Flex' +SITESUBTITLE = 'The minimalist Pelican theme' +SITEDESCRIPTION = 'Flex - The minimalist Pelican theme.' +# SITELOGO = '//s.gravatar.com/avatar/5dc5ba59a94eeab2106ad9d397361b2c?s=120' +# FAVICON = '/images/favicon.ico' +BROWSER_COLOR = '#333333' +PYGMENTS_STYLE = 'monokai' + +ROBOTS = 'index, follow' + +THEME = '../' +PATH = 'content' +TIMEZONE = 'America/New_York' + +I18N_TEMPLATES_LANG = 'en' +DEFAULT_LANG = 'en' +OG_LOCALE = 'en_US' +LOCALE = 'en_US' + +DATE_FORMATS = { + 'en': '%B %d, %Y', +} + +FEED_ALL_ATOM = 'feeds/all.atom.xml' +CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml' +TRANSLATION_FEED_ATOM = None +AUTHOR_FEED_ATOM = None +AUTHOR_FEED_RSS = None + +USE_FOLDER_AS_CATEGORY = False +MAIN_MENU = True +HOME_HIDE_TAGS = True + +SOCIAL = ( + ('github', 'https://github.com/alexandrevicenzi/Flex'), + ('rss', '/feeds/all.atom.xml'), +) + +MENUITEMS = (('Archives', '/archives.html'), + ('Categories', '/categories.html'), + ('Tags', '/tags.html'),) + +CC_LICENSE = { + 'name': 'Creative Commons Attribution-ShareAlike', + 'version': '4.0', + 'slug': 'by-sa' +} + +COPYRIGHT_YEAR = datetime.now().year +DEFAULT_PAGINATION = 10 + +DISQUS_SITENAME = "flex-pelican" +ADD_THIS_ID = 'ra-55adbb025d4f7e55' + +STATIC_PATHS = ['images', 'extra'] + +EXTRA_PATH_METADATA = { + 'extra/custom.css': {'path': 'static/custom.css'}, +} + +CUSTOM_CSS = 'static/custom.css' + +USE_LESS = True + +GOOGLE_ADSENSE = { + 'ca_id': 'ca-pub-6625957038449899', + 'page_level_ads': True, + 'ads': { + 'aside': '8752710348', + 'main_menu': '', + 'index_top': '', + 'index_bottom': '1124188687', + 'article_top': '', + 'article_bottom': '4843941849', + } +} diff --git a/docs/publishconf.py b/docs/publishconf.py new file mode 100644 index 0000000..df26fca --- /dev/null +++ b/docs/publishconf.py @@ -0,0 +1,14 @@ +# -*- coding: utf-8 -*- # + +import os +import sys + +sys.path.append(os.curdir) + +from pelicanconf import * + +SITEURL = 'https://blog.alexandrevicenzi.com' +RELATIVE_URLS = False +USE_LESS = False +DELETE_OUTPUT_DIRECTORY = True +GOOGLE_ANALYTICS = "UA-55543164-3" diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..8b0ec32 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +pelican +markdown