Skip to content

Commit

Permalink
Fix #39 Relative path bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ain committed Apr 28, 2017
1 parent cec3e9f commit ac67608
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 65 deletions.
26 changes: 13 additions & 13 deletions app/templates/.src/templates/layouts/default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
<meta name="google-site-verification" content="<Google Site Verification key here>">

<link rel="image_src" type="image/png" href="<Share icon>.png">
<link rel="apple-touch-icon" href="<Apple touch icon>.png">
<link rel="apple-touch-icon" href="{{assets}}/apple-touch-icon.png">

{{> facebook}}

<link rel="canonical" href="<Site URI>{{meta.canonical}}">
<link rel="shortcut icon" href="{{assets}}favicon.ico" type="image/x-icon">
<!-- build:css(.tmp) {{assets}}{{config.path.styles}}main.css -->
<% if (includeBootstrap && !includeSass) { %><link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"><% } %>
<link rel="stylesheet" href="{{assets}}{{config.path.styles}}main.css" type="text/css" media="all">
<link rel="shortcut icon" href="{{assets}}/favicon.ico" type="image/x-icon">
<!-- build:css(.tmp) {{assets}}/{{config.path.styles}}main.css -->
<% if (includeBootstrap && !includeSass) { %><link rel="stylesheet" href="{{assets}}/{{config.path.bower}}/bootstrap/dist/css/bootstrap.css"><% } %>
<link rel="stylesheet" href="{{assets}}/{{config.path.styles}}main.css" type="text/css" media="all">
<!-- endbuild -->
<script src="{{assets}}{{config.path.scripts}}vendor/modernizr.js"></script>
<script src="{{assets}}/{{config.path.scripts}}vendor/modernizr.js"></script>
<!--[if IE 8]>
<script src="{{assets}}{{config.path.script}}ie.js"></script>
<script src="{{assets}}/{{config.path.script}}ie.js"></script>
<![endif]-->
</head>
<body>
Expand All @@ -34,26 +34,26 @@
</div>
{{> footer }}
</div>
<!-- build:js {{assets}}{{config.path.script}}vendor.js -->
<!-- build:js {{assets}}/{{config.path.script}}vendor.js -->
<!-- bower:js -->
<script src="{{assets}}{{config.path.bower}}jquery/dist/jquery.js"></script>
<script src="{{assets}}/{{config.path.bower}}jquery/dist/jquery.js"></script>
<!-- endbower -->
<!-- endbuild -->
<% if (includeBootstrap) { %>
<!-- build:js scripts/plugins.js -->
<!-- build:js {{assets}}/{{config.path.script}}plugins.js -->
<% bsPlugins.forEach(function (plugin) { -%>
<script src="<%= bsPath + plugin %>.js"></script>
<% }) -%>
<!-- endbuild -->
<% } %>
<!-- build:js {{assets}}{{config.path.script}}main.js -->
<script type="text/javascript" src="{{assets}}{{config.path.script}}main.js"></script>
<!-- build:js {{assets}}/{{config.path.script}}main.js -->
<script type="text/javascript" src="{{assets}}/{{config.path.script}}main.js"></script>
<!-- endbuild -->
<!-- build:remove -->
<script src='//0.0.0.0:3000/socket.io/socket.io.js'></script>
<script>var ___socket___ = io.connect('http://0.0.0.0:3000');</script>
<script src='//0.0.0.0:3001/client/browser-sync-client.0.6.2.js'></script>
<script src="{{assets}}{{config.path.script}}debug.js"></script>
<script src="{{assets}}/{{config.path.script}}debug.js"></script>
<!-- endbuild -->

</body>
Expand Down
64 changes: 14 additions & 50 deletions app/templates/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ module.exports = function(grunt) {
'<%%= config.test %>/spec/{,*/}*.js'
],
options: {
config: '.jscsrc',
verbose: true
config: '.jscsrc'
}
},

Expand Down Expand Up @@ -248,10 +247,11 @@ module.exports = function(grunt) {
// concat, minify and revision files. Creates configurations in memory so
// additional tasks can operate on them
useminPrepare: {
html: '<%%= config.app %>/index.html',
options: {
root: '<%%= config.app %>',
dest: '<%%= config.dist %>'
},
html: '<%%= config.app %>/index.html'
}
},

// Performs rewrites based on rev and the useminPrepare configuration
Expand All @@ -260,10 +260,11 @@ module.exports = function(grunt) {
assetsDirs: [
'<%%= config.dist %>',
'<%%= config.dist %>/images',
'<%%= config.dist %>/styles'
'<%%= config.dist %>/styles',
'<%%= config.dist %>/scripts'
]
},
html: ['<%%= config.dist %>/{,*/}*.html'],
html: ['<%%= config.dist %>/{,**/}*.html'],
css: ['<%%= config.dist %>/styles/{,*/}*.css']
},

Expand Down Expand Up @@ -312,32 +313,6 @@ module.exports = function(grunt) {
}
},

// By default, your `index.html`'s <!-- Usemin block --> will take care
// of minification. These next options are pre-configured if you do not
// wish to use the Usemin blocks.
// cssmin: {
// dist: {
// files: {
// '<%%= config.dist %>/styles/main.css': [
// '.tmp/styles/{,*/}*.css',
// '<%%= config.app %>/styles/{,*/}*.css'
// ]
// }
// }
// },
// uglify: {
// dist: {
// files: {
// '<%%= config.dist %>/scripts/scripts.js': [
// '<%%= config.dist %>/scripts/scripts.js'
// ]
// }
// }
// },
// concat: {
// dist: {}
// },

// Copies remaining files to places other tasks can use
copy: {
dist: {
Expand Down Expand Up @@ -402,7 +377,7 @@ module.exports = function(grunt) {
flatten: true,
layoutext: '.hbs',
// FIXME: assets path malfunction https://github.com/assemble/grunt-assemble/issues/44
// assets: '<%%= config.app %>',
assets: '<%%= config.app %>/<%%= config.app %>',
layoutdir: '<%%= config.src %>/templates/layouts',
partials: ['<%%= config.src %>/templates/partials/*.hbs'],
data: ['<%%= config.src %>/data/{i18n/,}*.yml'],
Expand All @@ -423,7 +398,7 @@ module.exports = function(grunt) {
}
},
src: '!*.*',
dest: '<%%= config.app %>/'
dest: './<%%= config.app %>/'
},
pages: {
options: {
Expand All @@ -440,7 +415,7 @@ module.exports = function(grunt) {
}
},
src: '<%%= config.src %>/pages/{,*/}*.hbs',
dest: '<%%= config.app %>/'
dest: './<%%= config.app %>/'
}
},

Expand Down Expand Up @@ -477,17 +452,6 @@ module.exports = function(grunt) {
]
},

browserSync: {
dev: {
bsFiles: {
src: '.tmp/styles/main.css',
},
options: {
watchTask: true
}
}
},

browserSync: {
dev: {
bsFiles: {
Expand Down Expand Up @@ -516,7 +480,7 @@ module.exports = function(grunt) {
}
});

grunt.registerTask('serve', 'Start server. Use --allow-remote for remote access', function(target) {
grunt.registerTask('serve', 'Start server. Use --allow-remote for remote access', function() {
grunt.task.run([
'clean:server',
'concurrent:server',
Expand Down Expand Up @@ -559,11 +523,11 @@ module.exports = function(grunt) {
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'cssmin',
'uglify',
'copy:dist',<% if (includeModernizr) { %>
'modernizr',<% } %>
'concat:generated',
'cssmin:generated',
'uglify:generated',
'rev',
'usemin',
'htmlmin'
Expand Down
4 changes: 2 additions & 2 deletions app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"grunt-pngcheck": "^0.1.0",
"grunt-browser-sync": "^2.2.0",
"jit-grunt": "^0.10.0",<% if (includeAssemble) { %>
"grunt-assemble": "assemble/grunt-assemble#3148d66",
"grunt-assemble-permalinks": "^0.1.0",
"grunt-assemble": "^0.6.3",
"grunt-assemble-permalinks": "^0.1.1",
"grunt-assemble-i18n": "^0.1.1",
"handlebars-helper-rawinclude": "^1.0.0",
"handlebars-helper-i18n": "interactive-pioneers/handlebars-helper-i18n#128910a",<% } %>
Expand Down

0 comments on commit ac67608

Please sign in to comment.