Skip to content

Commit

Permalink
format code with prettier.io (alshedivat#2048)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alshedivat authored Jan 10, 2024
1 parent 93751ee commit 909fec3
Show file tree
Hide file tree
Showing 205 changed files with 37,750 additions and 23,224 deletions.
21 changes: 5 additions & 16 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"files": [
"README.md"
],
"files": ["README.md"],
"imageSize": 100,
"commit": false,
"contributorsPerLine": 7,
Expand All @@ -18,37 +16,28 @@
"name": "Maruan",
"avatar_url": "https://avatars.githubusercontent.com/u/2126561?v=4",
"profile": "http://maruan.alshedivat.com",
"contributions": [
"design",
"code"
]
"contributions": ["design", "code"]
},
{
"login": "rohandebsarkar",
"name": "Rohan Deb Sarkar",
"avatar_url": "https://avatars.githubusercontent.com/u/50144004?v=4",
"profile": "http://rohandebsarkar.github.io",
"contributions": [
"code"
]
"contributions": ["code"]
},
{
"login": "pourmand1376",
"name": "Amir Pourmand",
"avatar_url": "https://avatars.githubusercontent.com/u/32064808?v=4",
"profile": "https://amirpourmand.ir",
"contributions": [
"code"
]
"contributions": ["code"]
},
{
"login": "george-gca",
"name": "George",
"avatar_url": "https://avatars.githubusercontent.com/u/31376482?v=4",
"profile": "https://george-gca.github.io/",
"contributions": [
"code"
]
"contributions": ["code"]
}
],
"commitConvention": "angular"
Expand Down
14 changes: 8 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
title: ""
labels: bug
assignees: ''

assignees: ""
---

**Acknowledge the following**

- [ ] I carefully read and followed the [Getting Started](https://github.com/alshedivat/al-folio#getting-started) guide.
- [ ] 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.
- [ ] 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.]
Expand All @@ -17,6 +17,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -29,9 +30,10 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**System (please complete the following information):**
- OS: [e.g. iOS]
- Browser (and its version) [e.g. chrome, safari]
- Jekyll version [e.g. 3.8.7]

- OS: [e.g. iOS]
- Browser (and its version) [e.g. chrome, safari]
- Jekyll version [e.g. 3.8.7]
- Ruby version [e.g. 2.6.5]

**Additional context**
Expand Down
5 changes: 2 additions & 3 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
title: ""
labels: enhancement
assignees: ''

assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
64 changes: 30 additions & 34 deletions .github/workflows/deploy-docker-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,39 @@ name: Docker Image CI (Upload Tag)
on:
push:
tags:
- 'v*'
- "v*"

jobs:

build:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Buildx
uses: docker/setup-buildx-action@v2

-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: amirpourmand/al-folio

- name: Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Buildx
uses: docker/setup-buildx-action@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: amirpourmand/al-folio

- name: Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64/v8
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
46 changes: 22 additions & 24 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,33 @@ name: Docker Image CI

on:
push:
branches: [ master ]

jobs:
branches: [master]

jobs:
build:

runs-on: ubuntu-latest
if: github.repository_owner == 'alshedivat'

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Buildx
uses: docker/setup-buildx-action@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Buildx
uses: docker/setup-buildx-action@v2
- name: Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64/v8
tags: amirpourmand/al-folio
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64/v8
tags: amirpourmand/al-folio
55 changes: 27 additions & 28 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,30 @@ jobs:
# available images: https://github.com/actions/runner-images#available-images
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.2'
bundler-cache: true
- name: Update _config.yml ⚙️
uses: fjogeleit/[email protected]
with:
commitChange: false
valueFile: '_config.yml'
propertyPath: 'giscus.repo'
value: ${{ github.repository }}
- name: Install and Build 🔧
run: |
pip3 install --upgrade jupyter
npm install -g mermaid.cli
npm install -g purgecss
export JEKYLL_ENV=production
bundle exec jekyll build --lsi
purgecss -c purgecss.config.js
- name: Deploy 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _site

- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2"
bundler-cache: true
- name: Update _config.yml ⚙️
uses: fjogeleit/[email protected]
with:
commitChange: false
valueFile: "_config.yml"
propertyPath: "giscus.repo"
value: ${{ github.repository }}
- name: Install and Build 🔧
run: |
pip3 install --upgrade jupyter
npm install -g mermaid.cli
npm install -g purgecss
export JEKYLL_ENV=production
bundle exec jekyll build --lsi
purgecss -c purgecss.config.js
- name: Deploy 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _site
60 changes: 30 additions & 30 deletions .github/workflows/docker-slim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
types:
- completed

# on:
# on:
# push:
# branches:
# branches:
# - 'master'

jobs:
jobs:
build:
runs-on: ubuntu-latest
if: github.repository_owner == 'alshedivat'
Expand All @@ -22,30 +22,30 @@ jobs:
working-directory: ${{ github.workspace }}

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: update docker-compose
shell: bash
run: |
sed -i "s|\.:|${{ github.workspace }}:|g" ${{ github.workspace }}/docker-compose.yml
cat ${{ github.workspace }}/docker-compose.yml
- uses: kitabisa/[email protected]
env:
DSLIM_PULL: true
DSLIM_COMPOSE_FILE: ${{ github.workspace }}/docker-compose.yml
DSLIM_TARGET_COMPOSE_SVC: jekyll
DSLIM_CONTINUE_AFTER: signal
with:
target: amirpourmand/al-folio
tag: "slim"

# Push to the registry
- run: docker image push amirpourmand/al-folio:slim
- name: Checkout
uses: actions/checkout@v3

- name: Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: update docker-compose
shell: bash
run: |
sed -i "s|\.:|${{ github.workspace }}:|g" ${{ github.workspace }}/docker-compose.yml
cat ${{ github.workspace }}/docker-compose.yml
- uses: kitabisa/[email protected]
env:
DSLIM_PULL: true
DSLIM_COMPOSE_FILE: ${{ github.workspace }}/docker-compose.yml
DSLIM_TARGET_COMPOSE_SVC: jekyll
DSLIM_CONTINUE_AFTER: signal
with:
target: amirpourmand/al-folio
tag: "slim"

# Push to the registry
- run: docker image push amirpourmand/al-folio:slim
26 changes: 26 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: prettier

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:

jobs:
check:
# available images: https://github.com/actions/runner-images#available-images
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Setup Node.js ⚙️
uses: actions/setup-node@v4
- name: Install Prettier 💾
run: npm install --save-dev --save-exact prettier @shopify/prettier-plugin-liquid
- name: Prettier Check 🔎
run: npx prettier . --check
Loading

0 comments on commit 909fec3

Please sign in to comment.