diff --git a/config/config.yml b/config/config.yml index 54f1469..8ca4989 100644 --- a/config/config.yml +++ b/config/config.yml @@ -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 diff --git a/plugins/links.py b/plugins/links.py index b696760..8f0d906 100644 --- a/plugins/links.py +++ b/plugins/links.py @@ -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 diff --git a/theme/templates/extras/footer.html b/theme/templates/extras/footer.html index 804b6c8..b6e5b21 100644 --- a/theme/templates/extras/footer.html +++ b/theme/templates/extras/footer.html @@ -3,7 +3,7 @@