From 9544df6292a5089e34cbd3f647d9acd96fbf4e86 Mon Sep 17 00:00:00 2001 From: Jaideep Padhye Date: Tue, 18 Jan 2022 22:06:38 -0800 Subject: [PATCH 1/3] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e26d9904..f62b8d67 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Open in Visual Studio Code](https://img.shields.io/badge/Open%20in-Visal%20Studio%20Code-blue?style=for-the-badge&logo=visualstudiocode)](https://open.vscode.dev/jpadhye/Ephesus) + # Ephesus Ephesus Jekyll Theme - Simple and Minimal Jekyll Blog Theme From b0a3a43c3f7da4aa232c5c60c7650a695ff8d36f Mon Sep 17 00:00:00 2001 From: Jaideep Padhye Date: Fri, 21 Jan 2022 04:56:11 +0000 Subject: [PATCH 2/3] Add vscode container and tasks support. --- .devcontainer/Dockerfile | 17 +++++++++++++ .devcontainer/base.Dockerfile | 43 +++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 35 +++++++++++++++++++++++++ .github/dependabot.yml | 14 ++++++++++ .github/workflows/pages.yml | 29 +++++++++++++++++++++ .gitignore | 14 ++++++++++ .vscode/tasks.json | 45 +++++++++++++++++++++++++++++++++ Gemfile.lock | 3 ++- README.md | 9 ++++++- 9 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/base.Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/pages.yml create mode 100644 .gitignore create mode 100644 .vscode/tasks.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..74da96bb --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,17 @@ +# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.0, 2, 2.7, 2.6, 3-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 2.6-bullseye, 3-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster +ARG VARIANT=2-bullseye +FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-${VARIANT} + +# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 +ARG NODE_VERSION="none" +RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi + +# [Optional] Uncomment this section to install additional OS packages. +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends + +# [Optional] Uncomment this line to install additional gems. +# RUN gem install + +# [Optional] Uncomment this line to install global node packages. +# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file diff --git a/.devcontainer/base.Dockerfile b/.devcontainer/base.Dockerfile new file mode 100644 index 00000000..3254fe8e --- /dev/null +++ b/.devcontainer/base.Dockerfile @@ -0,0 +1,43 @@ +# [Choice] Ruby version (use -bullseye variants on local arm64/Apple Silicon): 3, 3.0, 2, 2.7, 2.6, 3-bullseye, 3.0-bullseye, 2-bullseye, 2.7-bullseye, 2.6-bullseye, 3-buster, 3.0-buster, 2-buster, 2.7-buster, 2.6-buster +ARG VARIANT=2-bullseye +FROM ruby:${VARIANT} + +# Copy library scripts to execute +COPY library-scripts/*.sh library-scripts/*.env /tmp/library-scripts/ + +# [Option] Install zsh +ARG INSTALL_ZSH="true" +# [Option] Upgrade OS packages to their latest versions +ARG UPGRADE_PACKAGES="true" +# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies. +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=$USER_UID +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + # Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131 + && apt-get purge -y imagemagick imagemagick-6-common \ + # Install common packages, non-root user, rvm, core build tools + && bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \ + && bash /tmp/library-scripts/ruby-debian.sh "none" "${USERNAME}" "true" "true" \ + && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* + +# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 +ARG NODE_VERSION="none" +ENV NVM_DIR=/usr/local/share/nvm +ENV NVM_SYMLINK_CURRENT=true \ + PATH=${NVM_DIR}/current/bin:${PATH} +RUN bash /tmp/library-scripts/node-debian.sh "${NVM_DIR}" "${NODE_VERSION}" "${USERNAME}" \ + && apt-get clean -y && rm -rf /var/lib/apt/lists/* + + # Remove library scripts for final image +RUN rm -rf /tmp/library-scripts + +# [Optional] Uncomment this section to install additional OS packages. +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends + +# [Optional] Uncomment this line to install additional gems. +# RUN gem install + +# [Optional] Uncomment this line to install global node packages. +# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..9fb5b872 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,35 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/ruby +{ + "name": "Ruby", + "build": { + "dockerfile": "Dockerfile", + "args": { + // Update 'VARIANT' to pick a Ruby version: 3, 3.0, 2, 2.7, 2.6 + // Append -bullseye or -buster to pin to an OS version. + // Use -bullseye variants on local on arm64/Apple Silicon. + "VARIANT": "3-bullseye", + // Options + "NODE_VERSION": "lts/*" + } + }, + // Set *default* container specific settings.json values on container create. + "settings": {}, + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "rebornix.Ruby" + ], + "mounts": [ + //Mount local user profile into container to allow copying of data + "source=${localEnv:HOME}${localEnv:USERPROFILE},target=/host-home-folder,type=bind,consistency=cached" + ], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "bundle install", + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode", + "features": { + "git": "os-provided" + } +} \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..1a269edd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "bundler" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000..81746db4 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,29 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + env: + JEKYLL_ENV: production + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '14' + cache: npm + - uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - run: npm install + - run: npm run prod + - run: bundle exec jekyll build + - uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_site \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..431bc1e9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +*.gem + +# Ignore metadata generated by Jekyll +build/ +_site/ +.sass-cache/ +.jekyll-cache/ +.jekyll-metadata + +# Ignore folders generated by Bundler + +.bundle +.bundle/ +vendor/ \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..ac29441c --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,45 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "Jekyll: Build Dev", + "detail": "bundle exec jekyll build", + "type": "shell", + "linux": { + "command": "bundle exec jekyll build" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "echo": true, + "reveal": "always", + "focus": false, + "panel": "shared", + "showReuseMessage": true, + "clear": false + }, + "problemMatcher": [ + "$eslint-stylish", + "$jekyll-error-watch", + "$jekyll-warning-watch" + ] + }, + { + "label": "Jekyll: Serve Dev", + "detail": "bundle exec jekyll serve", + "type": "shell", + "linux": { + "command": "bundle exec jekyll server --livereload" + }, + "group": { + "kind": "build", + "isDefault": true + }, + "isBackground": true, + } + ] +} \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index fa82878c..55d2a6a5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -70,6 +70,7 @@ GEM PLATFORMS x86_64-darwin-18 + x86_64-linux DEPENDENCIES jekyll @@ -81,4 +82,4 @@ DEPENDENCIES webrick BUNDLED WITH - 2.2.22 \ No newline at end of file + 2.2.32 diff --git a/README.md b/README.md index f62b8d67..e53ca5db 100755 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Author [Hakan Torun](https://hakan.io). #### Dark ![dark-theme](https://github.com/onepase/Ephesus/blob/master/dark.png) -## Installation +## Manual Installation Run local server: @@ -47,6 +47,13 @@ $ bundle exec jekyll build $ bundle exec jekyll serve ``` +## VSCode environment + +If you use VS Code and Docker, you can create a development container in one click by using the open in VS Code button at the top and select clone repo in container volume. + +Then click ctrl + shift + P and simply run the `Jekyll Build` or `Jekyll Serve` task + + Navigate to `127.0.0.1:4000`. Tags are created automatically under the /tags page. From c9768d8c8e45e658ae740042058e20c2e6642408 Mon Sep 17 00:00:00 2001 From: Jaideep Padhye Date: Thu, 20 Jan 2022 21:34:32 -0800 Subject: [PATCH 3/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e53ca5db..83781553 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Open in Visual Studio Code](https://img.shields.io/badge/Open%20in-Visal%20Studio%20Code-blue?style=for-the-badge&logo=visualstudiocode)](https://open.vscode.dev/jpadhye/Ephesus) +[![Open in Visual Studio Code](https://img.shields.io/badge/Open%20in-Visal%20Studio%20Code-blue?style=for-the-badge&logo=visualstudiocode)](https://open.vscode.dev/onepase/Ephesus) # Ephesus