Skip to content

Commit beb6f27

Browse files
authored
format code with prettier.io (#2048)
summary: - adds prettier formatter configuration - formats the entire repo using prettier, ignoring minified files (`*.min.css`) and heavy generated html - changes extensions of all `.html` files to `.liquid`, which is more correct and necessary for prettier to work correctly - replaces "%-" and "-%" with just "%" — manual liquid formatting using minus signs is superfluous since we are compressing and minifying the code anyway - adds CI action for running prettier check on PR and pushes to master
1 parent 60a09ed commit beb6f27

File tree

205 files changed

+37750
-23224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+37750
-23224
lines changed

.all-contributorsrc

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"files": [
3-
"README.md"
4-
],
2+
"files": ["README.md"],
53
"imageSize": 100,
64
"commit": false,
75
"contributorsPerLine": 7,
@@ -18,37 +16,28 @@
1816
"name": "Maruan",
1917
"avatar_url": "https://avatars.githubusercontent.com/u/2126561?v=4",
2018
"profile": "http://maruan.alshedivat.com",
21-
"contributions": [
22-
"design",
23-
"code"
24-
]
19+
"contributions": ["design", "code"]
2520
},
2621
{
2722
"login": "rohandebsarkar",
2823
"name": "Rohan Deb Sarkar",
2924
"avatar_url": "https://avatars.githubusercontent.com/u/50144004?v=4",
3025
"profile": "http://rohandebsarkar.github.io",
31-
"contributions": [
32-
"code"
33-
]
26+
"contributions": ["code"]
3427
},
3528
{
3629
"login": "pourmand1376",
3730
"name": "Amir Pourmand",
3831
"avatar_url": "https://avatars.githubusercontent.com/u/32064808?v=4",
3932
"profile": "https://amirpourmand.ir",
40-
"contributions": [
41-
"code"
42-
]
33+
"contributions": ["code"]
4334
},
4435
{
4536
"login": "george-gca",
4637
"name": "George",
4738
"avatar_url": "https://avatars.githubusercontent.com/u/31376482?v=4",
4839
"profile": "https://george-gca.github.io/",
49-
"contributions": [
50-
"code"
51-
]
40+
"contributions": ["code"]
5241
}
5342
],
5443
"commitConvention": "angular"

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
4+
title: ""
55
labels: bug
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
**Acknowledge the following**
10+
1111
- [ ] I carefully read and followed the [Getting Started](https://github.com/alshedivat/al-folio#getting-started) guide.
1212
- [ ] I read through [FAQ](https://github.com/alshedivat/al-folio#faq) and searched through the [past issues](https://github.com/alshedivat/al-folio/issues), none of which addressed my issue.
1313
- [ ] The issue I am raising is a potential bug in al-folio and not just a usage question. <br> [For usage questions, please post in the [Discussions](https://github.com/alshedivat/al-folio/discussions) instead of raising an issue.]
@@ -17,6 +17,7 @@ A clear and concise description of what the bug is.
1717

1818
**To Reproduce**
1919
Steps to reproduce the behavior:
20+
2021
1. Go to '...'
2122
2. Click on '....'
2223
3. Scroll down to '....'
@@ -29,9 +30,10 @@ A clear and concise description of what you expected to happen.
2930
If applicable, add screenshots to help explain your problem.
3031

3132
**System (please complete the following information):**
32-
- OS: [e.g. iOS]
33-
- Browser (and its version) [e.g. chrome, safari]
34-
- Jekyll version [e.g. 3.8.7]
33+
34+
- OS: [e.g. iOS]
35+
- Browser (and its version) [e.g. chrome, safari]
36+
- Jekyll version [e.g. 3.8.7]
3537
- Ruby version [e.g. 2.6.5]
3638

3739
**Additional context**

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: ''
4+
title: ""
55
labels: enhancement
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/workflows/deploy-docker-tag.yml

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,39 @@ name: Docker Image CI (Upload Tag)
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
77

88
jobs:
9-
109
build:
11-
1210
runs-on: ubuntu-latest
1311

1412
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v3
17-
18-
- name: Set up QEMU
19-
uses: docker/setup-qemu-action@v2
20-
21-
- name: Buildx
22-
uses: docker/setup-buildx-action@v2
23-
24-
-
25-
name: Docker meta
26-
id: meta
27-
uses: docker/metadata-action@v4
28-
with:
29-
images: amirpourmand/al-folio
30-
31-
- name: Login
32-
uses: docker/login-action@v2
33-
with:
34-
username: ${{ secrets.DOCKER_USERNAME }}
35-
password: ${{ secrets.DOCKER_PASSWORD }}
36-
37-
- name: Build and push
38-
uses: docker/build-push-action@v3
39-
with:
40-
context: .
41-
platforms: linux/amd64,linux/arm64/v8
42-
push: ${{ github.event_name != 'pull_request' }}
43-
tags: ${{ steps.meta.outputs.tags }}
44-
labels: ${{ steps.meta.outputs.labels }}
45-
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v2
18+
19+
- name: Buildx
20+
uses: docker/setup-buildx-action@v2
21+
22+
- name: Docker meta
23+
id: meta
24+
uses: docker/metadata-action@v4
25+
with:
26+
images: amirpourmand/al-folio
27+
28+
- name: Login
29+
uses: docker/login-action@v2
30+
with:
31+
username: ${{ secrets.DOCKER_USERNAME }}
32+
password: ${{ secrets.DOCKER_PASSWORD }}
33+
34+
- name: Build and push
35+
uses: docker/build-push-action@v3
36+
with:
37+
context: .
38+
platforms: linux/amd64,linux/arm64/v8
39+
push: ${{ github.event_name != 'pull_request' }}
40+
tags: ${{ steps.meta.outputs.tags }}
41+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/deploy-image.yml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,33 @@ name: Docker Image CI
22

33
on:
44
push:
5-
branches: [ master ]
6-
7-
jobs:
5+
branches: [master]
86

7+
jobs:
98
build:
10-
119
runs-on: ubuntu-latest
1210
if: github.repository_owner == 'alshedivat'
1311

1412
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v3
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v2
18+
19+
- name: Buildx
20+
uses: docker/setup-buildx-action@v2
1721

18-
- name: Set up QEMU
19-
uses: docker/setup-qemu-action@v2
20-
21-
- name: Buildx
22-
uses: docker/setup-buildx-action@v2
22+
- name: Login
23+
uses: docker/login-action@v2
24+
with:
25+
username: ${{ secrets.DOCKER_USERNAME }}
26+
password: ${{ secrets.DOCKER_PASSWORD }}
2327

24-
- name: Login
25-
uses: docker/login-action@v2
26-
with:
27-
username: ${{ secrets.DOCKER_USERNAME }}
28-
password: ${{ secrets.DOCKER_PASSWORD }}
29-
30-
- name: Build and push
31-
uses: docker/build-push-action@v4
32-
with:
33-
context: .
34-
push: true
35-
platforms: linux/amd64,linux/arm64/v8
36-
tags: amirpourmand/al-folio
28+
- name: Build and push
29+
uses: docker/build-push-action@v4
30+
with:
31+
context: .
32+
push: true
33+
platforms: linux/amd64,linux/arm64/v8
34+
tags: amirpourmand/al-folio

.github/workflows/deploy.yml

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,30 @@ jobs:
1919
# available images: https://github.com/actions/runner-images#available-images
2020
runs-on: ubuntu-latest
2121
steps:
22-
- name: Checkout 🛎️
23-
uses: actions/checkout@v3
24-
- name: Setup Ruby
25-
uses: ruby/setup-ruby@v1
26-
with:
27-
ruby-version: '3.2.2'
28-
bundler-cache: true
29-
- name: Update _config.yml ⚙️
30-
uses: fjogeleit/[email protected]
31-
with:
32-
commitChange: false
33-
valueFile: '_config.yml'
34-
propertyPath: 'giscus.repo'
35-
value: ${{ github.repository }}
36-
- name: Install and Build 🔧
37-
run: |
38-
pip3 install --upgrade jupyter
39-
npm install -g mermaid.cli
40-
npm install -g purgecss
41-
export JEKYLL_ENV=production
42-
bundle exec jekyll build --lsi
43-
purgecss -c purgecss.config.js
44-
- name: Deploy 🚀
45-
if: github.event_name != 'pull_request'
46-
uses: JamesIves/github-pages-deploy-action@v4
47-
with:
48-
folder: _site
49-
22+
- name: Checkout 🛎️
23+
uses: actions/checkout@v3
24+
- name: Setup Ruby
25+
uses: ruby/setup-ruby@v1
26+
with:
27+
ruby-version: "3.2.2"
28+
bundler-cache: true
29+
- name: Update _config.yml ⚙️
30+
uses: fjogeleit/[email protected]
31+
with:
32+
commitChange: false
33+
valueFile: "_config.yml"
34+
propertyPath: "giscus.repo"
35+
value: ${{ github.repository }}
36+
- name: Install and Build 🔧
37+
run: |
38+
pip3 install --upgrade jupyter
39+
npm install -g mermaid.cli
40+
npm install -g purgecss
41+
export JEKYLL_ENV=production
42+
bundle exec jekyll build --lsi
43+
purgecss -c purgecss.config.js
44+
- name: Deploy 🚀
45+
if: github.event_name != 'pull_request'
46+
uses: JamesIves/github-pages-deploy-action@v4
47+
with:
48+
folder: _site

.github/workflows/docker-slim.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ on:
77
types:
88
- completed
99

10-
# on:
10+
# on:
1111
# push:
12-
# branches:
12+
# branches:
1313
# - 'master'
1414

15-
jobs:
15+
jobs:
1616
build:
1717
runs-on: ubuntu-latest
1818
if: github.repository_owner == 'alshedivat'
@@ -22,30 +22,30 @@ jobs:
2222
working-directory: ${{ github.workspace }}
2323

2424
steps:
25-
- name: Checkout
26-
uses: actions/checkout@v3
27-
28-
- name: Login
29-
uses: docker/login-action@v2
30-
with:
31-
username: ${{ secrets.DOCKER_USERNAME }}
32-
password: ${{ secrets.DOCKER_PASSWORD }}
33-
34-
- name: update docker-compose
35-
shell: bash
36-
run: |
37-
sed -i "s|\.:|${{ github.workspace }}:|g" ${{ github.workspace }}/docker-compose.yml
38-
cat ${{ github.workspace }}/docker-compose.yml
39-
40-
- uses: kitabisa/[email protected]
41-
env:
42-
DSLIM_PULL: true
43-
DSLIM_COMPOSE_FILE: ${{ github.workspace }}/docker-compose.yml
44-
DSLIM_TARGET_COMPOSE_SVC: jekyll
45-
DSLIM_CONTINUE_AFTER: signal
46-
with:
47-
target: amirpourmand/al-folio
48-
tag: "slim"
49-
50-
# Push to the registry
51-
- run: docker image push amirpourmand/al-folio:slim
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
28+
- name: Login
29+
uses: docker/login-action@v2
30+
with:
31+
username: ${{ secrets.DOCKER_USERNAME }}
32+
password: ${{ secrets.DOCKER_PASSWORD }}
33+
34+
- name: update docker-compose
35+
shell: bash
36+
run: |
37+
sed -i "s|\.:|${{ github.workspace }}:|g" ${{ github.workspace }}/docker-compose.yml
38+
cat ${{ github.workspace }}/docker-compose.yml
39+
40+
- uses: kitabisa/[email protected]
41+
env:
42+
DSLIM_PULL: true
43+
DSLIM_COMPOSE_FILE: ${{ github.workspace }}/docker-compose.yml
44+
DSLIM_TARGET_COMPOSE_SVC: jekyll
45+
DSLIM_CONTINUE_AFTER: signal
46+
with:
47+
target: amirpourmand/al-folio
48+
tag: "slim"
49+
50+
# Push to the registry
51+
- run: docker image push amirpourmand/al-folio:slim

.github/workflows/prettier.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: prettier
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
pull_request:
9+
branches:
10+
- master
11+
- main
12+
workflow_dispatch:
13+
14+
jobs:
15+
check:
16+
# available images: https://github.com/actions/runner-images#available-images
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout 🛎️
20+
uses: actions/checkout@v3
21+
- name: Setup Node.js ⚙️
22+
uses: actions/setup-node@v4
23+
- name: Install Prettier 💾
24+
run: npm install --save-dev --save-exact prettier @shopify/prettier-plugin-liquid
25+
- name: Prettier Check 🔎
26+
run: npx prettier . --check

0 commit comments

Comments
 (0)