From 4701bc1628e5131dab5b64d19d6ae37b078bd03d Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 21 May 2016 20:35:59 +0100 Subject: [PATCH] Add footer and social links --- .gitignore | 2 +- pelicanconf.py | 15 +++++++--- plugins/social.py | 14 +++++++++ theme/static/src/scss/footer.scss | 45 ++++++++++++++++++++++++++++ theme/static/src/scss/index.scss | 1 + theme/static/src/scss/variables.scss | 4 +++ theme/templates/base.html | 34 +++++++++++++++++++++ 7 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 plugins/social.py create mode 100644 theme/static/src/scss/footer.scss diff --git a/.gitignore b/.gitignore index ea49359..3a53396 100644 --- a/.gitignore +++ b/.gitignore @@ -60,4 +60,4 @@ target/ # Pelican stuff output/ theme/static/build/ -plugins/ +pelican_plugins/ diff --git a/pelicanconf.py b/pelicanconf.py index f069897..15603dc 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -2,6 +2,9 @@ # -*- coding: utf-8 -*- # from __future__ import unicode_literals +import sys, os +sys.path.insert(0, os.path.realpath('./plugins')) + AUTHOR = 'Jake Howard' SITENAME = 'TheOrangeOne' SITEURL = 'http://theorangeone.net' @@ -26,10 +29,11 @@ LINKS = (('Pelican', 'http://getpelican.com/'), ('You can modify those links in your config file', '#'),) # Social widget -SOCIAL = (('You can add links in your config file', '#'), - ('Another social link', '#'),) +import social +SOCIAL = social.generate() -DEFAULT_PAGINATION = 15 + +DEFAULT_PAGINATION = False DELETE_OUTPUT_DIRECTORY = True @@ -67,9 +71,12 @@ ARCHIVES_SAVE_AS = "blog/archive/index.html" CATEGORY_SAVE_AS = False CATEGORIES_SAVE_AS = False -PLUGIN_PATHS = ["plugins"] +PLUGIN_PATHS = ["pelican_plugins"] PLUGINS = ['sitemap'] SITEMAP = { 'format': 'xml' } + + +# Extra context diff --git a/plugins/social.py b/plugins/social.py new file mode 100644 index 0000000..67b9374 --- /dev/null +++ b/plugins/social.py @@ -0,0 +1,14 @@ +from collections import namedtuple + + +SocialLink = namedtuple('SocialLink', ['name', 'url', 'icon']) + + +def generate(): + return { + "github": SocialLink("GitHub", "https://github.com/RealOrangeOne", "fa-github"), + "twitter": SocialLink("Twitter", "https://twitter.com/RealOrangeOne", "fa-twitter"), + "reddit": SocialLink("Reddit", "https://reddit.com/user/RealOrangeOne", "fa-reddit"), + "instagram": SocialLink("Instagram", "https://instagram.com/RealOrangeOne", "fa-instagram"), + "youtube": SocialLink("YouTube", "https://youtube.com/user/TheOrangeOneOfficial", "fa-youtube") + } diff --git a/theme/static/src/scss/footer.scss b/theme/static/src/scss/footer.scss new file mode 100644 index 0000000..fc378dc --- /dev/null +++ b/theme/static/src/scss/footer.scss @@ -0,0 +1,45 @@ +footer { + background-color: $brand-grey-dark; + padding-top: 30px; + width: 100%; + height: $footer-height; + text-align: center; + color: $white; + + a { + color: $brand-orange; + + &:hover { + text-decoration: none; + color: inherit; + } + } + + .bar-links { + margin: 0 7px; + } + + .powered-by { + font-size: $font-size-h6; + } + + .social { + margin: 0; + padding: 7px; + font-size: 23px; + + a { + margin: 0 4px; + color: $white; + + &:hover { + color: $brand-orange; + } + } + } + + .ci-badge { + margin-top: 10px; + height: $font-size-h4; + } +} diff --git a/theme/static/src/scss/index.scss b/theme/static/src/scss/index.scss index 38a7492..15089f4 100644 --- a/theme/static/src/scss/index.scss +++ b/theme/static/src/scss/index.scss @@ -26,3 +26,4 @@ $fa-font-path: "../fonts"; @import "homepage"; +@import "footer"; diff --git a/theme/static/src/scss/variables.scss b/theme/static/src/scss/variables.scss index 47cfd21..0fe8a9b 100644 --- a/theme/static/src/scss/variables.scss +++ b/theme/static/src/scss/variables.scss @@ -2,9 +2,13 @@ $brand-orange: #F05F40; $brand-orange-dark: darken($brand-orange, 10%); $brand-grey-dark: #333; +/* @group General Colours */ + $white: #FFF; +/* @end General Colours */ +$footer-height: 250px; $font-family-heading: "Open Sans", "Helvetica Neue", Arial, sans-serif; /* @group Bootstrap Overrides */ diff --git a/theme/templates/base.html b/theme/templates/base.html index 9a0e88b..e3f13c5 100644 --- a/theme/templates/base.html +++ b/theme/templates/base.html @@ -39,6 +39,40 @@ {% block content %}{% endblock %} + +