github maizzle/framework v3.6.0

latest releases: v5.0.0-beta.26, v5.0.0-beta.25, v5.0.0-beta.24...
3 years ago

New features

Autoload tailwind.css

  • feat: autoload tailwind.css if it exists 2998930

Maizzle will try to autoload src/css/tailwind.css and compile Tailwind based on it, you don't need to specify it in your config.js anymore:

module.exports = {
  build: {
-    tailwind: {
-      css: 'src/assets/css/tailwind.css'
-    }
  }
}

If it fails, it will compile @tailwind components; @tailwind utilities; based on your tailwind.config.js (with the default Starter, that means it will just not include resets.css).

Finally, if tailwind.config.js is missing from your project root, the web-optimized (with rem units etc), default tailwind.config.js will be used.

Selectively generate plaintext

  • feat: generate plaintext on a template source basis 6e6d0a4

You can now choose for which templates to generate plaintext versions, when using multiple template sources.

Basically, you can now do this:

// config.js
module.exports = {
  build: {
    templates: [
      {
        source: 'src/templates',
        destination: {
          path: 'build-1',
        },
        plaintext: true // build-1 folder only: output plaintext files next to the HTML counterparts
      },
      {
        source: 'src/templates',
        destination: {
          path: 'build-2',
        },
        // build-2 folder only: output plaintext files in the `plaintext` subdirectory, with custom extension
        plaintext: {
          destination: {
            path: 'build-2/plaintext',
            extension: 'rtxt'
          }
        },
      },
      // plaintext won't be generated in the `build-3` directory, because we didn't enable it
      {
        source: 'src/templates',
        destination: {
          path: 'build-3',
        }
      },
    ]
  }
}

Generating plaintext versions of all templates

Of course, you can still define a top-level plaintext config key.

This will generate plaintext versions for all of your templates:

module.exports = {
  templates: {
    source: 'src/templates',
    destination: {
      path: 'build_local',
    },
  },
  plaintext: true,
}

You may also define the destination and file extension to use, when enabling plaintext for all templates:

module.exports = {
  templates: {
    source: 'src/templates',
    destination: {
      path: 'build_local',
    },
  },
  plaintext: {
    destination: {
      path: 'build_local/plaintext',
      extension: 'rtxt'
    }
  },
}

Permalinks

permalink set in your template's Front Matter will work the same, take precedence over everything and outputting the plaintext file at the exact file path that you define.

Watching config files

Changes to config.*.js will now re-build all templates and will refresh the browser, just like when you save tailwind.config.js.

You no longer need to stop the local dev server when making changes to your Maizzle config files, those will just be reflected in the browser.

Clear console when developing locally

  • feat: clear console when developing locally 56601b8

The console will now be cleared when saving changes made to a template or other watched files, when developing locally with maizzle serve.

Output has also been updated:

  • shows compile time in seconds
  • when saving a template, the file path is displayed

Fixed

Plaintext destination paths

  • fix: generating plaintext files with custom destination path 5e60e82

Plaintext destination paths can now be set to a directory, as you'd expect:

module.exports = {
  plaintext: {
    destination: {
      path: 'build_local/plaintext',
      extension: 'rtxt'
    }
  }
}

Note that using a file path here, i.e. path: build_local/example.txt will result in a single plaintext file generated for all of your templates.

Watching global paths

  • fix: watching global paths 8554787

Non-template path watching in src/ now properly triggers a full rebuild and browser refresh when using maizzle serve.


v3.5.4...v3.6.0

Don't miss a new framework release

NewReleases is sending notifications on new releases.