Skip to content

Commit

Permalink
Minify Compiled Files
Browse files Browse the repository at this point in the history
  • Loading branch information
yousinix committed Jan 10, 2020
1 parent afb8609 commit 8849dda
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 150 deletions.
66 changes: 33 additions & 33 deletions _includes/blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@

{% for post in paginator.posts %}

{% comment %} Default Styles {% endcomment %}
{% assign card_style = '' %}
{% assign text_style = 'text-dark' %}
{% assign badge_style = 'badge-dark' %}
{%- comment -%} Default Styles {%- endcomment -%}
{%- assign card_style = '' -%}
{%- assign text_style = 'text-dark' -%}
{%- assign badge_style = 'badge-dark' -%}

{% comment %} Update Styles {% endcomment %}
{% if post.style == 'fill' %}
{% assign card_style = post.color | prepend: 'bg-' %}
{% if post.color != 'light' %}
{% assign text_style = 'text-white' %}
{% assign badge_style = 'badge-light text-' %}
{% assign badge_style = badge_style | append: post.color %}
{% endif %}
{% else %}
{% assign card_style = post.color | prepend: 'border border-' %}
{% if post.color %}
{% assign badge_style = post.color | prepend: 'badge-' %}
{% endif %}
{% endif %}
{%- comment -%} Update Styles {%- endcomment -%}
{%- if post.style == 'fill' -%}
{%- assign card_style = post.color | prepend: 'bg-' -%}
{%- if post.color != 'light' -%}
{%- assign text_style = 'text-white' -%}
{%- assign badge_style = 'badge-light text-' -%}
{%- assign badge_style = badge_style | append: post.color -%}
{%- endif -%}
{%- else -%}
{%- assign card_style = post.color | prepend: 'border border-' -%}
{%- if post.color -%}
{%- assign badge_style = post.color | prepend: 'badge-' -%}
{%- endif -%}
{%- endif -%}

{% comment %} Determine Post URL {% endcomment %}
{% if post.external_url %}
{% assign post_url = post.external_url %}
{% else %}
{% assign post_url = post.url | relative_url %}
{% endif %}
{%- comment -%} Determine Post URL {%- endcomment -%}
{%- if post.external_url -%}
{%- assign post_url = post.external_url -%}
{%- else -%}
{%- assign post_url = post.url | relative_url -%}
{%- endif -%}

<div class="col-lg-6 my-3 wow animated fadeIn" data-wow-delay=".15s">
<a href="{{ post_url }}" class="post card {{ card_style }}">
Expand All @@ -39,11 +39,11 @@ <h3 class="card-title">{{ post.title }}</h3>
{% endfor %}
</p>
<p class="card-text">
{% if post.description %}
{%- if post.description -%}
{{ post.description }}
{% else %}
{%- else -%}
{{ post.content | truncatewords: 25, "<small><i> read more...</i></small>" }}
{% endif %}
{%- endif -%}
</p>
</div>
<div class="card-footer {{ text_style }}">
Expand All @@ -57,19 +57,19 @@ <h3 class="card-title">{{ post.title }}</h3>
<!-- Pagination links -->
<div class="mx-auto my-3">

{% if paginator.previous_page %}
{%- if paginator.previous_page -%}
<a href="{{ paginator.previous_page_path | relative_url }}" class="badge badge-primary"><</a>
{% else %}
{%- else -%}
<span class="badge badge-light text-muted"><</span>
{% endif %}
{%- endif -%}

<small class="mx-2"> Page <b>{{ paginator.page }}</b> of {{ paginator.total_pages }} </small>

{% if paginator.next_page %}
{%- if paginator.next_page -%}
<a href="{{ paginator.next_page_path | relative_url }}" class="badge badge-primary">></a>
{% else %}
{%- else -%}
<span class="badge badge-light text-muted">></span>
{% endif %}
{%- endif -%}

</div>

Expand Down
30 changes: 15 additions & 15 deletions _includes/blog/tags.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<!-- Collect tags from all posts -->
{% assign tags = blank %}
{% for post in site.posts %}
{% assign post_tags = post.tags | join:'|' | append:'|' %}
{% if post_tags != '|' %}
{% assign tags = tags | append:post_tags %}
{% endif %}
{% endfor %}
{% assign tags = tags | split:'|' | uniq | sort %}
{%- assign tags = blank -%}
{%- for post in site.posts -%}
{%- assign post_tags = post.tags | join:'|' | append:'|' -%}
{%- if post_tags != '|' -%}
{%- assign tags = tags | append:post_tags -%}
{%- endif -%}
{%- endfor -%}
{%- assign tags = tags | split:'|' | uniq | sort -%}

<!-- List tags & related posts -->
{% for tag in tags %}
<div class="py-3">
<h4 id="{{ tag | slugify }}">{{ tag }}</h4>
<ol>
{% for post in site.posts %}
{% if post.tags contains tag %}
{% if post.external_url %}
{% assign url = post.external_url %}
{% else %}
{% assign url = post.url | relative_url %}
{% endif %}
{%- if post.tags contains tag -%}
{%- if post.external_url -%}
{%- assign url = post.external_url -%}
{%- else -%}
{%- assign url = post.url | relative_url -%}
{%- endif -%}
<a href="{{ url }}"><li>{{ post.title }}</li></a>
<small class="text-muted"> - {{ post.date | date_to_long_string }}</small>
<br/>
{% endif %}
{%- endif -%}
{% endfor %}
</ol>
</div>
Expand Down
8 changes: 7 additions & 1 deletion _includes/elements/button.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<a class="m-1 btn btn-{{ include.style | default: 'outline-primary' }} btn-{{ include.size | default: 'md' }} {% if include.block == 'true' %} btn-block {% endif %}" href="{{ include.link | default: '#' }}">
{% if include.block == 'true' %}
{%- assign block_style = "btn-block" -%}
{%- else -%}
{%- assign block_style = "" -%}
{%- endif -%}

<a class="m-1 btn btn-{{ include.style | default: 'outline-primary' }} btn-{{ include.size | default: 'md' }} {{ block_style }}" href="{{ include.link | default: '#' }}">
{{ include.text | default: "Button" }}
</a>
12 changes: 6 additions & 6 deletions _includes/elements/carousel.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@

<ol class="carousel-indicators">
{% for image in images %}
{% if forloop.first == true %}
{%- if forloop.first -%}
<li data-target="#carouselExampleIndicators" data-slide-to="{{forloop.index0}}" class="active"></li>
{% else %}
{%- else -%}
<li data-target="#carouselExampleIndicators" data-slide-to="{{forloop.index0}}"></li>
{% endif %}
{%- endif -%}
{% endfor %}
</ol>

<div class="carousel-inner">
{% for image in images %}
{% if forloop.first == true %}
{%- if forloop.first -%}
<div class="carousel-item active">
<img src="{{ image }}" class="d-block w-100">
</div>
{% else %}
{%- else -%}
<div class="carousel-item">
<img src="{{ image }}" class="d-block w-100">
</div>
{% endif %}
{%- endif -%}
{% endfor %}
</div>

Expand Down
4 changes: 2 additions & 2 deletions _includes/elements/figure.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<figure class="figure w-100">
<img src="{{ include.image }}" class="figure-img img-fluid rounded" alt="{{ include.alt | default: include.caption }}">
{% if include.caption %}
{%- if include.caption -%}
<figcaption class="figure-caption text-center">{{ include.caption }}</figcaption>
{% endif %}
{%- endif -%}
</figure>
12 changes: 6 additions & 6 deletions _includes/elements/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

<div class="list-group my-3">

{% if include.title %}
{%- if include.title -%}
<a class="list-group-item list-group-item-action active disabled text-white">{{ include.title }}</a>
{% endif %}
{%- endif -%}

{% for item in items %}
{% if include.type == "toc" %}
{%- if include.type == "toc" -%}
<a class="list-group-item list-group-item-action" href="#{{ item | slugify }}">{{ item }}</a>
{% else %}
{% assign item_object = item | split: ',' %}
{%- else -%}
{%- assign item_object = item | split: ',' -%}
<a class="list-group-item list-group-item-action" href="{{ item_object[1] }}">{{ item_object[0] }}</a>
{% endif %}
{%- endif -%}
{% endfor %}

</div>
Expand Down
72 changes: 36 additions & 36 deletions _includes/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,53 @@
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav ml-auto">

{% assign html_pages = site.html_pages | sort: 'weight' %}
{% assign filtered_pages = "" | split: "" %}
{%- assign html_pages = site.html_pages | sort: 'weight' -%}
{%- assign filtered_pages = "" | split: "" -%}

{% for html_page in html_pages %}
{%- for html_page in html_pages -%}

{% assign exclude = false %}
{%- assign exclude = false -%}

{% for exclude_path in site.nav_exclude %}
{%- for exclude_path in site.nav_exclude -%}

{% if html_page.path == exclude_path %}
{% assign exclude = true %}
{% break %}
{% else if exclude_path contains ':num' %}
{% assign temp = html_page.path %}
{% assign parts = exclude_path | split: ':num' %}
{% for part in parts %}
{% assign temp = temp | remove: part %}
{% endfor %}
{% assign test_num = temp | plus: 0 | downcase %}
{% if temp == test_num %}
{% assign exclude = true %}
{% break %}
{% endif %}
{% endif %}
{%- if html_page.path == exclude_path -%}
{%- assign exclude = true -%}
{%- break -%}
{%- else if exclude_path contains ':num' -%}
{%- assign temp = html_page.path -%}
{%- assign parts = exclude_path | split: ':num' -%}
{%- for part in parts -%}
{%- assign temp = temp | remove: part -%}
{%- endfor -%}
{%- assign test_num = temp | plus: 0 | downcase -%}
{%- if temp == test_num -%}
{%- assign exclude = true -%}
{%- break -%}
{%- endif -%}
{%- endif -%}

{% endfor %}
{%- endfor -%}

{% unless exclude %}
{% assign filtered_pages = filtered_pages | push: html_page %}
{% endunless %}
{%- unless exclude -%}
{%- assign filtered_pages = filtered_pages | push: html_page -%}
{%- endunless -%}

{% endfor %}
{%- endfor -%}


{% for html_page in filtered_pages %}

{% if page.url contains html_page.url %}
{% assign active_status = "active" %}
{% else %}
{% assign active_status = "" %}
{% endif %}

{% if html_page.external_url %}
{% assign url = html_page.external_url %}
{% else %}
{% assign url = html_page.url | relative_url %}
{% endif %}
{%- if page.url contains html_page.url -%}
{%- assign active_status = "active" -%}
{%- else -%}
{%- assign active_status = "" -%}
{%- endif -%}

{%- if html_page.external_url -%}
{%- assign url = html_page.external_url -%}
{%- else -%}
{%- assign url = html_page.url | relative_url -%}
{%- endif -%}

<a class="nav-item nav-link {{ active_status }}" href="{{ url }}">{{ html_page.title }}</a>

Expand Down
62 changes: 31 additions & 31 deletions _includes/projects/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
<!-- Remote Projects -->
{% for remote_project in page.remote_projects %}

{% for repo in site.github.public_repositories %}
{% if remote_project == repo.name %}
{% assign project = repo %}
{% endif %}
{% endfor %}

{% assign words = project.name | split: '-' %}
{% capture titlecase %}
{% for word in words %}
{{ word | capitalize }}
{% endfor %}
{% endcapture %}

{% assign project_type = "remote" %}
{% assign project_id = project.name %}
{% assign project_img = false %}
{% assign project_name = titlecase %}
{% assign project_desc = project.description %}
{% assign project_url = project.html_url %}
{%- for repo in site.github.public_repositories -%}
{%- if remote_project == repo.name -%}
{%- assign project = repo -%}
{%- endif -%}
{%- endfor -%}

{%- assign words = project.name | split: '-' -%}
{%- capture titlecase -%}
{%- for word in words -%}
{{ word | capitalize | append: ' ' }}
{%- endfor -%}
{%- endcapture -%}

{%- assign project_type = "remote" -%}
{%- assign project_id = project.name -%}
{%- assign project_img = false -%}
{%- assign project_name = titlecase | strip -%}
{%- assign project_desc = project.description -%}
{%- assign project_url = project.html_url -%}

{% include projects/project-card.html %}

Expand All @@ -35,18 +35,18 @@
<!-- Local Projects -->
{% for project in site.projects %}

{% assign project_type = "local" %}
{% assign project_id = project.name | slugify %}
{% assign project_img = project.image %}
{% assign project_name = project.name %}
{% assign project_desc = project.description %}
{% assign project_tools = project.tools %}

{% if project.external_url %}
{% assign project_url = project.external_url %}
{% else %}
{% assign project_url = project.url | relative_url %}
{% endif %}
{%- assign project_type = "local" -%}
{%- assign project_id = project.name | slugify -%}
{%- assign project_img = project.image -%}
{%- assign project_name = project.name -%}
{%- assign project_desc = project.description -%}
{%- assign project_tools = project.tools -%}

{%- if project.external_url -%}
{%- assign project_url = project.external_url -%}
{%- else -%}
{%- assign project_url = project.url | relative_url -%}
{%- endif -%}

{% include projects/project-card.html %}

Expand Down
Loading

0 comments on commit 8849dda

Please sign in to comment.