Code Monkey home page Code Monkey logo

pelican-octopress-theme's Introduction

Octopress Theme for Pelican

This is a theme for Pelican that looks like Octopress default theme. I wrote this theme for my personal blog.

Why use this theme?

I really like Octopress default theme, I think is enough pretty and very readable. On the other hand I don't like any of the themes currently available for Pelican. As I'm not able to write a nice theme from scratch I've just copied the Octopress' one.

Why didn't you use Octopress?

I've started writing my blog with Octopress but I haven't found a way to easily have a multi-language blog without hacking more than the time I was planning to spend to setup my blog. You can argue that the time spent to copy the Octopress' theme is more than adding a multi-language feature for Octopress.. I'm not sure of that since I've no idea what kind of changes Octopress required to support multiple language per post.

I've found out that I like more the organization of Pelican: Octopress/Jekyll have a unique repository you have to fork, so its code is mixed with your blog's data. Pelican instead separates the two things. Also Pelican is written in Python that I know way better than Ruby.

The theme is missing XXX

I've started writing this theme just for my blog and my blog required few template pages and few features. If you want to add XXX please be free to fork this repository and submit a pull request, I'll be happy to merge it!

Plugins

This theme add a nice section on the sidebar with a list of GitHub repositories of the user. You can enable it by using these settings:

  • GITHUB_USER: (required to enable) your username
  • GITHUB_REPO_COUNT: 5
  • GITHUB_SKIP_FORK: False
  • GITHUB_SHOW_USER_LINK: False

This theme also allows sharing via Twitter, Google Plus, and Facebook. To enable any of these, use the following settings:

  • TWITTER_USER: (required to enable) your username
  • GOOGLE_PLUS_ID: (required to enable) your ID
  • FACEBOOK_LIKE: (required to enable) True

Extra Twitter options (default values are shown):

  • TWITTER_WIDGET_ID: (required to enable feed) ID obtained from twitter settings
  • TWITTER_TWEET_BUTTON: False show twitter tweet button
  • TWITTER_FOLLOW_BUTTON: False show twitter follow button
  • TWITTER_TWEET_COUNT: 3 number of latest tweets to show
  • TWITTER_SHOW_REPLIES: 'false' whether to list replies among latest tweets
  • TWITTER_SHOW_FOLLOWER_COUNT: 'true' show number of followers

Extra google plus options (default values are shown):

  • GOOGLE_PLUS_ONE: False show +1 button
  • GOOGLE_PLUS_HIDDEN: False hide the google plus sidebar link.

Google Analytics -------------

  • GOOGLE_ANALYTICS: "UA-XXXX-YYYY" to activate Google Analytics(classic)
  • GOOGLE_UNIVERSAL_ANALYTICS: "UA-XXXX-Y" to activate Google Universal Analytics
  • GOOGLE_UNIVERSAL_ANALYTICS_COOKIEDOMAIN: 'auto' optional cookie domain setting for Google Universal Analytics
  • GOOGLE_ANALYTICS_DISPLAY_FEATURES: True to enable Display Advertiser Features. This setting works for both Classic Analytics and Universal Analytics.

Sidebar image

  • SIDEBAR_IMAGE: Adds specified image to sidebar. Example value: "images/author_photo.jpg"
  • SIDEBAR_IMAGE_ALT: Alternative text for sidebar image
  • SIDEBAR_IMAGE_WIDTH: Width of sidebar image
  • SEARCH_BOX: set to true to enable site search box
  • SITESEARCH: [default: 'http://google.com/search'] search engine to which search form should be pointed (optional)

QR Code generation -------------

  • QR_CODE: set to true to enable the qr code generation for articles and pages by browser

FeedBurner integration

  • FEED_FEEDBURNER: set this to the part of your FeedBurner URL after the http://feeds.feedburner.com/ to set the displayed feed URL to your FeedBurner URL. This also disables generation of the RSS and ATOM tags, regardless of whether you've set the FEED_RSS or FEED_ATOM variables. This way, you can arbitrarily set your generated feed URL while presenting your FeedBurner URL to your users.

Disqus comments

  • DISQUS_SITENAME: (required to enable) set this to the short site identifier of your Disqus site. Example: mrsenko

Isso self-hosted comments

Isso is intended to be a Free replacement for systems like Disqus. Because it is self-hosted, it gives you full control over the comments posted to your website.

  • ISSO_SITEURL: (required to enable) set this to the URL of the server Isso is being served from without a trailing slash. Example: http://example.com

NOTE: comments are displayed only if the article is not a draft and SITEURL is defined (usually is) and either one of DISQUS_SITENAME or ISSO_SITEURL are defined!

X min read

medium.com like "X min read" feature. You need to activate the plugin post_stats for this to work (default values are shown):

  • X_MIN_READ: False

Favicon

  • FAVICON_FILENAME: set to path of your favicon. The default is empty in which case the template will use the hardcoded address favicon.png.

Main Navigation (menu bar)

  • DISPLAY_PAGES_ON_MENU: True show pages
  • DISPLAY_CATEGORIES_ON_MENU: True show categories
  • DISPLAY_FEEDS_ON_MENU: True show feed icons (on the very right side)
  • MENUITEMS: () show static links (before categories)
  • MENUITEMS_MIDDLE: () show static links (between pages and categories) e.g.: MENUITEMS_MIDDLE = ( ('link1', '/static/file1.zip'), )
  • MENUITEMS_AFTER: () show static links (after categories) e.g.: MENUITEMS_AFTER = ( ('link2', '/static/file2.pdf'), )

Markup for Social Sharing

In order to specify page title, description, image and other metadata for customized social sharing (e.g. Twitter cards), you can add the following metadata to each post:

  • title: The title of the post. This is expected for any post.
  • description: A long form description of the post.
  • social_image: A path to an image, relative to SITEURL. This image

    will show up next to the other information in social shares.

- twitter_site: A Twitter handle, e.g. @getpelican for the owner

of the site.

twitter_creator: A Twitter handle, e.g. @getpelican` for the author

of the post.

In addition, you can provide a default post image (instead of setting social_image in the post metadata), by setting SOCIAL_IMAGE in your pelicanconf.

These can be used for social sharing on Google+, Twitter, and Facebook as well as provide more detailed page data for Google Search. In order to enable in each respective channel, your post metadata needs to specify:

  • title: The title of the post. This is expected for any post.
  • use_schema_org: true: For Google and Google+ specific meta tags.
  • use_open_graph: true: For Facebook specific meta tags.
  • use_twitter_card: true: For Twitter specific meta tags.

Archive Title

  • ARCHIVE_TITLE: Custom page title for archives.html. Default is "Blog Archive".

Contribute

  1. Fork the repository on Github
  2. Send a pull request

Authors

pelican-octopress-theme's People

Contributors

43061b4a avatar atodorov avatar calfzhou avatar cyrozap avatar dhermes avatar duilio avatar ekinertac avatar jakevdp avatar keflavich avatar keisisqrl avatar mortada avatar mrjohannchang avatar mstreuhofer avatar nt3rp avatar sagarbehere avatar sharjeel avatar stephenpcg avatar synapticarbors avatar yangliping avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pelican-octopress-theme's Issues

Responsive Design

Adding a website responsiveness turn on/off switch in config file would be nice.

Pelican 3.7.0 - Variable PAGES renamed to pages

Hi,

With version 3.7.0, the PAGES variables was renamed to a lowercased version: pages.

In templates/_includes/navigation.html, there is one occurrence of this variable.

Can you make this change please? Thanks

Footnote symbol style is not working for me

Hello, I've added a footnote using [*]_ and although it works fine, I don't like how the symbol is styled: It is full size and not a superscript :(

Can we fix the css ? I found out that the footnote symbol has a class of footnote-reference something like this:

<a class="footnote-reference" href="#id2" id="id1">[*]</a>

I believe that if we added the following style it would be much better:

.footnote-reference {
   font-size: 0.5em;
   vertical-align: top;
}

Thanks !

Empty ATOM feed

I use RSS instead of ATOM feeds, and kept getting a duplicate empty ATOM feed in the navigation bar. In templates/_includes/navigation.html there is an "{% if FEED_RSS %}" block, but not a corresponding "{% if FEED_ATOM %}". Adding it removed the duplicate feed icon.


@@ -1,5 +1,7 @@
 <ul class="subscription" data-subscription="rss">
+  {% if FEED_ATOM %}
   <li><a href="{{ FEED_DOMAIN }}/{{ FEED_ATOM }}" rel="subscribe-rss">RSS</a></li>
+  {% endif %}
   {% if FEED_RSS %}
   <li><a href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" rel="subscribe-rss">RSS</a></li>
   {% endif %}

DISQUS integration.

Hi Guys,

How to integrate DISQUS comment plugin with pelican-octopress-theme. I added DISQUS_SITENAME = "XXX" It's showing comment section. please guide me How to fix this.

Note:
I tested other themes it's DISQUS working. only issue with pelican-octopress-theme

Regression: github projects sidebar

Commit ceb4837 moved external scripts from <head> to the <body> tag, which has broken the github projects sidebar. The sidebar uses javascript that depends on ender.js, but the sidebar script is inserted before the ender <script> tag after this change, so the projects are never loaded.

The fix is either to a) move the script tags above the sidebar include, or b) put them back in <head>. I didn't make a pull request, since I'm not sure which way you want to go, but I can if you'd like.

Edit: bah, markup problems.

jinja2.exceptions.UndefinedError: 'period' is undefined in period_archives.html

Not able to generate html while running pelican command

pelican --debug --autoreload -r content -o output -s pelicanconf.py -t pelican-octopress-theme

Environmental

Ubuntu 14.04.2 LTS
Python 2.7.6
Pelican 3.3.0
Jinja2 2.7.3

The error log is

CRITICAL: ("'period' is undefined",)
CRITICAL: 'period' is undefined
Traceback (most recent call last):
  File "/usr/bin/pelican", line 9, in <module>
    load_entry_point('pelican==3.3', 'console_scripts', 'pelican')()
  File "/usr/lib/python2.7/dist-packages/pelican/__init__.py", line 350, in main
    pelican.run()
  File "/usr/lib/python2.7/dist-packages/pelican/__init__.py", line 181, in run
    p.generate_output(writer)
  File "/usr/lib/python2.7/dist-packages/pelican/generators.py", line 475, in generate_output
    self.generate_pages(writer)
  File "/usr/lib/python2.7/dist-packages/pelican/generators.py", line 370, in generate_pages
    self.generate_period_archives(write)
  File "/usr/lib/python2.7/dist-packages/pelican/generators.py", line 303, in generate_period_archives
    _generate_period_archives(self.dates, key, save_as)
  File "/usr/lib/python2.7/dist-packages/pelican/generators.py", line 285, in _generate_period_archives
    dates=archive, blog=True)
  File "/usr/lib/python2.7/dist-packages/pelican/writers.py", line 211, in write_file
    override_output)
  File "/usr/lib/python2.7/dist-packages/pelican/writers.py", line 148, in _write_file
    output = template.render(localcontext)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/workspace/others/arulrajnet/blog/arulraj.net/pelican-octopress-theme/templates/period_archives.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "/opt/workspace/others/arulrajnet/blog/arulraj.net/pelican-octopress-theme/templates/base.html", line 11, in top-level template code
    <title>{% block title %}{{ SITENAME }}{% endblock %}</title>
  File "/opt/workspace/others/arulrajnet/blog/arulraj.net/pelican-octopress-theme/templates/period_archives.html", line 2, in block "title"
    {% block title %}Archive &ndash; {{ period[2] }} {{ period[1] }} {{ period[0]  }} &mdash; {{ SITENAME }}{% endblock %}
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 378, in getitem
    return obj[argument]
jinja2.exceptions.UndefinedError: 'period' is undefined

Support for line numbers of code block

Hi,

When linenums enabled, the style of code block will be mess up. Because the DOM structure of the code block of pelican is different with octopress, sass/partials/_syntax.scss should match up peilican.

'markdown.extensions.codehilite': {
    'css_class': 'highlight',
    'linenums': True
}

Can you support this? Thanks!

header images?

Hi.

Thanks very much for the excellent port.

I'd like to use this theme and include an image header.

There's a handy overview of how to do this for octopress blogs here
http://blog.bigdinosaur.org/changing-octopresss-header/

Most of which seems to work because the sass component is, as I understand it, unchanged in the pelican port.

However I'm still finding it tricky to get the various options working here.

I was wondering if anyone has implemented or seen header images in a pelican+octopress-theme blog, which I could use for reference?

Ta.

Make it work better with pelican-ipynb

I recently tried to integrate pelican-ipynb (https://github.com/danielfrg/pelican-ipynb) with this theme. Unfortunately, the styling that ipynb applies when using an ipynb file directly as a content type is not very good (everything is pushed to the right, there's a prompt displayed on markup cells etc).

I did some changes so the styling to make it tolerable (check https://github.com/spapas/pelican-octopress-theme/blob/master/static/css/extra_style.css) however that leaves much to be desired.

It would be great if somebody fixed the styling of this theme so that ipynb files would be displayed nice.

Q: how to change date defaults

Hi.

(Apologies if this is a pelican-generic Q rather than specific to this theme...)

I'm using pelican with a modified version of this theme for some rolling (i.e. regularly updated) documentation. Consequently I'd like to either remove or modify the text that lists the date at the top of each entry: in my case it would be better to say something like 'Last modified XX/XX/XX'.

Two other changes I'd like to make if poss:

  1. I would also like to list archives by something other than date, e.g. by tag;
  2. I'd like to change the archive page text to something other than 'Blog archive' (because it isn't really a blog as such); e.g. just 'archive'

Could you please advise on how I can make these changes?

Thanks very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.