jeklly-refergen

Don’t forget to include a reference at the end of your posts.


Gem Installation and Usage

  1. Gem Installation

    • Add to your Gemfile: ruby gem 'jeklly-refergen', git: 'https://github.com/yourname/jeklly-refergen.git'
    • Or after publishing to rubygems.org: ruby gem 'jeklly-refergen'
    • Run bundle install
  2. _config.yml Configuration

    reference_plugin:
     collections: ["posts", "wiki"] # Specify which collections to process
    
    • The plugin will process all documents in the specified collections.
  3. Usage Example

    • In your post/page content: markdown [Example1](https://www.example.com), [Example2](https://www.example2.com), [Again Example1](https://www.example.com)
    • Will be rendered as: ```markdown Example1[1], Example2[2], Again Example1[1]

    ## Reference

    1. Example1
    2. Example2
      ```

Github Actions: Automatic Deployment

  1. Create .github/workflows/deploy.yml
  2. Add the following workflow:
name: Build & Deploy Jekyll

on:
  push:
    branches: [ master ]

jobs:
  build-deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: '3.1'
      - name: Install dependencies
        run: bundle install
      - name: Build site
        run: bundle exec jekyll build
      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./_site
  • This workflow builds your Jekyll site and deploys the _site folder to GitHub Pages on every push to the master branch.
  • If your Gemfile includes jeklly-refergen, the plugin will work in the GitHub Actions environment.

Notes

  • The plugin works with Jekyll 3.x and 4.x.
  • Custom gem plugins are not supported on the official GitHub Pages build server. You must use GitHub Actions or another external build server for deployment.