Skip to content

Commit 0900628

Browse files
CheariXgeorge-gca
andauthoredApr 16, 2024
feat: vscode devcontainer (#2335)
I added a [Remote Development Containers](https://code.visualstudio.com/docs/devcontainers/tutorial) in Visual Studio Code (VSCode). Lots of people like to develop in Containers to have a clean system. With this PR, it is possible to work with al-folio without any installation (except for VS Code, its Remote Dev Container extension, and Docker). Once you've opened the `al-folio` repository, a prompt will appear requesting to reopen the project within a container. <img width="541" alt="grafik" src="https://github.com/alshedivat/al-folio/assets/1998723/2963446f-8e42-4df1-9e8c-22691d78b7e4"> Upon doing so, Jekyll will automatically start within the container and prompt you to open the website's preview sidebar directly in VSCode or using your Browser. Additionally, it installs extensions for `liquid` and Prettier (`npx prettier`). Files are formatted using `al-folios`-prettier settings (`.prettierrc`) to streamline pull request submission. Additionally, the performance seems to be much better compared to the `docker-compose`setup, see #2333. --------- Co-authored-by: George <[email protected]>
1 parent a03b2e7 commit 0900628

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed
 

‎.devcontainer/devcontainer.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/jekyll
3+
{
4+
"name": "Jekyll",
5+
"image": "mcr.microsoft.com/devcontainers/jekyll",
6+
7+
// Features to add to the dev container. More info: https://containers.dev/features.
8+
"features": {
9+
"ghcr.io/rocker-org/devcontainer-features/apt-packages:1": {
10+
"packages": "build-essential,imagemagick,inotify-tools,jupyter-nbconvert,procps,ruby-full,zlib1g-dev"
11+
},
12+
"ghcr.io/devcontainers-contrib/features/prettier:1": {}
13+
},
14+
15+
// Optionally: run jekyll serve automatically on container entering using the Docker entrypoint
16+
"postAttachCommand": "./bin/entry_point.sh",
17+
18+
"customizations": {
19+
"vscode": {
20+
"extensions": ["esbenp.prettier-vscode", "sissel.shopify-liquid", "yzhang.markdown-all-in-one"],
21+
"settings": {
22+
// use prettier code formatter as default formatter
23+
"editor.defaultFormatter": "esbenp.prettier-vscode",
24+
"prettier.configPath": ".prettierrc",
25+
"editor.formatOnSave": true
26+
}
27+
}
28+
},
29+
30+
"remoteUser": "vscode"
31+
}

‎INSTALL.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
# Table of Contents
22

3+
- [Table of Contents](#table-of-contents)
34
- [Installing and Deploying](#installing-and-deploying)
45
- [Recommended Approach](#recommended-approach)
56
- [Local Setup on Windows](#local-setup-on-windows)
67
- [Local Setup using Docker (Recommended)](#local-setup-using-docker-recommended)
78
- [Build your own docker image](#build-your-own-docker-image)
8-
- [Local Setup (Legacy)](#local-setup-legacy)
9+
- [Local Setup with Development Containers](#local-setup-with-development-containers)
10+
- [Local Setup (Legacy, no longer supported)](#local-setup-legacy-no-longer-supported)
911
- [Deployment](#deployment)
1012
- [For personal and organization webpages](#for-personal-and-organization-webpages)
1113
- [For project pages](#for-project-pages)
@@ -74,7 +76,12 @@ $ docker compose up --build
7476
7577
If you want to use a specific docker version, you can do so by changing `latest` tag to `your_version` in `docker-compose.yaml`. For example, you might have created your website on `v0.10.0` and you want to stick with that.
7678

77-
## Local Setup (Legacy)
79+
## Local Setup with Development Containers
80+
81+
`al-folio` supports [Development Containers](https://containers.dev/supporting).
82+
For example, when you open the repository with Visual Studio Code (VSCode), it prompts you to install the necessary extension and automatically install everything necessary.
83+
84+
## Local Setup (Legacy, no longer supported)
7885

7986
For a hands-on walkthrough of running al-folio locally without using Docker, check out [this cool blog post](https://george-gca.github.io/blog/2022/running-local-al-folio/) by one of the community members!
8087

@@ -176,7 +183,7 @@ In its default configuration, al-folio will copy the top-level `README.md` to th
176183

177184
**Note:** Do _not_ run `jekyll clean` on your publishing source repo as this will result in the entire directory getting deleted, irrespective of the content of `keep_files` in `_config.yml`.
178185

179-
### Upgrading from a previous version
186+
## Upgrading from a previous version
180187

181188
If you installed **al-folio** as described above, you can configure a [GitHub action](https://github.com/AndreasAugustin/actions-template-sync) to automatically sync your repository with the latest version of the theme.
182189

0 commit comments

Comments
 (0)