From 4c15bc7ece09c7fbfd7e51df43147c38eaafdedf Mon Sep 17 00:00:00 2001 From: Vicky Steeves Date: Sun, 7 May 2017 12:15:57 -0400 Subject: [PATCH] filtered homepage posts, template post_list changes --- conf.py | 2 +- pages/index.rst | 13 ++ posts/announcement.html | 5 +- scholarship/coming-soon.html | 9 +- themes/custom/assets/css/custom.css | 55 +++++++++ themes/custom/templates/index.tmpl | 30 ++--- themes/custom/templates/index_helper.tmpl | 40 ++++++ themes/custom/templates/post.tmpl | 59 +++++++++ themes/custom/templates/post_header.tmpl | 52 ++++++++ themes/custom/templates/post_helper.tmpl | 116 ++++++++++++++++++ .../custom/templates/post_list_directive.tmpl | 28 +++++ themes/custom/templates/tags.tmpl | 37 ++++++ 12 files changed, 425 insertions(+), 21 deletions(-) create mode 100644 pages/index.rst create mode 100644 themes/custom/templates/index_helper.tmpl create mode 100644 themes/custom/templates/post.tmpl create mode 100644 themes/custom/templates/post_header.tmpl create mode 100644 themes/custom/templates/post_helper.tmpl create mode 100644 themes/custom/templates/post_list_directive.tmpl create mode 100644 themes/custom/templates/tags.tmpl diff --git a/conf.py b/conf.py index 2ffeeef..7929781 100644 --- a/conf.py +++ b/conf.py @@ -451,7 +451,7 @@ HIDDEN_AUTHORS = ['Guest'] # Final location for the main blog page and sibling paginated pages is # output / TRANSLATION[lang] / INDEX_PATH / index-*.html -INDEX_PATH = "" +INDEX_PATH = "public/pages/index/" # Optional HTML that displayed on “main” blog index.html files. # May be used for a greeting. (translatable) diff --git a/pages/index.rst b/pages/index.rst new file mode 100644 index 0000000..6de2197 --- /dev/null +++ b/pages/index.rst @@ -0,0 +1,13 @@ +.. title: +.. slug: index +.. date: 2017-01-06 14:24:09 UTC-05:00 +.. tags: +.. category: +.. link: +.. description: +.. type: text +.. hidetitle: True + +.. post-list:: + :sections: updates + diff --git a/posts/announcement.html b/posts/announcement.html index f017954..8b2e9f4 100644 --- a/posts/announcement.html +++ b/posts/announcement.html @@ -1,13 +1,14 @@ + diff --git a/scholarship/coming-soon.html b/scholarship/coming-soon.html index 162b4de..7386d63 100644 --- a/scholarship/coming-soon.html +++ b/scholarship/coming-soon.html @@ -1,18 +1,19 @@ + -

This will be a feed of new scholarship added to LISSA. You will be able to add materials during the soft launch, coming soon!

+

This page will be propagated by an RSS feed of new materials in LISSA. Check back during our soft launch to see what's being added!

diff --git a/themes/custom/assets/css/custom.css b/themes/custom/assets/css/custom.css index 17011bf..b9277e9 100644 --- a/themes/custom/assets/css/custom.css +++ b/themes/custom/assets/css/custom.css @@ -186,3 +186,58 @@ fieldset[disabled] .btn-default.focus { color: #9c7eaf; background-color: #ffffff; } + +/* --------------------TAGS--------------------------*/ +#index-tags { + text-align:left; + font-size:1.1em; +} + +#index-tags li { + background-color: transparent; +} + +#index-tags li a { + font-weight: normal; + color: #8966a0; + font-size:1.5em; + text-decoration: underline; +} + +/* --------------------TAGS LIST--------------------------*/ +.list-tags { + text-align:left; + font-size:1.3em; +} + +.list-tags li { + background-color: transparent; +} + +.list-tags li a { + font-weight: normal; + color: #8966a0; + font-size:1.5em; + text-decoration: underline; +} + +/* --------------------PAGINATION--------------------------*/ +.pager li > a, .pager li > span{ + display: inline-block; + padding: 5px 14px; + background-color: #8966a0; + border: 1px solid transparent; + border-radius: 15px; +} + +.pager li > a:hover, .pager li > a:focus { + background-color: #563f65; + text-decoration: none; +} + + +/* --------------------POST LIST--------------------------*/ +.post-list .list-unstyled > .post-list-item > h2 > a { + text-decoration:none; +} + \ No newline at end of file diff --git a/themes/custom/templates/index.tmpl b/themes/custom/templates/index.tmpl index 832dc93..c59650d 100644 --- a/themes/custom/templates/index.tmpl +++ b/themes/custom/templates/index.tmpl @@ -1,7 +1,6 @@ ## -*- coding: utf-8 -*- <%namespace name="helper" file="index_helper.tmpl"/> <%namespace name="comments" file="comments_helper.tmpl"/> -<%namespace name="pagination" file="pagination_helper.tmpl"/> <%inherit file="base.tmpl"/> <%block name="extra_head"> @@ -12,27 +11,20 @@ <%block name="content"> +<%block name="content_header"> % if 'main_index' in pagekind: ${front_index_header} % endif -% if page_links: - ${pagination.page_navigation(current_page, page_links, prevlink, nextlink, prev_next_links_reversed)} -% endif
% for post in posts:
-

${post.title()|h}

+

${post.title()|h}

@@ -44,6 +36,16 @@
${post.text(teaser_only=False)} %endif + % if post.tags: +
+ Tagged: + %for tag in post.tags: +
  • ${tag}
  • + %endfor + +
    + % endif
    % endfor diff --git a/themes/custom/templates/index_helper.tmpl b/themes/custom/templates/index_helper.tmpl new file mode 100644 index 0000000..0caea44 --- /dev/null +++ b/themes/custom/templates/index_helper.tmpl @@ -0,0 +1,40 @@ +## -*- coding: utf-8 -*- +<%def name="html_pager()"> + %if prevlink or nextlink: + + %endif + + +<%def name="mathjax_script(posts)"> + %if any(post.is_mathjax for post in posts): + %if use_katex: + + + + %else: + + % if mathjax_config: + ${mathjax_config} + % else: + + % endif + %endif + %endif + diff --git a/themes/custom/templates/post.tmpl b/themes/custom/templates/post.tmpl new file mode 100644 index 0000000..469c1e1 --- /dev/null +++ b/themes/custom/templates/post.tmpl @@ -0,0 +1,59 @@ +## -*- coding: utf-8 -*- +<%namespace name="helper" file="post_helper.tmpl"/> +<%namespace name="pheader" file="post_header.tmpl"/> +<%namespace name="comments" file="comments_helper.tmpl"/> +<%inherit file="base.tmpl"/> + +<%block name="extra_head"> + ${parent.extra_head()} + % if post.meta('keywords'): + + % endif + %if post.description(): + + %endif + + %if post.prev_post: + + %endif + %if post.next_post: + + %endif + % if post.is_draft: + + % endif + ${helper.open_graph_metadata(post)} + ${helper.twitter_card_information(post)} + ${helper.meta_translations(post)} + + +<%block name="content"> +
    + ${pheader.html_post_header()} +
    + ${post.text()} +
    + + % if not post.meta('nocomments') and site_has_comments: +
    +

    ${messages("Comments")}

    + ${comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)} +
    + % endif + ${helper.mathjax_script(post)} +
    +${comments.comment_link_script()} + + +<%block name="sourcelink"> +% if show_sourcelink: +
  • + ${messages("Source")} +
  • +% endif + diff --git a/themes/custom/templates/post_header.tmpl b/themes/custom/templates/post_header.tmpl new file mode 100644 index 0000000..b223f54 --- /dev/null +++ b/themes/custom/templates/post_header.tmpl @@ -0,0 +1,52 @@ +## -*- coding: utf-8 -*- +<%namespace name="helper" file="post_helper.tmpl"/> +<%namespace name="comments" file="comments_helper.tmpl"/> + +<%def name="html_title()"> +%if title and not post.meta('hidetitle'): +

    ${post.title()|h}

    +%endif + + +<%def name="html_translations(post)"> + % if len(post.translated_to) > 1: + + % endif + + +<%def name="html_sourcelink()"> + % if show_sourcelink: +

    ${messages("Source")}

    + % endif + + +<%def name="html_post_header()"> +
    + ${html_title()} + + ${html_translations(post)} +
    + diff --git a/themes/custom/templates/post_helper.tmpl b/themes/custom/templates/post_helper.tmpl new file mode 100644 index 0000000..47bf9b3 --- /dev/null +++ b/themes/custom/templates/post_helper.tmpl @@ -0,0 +1,116 @@ +## -*- coding: utf-8 -*- + +<%def name="meta_translations(post)"> + %if len(translations) > 1: + %for langname in sorted(translations): + %if langname != lang and ((not post.skip_untranslated) or post.is_translation_available(langname)): + + %endif + %endfor + %endif + + +<%def name="html_tags(post)"> + %if post.tags: + + %endif + + +<%def name="html_pager(post)"> + %if post.prev_post or post.next_post: + + %endif + + +<%def name="open_graph_metadata(post)"> +%if use_open_graph: + + + + %if post.description(): + + %else: + + %endif + %if post.previewimage: + + %endif + +### Will only work with Pintrest and breaks everywhere else who expect a [Facebook] URI. +### %if post.author(): +### +### %endif + %if post.date.isoformat(): + + %endif + %if post.tags: + %for tag in post.tags: + + %endfor + %endif +%endif + + +<%def name="twitter_card_information(post)"> +%if twitter_card and twitter_card['use_twitter_cards']: + + %if 'site:id' in twitter_card: + + %elif 'site' in twitter_card: + + %endif + %if 'creator:id' in twitter_card: + + %elif 'creator' in twitter_card: + + %endif +%endif + + +<%def name="mathjax_script(post)"> + %if post.is_mathjax: + %if use_katex: + + + % if katex_auto_render: + + % else: + + % endif + %else: + + % if mathjax_config: + ${mathjax_config} + % else: + + % endif + %endif + %endif + diff --git a/themes/custom/templates/post_list_directive.tmpl b/themes/custom/templates/post_list_directive.tmpl new file mode 100644 index 0000000..6487ef6 --- /dev/null +++ b/themes/custom/templates/post_list_directive.tmpl @@ -0,0 +1,28 @@ +## -*- coding: utf-8 -*- +<%block name="content"> + +
    + %if posts: + + %endif +
    + + \ No newline at end of file diff --git a/themes/custom/templates/tags.tmpl b/themes/custom/templates/tags.tmpl new file mode 100644 index 0000000..c3ab097 --- /dev/null +++ b/themes/custom/templates/tags.tmpl @@ -0,0 +1,37 @@ +## -*- coding: utf-8 -*- +<%inherit file="base.tmpl"/> + +<%block name="content"> +% if cat_items: + % if items: +

    ${messages("Categories")}

    + % endif + % for text, full_name, path, link, indent_levels, indent_change_before, indent_change_after in cat_hierarchy: + % for i in range(indent_change_before): + + % if i + 1 < len(indent_levels): + + % endif + % endfor + % endfor + % if items: +

    ${messages("Tags")}

    + % endif +%endif +% if items: + +% endif + \ No newline at end of file