Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sails-linker.js « config « tasks - github.com/kakawait/hugo-tranquilpeak-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b9f151ca4884b790fdae77699b8d9c58cb7ccdfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module.exports = function(grunt) {
  var pipeline = require('../pipeline');
  var util = require('util');
  grunt.config.set('sails-linker', {
    devJs: {
      options: {
        startTag: '<!--SCRIPTS-->',
        endTag: '<!--SCRIPTS END-->',
        fileRef: function(filepath) {
          var tmpl = '<script src="{{ "%s" | absURL}}"></script>';
          return util.format(tmpl, filepath.substring(filepath.indexOf('/')));
        },
        appRoot: 'src/'
      },
      files: {
        'layouts/partials/script.html': pipeline.tranquilpeakJsFilesToInject
      }
    },
    devCss: {
      options: {
        startTag: '<!--STYLES-->',
        endTag: '<!--STYLES END-->',
        fileRef: function(filepath) {
          var tmpl = '<link rel="stylesheet" href="{{ "%s" | absURL}}" />';
          return util.format(tmpl, filepath.substring(filepath.indexOf('/') + 1));
        },
        appRoot: 'src/'
      },
      files: {
        'layouts/partials/head.html': pipeline.tranquilpeakCssFilesToInject
      }
    },
    prodJs: {
      options: {
        startTag: '<!--SCRIPTS-->',
        endTag: '<!--SCRIPTS END-->',
        fileRef: function(filepath) {
          var tmpl = '<script src="{{ "%s" | absURL}}"></script>';
          return util.format(tmpl, filepath.substring(filepath.indexOf('/')));
        },
        appRoot: 'src/'
      },
      files: {
        'layouts/partials/script.html': 'static/js/*.min.js'
      }
    },
    prodCss: {
      options: {
        startTag: '<!--STYLES-->',
        endTag: '<!--STYLES END-->',
        fileRef: function(filepath) {
          var tmpl = '<link rel="stylesheet" href="{{ "%s" | absURL}}" />';
          return util.format(tmpl, filepath.substring(filepath.indexOf('/') + 1));
        },
        appRoot: 'src/'
      },
      files: {
        'layouts/partials/head.html': 'static/css/*.min.css'
      }
    }
  });

  grunt.loadNpmTasks('grunt-sails-linker');
};