Giter Site home page Giter Site logo

docpad-plugin-less's Introduction

docpad-plugin-less

Travis CI Build Status NPM version NPM downloads Dependency Status Dev Dependency Status
GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Adds support for the LESS CSS pre-processor to DocPad

Usage

By default the following configuration is used:

  • on the development environment, inline sourcemaps are enabled and compression is disabled
  • on any other environment, sourcemaps are disabled and compression is enabled
  • when a less document references another document via @import, the document has its referencesOthers meta property set to true

As an example, to inverse these defaults, you would provide in your DocPad Configuration File:

{
  plugins:
    less:
      referencesOthers: false
      # http://lesscss.org/#using-less-configuration
      lessOptions:
        compress: false,
        sourceMap:
          sourceMapFileInline: true

  environments:
    development:
      plugins:
        less:
          lessOptions:
            compress: true,
            sourceMap: false
}

Install

Install this DocPad plugin by entering docpad install less into your terminal.

History

Discover the release history by heading on over to the HISTORY.md file.

Contribute

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

GitHub Sponsors donate button Patreon donate button Flattr donate button Liberapay donate button Buy Me A Coffee donate button Open Collective donate button crypto donate button PayPal donate button Wishlist browse button

Contributors

These amazing people have contributed code to this project:

Discover how you can contribute by heading on over to the CONTRIBUTING.md file.

License

Unless stated otherwise all works are:

and licensed under:

docpad-plugin-less's People

Contributors

balupton avatar dependabot[bot] avatar robloach avatar sdomagala avatar vsopvsop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docpad-plugin-less's Issues

docpad-plugin-less doesn't support less.css.less files under directory of files

Usually, static files will be put under src/files/, just as the overview introduces:

For example, images, vendor files, plain stylesheet and javascript files, etc.

However, .css.less files under src/files/ won't be rendered unless you put them under src/documents which will destroy the designed structure of website.

The structure I used:

* src
    - documents
        - .html.eco
    - files
        - assets
            - css
               .css.less
             - js
             - images
             - fonts

The structure I want in output:

* out
    .html
    - asstets
       - css
          .css
       - js
       - images
       - fonts

But if I want to use this plugin, I have to adjust the structure:

* src
    - documents
        - .html.eco
        - assets
            - css
               .css.less
    - files
        - assets2
           - js
           - images
           - fonts

Where to store included Less files

Apologies if this is an obvious question, but won't storing all Less files in the documents directory cause them to be parsed independently even if they're pulled in with @include?

Using the bootstrap skeleton as an example, the Bootstrap less (vendor files) are stored in files/vendor/ but is @included by twitter-bootstrap.less.

I'm pretty new to some of this so I could well be taking the wrong approach, but my Less typically compiles down to a single CSS file. For this use case should the Less files be stored in files/ so they're not reparsed, with a single file in documents/ to do the relevant includes?

... or have I got the wrong end of the stick completey!?

Implement non-Node functions for environment

INPUT (test.css.less)

.cat-image {
width: image-width("cat.png");
height: image-height("cat.png");
background-size: image-size("cat.png");
}

EXPECTED OUTPUT

.cat-image {
width: 300px;
height: 250px;
background-size: 300px 250px;
}

ACTUAL OUTPUT (test.css)

.cat-image {
width: image-width("cat.png");
height: image-height("cat.png");
background-size: image-size("cat.png");
}


The functions 'image-size', 'image-width' and 'image-height' are not implemented. These were introduced in Less v2.2.0. Read more here: http://lesscss.org/functions/#misc-functions-image-size

[email protected] hangs with Docpad v6.79.4

Good afternoon:

I've tried the last update of Docpad and your plugin and I have this problem: Docpad hangs with docpad-plugin-less 2.5.0 but it works perfectly with docpad-plugin-less 2.4.1.

I don't know why it begins to cause problems on my site project. I give you the next information:

If you need anything else, just tell me.
Thank you.

Comiling files on save

I'm having an issue when when I save the .less file, sometimes the output doesn't get compiled on save or resave. In order to get the changes to update I have to kill the docpad service and restart it. Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.