diff --git a/content/pages/about.html b/content/pages/about.html index 7722aae..f873c29 100644 --- a/content/pages/about.html +++ b/content/pages/about.html @@ -4,16 +4,6 @@ -
-
-
-
-

About Me

-
-
-
-
-
@@ -23,7 +13,7 @@ I work as a full stack developer, but I prefer working on servers and mobile apps.

-
+
diff --git a/content/pages/homepage.html b/content/pages/homepage.html index 40d833e..b71e271 100644 --- a/content/pages/homepage.html +++ b/content/pages/homepage.html @@ -98,14 +98,15 @@

Blog

+
{% for article in categories|category_find("blog")|limit(4) %} -

{{ article.title }}

{{ article.summary|striptags|e }}

+
{% endfor %} View all posts
@@ -116,15 +117,13 @@

More Content


There's more than just my project and blog!

- - College - - - Setup - - - Work - + {% for category, articles in categories %} + {% if category.name not in ['blog', 'projects'] %} + + {{ category.name }} + + {% endif %} + {% endfor %}
diff --git a/pelicanconf.py b/pelicanconf.py index 3679276..e3e5a2f 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -68,10 +68,10 @@ FEED_DOMAIN = SITEURL PLUGIN_PATHS = ["plugins", "pelican_plugins"] PLUGINS = [ 'sitemap', - 'pelican-jinja2content', + 'screenfetch', 'metatags', 'autopages', - 'screenfetch', + 'pelican-jinja2content', 'post_build', 'static_build' ] @@ -108,7 +108,10 @@ from plugins import filters JINJA_FILTERS = { "datetime": filters.format_datetime, "category_find": filters.category_find, - "limit": filters.limit + "limit": filters.limit, + "get_title": filters.get_title, + "get_html_title": filters.get_html_title, + "get_image": filters.get_image } JINJA_ENVIRONMENT = { diff --git a/plugins/filters.py b/plugins/filters.py index 2950233..402954d 100644 --- a/plugins/filters.py +++ b/plugins/filters.py @@ -1,6 +1,10 @@ import iso8601 +def get_attribute(cls, attr, default=None): + return getattr(cls, attr, default) + + def format_datetime(value): return iso8601.parse_date(str(value)).strftime("%x") @@ -19,3 +23,19 @@ def limit(line, length): return " ".join(line.split(" ")[:length]) + '...' elif isinstance(line, list): return line[:length] + + +def get_title(instance): + return ( + get_attribute(instance, 'title') or (hasattr(instance, 'page') and get_attribute(instance.page, 'name')) or get_attribute(instance, 'name') or '' + ) + + +def get_html_title(instance): + return ( + get_attribute(instance, 'html_title') or get_title(instance) + ) + + +def get_image(instance): + return get_attribute(instance, 'image') or (hasattr(instance, 'page') and get_attribute(instance.page, 'name')) or '' diff --git a/plugins/links.py b/plugins/links.py index f1de30f..123df2a 100644 --- a/plugins/links.py +++ b/plugins/links.py @@ -1,5 +1,4 @@ from collections import namedtuple -from random import shuffle from config import social @@ -32,5 +31,4 @@ def index_projects(): ProjectLink("Yoga-Pal", "/projects/yoga-pal/", "http://brain-images.cdn.dixons.com/8/1/10135218/l_10135218_002.jpg"), ProjectLink("Wall of Sheep", "/wall-of-sheep/", "http://www.hackerstickers.com/uploaded/thumbnails/db_file_img_3582_475xauto.jpg") ] - shuffle(projects) return projects diff --git a/tests/__init__.py b/tests/__init__.py index 83d67b0..1b8d62f 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -35,7 +35,7 @@ class TestCase(unittest.TestCase): self.assertIn(title, content.title.string) def assertHeaderTitle(self, content, title): - header_title = content.find('h1', class_="section-heading") + header_title = content.find('div', class_="header-content").find('h1') self.assertIn(title, self.get_children(header_title)) def assertSamePath(self, p1, p2): diff --git a/tests/tests_common.py b/tests/tests_common.py index 3d6c70d..b935074 100644 --- a/tests/tests_common.py +++ b/tests/tests_common.py @@ -51,7 +51,7 @@ class CommonPagesTestCase(TestCase): def test_footer_links(self): content = self.client.get('index.html') footer = content.footer - for link in footer.find('p', class_="social").find_all('a'): + for link in footer.find('h2', class_="social").find_all('a'): self.assertIn(link.attrs['alt'], social_settings['footer_accounts']) self.assertIn("fa fa-", str(list(link.children)[0])) diff --git a/theme/static/src/scss/footer.scss b/theme/static/src/scss/footer.scss index 7f97e9c..abe2c35 100644 --- a/theme/static/src/scss/footer.scss +++ b/theme/static/src/scss/footer.scss @@ -1,6 +1,6 @@ footer { background-color: $brand-grey-dark; - padding-top: 20px; + padding-top: 50px; width: 100%; height: $footer-height; text-align: center; @@ -28,12 +28,11 @@ footer { } .social { - margin: 0; - padding: 7px; - font-size: 23px; + margin-top: 0; + margin-bottom: 25px; a { - margin: 0 4px; + margin: 0 5px; color: $white; &:hover { diff --git a/theme/static/src/scss/functional.scss b/theme/static/src/scss/functional.scss index d2e3b5a..58c9665 100644 --- a/theme/static/src/scss/functional.scss +++ b/theme/static/src/scss/functional.scss @@ -10,3 +10,9 @@ .text-shadow { text-shadow: 0 5px 3px $brand-grey-dark; } + +.outer-gutter { + @extend .no-gutter; + + padding: 0 $grid-gutter-width / 2; +} diff --git a/theme/static/src/scss/index.scss b/theme/static/src/scss/index.scss index cdf148f..22dd28b 100644 --- a/theme/static/src/scss/index.scss +++ b/theme/static/src/scss/index.scss @@ -71,16 +71,18 @@ p a { padding: 1px 0; } -#header { +header#header { display: flex; align-items: center; + min-height: 50vh; + &.image .section-heading { @extend .text-shadow; } - @media screen and (min-height: $screen-xs-max) { - height: 40vh; + @media screen and (max-height: $screen-xs-max) { + height: 100vh; } } @@ -99,3 +101,7 @@ p a { } } } + +.github-card-container > iframe { + max-width: 100%; +} diff --git a/theme/static/src/scss/library-overrides.scss b/theme/static/src/scss/library-overrides.scss index 1409c47..24f960c 100644 --- a/theme/static/src/scss/library-overrides.scss +++ b/theme/static/src/scss/library-overrides.scss @@ -15,14 +15,6 @@ @include button-variant(#333, #F5F5F5, #D8D8D8); } -$btn-srobo-bg: #253571; -$btn-srobo-border: darken($btn-srobo-bg, 5%); - -.btn-srobo { - @include button-variant(#DADADA, $btn-srobo-bg, $btn-srobo-border); -} - - .highlight > pre { font-size: $font-size-base; } diff --git a/theme/static/src/scss/variables.scss b/theme/static/src/scss/variables.scss index 0ebb74a..8f7e1ff 100644 --- a/theme/static/src/scss/variables.scss +++ b/theme/static/src/scss/variables.scss @@ -9,9 +9,11 @@ $white: #FFF; /* @end General Colours */ -$footer-height: 175px; +$footer-height: 300px; $font-family-heading: "Open Sans", "Helvetica Neue", Arial, sans-serif; +$srobo-blue: #243373; + /* @group Bootstrap Overrides */ $font-family-base: "Roboto", "Helvetica Neue", Arial, sans-serif; diff --git a/theme/templates/article.html b/theme/templates/article.html index 82d27a4..8fcd85c 100644 --- a/theme/templates/article.html +++ b/theme/templates/article.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block htmltitle %} - {{ article.html_title or article.title }} + {{ article|get_html_title }} {% endblock %} {% block metadata %} diff --git a/theme/templates/blog.html b/theme/templates/blog.html index a6ed1d1..088a813 100644 --- a/theme/templates/blog.html +++ b/theme/templates/blog.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block htmltitle %} - {{ article.title }} + {{ article|get_html_title }} {% endblock %} {% block metadata %} diff --git a/theme/templates/categories/robotics.md b/theme/templates/categories/robotics.md index 90ad83d..872404b 100644 --- a/theme/templates/categories/robotics.md +++ b/theme/templates/categories/robotics.md @@ -1,5 +1,6 @@ --- hide_list: true +name: Student Robotics --- Student Robotics is the the place where my development knowledge really started to grow. Thanks to the other people in my team teaching me. I had never done anything robotics related, and so when my computing teacher initially told us about it, I wasn't really interested. After I found out that my friend was also doing it, I signed up, and went along to the kickstart. From then on I was hooked, getting involved with all aspects of the development and design, as well as helping out other teams on the IRC room. @@ -10,31 +11,37 @@ Student Robotics is the the place where my development knowledge really started More information can be found on [their website](https://studentrobotics.org). ## My Entries -Being at college for 2 years, meant I was able to enter 2 years of competitions, SR14, and SR15. We were encouraged to gain an online presence for our team, so I created a website for both years. Unfortunately due to account inactivity, and me changing my website 3 times since, The original pages have been lost, however a large amount of the content the content still remains. +Being at college for 2 years, meant I was able to enter 2 years of competitions, [SR14](2014), and [SR15](2015). We were encouraged to gain an online presence for our team, so I created a website for both years. Unfortunately due to account inactivity, and me changing my website 3 times since, The original pages have been lost, however a large amount of the content the content still remains. -
+ +
-
- Lucy -
-

Student Robotics 2014

-

Robot Name: Lucy -
(No, it doesn't stand for anything) -

More Info

+ +
+
+
+

2014

+
+
+ Lucy +
+
-
+
-
-
- A.L.I.C.E -
-

Student Robotics 2015

-

Robot Name : A.L.I.C.E -
(Autonomous Logistics and Inevitable Collision Engine)

-

More Info

+ +
+
+
+

2015

+
+
+ A.L.I.C.E +
+
-
+
diff --git a/theme/templates/category.html b/theme/templates/category.html index a2f1216..530a212 100644 --- a/theme/templates/category.html +++ b/theme/templates/category.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block htmltitle %} - {{ category|title }} + {{ category|get_html_title|title }} {% endblock %} {% block metadata %} @@ -9,16 +9,7 @@ {% endblock %} {% block content %} -
-
-
-
-

{{ category.name|title }}

-
-
-
-
-
+ {% include 'extras/header.html' with instance=category %} {% if category.page.content %}
@@ -39,7 +30,7 @@
-

{{ article.title }}

+

{{ article|get_title }}

{{ article.summary|striptags|e }}

diff --git a/theme/templates/extras/footer.html b/theme/templates/extras/footer.html index 7bbdfa1..55bd473 100644 --- a/theme/templates/extras/footer.html +++ b/theme/templates/extras/footer.html @@ -2,18 +2,18 @@
-

Powered by Pelican, - Inception Hosting, + SoYouStart, and a whole heap of Magic!

diff --git a/theme/templates/extras/header.html b/theme/templates/extras/header.html index f1538a7..93dc8de 100644 --- a/theme/templates/extras/header.html +++ b/theme/templates/extras/header.html @@ -1,6 +1,8 @@ - + diff --git a/theme/templates/page-home.html b/theme/templates/page-home.html index de18cf8..db8aed8 100644 --- a/theme/templates/page-home.html +++ b/theme/templates/page-home.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block htmltitle %} - {{ page.title }} + {{ page|get_html_title }} {% endblock %} {% block metadata %} diff --git a/theme/templates/page.html b/theme/templates/page.html index 2e16bbd..ded7247 100644 --- a/theme/templates/page.html +++ b/theme/templates/page.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block htmltitle %} - {{ page.html_title or page.title }} + {{ page|get_html_title }} {% endblock %} {% block metadata %} @@ -9,8 +9,8 @@ {% endblock %} {% block content %} + {% include 'extras/header.html' with instance=page %} {% if not page.no_container %} - {% include 'extras/header.html' with instance=page %}
{{ page.content }} diff --git a/theme/templates/projects.html b/theme/templates/projects.html index 3d35ed5..e92595d 100644 --- a/theme/templates/projects.html +++ b/theme/templates/projects.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block htmltitle %} - {{ article.title }} + {{ article|get_html_title }} {% endblock %} {% block metadata %} @@ -23,7 +23,7 @@
{% if article.download_link %} - Download {{ article.title }} + Download {{ article|get_title }} {% endif %} {% if article.repo %}