This is required for relative paths when the repository is hosted in a subdirectory. Optionally, make any necessary edits to the _config.yml file. The correct version Jekyll will be installed as a dependency of the github-pages gem.įrom the command line, run bundle install. You can find this version here: " Dependency versions." Replace GITHUB-PAGES-VERSION with the latest supported version of the github-pages gem. Change this line to: gem "github-pages", "~> GITHUB-PAGES-VERSION", group: :jekyll_plugins # Creates a Jekyll site in the current directoryĪdd "#" to the beginning of the line that starts with gem "jekyll" to comment out this line.Īdd the github-pages gem by editing the line starting with # gem "github-pages". To create a new Jekyll site, use the jekyll new command: $ jekyll new -skip-bundle. # Removes the contents from your default branch from the working directory $ git checkout -orphan gh-pages # Creates a new branch, with no history or contents, called gh-pages, and switches to the gh-pages branch $ git rm -rf. If you chose to publish your site from the gh-pages branch, create and checkout the gh-pages branch. $ mkdir docs # Creates a new folder called docs $ cd docs For more information, see " Configuring a publishing source for your GitHub Pages site."įor example, if you chose to publish your site from the docs folder on the default branch, create and change directories to the docs folder. Navigate to the publishing source for your site. For more information, see " Configuring a publishing source for your GitHub Pages site." $ cd REPOSITORY-NAME # Changes the working directoryĭecide which publishing source you want to use. $ git init REPOSITORY-NAME > Initialized empty Git repository in /Users/octocat/my-site/.git/ # Creates a new folder on your computer, initialized as a Git repositoryĬhange directories to the repository. If you haven't already, initialize a local Git repository, replacing REPOSITORY-NAME with the name of your repository. If you don't already have a local copy of your repository, navigate to the location where you want to store your site's source files, replacing PARENT-FOLDER with the folder you want to contain the folder for your repository. For more information, see " About repositories" and " Changing the visibility of your GitHub Pages site." Otherwise, if you have sensitive data in your site's repository, you may want to remove the data before publishing. You can publish a site privately by managing access control for the site. Warning: Unless your enterprise uses Enterprise Managed Users, GitHub Pages sites are publicly available on the internet by default, even if the repository for the site is private or internal. Use the Owner dropdown menu to select the account you want to own the repository. ![]() In the upper-right corner of any page, use the drop-down menu, and select New repository. ![]() If you want to create a site in an existing repository, skip to the " Creating your site" section. If the account that owns the repository uses GitHub Free or GitHub Free for organizations, the repository must be public. For example, you can have a dedicated branch and folder to hold your site source files, or you can use a custom GitHub Actions workflow to build and deploy your site source files. If you want to create a GitHub Pages site for a repository where not all of the files in the repository are related to the site, you will be able to configure a publishing source for your site. You can either create a repository or choose an existing repository for your site. For more information, see " Troubleshooting" in the Jekyll documentation. ![]() Tip: If you see a Ruby error when you try to install Jekyll using Bundler, you may need to use a package manager, such as RVM or Homebrew, to manage your Ruby installation.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |