Skip to content

Commit a2e569d

Browse files
committed
Replace python with bash.
1 parent e6de482 commit a2e569d

16 files changed

Lines changed: 336 additions & 556 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ jobs:
2929
with:
3030
ruby-version: '2.6.x'
3131

32-
- uses: actions/setup-python@v1
33-
with:
34-
python-version: '3.7.x'
35-
3632
- name: Checkout
3733
uses: actions/checkout@v2
34+
with:
35+
fetch-depth: 0
3836

3937
- name: Bundle Caching
4038
id: bundle-cache
@@ -45,21 +43,7 @@ jobs:
4543
restore-keys: |
4644
${{ runner.os }}-gems-
4745
48-
- name: Get pip cache path
49-
id: get-pip-cache-path
50-
run: |
51-
echo "::set-output name=path::`pip show pip | grep "Location" | awk '{print $2}'`"
52-
53-
- name: Pip caching
54-
id: pip-cache
55-
uses: actions/cache@v1
56-
with:
57-
path: ${{ steps.get-pip-cache-path.outputs.path }}
58-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
59-
restore-keys: |
60-
${{ runner.os }}-pip-
61-
62-
- name: Install gnu-coreutils for macOS
46+
- name: Install GNU-Coreutils(for macOS)
6347
if: runner.os == 'macOS'
6448
run: |
6549
brew install coreutils
@@ -78,11 +62,6 @@ jobs:
7862
run: |
7963
bundle install --local
8064
81-
- name: Pip installing
82-
if: steps.pip-cache.outputs.cache-hit != 'true'
83-
run: |
84-
pip install -r _scripts/py/requirements.txt
85-
8665
- name: Build Site
8766
run: |
8867
bash tools/build.sh

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ dist: bionic
44
language: ruby
55
rvm: 2.6.5
66

7-
before_install:
8-
- pyenv global 3.7.6
9-
107
install:
11-
- pip install -r _scripts/py/requirements.txt
128
- bundle install --path vendor/bundle --quiet
139

1410
addons:

_includes/panel.html

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,51 @@
99
<div id="panel-wrapper" class="col-xl-3 pl-2 text-muted topbar-down">
1010

1111
<div class="access">
12-
{% assign lastmod_list = "" | split: "" %}
13-
{% assign index = 0 %}
1412

15-
{% for post in site.posts %}
16-
{% if post.seo.date_modified > post.date and post.seo.date_modified != nil %}
17-
{% capture item %}
18-
{{ post.seo.date_modified }}::{{ index }}
13+
{% if site.data.updates %}
14+
{% assign MAX_SIZE = 5 %}
15+
{% assign sum = 0 %}
16+
{% assign sort_list = "" | split: "" %}
17+
18+
{% for entry in site.data.updates %}
19+
{% capture elem %}
20+
{{- entry.lastmod -}}::{{- entry.filename -}}
1921
{% endcapture %}
20-
{% assign lastmod_list = lastmod_list | push: item %}
21-
{% endif %}
22-
{% assign index = index | plus: 1 %}
23-
{% endfor %}
22+
{% assign sort_list = sort_list | push: elem %}
23+
{% endfor %}
24+
25+
{% assign sort_list = sort_list | sort | reverse %}
26+
27+
{% if sort_list.size > 0 %}
2428

25-
{% if lastmod_list.size > 0 %}
2629
<div id="access-lastmod" class="post">
2730
<h3 data-toc-skip>
2831
{{- site.data.label.panel.lastmod -}}
2932
</h3>
3033
<ul class="post-content pl-0 pb-1 ml-1 mt-2">
31-
{% assign MAX_SIZE = 5 %}
32-
{% assign sum = 0 %}
33-
{% assign lastmod_list = lastmod_list | sort | reverse %}
34-
{% for item in lastmod_list %}
35-
{% assign index = item | split: "::" | last | plus: 0 %}
36-
{% assign post = site.posts[index] %}
37-
<li><a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></li>
38-
{% assign sum = sum | plus: 1 %}
39-
{% if sum >= MAX_SIZE %}
40-
{% break %}
41-
{% endif %}
42-
{% endfor %}
34+
35+
{% for item in sort_list %}
36+
{% assign post_url = item | split: "::" | last | prepend: "/posts/" | append: "/" %}
37+
{% assign post = site.posts | where: "url", post_url | first %}
38+
39+
{% if post %}
40+
{% assign url = post.url | prepend: site.baseurl %}
41+
42+
<li><a href="{{ url }}">{{ post.title }}</a></li>
43+
44+
{% assign sum = sum | plus: 1 %}
45+
{% if sum >= MAX_SIZE %} {% break %} {% endif %}
46+
47+
{% endif %}
48+
49+
{% endfor %}
50+
4351
</ul>
4452
</div><!-- #access-lastmod -->
45-
{% endif %}
53+
54+
{% endif %}
55+
56+
{% endif %} <!-- site.data.updates -->
4657

4758
<div id="access-tags">
4859
<h3 data-toc-skip>

_layouts/post.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,20 @@ <h1 data-toc-skip>{{ page.title }}</h1>
3535
</div>
3636

3737
<!-- lastmod -->
38-
{% if page.seo.date_modified > page.date %}
38+
{%- capture filename -%}
39+
{{ page.url | split: "/" | last }}
40+
{%- endcapture -%}
41+
42+
{% assign record = site.data.updates | where: "filename", filename | first %}
43+
44+
{% if record %}
3945
<div>
4046
Updated
4147
<span class="timeago lastmod"
4248
data-toggle="tooltip" data-placement="bottom"
43-
title="{{ page.seo.date_modified | date: site.data.date_format.tooltip }}">
44-
{{ page.seo.date_modified | date: site.data.date_format.post }}
45-
<i class="unloaded">{{ page.seo.date_modified | date_to_xmlschema}}</i>
49+
title="{{ record.lastmod | date: site.data.date_format.tooltip }}">
50+
{{ record.lastmod | date: site.data.date_format.post }}
51+
<i class="unloaded">{{ record.lastmod | date_to_xmlschema}}</i>
4652
</span>
4753
</div>
4854
{% endif %}

_scripts/py/init_all.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

_scripts/py/pages_generator.py

Lines changed: 0 additions & 205 deletions
This file was deleted.

_scripts/py/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)