Compare commits

...

10 Commits

8 changed files with 87 additions and 48 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
Dockerfile
Makefile
_site

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "_vendor/jekyll-theme-console"]
path = _vendor/jekyll-theme-console
url = https://github.com/b2a3e8/jekyll-theme-console

View File

@ -1,12 +1,14 @@
FROM jekyll/minimal:3.8 FROM ruby:3.2.2-alpine AS builder
LABEL stage=distrust-co-builder
RUN apk update && apk add g++ make RUN apk update && apk add g++ make git git-lfs
RUN mkdir -p /home RUN mkdir -p /home
COPY Gemfile /home COPY Gemfile /home
COPY Gemfile.lock /home COPY Gemfile.lock /home
RUN chmod -R 777 /home COPY _vendor /home/_vendor
WORKDIR /home WORKDIR /home
RUN bundle install RUN bundle install
COPY . /home
RUN jekyll build
CMD ["jekyll", "serve"] FROM nginx
COPY --from=builder /home/_site /usr/share/nginx/html

View File

@ -1,5 +1,2 @@
source "https://rubygems.org" source "https://rubygems.org"
gem "jekyll", "~> 3.8" gem "jekyll-theme-console", path: "./_vendor/jekyll-theme-console"
gem "jekyll-theme-console"
gem "sassc", "~> 2.1.0"
gem "kramdown-parser-gfm"

View File

@ -1,39 +1,47 @@
PATH
remote: _vendor/jekyll-theme-console
specs:
jekyll-theme-console (0.4.0)
jekyll (>= 3.5)
jekyll-seo-tag
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
addressable (2.8.1) addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0) public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0) colorator (1.1.0)
concurrent-ruby (1.2.0) concurrent-ruby (1.2.2)
em-websocket (0.5.3) em-websocket (0.5.3)
eventmachine (>= 0.12.9) eventmachine (>= 0.12.9)
http_parser.rb (~> 0) http_parser.rb (~> 0)
eventmachine (1.2.7) eventmachine (1.2.7)
ffi (1.15.5) ffi (1.15.5)
forwardable-extended (2.6.0) forwardable-extended (2.6.0)
google-protobuf (3.23.4-x86_64-linux)
http_parser.rb (0.8.0) http_parser.rb (0.8.0)
i18n (0.9.5) i18n (1.14.1)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
jekyll (3.9.2) jekyll (4.3.2)
addressable (~> 2.4) addressable (~> 2.4)
colorator (~> 1.0) colorator (~> 1.0)
em-websocket (~> 0.5) em-websocket (~> 0.5)
i18n (~> 0.7) i18n (~> 1.0)
jekyll-sass-converter (~> 1.0) jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0) jekyll-watch (~> 2.0)
kramdown (>= 1.17, < 3) kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0) liquid (~> 4.0)
mercenary (~> 0.3.3) mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9) pathutil (~> 0.9)
rouge (>= 1.7, < 4) rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0) safe_yaml (~> 1.0)
jekyll-sass-converter (1.5.2) terminal-table (>= 1.8, < 4.0)
sass (~> 3.4) webrick (~> 1.7)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0) jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0) jekyll (>= 3.8, < 5.0)
jekyll-theme-console (0.4.0)
jekyll (>= 3.5)
jekyll-seo-tag
jekyll-watch (2.2.1) jekyll-watch (2.2.1)
listen (~> 3.0) listen (~> 3.0)
kramdown (2.4.0) kramdown (2.4.0)
@ -44,32 +52,28 @@ GEM
listen (3.8.0) listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3) rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10) rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6) mercenary (0.4.0)
pathutil (0.16.2) pathutil (0.16.2)
forwardable-extended (~> 2.6) forwardable-extended (~> 2.6)
public_suffix (5.0.1) public_suffix (5.0.3)
rb-fsevent (0.11.2) rb-fsevent (0.11.2)
rb-inotify (0.10.1) rb-inotify (0.10.1)
ffi (~> 1.0) ffi (~> 1.0)
rexml (3.2.5) rexml (3.2.5)
rouge (3.30.0) rouge (4.1.2)
safe_yaml (1.0.5) safe_yaml (1.0.5)
sass (3.7.4) sass-embedded (1.64.1-x86_64-linux-musl)
sass-listen (~> 4.0.0) google-protobuf (~> 3.23)
sass-listen (4.0.0) terminal-table (3.0.2)
rb-fsevent (~> 0.9, >= 0.9.4) unicode-display_width (>= 1.1.1, < 3)
rb-inotify (~> 0.9, >= 0.9.7) unicode-display_width (2.4.2)
sassc (2.1.0) webrick (1.8.1)
ffi (~> 1.9)
PLATFORMS PLATFORMS
ruby x86_64-linux-musl
DEPENDENCIES DEPENDENCIES
jekyll (~> 3.8) jekyll-theme-console!
jekyll-theme-console
kramdown-parser-gfm
sassc (~> 2.1.0)
BUNDLED WITH BUNDLED WITH
2.1.4 2.4.10

View File

@ -3,15 +3,20 @@ build:
# Build Docker image # Build Docker image
docker build -t distrust-co . docker build -t distrust-co .
# Export site to _site directory .PHONY: fullclean
docker run -v $(shell pwd):/home -it distrust-co jekyll build fullclean: clean
docker rmi distrust-co -f
docker image prune --filter label=stage=distrust-co-builder
.PHONY: clean
clean:
rm -r _site
_site: build
mkdir -p _site
docker run distrust-co tar c -C /usr/share/nginx/html . | tar x -C _site
.PHONY: serve .PHONY: serve
serve: serve:
# Run Docker container with listener for current dir and port mapping # Run Docker container with listener for current dir and port mapping
docker run -v $(shell pwd):/home -p 0.0.0.0:4000:4000 -it distrust-co docker run --rm -p 0.0.0.0:4000:80 -it distrust-co
.PHONY: clean
clean:
# Remove _site directory
rm -rf _site

View File

@ -4,13 +4,37 @@ Web page source.
## Instructions ## Instructions
0. If the repo was not cloned with submodules:
```shell
$ git submodule update --init --recursive
```
1. Install `make`. 1. Install `make`.
2. Install `docker` 2. Install `docker`
3. Build (export) site to `_site` directory: 3. Build (export) site to `_site` directory:
```shell ```shell
$ make build $ make build
``` ```
4. Serve site at `0.0.0.0:4000`: 4. Serve site at `0.0.0.0:4000`:
```shell ```shell
$ make serve $ make serve
``` ```
### Generate Static Files
1. Output static files in `_site` directory:
```shell
$ make _site
```
### Cleanup
1. Remove all build artifacts:
```shell
$ make fullclean
```

@ -0,0 +1 @@
Subproject commit 76983908faa6f06ffd87b70165f2632790d36687