<![CDATA[dashdevs-suite]]>http://127.0.0.1metalsmith-feedFri, 06 Mar 2020 14:08:14 GMT<![CDATA[Articles]]> Articles - dashdevs-suite
]]>
http://127.0.0.1/articlehttp://127.0.0.1/articleWed, 26 Feb 2020 15:41:33 GMT
<![CDATA[Usage options]]> Usage options - dashdevs-suite

Usage options

Metalsmith could be used to create any number of resources, including:

  • a fast static website with minimal server-side requirements
  • technical documentation
  • an eBook
  • application prototypes
  • build tools or project scaffolding

The markdown files can be converted to other files types using plugins such as metalsmith-pandoc or metalsmith-pdf.

]]>
http://127.0.0.1/article/usagehttp://127.0.0.1/article/usageMon, 14 Mar 2016 00:00:00 GMT
<![CDATA[Gotchas]]> Gotchas - dashdevs-suite

Gotchas

Not everything is necessarily straight-forward in the Metalsmith world…

Incompatible plugins

Some plugins clash with another. For example, metalsmith-rootpath which calculates relative roots does not play nicely with metalsmith-permalinks which creates custom folder structures.

Note: lib/metalsmith-moremeta in this project sets a correct root variable whether permalinks are used or not.

Plugin order can be critical

One plugins may depend on another or conflict if placed the wrong way around. For example, the RSS-generating metalsmith-feed plugin must be called after metalsmith-layouts to ensure rss.xml is not generated within a page template.

Browsersync build issues

When Browsersync is running and files are edited, collections are re-parsed but the old data remains. This can cause menus and next/back links to be incorrect. To fix this, stop and restart the build.

]]>
http://127.0.0.1/article/gotchashttp://127.0.0.1/article/gotchasThu, 10 Mar 2016 00:00:00 GMT
<![CDATA[Gulp]]> Gulp - dashdevs-suite

Gulp

Metalsmith has plugins for CSS pre-processing with Sass, image minification, file concatenation, uglification and more. The build code will be familiar to anyone with Gulp experience.

Do you still need Gulp?

Metalsmith is often enough for simpler workflows. However, Gulp has a more extensive range of plugins and permits complex build activities such as linting and PostCSS processing with auto-prefixer.

Metalsmith can be used within any Gulp task, e.g.

var
    gulp       = require('gulp'),
    metalsmith = require('metalsmith'),
    publish    = require('metalsmith-publish'),
    markdown   = require('metalsmith-markdown');

// build HTML files using Metalsmith
gulp.task('html', function() {

    var ms = metalsmith(dir.base)
        .clean(false)
        .source('src/html/')
        .destination('build')
        .use(publish())
        .use(markdown())
        .build(function(err) {
            if (err) throw err;
        });

});

Further Gulp tasks can then be added. Note .clean(false) ensures Metalsmith never wipes the build folder when other tasks are active.

There are a number of Gulp/Metalsmith integration plugins although they are rarely necessary.

]]>
http://127.0.0.1/article/gulphttp://127.0.0.1/article/gulpWed, 02 Mar 2016 00:00:00 GMT
<![CDATA[Future publication]]> Future publication - dashdevs-suite

Future publication

This article will only appear if the site is built is run after 1 March, 2016.

]]>
http://127.0.0.1/article/futurehttp://127.0.0.1/article/futureTue, 01 Mar 2016 00:00:00 GMT