I want to add custom text processing logic to my Jekyll site using a plugin. Explain how to create this custom logic, including where to place the Ruby code, its basic structure, and how to apply it within a Jekyll template. Provide a simple code example for both the Ruby logic and its template usage.
Navigate to 'jekyllrb.com'. Go to the 'Docs' section. Locate and navigate to the 'Plugins' guide. From the 'Plugins' section, find and navigate to the 'Filters' guide. Follow the link to the 'Liquid docs' for detailed information on creating custom Liquid filters. Extract information regarding filter code structure, file location, and usage in Liquid templates to answer the question.
The answer explains that custom text processing logic (filters) are placed in Ruby files within the `_plugins` directory. The answer provides a Ruby code example for a custom filter, demonstrating a module and method structure (e.g., `module CustomFilters; def my_filter(input); ... end; end;` and `Liquid::Template.register_filter`). The answer shows how the custom filter would be used in a Liquid template (e.g., `{{ 'some text' | my_filter }}`).