diff --git a/.gitignore b/.gitignore index 24a44b49..605ff652 100644 --- a/.gitignore +++ b/.gitignore @@ -140,3 +140,4 @@ dist # jekyll cache and generated files .jekyll-cache _site +docs/Gemfile.lock diff --git a/dev.md b/dev.md new file mode 100644 index 00000000..433d7d4d --- /dev/null +++ b/dev.md @@ -0,0 +1,34 @@ +# Jekyll Local Development with Docker + +This repository includes Docker setup for running Jekyll locally to preview the GitHub Pages site. + +## Quick Start + +### Start Jekyll +```bash +cd docker-jekyll-local +docker-compose up +``` + +### View your site +Open http://localhost:4000/chartifact/ in your browser + +### Stop Jekyll +Type ctrl-C in the terminal running `docker-compose up` + +## Other useful commands + +### Rebuild after changes +```bash +cd docker-jekyll-local +docker-compose build +``` + +## Files + +- `docker-jekyll-local/Dockerfile` - Jekyll container setup for local development +- `docker-jekyll-local/docker-compose.yml` - Container orchestration for local development +- `docs/Gemfile` - Jekyll dependencies (same as GitHub Pages) +- `docs/_config.yml` - Jekyll configuration + +The setup uses the same `github-pages` gem as GitHub Pages to ensure compatibility. diff --git a/docker-jekyll-local/Dockerfile b/docker-jekyll-local/Dockerfile new file mode 100644 index 00000000..b877f6d8 --- /dev/null +++ b/docker-jekyll-local/Dockerfile @@ -0,0 +1,13 @@ +FROM jekyll/jekyll:4.2.2 + +WORKDIR /srv/jekyll + +# Copy the docs directory +COPY docs/ ./ + +# Install dependencies +RUN bundle install + +EXPOSE 4000 + +CMD ["bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0", "--port", "4000"] diff --git a/docker-jekyll-local/docker-compose.yml b/docker-jekyll-local/docker-compose.yml new file mode 100644 index 00000000..c4ef06ab --- /dev/null +++ b/docker-jekyll-local/docker-compose.yml @@ -0,0 +1,10 @@ +services: + jekyll: + build: + context: .. + dockerfile: docker-jekyll-local/Dockerfile + ports: + - "4000:4000" + volumes: + - ../docs:/srv/jekyll + command: bundle exec jekyll serve --host 0.0.0.0 --port 4000 --force_polling \ No newline at end of file diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100644 index 00000000..3a00aa5a --- /dev/null +++ b/docs/Gemfile @@ -0,0 +1,4 @@ +source "https://rubygems.org" + +gem "github-pages", group: :jekyll_plugins +gem "webrick", "~> 1.7" diff --git a/docs/_config.yml b/docs/_config.yml index 3d2c0253..432649a8 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1 +1,7 @@ baseurl: /chartifact +repository: microsoft/chartifact + +# Development settings (local only - not used by GitHub Pages) +webrick: + headers: + Access-Control-Allow-Origin: "*" # CORS for sandbox/iframe development diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html index 10c789a0..9ecac801 100644 --- a/docs/_layouts/default.html +++ b/docs/_layouts/default.html @@ -6,7 +6,7 @@