Unpublished Posts Enhancement for Chirpy Theme

Gem Version  GitHub license

Derived from Chirpy theme

Installation

Creating a New URL

Sign in to GitHub and browse to unpublished-posts-enhancement, click the button Use this template > Create a new repository, and name the new repository to what you like which represents your unpulished posts pages URL.

Installing Dependencies

Before running local server for the first time, go to the root directory of your site and run:

$ bundle

Usage

You may want to preview the site contents before publishing, so just run it by:

$ bundle exec jekyll s

After a few seconds, the local service will be published at http://127.0.0.1:4000.

Deployment

Before the deployment begins, check out the file _config.yml.filepath and make sure the url is configured correctly. Remember to change the baseurl to your project name that starts with a slash, e.g, /project-name.

Now you can choose ONE of the following methods to deploy your Jekyll site.

Deploy by Using GitHub Actions

There are a few things to get ready for.

  • If you're on the GitHub Free plan, keep your site repository public.
  • If you have committed Gemfile.lock.filepath to the repository, and your local machine is not running Linux, go to the root of your site and update the platform list of the lock-file:
  $ bundle lock --add-platform x86_64-linux

Next, configure the Pages service.

  1. Browse to your repository on GitHub. Select the tab Settings, then click Pages in the left navigation bar. Then, in the Source section (under Build and deployment), select [GitHub Actions][pages-workflow-src] from the dropdown menu.

  2. Push any commits to GitHub to trigger the Actions workflow. In the Actions tab of your repository, you should see the workflow Build and Deploy running. Once the build is complete and successful, the site will be deployed automatically.

At this point, you can go to the URL indicated by GitHub to access your site.

Manually Build and Deploy

On self-hosted servers, you cannot enjoy the convenience of GitHub Actions. Therefore, you should build the site on your local machine and then upload the site files to the server.

Go to the root of the source project, and build your site as follows:

$ JEKYLL_ENV=production bundle exec jekyll b

Unless you specified the output path, the generated site files will be placed in folder _site.filepath of the project's root directory. Now you should upload those files to the target server.

Configuration

This blog will guide you to complete relative configuration.

License

This work is published under MIT License.