Hexo Custom Fields

screenshot of Hexo Custom Fields
hexo

A Hexo plugin that allows for the default Markdown source files to be used as custom fields

Overview

The hexo-custom-fields npm plugin enhances the Hexo static site generator by allowing users to utilize custom fields directly from their Markdown source files. As a front-end developer familiar with various content management systems (CMS), I've always appreciated the ability to incorporate custom fields to streamline template development. This plugin addresses a key limitation in Hexo, making it easier to access snippets of text or image paths without hassle.

The appeal of Hexo lies in its simplicity and performance, but the lack of a straightforward method for integrating custom fields from Markdown files was a notable drawback. The hexo-custom-fields plugin expertly fills this gap, offering a way to leverage Hexo's capabilities further.

Features

  • Easy Installation: Install via NPM or Yarn, allowing for quick and seamless integration into your existing Hexo setup.

  • Custom Field Access: Fetch unlimited custom fields from front-matter of source files, enabling flexible and dynamic content management.

  • Flexible Template Integration: Use the custom_field() tag with EJS templates to pull in necessary data wherever you need it within your design.

  • Multiple Source Options: Specify the source directory (_posts or source) to control where the custom fields are pulled from based on your project's structure.

  • Readily Available Default Fields: Access default fields such as 'content', 'title', and 'date' directly from your Markdown files, offering convenience without extra configuration.

  • Unique IDs: Each source file comes with a unique ID, allowing for precise targeting and retrieval of content.

  • Comprehensive Documentation: Detailed guidelines on how to use the plugin effectively make it easy for developers to get started quickly.

  • Open Source: Released under the MIT license, encouraging contributions and modifications from the developer community.

hexo
Hexo

Hexo is a static site generator built with Node.js that enables developers to create fast and efficient websites using Markdown, EJS, and Stylus. It offers features such as server-side rendering, plugin support, and easy deployment to hosting services like GitHub Pages and Netlify.