1
Fork 0

move accounts to config

This commit is contained in:
Jake Howard 2016-09-10 16:40:02 +01:00
parent f2391911bf
commit 75c931ed19
Signed by: jake
GPG key ID: 57AFB45680EDD477
3 changed files with 99 additions and 17 deletions

View file

@ -13,3 +13,91 @@ pelican_plugins:
- screenfetch
sitemap_format: xml
accounts:
github:
- GitHub
- RealOrangeOne
- https://github.com/{0}/
- fa-github
twitter:
- Twitter
- RealOrangeOne
- https://twitter.com/{0}/
- fa-twitter
reddit:
- Reddit
- RealOrangeOne
- https://reddit.com/u/{0}/
- fa-reddit
instagram:
- Instagram
- RealOrangeOne
- https://instagram.com/{0}/
- fa-instagram
youtube:
- YouTube
- TheOrangeOneOfficial
- https://youtube.com/users/{0}/
- fa-youtube
flickr:
- Flickr
- TheOrangeOne
- https://flickr.com/photos/{0}/
- fa-flickr
bitbucket:
- BitBucket
- TheOrangeOne
- https://bitbucket.com/{0}/
- fa-bitbucket
trello:
- Trello
- TheOrangeOne
- https://trello.com/{0}/
- fa-trello
freenode:
- Freenode IRC
- TheOrangeOne
- https://webchat.freenode.net/
- fa-rss
atomio:
- AtomIO Slack
- TheOrangeOne
- https://atomio.slack.com/
- fa-slack
pcpartpicker:
- PCPartPicker
- TheOrangeOne97
- https://uk.pcpartpicker.com/user/{0}/
- fa-desktop
codepen:
- CodePen
- TheOrangeOne
- https://codepen.io/~{0}/
- fa-codepen
npm:
- npm
- TheOrangeOne
- https://www.npmjs.com/~{0}/
- fa-file-code-io
footer_accounts:
- github
- twitter
- reddit
- instagram
- youtube
- flickr

View file

@ -1,26 +1,20 @@
from collections import namedtuple
from random import shuffle
from config import settings, DotDictionary
ProjectLink = namedtuple("ProjectLink", ["name", "url", "image"])
Account = namedtuple("Account", ["name", "url", "icon", "username"])
def accounts():
links = {
"github": Account("GitHub", "https://github.com/RealOrangeOne/", "fa-github", "RealOrangeOne"),
"twitter": Account("Twitter", "https://twitter.com/RealOrangeOne", "fa-twitter", "@RealOrangeOne"),
"reddit": Account("Reddit", "https://reddit.com/user/RealOrangeOne", "fa-reddit", "/u/RealOrangeOne"),
"instagram": Account("Instagram", "https://instagram.com/RealOrangeOne", "fa-instagram", "RealOrangeOne"),
"youtube": Account("YouTube", "https://youtube.com/user/TheOrangeOneOfficial", "fa-youtube", "TheOrangeOneOfficial"),
"flickr": Account("Flickr", "https://flickr.com/photos/TheOrangeOne/", "fa-flickr", "TheOrangeOne"),
"bitbucket": Account("BitBucket", "https://bitbucket.org/TheOrangeOne", "fa-bitbucket", "TheOrangeOne"),
"trello": Account("Trello", "https://trello.com/TheOrangeOne", "fa-trello", "TheOrangeOne"),
"freenode": Account("Freenode", "https://webchat.freenode.net", "fa-rss", "TheOrangeOne"),
"atomio": Account("Atomio Slack", "https://atomio.slack.com", "fa-slack", "TheOrangeOne"),
"pcpartpicker": Account("PCPartPicker", "https://uk.pcpartpicker.com/user/theorangeone97", "fa-desktop", "TheOrangeOne97"),
"codepen": Account("CodePen", "https://codepen.io/TheOrangeOne", "fa-codepen", "TheOrangeOne"),
"npm": Account("npm", "https://www.npmjs.com/~TheOrangeOne", "fa-file-code-io", "TheOrangeOne")
}
links = {}
for key, (site, user, url, icon) in settings.accounts.items():
links[key] = DotDictionary({
'site': site,
'username': user,
'url': url.format(user),
'icon': icon
})
return links

View file

@ -3,7 +3,7 @@
<div class="row">
<div class="col-xs-12">
<p class="social">
{% for link in FOOTER_LINKS|sort %}
{% for link in FOOTER_LINKS %}
<a href="{{ link.url }}"><i class="fa {{ link.icon }}"></i></a>
{% endfor %}
</p>