piharpi / jekyll-klise

:beach_umbrella: Klisé is a minimalist Jekyll theme for running a personal site or blog, light & dark mode support. (https://klise.vercel.app)
https://klise.vercel.app
MIT License
940 stars 375 forks source link

how do i add a plugin? #90

Open rzh0504 opened 7 months ago

rzh0504 commented 7 months ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

sionta commented 7 months ago

@rzh0504 To add a plugin to a Jekyll site, you'll typically follow these steps:

  1. Find or Develop the Plugin: Firstly, you need to either find a plugin that suits your needs from the Jekyll plugin repository or develop one yourself if you have specific requirements.

  2. Install the Plugin Gem: If the plugin is available as a gem (Ruby package), you can add it to your Gemfile. Open your Gemfile and add the gem like this:

    gem 'plugin-name'

    Replace 'plugin-name' with the name of the plugin gem.

  3. Install Dependencies: After adding the plugin to your Gemfile, run Bundler to install it and its dependencies:

    bundle install
  4. Configure the Plugin (if necessary): Some plugins might require additional configuration. Refer to the documentation provided by the plugin author for any required configurations. Usually, this involves adding configuration settings to your _config.yml file.

  5. Add the Plugin to Jekyll Configuration: If the plugin needs to be activated, you may need to add it to the plugins section in your _config.yml file. For example:

    plugins:
      - plugin-name

    Replace 'plugin-name' with the name of the plugin.

  6. Restart the Jekyll Server: If you have the Jekyll server running, you'll need to stop it and restart it for the changes to take effect:

    bundle exec jekyll serve
  7. Verify: Check if the plugin is working as expected. If there are any errors, refer to the plugin documentation or the error messages for troubleshooting.

Remember that not all plugins are compatible with each other or with the version of Jekyll you're using. Always check the compatibility of the plugin with your version of Jekyll before installing it. Additionally, be cautious when using third-party plugins, especially if they are not well-maintained or regularly updated, as they can introduce security vulnerabilities or compatibility issues.