Skip to content

Commit

Permalink
Replace python with bash.
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Apr 23, 2020
1 parent 0472eba commit dd21451
Show file tree
Hide file tree
Showing 16 changed files with 336 additions and 556 deletions.
27 changes: 3 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,10 @@ jobs:
with:
ruby-version: '2.6.x'

- uses: actions/setup-python@v1
with:
python-version: '3.7.x'

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Bundle Caching
id: bundle-cache
Expand All @@ -45,21 +43,7 @@ jobs:
restore-keys: |
${{ runner.os }}-gems-
- name: Get pip cache path
id: get-pip-cache-path
run: |
echo "::set-output name=path::`pip show pip | grep "Location" | awk '{print $2}'`"
- name: Pip caching
id: pip-cache
uses: actions/cache@v1
with:
path: ${{ steps.get-pip-cache-path.outputs.path }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install gnu-coreutils for macOS
- name: Install GNU-Coreutils(for macOS)
if: runner.os == 'macOS'
run: |
brew install coreutils
Expand All @@ -78,11 +62,6 @@ jobs:
run: |
bundle install --local
- name: Pip installing
if: steps.pip-cache.outputs.cache-hit != 'true'
run: |
pip install -r _scripts/py/requirements.txt
- name: Build Site
run: |
bash tools/build.sh
Expand Down
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ dist: bionic
language: ruby
rvm: 2.6.5

before_install:
- pyenv global 3.7.6

install:
- pip install -r _scripts/py/requirements.txt
- bundle install --path vendor/bundle --quiet

addons:
Expand Down
59 changes: 35 additions & 24 deletions _includes/panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,51 @@
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">

<div class="access">
{% assign lastmod_list = "" | split: "" %}
{% assign index = 0 %}

{% for post in site.posts %}
{% if post.seo.date_modified > post.date and post.seo.date_modified != nil %}
{% capture item %}
{{ post.seo.date_modified }}::{{ index }}
{% if site.data.updates %}
{% assign MAX_SIZE = 5 %}
{% assign sum = 0 %}
{% assign sort_list = "" | split: "" %}

{% for entry in site.data.updates %}
{% capture elem %}
{{- entry.lastmod -}}::{{- entry.filename -}}
{% endcapture %}
{% assign lastmod_list = lastmod_list | push: item %}
{% endif %}
{% assign index = index | plus: 1 %}
{% endfor %}
{% assign sort_list = sort_list | push: elem %}
{% endfor %}

{% assign sort_list = sort_list | sort | reverse %}

{% if sort_list.size > 0 %}

{% if lastmod_list.size > 0 %}
<div id="access-lastmod" class="post">
<h3 data-toc-skip>
{{- site.data.label.panel.lastmod -}}
</h3>
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
{% assign MAX_SIZE = 5 %}
{% assign sum = 0 %}
{% assign lastmod_list = lastmod_list | sort | reverse %}
{% for item in lastmod_list %}
{% assign index = item | split: "::" | last | plus: 0 %}
{% assign post = site.posts[index] %}
<li><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></li>
{% assign sum = sum | plus: 1 %}
{% if sum >= MAX_SIZE %}
{% break %}
{% endif %}
{% endfor %}

{% for item in sort_list %}
{% assign post_url = item | split: "::" | last | prepend: "/posts/" | append: "/" %}
{% assign post = site.posts | where: "url", post_url | first %}

{% if post %}
{% assign url = post.url | prepend: site.baseurl %}

<li><a href="{{ url }}">{{ post.title }}</a></li>

{% assign sum = sum | plus: 1 %}
{% if sum >= MAX_SIZE %} {% break %} {% endif %}

{% endif %}

{% endfor %}

</ul>
</div><!-- #access-lastmod -->
{% endif %}

{% endif %}

{% endif %} <!-- site.data.updates -->

<div id="access-tags">
<h3 data-toc-skip>
Expand Down
14 changes: 10 additions & 4 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,20 @@ <h1 data-toc-skip>{{ page.title }}</h1>
</div>

<!-- lastmod -->
{% if page.seo.date_modified > page.date %}
{%- capture filename -%}
{{ page.url | split: "/" | last }}
{%- endcapture -%}

{% assign record = site.data.updates | where: "filename", filename | first %}

{% if record %}
<div>
Updated
<span class="timeago lastmod"
data-toggle="tooltip" data-placement="bottom"
title="{{ page.seo.date_modified | date: site.data.date_format.tooltip }}">
{{ page.seo.date_modified | date: site.data.date_format.post }}
<i class="unloaded">{{ page.seo.date_modified | date_to_xmlschema}}</i>
title="{{ record.lastmod | date: site.data.date_format.tooltip }}">
{{ record.lastmod | date: site.data.date_format.post }}
<i class="unloaded">{{ record.lastmod | date_to_xmlschema}}</i>
</span>
</div>
{% endif %}
Expand Down
18 changes: 0 additions & 18 deletions _scripts/py/init_all.py

This file was deleted.

205 changes: 0 additions & 205 deletions _scripts/py/pages_generator.py

This file was deleted.

2 changes: 0 additions & 2 deletions _scripts/py/requirements.txt

This file was deleted.

Loading

0 comments on commit dd21451

Please sign in to comment.