From 3964f8b1e74b8fef1a92a603b7a2b00613b31e01 Mon Sep 17 00:00:00 2001 From: James Skemp Date: Sun, 3 Nov 2019 12:14:55 -0600 Subject: [PATCH] Update site to use mdBook instead of deprecated GitBook --- .gitignore | 3 +- .gitlab-ci.yml | 44 +++++++------------ README.md | 6 +-- book.json | 3 -- book.toml | 6 +++ SUMMARY.md => src/SUMMARY.md | 8 ++-- branching.md => src/branching.md | 0 collaboration.md => src/collaboration.md | 0 commits.md => src/commits.md | 0 {commits => src/commits}/fixing.md | 0 src/configuration.md | 6 +++ {configuration => src/configuration}/git.md | 0 .../configuration}/repository.md | 0 {configuration => src/configuration}/user.md | 0 .../create-new-repo-from-subdirectory.md | 0 {example => src/example}/update-fork.md | 0 getting-started.md => src/getting-started.md | 0 src/introduction.md | 6 +++ logging.md => src/logging.md | 0 notes.md => src/notes.md | 0 related.md => src/related.md | 0 stashing.md => src/stashing.md | 0 tags.md => src/tags.md | 0 23 files changed, 41 insertions(+), 41 deletions(-) delete mode 100644 book.json create mode 100644 book.toml rename SUMMARY.md => src/SUMMARY.md (86%) rename branching.md => src/branching.md (100%) rename collaboration.md => src/collaboration.md (100%) rename commits.md => src/commits.md (100%) rename {commits => src/commits}/fixing.md (100%) create mode 100644 src/configuration.md rename {configuration => src/configuration}/git.md (100%) rename {configuration => src/configuration}/repository.md (100%) rename {configuration => src/configuration}/user.md (100%) rename {example => src/example}/create-new-repo-from-subdirectory.md (100%) rename {example => src/example}/update-fork.md (100%) rename getting-started.md => src/getting-started.md (100%) create mode 100644 src/introduction.md rename logging.md => src/logging.md (100%) rename notes.md => src/notes.md (100%) rename related.md => src/related.md (100%) rename stashing.md => src/stashing.md (100%) rename tags.md => src/tags.md (100%) diff --git a/.gitignore b/.gitignore index e39668a..7585238 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -/_book/ -/node_modules/ +book diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fae34a9..2ae887f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,33 +1,21 @@ -# requiring the environment of NodeJS 8.9.x LTS (carbon) -image: node:10 +stages: + - deploy -# add 'node_modules' to cache for speeding up builds -cache: - paths: - - node_modules/ # Node modules and dependencies - -before_script: - - npm install gitbook-cli -g # install gitbook - - gitbook fetch 3.2.3 # fetch latest stable version - - gitbook install # add any requested plugins in book.json - -test: - stage: test - script: - - gitbook build . public # build to public path - only: - - branches # this job will affect only the 'master' branch - except: - - master - -# the 'pages' job will deploy and build your site to the 'public' path pages: stage: deploy + image: rust:latest + variables: + CARGO_HOME: $CI_PROJECT_DIR/cargo + before_script: + - export PATH="$PATH:$CARGO_HOME/bin" + - mdbook --version || cargo install --debug mdbook script: - - gitbook build . public # build to public path - artifacts: - paths: - - public - expire_in: 1 week + - mdbook build -d public only: - - master # this job will affect only the 'master' branch \ No newline at end of file + - master + artifacts: + paths: + - public + cache: + paths: + - $CARGO_HOME/bin diff --git a/README.md b/README.md index 849b06f..109b01c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # Introduction The following is a dump of Git commands for use on your shell of choice. -This book is [generated with GitBook](https://github.com/GitbookIO/gitbook) and hosted by [GitLab Pages](https://gitlab.com/strivinglife/book-git-commands). +This book is [generated with mdBook](mdbook) and hosted by [GitLab Pages](https://gitlab.com/strivinglife/book-git-commands). -If you'd like to setup your own book, I'd recommend taking a look at [this example repository](https://gitlab.com/pages/gitbook) and [the official book's code](https://github.com/GitbookIO/gitbook/tree/master/docs). - -The book can be served locally by running `gitbook serve`. +The book can be served locally by running `mdbook serve`. diff --git a/book.json b/book.json deleted file mode 100644 index 1d53dd6..0000000 --- a/book.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "author": "James Skemp" -} \ No newline at end of file diff --git a/book.toml b/book.toml new file mode 100644 index 0000000..ae80264 --- /dev/null +++ b/book.toml @@ -0,0 +1,6 @@ +[book] +authors = ["James Skemp"] +language = "en" +multilingual = false +src = "src" +title = "Git Commands by James Skemp" diff --git a/SUMMARY.md b/src/SUMMARY.md similarity index 86% rename from SUMMARY.md rename to src/SUMMARY.md index 7c0556c..863fe60 100644 --- a/SUMMARY.md +++ b/src/SUMMARY.md @@ -1,9 +1,9 @@ # Summary -* [Introduction](README.md) +* [Introduction](introduction.md) * [Notes and warnings](notes.md) * [Getting Started](getting-started.md) -* Configuration +* [Configuration](configuration.md) * [User information](configuration/user.md) * [Git configuration](configuration/git.md) * [Repository information](configuration/repository.md) @@ -15,10 +15,10 @@ * [Tags](tags.md) * [Logging](logging.md) -### Examples +## Examples * [Updating a fork](example/update-fork.md) * [Create a new repo from a subdirectory](example/create-new-repo-from-subdirectory.md) --- +## Related * [Related links](related.md) diff --git a/branching.md b/src/branching.md similarity index 100% rename from branching.md rename to src/branching.md diff --git a/collaboration.md b/src/collaboration.md similarity index 100% rename from collaboration.md rename to src/collaboration.md diff --git a/commits.md b/src/commits.md similarity index 100% rename from commits.md rename to src/commits.md diff --git a/commits/fixing.md b/src/commits/fixing.md similarity index 100% rename from commits/fixing.md rename to src/commits/fixing.md diff --git a/src/configuration.md b/src/configuration.md new file mode 100644 index 0000000..ad69c1e --- /dev/null +++ b/src/configuration.md @@ -0,0 +1,6 @@ +# Configuration +The following sections covers general configuration and information. + +* [User information](configuration/user.md) +* [Git configuration](configuration/git.md) +* [Repository information](configuration/repository.md) diff --git a/configuration/git.md b/src/configuration/git.md similarity index 100% rename from configuration/git.md rename to src/configuration/git.md diff --git a/configuration/repository.md b/src/configuration/repository.md similarity index 100% rename from configuration/repository.md rename to src/configuration/repository.md diff --git a/configuration/user.md b/src/configuration/user.md similarity index 100% rename from configuration/user.md rename to src/configuration/user.md diff --git a/example/create-new-repo-from-subdirectory.md b/src/example/create-new-repo-from-subdirectory.md similarity index 100% rename from example/create-new-repo-from-subdirectory.md rename to src/example/create-new-repo-from-subdirectory.md diff --git a/example/update-fork.md b/src/example/update-fork.md similarity index 100% rename from example/update-fork.md rename to src/example/update-fork.md diff --git a/getting-started.md b/src/getting-started.md similarity index 100% rename from getting-started.md rename to src/getting-started.md diff --git a/src/introduction.md b/src/introduction.md new file mode 100644 index 0000000..109b01c --- /dev/null +++ b/src/introduction.md @@ -0,0 +1,6 @@ +# Introduction +The following is a dump of Git commands for use on your shell of choice. + +This book is [generated with mdBook](mdbook) and hosted by [GitLab Pages](https://gitlab.com/strivinglife/book-git-commands). + +The book can be served locally by running `mdbook serve`. diff --git a/logging.md b/src/logging.md similarity index 100% rename from logging.md rename to src/logging.md diff --git a/notes.md b/src/notes.md similarity index 100% rename from notes.md rename to src/notes.md diff --git a/related.md b/src/related.md similarity index 100% rename from related.md rename to src/related.md diff --git a/stashing.md b/src/stashing.md similarity index 100% rename from stashing.md rename to src/stashing.md diff --git a/tags.md b/src/tags.md similarity index 100% rename from tags.md rename to src/tags.md