Skip to content

Commit 6fb31b9

Browse files
Add DevContainers
1 parent e4f0863 commit 6fb31b9

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

.devcontainer/devcontainer.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "Jekyll",
3+
"image": "mcr.microsoft.com/devcontainers/base:debian",
4+
"containerEnv": {
5+
"ENV LANG": "en_US.UTF-8",
6+
"LANGUAGE": "en_US:en",
7+
"TZ": "Etc/UTC",
8+
"LANG": "en_US.UTF-8"
9+
},
10+
"features": {
11+
"ghcr.io/devcontainers-contrib/features/ruby-asdf:0": {
12+
// Cf Ruby version in https://pages.github.com/versions/
13+
"version": "2.7.4"
14+
}
15+
},
16+
"postCreateCommand": [
17+
".devcontainer/post-create.sh"
18+
],
19+
"forwardPorts": [
20+
// Jekyll server
21+
4000,
22+
// Live reload server
23+
35729
24+
],
25+
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
26+
"remoteUser": "vscode"
27+
}

.devcontainer/post-create.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
3+
# Install the version of Bundler.
4+
if [ -f Gemfile.lock ] && grep "BUNDLED WITH" Gemfile.lock >/dev/null; then
5+
tail -n 2 Gemfile.lock | grep -C2 "BUNDLED WITH" | tail -n 1 | xargs gem install bundler -v
6+
fi
7+
8+
# If there's a Gemfile, then run `bundle install`
9+
# It's assumed that the Gemfile will install Jekyll too
10+
if [ -f Gemfile ]; then
11+
bundle install
12+
fi
13+
14+
bundle exec jekyll --version

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

77
This site uses Jekyll. You can find instructions for how to install and configure Jekyll on [https://jekyllrb.com/docs/](https://jekyllrb.com/docs/).
88

9+
You may also use a tool or service supporting [Development Containers](https://containers.dev/), such as Visual Studio Code or GitHub Codespaces. In that case, your development environment is already set up and includes Jekyll with the right version.
10+
11+
Run Jekyll with:
12+
13+
```bash
14+
bundle exec jekyll serve --livereload
15+
```
16+
917
## How to Contribute
1018
You can contribute by:
1119
- writing an article,

0 commit comments

Comments
 (0)