Skip to content

Commit

Permalink
Expand localization to tag page (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylhare committed Feb 19, 2021
1 parent 02981c6 commit ff215df
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 68 deletions.
1 change: 0 additions & 1 deletion _includes/portfolio.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- Portfolio Grid Section -->

<div class="portfolio-grid">
{% for item in site.portfolio %}
<div class="portfolio-cell">
Expand Down
2 changes: 1 addition & 1 deletion _includes/post_info.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% assign author = site.data.authors[include.author] %}
{% assign date = include.date %}
{% assign date = include.date | default: "today" | date: "%B %-d, %Y" %}

<div class="post-info">
{%- if author.url -%}<a href="{{ author.url | relative_url }}" target="_blank">{%- endif -%}
Expand Down
125 changes: 59 additions & 66 deletions _layouts/tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@

<div class="home">

<!-- cycles through posts to get tags -->
{% assign rawtags = "" %}
{% for post in site.posts %}
{% if post.tags.size > 0 %}
{% assign post_tags = post.tags | join:'|' | append:'|' %}
{% assign rawtags = rawtags | append:post_tags %}
{% endif %}
{% endfor %}
<!-- cycles through posts to get tags -->
{% assign rawtags = "" %}
{% for post in site.posts %}
{% if post.tags.size > 0 %}
{% assign post_tags = post.tags | join:'|' | append:'|' %}
{% assign rawtags = rawtags | append:post_tags %}
{% endif %}
{% endfor %}

<!-- cycles through portfolio collection to get tags -->
{% assign portfolio = site.portfolio | map: 'tags' | join: ',' | split: ',' | uniq %}
{% for tag in portfolio %}
{% assign portfolio_tags = tag | join: '|' | append: '|' %}
{% assign rawtags = rawtags | append: portfolio_tags %}
{% endfor %}
<!-- cycles through portfolio collection to get tags -->
{% assign portfolio = site.portfolio | map: 'tags' | join: ',' | split: ',' | uniq %}
{% for tag in portfolio %}
{% assign portfolio_tags = tag | join: '|' | append: '|' %}
{% assign rawtags = rawtags | append: portfolio_tags %}
{% endfor %}

<!-- cycles through pages to get tags -->
{% for page in site.pages %}
{% if page.tags.size > 0 %}
{% assign page_tags = page.tags | join:'|' | append:'|' %}
{% assign rawtags = rawtags | append:page_tags %}
{% endif %}
{% endfor %}
<!-- cycles through pages to get tags -->
{% for page in site.pages %}
{% if page.tags.size > 0 %}
{% assign page_tags = page.tags | join:'|' | append:'|' %}
{% assign rawtags = rawtags | append:page_tags %}
{% endif %}
{% endfor %}

<!-- Displays the list of tags-->
{% include tags_list.html tags=rawtags %}
<!-- Displays the list of tags-->
{% include tags_list.html tags=rawtags %}

<!-- Displays the posts and pages that contains the tag-->
<div class="posts">
Expand All @@ -44,51 +44,44 @@ <h3 id="{{ tag | cgi_escape }}" class="tag-anchor">
<div class="tag-posts">

<!-- Pages -->
{% for page in site.pages %}
{% if page.tags contains tag %}
<h5 class="tag-title">
<a href="{{ page.url | relative_url }}">
<i class="far fa-file-image" aria-hidden="true"></i>
{{ page.title }}
</a>

<div class="meta">
{{ "today" | date: "%B %-d, %Y" }}
</div>
</h5>
{% endif %}
{% endfor %}

{% for page in site.pages %}
{% if page.tags contains tag %}
<h5 class="tag-title">
<a href="{{ page.url | relative_url }}">
<i class="far fa-file-image" aria-hidden="true"></i>
{{ page.title }}
</a>
{% include post_info.html date=page.date %}
</h5>
{% endif %}
{% endfor %}

<!-- Posts -->
{% for post in site.posts %}
{% if post.tags contains tag %}
<h5 class="tag-title">
<a href="{{ post.url | relative_url }}">
<i class="far fa-file-alt" aria-hidden="true"></i>
{{ post.title }}
</a>

<div class="meta">
{{ post.date | date: "%B %-d, %Y" }}
</div>
</h5>
{% endif %}
{% endfor %}

{% for post in site.posts %}
{% if post.tags contains tag %}
<h5 class="tag-title">
<a href="{{ post.url | relative_url }}">
<i class="far fa-file-alt" aria-hidden="true"></i>
{{ post.title }}
</a>

{% include post_info.html date=post.date %}
</h5>
{% endif %}
{% endfor %}

<!-- Portfolio -->
{% for note in site.portfolio %}
{% if note.tags contains tag %}
<h5 class="tag-title">
<a href="{{ note.url | relative_url }}">
<i class="far fa-file" aria-hidden="true"></i>
{{ note.title }}
</a>

<div class="meta">
{{ note.date | date: "%B %-d, %Y" }}
</div>
</h5>
{% endif %}
{% for note in site.portfolio %}
{% if note.tags contains tag %}
<h5 class="tag-title">
<a href="{{ note.url | relative_url }}">
<i class="far fa-file" aria-hidden="true"></i>
{{ note.title }}
</a>

{% include post_info.html date=note.date %}
</h5>
{% endif %}
{% endfor %}

</div>
Expand Down
4 changes: 4 additions & 0 deletions _sass/layouts/_tags.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
a {
margin-left: $padding-x-small;
}

.post-info {
float: right;
}
}

.meta {
Expand Down

0 comments on commit ff215df

Please sign in to comment.