1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
theorangeone.net-legacy/plugins/links.py

35 lines
1.2 KiB
Python
Raw Normal View History

2016-05-21 20:35:59 +01:00
from collections import namedtuple
2017-01-13 21:41:40 +00:00
from config import social
2016-09-10 16:40:02 +01:00
2016-05-21 20:35:59 +01:00
2016-05-29 23:23:55 +01:00
ProjectLink = namedtuple("ProjectLink", ["name", "url", "image"])
2016-05-21 20:35:59 +01:00
2016-06-17 17:17:05 +01:00
def accounts():
2016-09-10 16:40:02 +01:00
links = {}
2017-01-13 21:41:40 +00:00
for key, (site, user, url, icon) in social['accounts'].items():
links[key] = {
2016-09-11 21:26:30 +01:00
'key': key,
2016-09-10 16:40:02 +01:00
'site': site,
'username': user,
'url': url.format(user),
'icon': icon
2017-01-13 21:41:40 +00:00
}
2016-06-17 17:17:05 +01:00
return links
def footer():
all_accounts = accounts()
2017-01-13 21:41:40 +00:00
return [all_accounts[account] for account in social['footer_accounts']]
2016-05-29 23:23:55 +01:00
def index_projects():
projects = [
ProjectLink("Student Robotics", "/robotics/", "https://c2.staticflickr.com/8/7711/17122633430_e1b599fe47.jpg"),
2016-05-30 17:39:43 +01:00
ProjectLink("Dotfiles", "/projects/dotfiles/", "http://jleajones.com/assets/images/dotfiles.png"),
2016-06-18 12:29:43 +01:00
ProjectLink("Custom PC", "/setup/custom-pc/", "https://c2.staticflickr.com/8/7083/27071954860_f6096ccce6.jpg"),
ProjectLink("Yoga-Pal", "/projects/yoga-pal/", "http://brain-images.cdn.dixons.com/8/1/10135218/l_10135218_002.jpg"),
2016-07-05 22:19:52 +01:00
ProjectLink("Wall of Sheep", "/wall-of-sheep/", "http://www.hackerstickers.com/uploaded/thumbnails/db_file_img_3582_475xauto.jpg")
2016-05-29 23:23:55 +01:00
]
return projects