From 0bf9bbfcfb7b7cbcf6c4fd4a75a9f622926498b5 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 17 Jan 2017 22:03:25 +0000 Subject: [PATCH 01/17] restyle header --- content/pages/about.html | 12 +----------- theme/static/src/scss/index.scss | 12 +++++++++--- theme/templates/category.html | 13 ++----------- theme/templates/extras/header.html | 12 +++++++----- theme/templates/page.html | 2 +- 5 files changed, 20 insertions(+), 31 deletions(-) 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/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/templates/category.html b/theme/templates/category.html index a2f1216..e7cab7e 100644 --- a/theme/templates/category.html +++ b/theme/templates/category.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block htmltitle %} - {{ category|title }} + {{ category.name|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 %}
diff --git a/theme/templates/extras/header.html b/theme/templates/extras/header.html index f1538a7..033c1cf 100644 --- a/theme/templates/extras/header.html +++ b/theme/templates/extras/header.html @@ -1,6 +1,8 @@ - + diff --git a/theme/templates/page.html b/theme/templates/page.html index 2e16bbd..bc9f14f 100644 --- a/theme/templates/page.html +++ b/theme/templates/page.html @@ -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 }} From d085781ada7b4b9a37df7358fa03150706134f2f Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 17 Jan 2017 22:14:01 +0000 Subject: [PATCH 02/17] update header assert in tests --- tests/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): From 1f8cf9871e9fdaf5eeb4ce2573c721e7d1fe8e5e Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 18 Jan 2017 07:24:29 +0000 Subject: [PATCH 03/17] resize footer --- theme/static/src/scss/footer.scss | 2 +- theme/static/src/scss/variables.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/theme/static/src/scss/footer.scss b/theme/static/src/scss/footer.scss index 7f97e9c..ea7a041 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; diff --git a/theme/static/src/scss/variables.scss b/theme/static/src/scss/variables.scss index 0ebb74a..174e402 100644 --- a/theme/static/src/scss/variables.scss +++ b/theme/static/src/scss/variables.scss @@ -9,7 +9,7 @@ $white: #FFF; /* @end General Colours */ -$footer-height: 175px; +$footer-height: 300px; $font-family-heading: "Open Sans", "Helvetica Neue", Arial, sans-serif; From c249dbb35dd7ed8f3068ccd802394e6a85ff5bea Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 18 Jan 2017 21:28:40 +0000 Subject: [PATCH 04/17] fix screenfetch stuff --- pelicanconf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelicanconf.py b/pelicanconf.py index 3679276..648c65b 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' ] From 5ae3fee3fd43966d8a80ce8512b40e5fcf462968 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 18 Jan 2017 21:29:22 +0000 Subject: [PATCH 05/17] split blogs better --- content/pages/homepage.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content/pages/homepage.html b/content/pages/homepage.html index 40d833e..ff54338 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
From ac924536d9f99e5cffef5f3d53f6f9e20b3b4550 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 19 Jan 2017 18:25:22 +0000 Subject: [PATCH 06/17] Use global way to get titles --- pelicanconf.py | 4 +++- plugins/filters.py | 12 ++++++++++++ theme/templates/article.html | 2 +- theme/templates/blog.html | 2 +- theme/templates/category.html | 4 ++-- theme/templates/extras/header.html | 2 +- theme/templates/page-home.html | 2 +- theme/templates/page.html | 2 +- theme/templates/projects.html | 4 ++-- 9 files changed, 24 insertions(+), 10 deletions(-) diff --git a/pelicanconf.py b/pelicanconf.py index 648c65b..17e444f 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -108,7 +108,9 @@ 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 } JINJA_ENVIRONMENT = { diff --git a/plugins/filters.py b/plugins/filters.py index 2950233..b52296f 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,11 @@ 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) 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/category.html b/theme/templates/category.html index e7cab7e..9a2e056 100644 --- a/theme/templates/category.html +++ b/theme/templates/category.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block htmltitle %} - {{ category.name|title }} + {{ category|get_html_title }} {% endblock %} {% block metadata %} @@ -30,7 +30,7 @@
-

{{ article.title }}

+

{{ article|get_title }}

{{ article.summary|striptags|e }}

diff --git a/theme/templates/extras/header.html b/theme/templates/extras/header.html index 033c1cf..d590185 100644 --- a/theme/templates/extras/header.html +++ b/theme/templates/extras/header.html @@ -1,7 +1,7 @@
From 986c070b776f669ace435324865a22e65f2b56bd Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 23 Jan 2017 14:12:12 +0000 Subject: [PATCH 17/17] Fix ordering of other categories --- content/pages/homepage.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/pages/homepage.html b/content/pages/homepage.html index 622af66..b71e271 100644 --- a/content/pages/homepage.html +++ b/content/pages/homepage.html @@ -120,7 +120,7 @@ {% for category, articles in categories %} {% if category.name not in ['blog', 'projects'] %} - {{ category|get_title }} + {{ category.name }} {% endif %} {% endfor %}