feat(dev): support vscode dev-container (#1781)
This commit is contained in:
parent
1c5fa0880d
commit
1e3d4a6323
8 changed files with 59 additions and 19 deletions
31
.devcontainer/devcontainer.json
Normal file
31
.devcontainer/devcontainer.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"name": "Jekyll",
|
||||
"image": "mcr.microsoft.com/devcontainers/jekyll:2-bullseye",
|
||||
"onCreateCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
|
||||
"postCreateCommand": "bash .devcontainer/post-create.sh",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"settings": {
|
||||
"terminal.integrated.defaultProfile.linux": "zsh",
|
||||
// Speed up extension installation
|
||||
"extensions.verifySignature": false
|
||||
},
|
||||
"extensions": [
|
||||
// Liquid tags auto-complete
|
||||
"killalau.vscode-liquid-snippets",
|
||||
// Liquid syntax highlighting and formatting
|
||||
"Shopify.theme-check-vscode",
|
||||
// Shell
|
||||
"timonwong.shellcheck",
|
||||
"mkhl.shfmt",
|
||||
// Common formatter
|
||||
"EditorConfig.EditorConfig",
|
||||
"esbenp.prettier-vscode",
|
||||
"stylelint.vscode-stylelint",
|
||||
"yzhang.markdown-all-in-one",
|
||||
// Git
|
||||
"mhutchie.git-graph"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
10
.devcontainer/post-create.sh
Normal file
10
.devcontainer/post-create.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [ -f package.json ]; then
|
||||
bash -i -c "nvm install --lts && nvm install-latest-npm"
|
||||
npm i
|
||||
npm run build
|
||||
fi
|
||||
|
||||
# Install dependencies for shfmt extension
|
||||
curl -sS https://webi.sh/shfmt | sh &>/dev/null
|
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
|
@ -23,3 +23,7 @@ updates:
|
|||
- "major"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "devcontainers"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: weekly
|
||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -17,7 +17,7 @@ package-lock.json
|
|||
|
||||
# IDE configurations
|
||||
.idea
|
||||
.vscode
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/extensions.json
|
||||
|
||||
|
|
12
.vscode/extensions.json
vendored
12
.vscode/extensions.json
vendored
|
@ -1,13 +1,3 @@
|
|||
{
|
||||
"recommendations": [
|
||||
// Liquid tags auto-complete
|
||||
"killalau.vscode-liquid-snippets",
|
||||
// Liquid syntax highlighting and formatting
|
||||
"Shopify.theme-check-vscode",
|
||||
// Common formatter
|
||||
"esbenp.prettier-vscode",
|
||||
"foxundermoon.shell-format",
|
||||
"stylelint.vscode-stylelint",
|
||||
"yzhang.markdown-all-in-one"
|
||||
]
|
||||
"recommendations": ["ms-vscode-remote.remote-containers"]
|
||||
}
|
||||
|
|
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
|
@ -15,13 +15,13 @@
|
|||
"editor.defaultFormatter": "Shopify.theme-check-vscode"
|
||||
},
|
||||
"[shellscript]": {
|
||||
"editor.defaultFormatter": "foxundermoon.shell-format"
|
||||
"editor.defaultFormatter": "mkhl.shfmt"
|
||||
},
|
||||
// Disable vscode built-in stylelint
|
||||
"css.validate": false,
|
||||
"scss.validate": false,
|
||||
"less.validate": false,
|
||||
// Stylint extension settings
|
||||
"stylelint.snippet": ["css", "less", "postcss", "scss"],
|
||||
"stylelint.validate": ["css", "less", "postcss", "scss"]
|
||||
"stylelint.snippet": ["css", "scss"],
|
||||
"stylelint.validate": ["css", "scss"]
|
||||
}
|
||||
|
|
|
@ -6,11 +6,11 @@
|
|||
|
||||
A minimal, responsive, and feature-rich Jekyll theme for technical writing.
|
||||
|
||||
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?color=brightgreen)][gem]
|
||||
[![CI](https://github.com/cotes2020/jekyll-theme-chirpy/actions/workflows/ci.yml/badge.svg?branch=master&event=push)][ci]
|
||||
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?&logo=RubyGems&logoColor=gainsboro&label=gem&color=brightgreen)][gem]
|
||||
[![CI](https://img.shields.io/github/actions/workflow/status/cotes2020/jekyll-theme-chirpy/ci.yml?logo=github&logoColor=gainsboro)][ci]
|
||||
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/4e556876a3c54d5e8f2d2857c4f43894)][codacy]
|
||||
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy.svg)][license]
|
||||
[![996.icu](https://img.shields.io/badge/link-996.icu-%23FF4D5B.svg)](https://996.icu)
|
||||
[![GitHub license](https://img.shields.io/github/license/cotes2020/jekyll-theme-chirpy)][license]
|
||||
[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&logo=visualstudiocode&logoColor=gainsboro&message=Open&color=deepskyblue)][open-container]
|
||||
|
||||
[**Live Demo** →][demo]
|
||||
|
||||
|
@ -72,6 +72,7 @@ This project is published under [MIT License][license].
|
|||
[ci]: https://github.com/cotes2020/jekyll-theme-chirpy/actions/workflows/ci.yml?query=event%3Apush+branch%3Amaster
|
||||
[codacy]: https://app.codacy.com/gh/cotes2020/jekyll-theme-chirpy/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade
|
||||
[license]: https://github.com/cotes2020/jekyll-theme-chirpy/blob/master/LICENSE
|
||||
[open-container]: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/cotes2020/jekyll-theme-chirpy
|
||||
[jekyllrb]: https://jekyllrb.com/
|
||||
[clipartmax]: https://www.clipartmax.com/middle/m2i8b1m2K9Z5m2K9_ant-clipart-childrens-ant-cute/
|
||||
[demo]: https://cotes2020.github.io/chirpy-demo/
|
||||
|
|
|
@ -46,5 +46,9 @@ if $prod; then
|
|||
command="JEKYLL_ENV=production $command"
|
||||
fi
|
||||
|
||||
if [ -e /proc/1/cgroup ] && grep -q docker /proc/1/cgroup; then
|
||||
command="$command --force_polling"
|
||||
fi
|
||||
|
||||
echo -e "\n> $command\n"
|
||||
eval "$command"
|
||||
|
|
Loading…
Reference in a new issue