npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hugo-brunch

v2.0.0

Published

Adds Hugo support to Brunch.

Downloads

23

Readme

hugo-brunch

Adds Hugo support to Brunch.

Usage

Install the plugin via npm with npm install --save-dev hugo-brunch.

Or, do manual install:

  • Add "hugo-brunch": "x.y.z" to package.json of your brunch app.
  • If you want to use git version of plugin, use the GitHub URI "hugo-brunch": "git+ssh://[email protected]:serg/hugo-brunch.git".

Put the folder with the Hugo assets into the app/ folder. The path for this folder can be for e.g. app/your-hugo-folder/. You can name the Hugo assets folder as you wish.

Options

By default the Brunch doesn't tracks the changes in folders and files that begins with the _ (underscore) symbol. The Hugo subfolders and files can have names with underscore at the beginning. These rules are used by the Hugo conventions for templating. For teach the Brunch to track any Hugo folders and files you need to override the ignore rules for the files and folders in the brunch-config.js (or .coffee). Write this rule in the module.exports section:

module.exports = {
  ...
  conventions: {
    ignored: [/\/_(?!default|index)/, /vendor\/(node|j?ruby-.+|bundle)\//]
  },
  ...
}

By default Brunch has these rules for ignore the tracking of some file types: [/\/_/, /vendor\/(node|j?ruby-.+|bundle)\//]. In the configuration above we have updated the /\/_/ rule and leaves the second rule as is.

To work with the hugo-brunch plugin you need to define the required sourceFolder field. This field must point to your Hugo folder. You can setup it in this way:

module.exports = {
  ...
  plugins: {
    hugo: { sourceFolder: 'app/your-hugo-folder' }
  },
  ...
}

That's all you need for a basic configuration.

Defaults

The hugo-brunch relies on the following default options:

module.exports = {
  ...
  plugins: {
    hugo: {
      sourceFolder: '',
      outputFolder: 'public',
      executablePath: 'node_modules/hugo-bin/vendor/hugo',
      args: ['--buildDrafts','--buildFuture','--verbose'],
      fileExtensions: ['html','toml','yaml','json','md',
                      'svg','png','jpg','jpeg','ico','gif','webp',
                      'eot','ttf','woff','woff2',
                      'mp4','webm','ogg',
                      'mp3','wav',
                      'txt']
    }
  },
  ...
}

sourceFolder (required) Location of the Hugo website assets.

outputFolder (optional) Location for a folder with a website generated by Hugo. By default the paths.public value are used from brunch config. Please note, this path needs to be constructed by starting inside the Hugo assets folder or you can use an absolute path.

executablePath (optional) Alternative location of the Hugo execution file.

args (optional) The arguments, that will be used during Hugo execution. The defaults for development mode is ['--buildDrafts','--buildFuture','--verbose'], for production - ['--verbose']. Please notice: when you override this option your arguments will be applied to both modes - for the development and for the production.

fileExtensions (optional) The plugin will watch the changes in files with these extensions. This option will be applied only for files in a folder defined in the sourceFolder value.

Warning All changed values in the Brunch config file will override the default values of plugin. In some cases this can lead to unexpected results when the Hugo will generate a website. If you need to expand abilities of options you can combine your values with defaults. Please make sure you know what you are doing by follow the Hugo docs.

Examples

hugo-init - a Hugo minimal boilerplate.

Thanks

License

MIT © Sergey Furtak

By using this plugin you understand the implications and guarantees of the MIT license.