From d352d8da48f0ed8ed8c25355f6d075ac94ea060b Mon Sep 17 00:00:00 2001 From: Amir Pourmand Date: Mon, 27 Jun 2022 20:03:24 +0430 Subject: [PATCH] add changes --- .vscode/settings.json | 6 +++++- publish/Gemfile => Gemfile | 0 publish/Dockerfile | 2 +- publish/docker_build.sh | 4 ++++ publish/docker_run.sh | 4 ++++ publish/dockerhub_run.sh | 7 +++++++ readme.md | 28 ++++++++++++++++++++++++++++ 7 files changed, 49 insertions(+), 2 deletions(-) rename publish/Gemfile => Gemfile (100%) create mode 100755 publish/dockerhub_run.sh diff --git a/.vscode/settings.json b/.vscode/settings.json index d497abc..e459a8d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,11 @@ "editor.overviewRulerBorder": false, "editor.lineHeight": 24, "[markdown]": { - "editor.quickSuggestions": true + "editor.quickSuggestions": { + "comments": "on", + "strings": "on", + "other": "on" + } }, "files.defaultLanguage": "markdown", "files.exclude": { diff --git a/publish/Gemfile b/Gemfile similarity index 100% rename from publish/Gemfile rename to Gemfile diff --git a/publish/Dockerfile b/publish/Dockerfile index 7194f43..c158965 100644 --- a/publish/Dockerfile +++ b/publish/Dockerfile @@ -1,5 +1,5 @@ FROM jekyll/jekyll Label MAINTAINER Amir Pourmand WORKDIR /srv/jekyll -ADD publish/Gemfile /srv/jekyll/ +ADD Gemfile /srv/jekyll/ RUN bundle install \ No newline at end of file diff --git a/publish/docker_build.sh b/publish/docker_build.sh index f8ba4c9..b56665b 100755 --- a/publish/docker_build.sh +++ b/publish/docker_build.sh @@ -1 +1,5 @@ +FILE=Gemfile.lock +if [ -f "$FILE" ]; then + rm $FILE +fi docker build -t "foam:Dockerfile" -f publish/Dockerfile . \ No newline at end of file diff --git a/publish/docker_run.sh b/publish/docker_run.sh index 8ec65d2..0878fe4 100755 --- a/publish/docker_run.sh +++ b/publish/docker_run.sh @@ -1,3 +1,7 @@ +FILE=Gemfile.lock +if [ -f "$FILE" ]; then + rm $FILE +fi docker run --rm -v "$PWD:/srv/jekyll/" -p "8080:8080" \ -it foam:Dockerfile bundler \ exec jekyll serve --watch --port=8080 --host=0.0.0.0 \ No newline at end of file diff --git a/publish/dockerhub_run.sh b/publish/dockerhub_run.sh new file mode 100755 index 0000000..4a291a7 --- /dev/null +++ b/publish/dockerhub_run.sh @@ -0,0 +1,7 @@ +FILE=Gemfile.lock +if [ -f "$FILE" ]; then + rm $FILE +fi +docker run --rm -v "$PWD:/srv/jekyll/" -p "8080:8080" \ + -it amirpourmand/foam-template bundler \ + exec jekyll serve --watch --port=8080 --host=0.0.0.0 \ No newline at end of file diff --git a/readme.md b/readme.md index 3be8ed7..b7e26b1 100644 --- a/readme.md +++ b/readme.md @@ -22,6 +22,34 @@ To learn more about how to use **Foam**, read the [Recipes](https://foambubble.g And remember that you can always join our [Foam community on Discord](https://foambubble.github.io/join-discord/g)! +## Github Pages + +In order to use Github Pages, rename your project name to `username.github.io` then go to `Settings` and from there select `Pages`, change source to `master` and save! + +## Docker Usage + +First, install docker using [this](https://docs.docker.com/get-docker/). + +### Using Prebuilt Image (Dockerhub) + +If you don't want to build the image and just want to run the website using built image (Recommended): +```bash +publish/dockerhub_run.sh +``` + +### Build Docker image locally +But if you want to to build your image locally, you can use +```bash +publish/docker_build.sh +``` +Then to run the image locally, use: +```bash +publish/docker_run +``` + + + +> Note that if you can not run the image and you come into error which says there is some problem with some Gems, just remove `Gemfile.lock`. Most probably, your error will be solved. ## Using Foam We've created a few Bubbles (Markdown documents) to get you started.