Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Folder Structure #454

Merged
merged 4 commits into from
Sep 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bowerrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"directory": "bower_components"
"directory": "assets/components"
}
Empty file modified 404.php
100644 → 100755
Empty file.
Empty file modified CHANGELOG.md
100644 → 100755
Empty file.
302 changes: 158 additions & 144 deletions Gruntfile.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,145 +1,159 @@
module.exports = function(grunt) {
// time
require('time-grunt')(grunt);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

sass: {
options: {
// If you can't get source maps to work, run the following command in your terminal:
// $ sass scss/foundation.scss:css/foundation.css --sourcemap
// (see this link for details: http://thesassway.com/intermediate/using-source-maps-with-sass )
sourceMap: true
},

dist: {
options: {
outputStyle: 'compressed'
},
files: {
'css/foundation.css': 'scss/foundation.scss'
}
}
},

copy: {
scripts: {
expand: true,
cwd: 'bower_components/foundation/js/vendor/',
src: '**',
flatten: 'true',
dest: 'js/vendor/'
},

iconfonts: {
expand: true,
cwd: 'bower_components/fontawesome/',
src: ['**', '!**/less/**', '!**/css/**', '!bower.json'],
dest: 'assets/fontawesome/'
},

},


'string-replace': {

fontawesome: {
files: {
'assets/fontawesome/scss/_variables.scss': 'assets/fontawesome/scss/_variables.scss'
},
options: {
replacements: [
{
pattern: '../fonts',
replacement: '../assets/fontawesome/fonts'
}
]
}
},
},

concat: {
options: {
separator: ';',
},
dist: {
src: [

// Foundation core
'bower_components/foundation/js/foundation/foundation.js',

// Pick the componenets you need in your project
'bower_components/foundation/js/foundation/foundation.abide.js',
'bower_components/foundation/js/foundation/foundation.accordion.js',
'bower_components/foundation/js/foundation/foundation.alert.js',
'bower_components/foundation/js/foundation/foundation.clearing.js',
'bower_components/foundation/js/foundation/foundation.dropdown.js',
'bower_components/foundation/js/foundation/foundation.equalizer.js',
'bower_components/foundation/js/foundation/foundation.interchange.js',
'bower_components/foundation/js/foundation/foundation.joyride.js',
'bower_components/foundation/js/foundation/foundation.magellan.js',
'bower_components/foundation/js/foundation/foundation.offcanvas.js',
'bower_components/foundation/js/foundation/foundation.orbit.js',
'bower_components/foundation/js/foundation/foundation.reveal.js',
'bower_components/foundation/js/foundation/foundation.slider.js',
'bower_components/foundation/js/foundation/foundation.tab.js',
'bower_components/foundation/js/foundation/foundation.tooltip.js',
'bower_components/foundation/js/foundation/foundation.topbar.js',

// Include your own custom scripts (located in the custom folder)
'js/custom/*.js'

],
// Finally, concatinate all the files above into one single file
dest: 'js/foundation.js',
},
},

uglify: {
dist: {
files: {
// Shrink the file size by removing spaces
'js/foundation.js': ['js/foundation.js']
}
}
},

watch: {
grunt: { files: ['Gruntfile.js'] },

sass: {
files: 'scss/**/*.scss',
tasks: ['sass'],
options: {
livereload:true,
}
},

js: {
files: 'js/custom/**/*.js',
tasks: ['concat', 'uglify'],
options: {
livereload:true,
}
},

all: {
files: '**/*.php',
options: {
livereload:true,
}
}
}
});

grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-string-replace');

grunt.registerTask('build', ['copy', 'string-replace:fontawesome', 'sass', 'concat', 'uglify']);
grunt.registerTask('default', ['watch']);
module.exports = function (grunt) {
// time
require('time-grunt')(grunt);

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

sass: {

options: {
// If you can't get source maps to work, run the following command in your terminal:
// $ sass scss/foundation.scss:css/foundation.css --sourcemap
// (see this link for details: http://thesassway.com/intermediate/using-source-maps-with-sass )
sourceMap: true
},

dist: {
options: {
outputStyle: 'compressed'
},
files: {
'assets/stylesheets/foundation.css': 'assets/scss/foundation.scss'
}
}

},

copy: {

scripts: {
expand: true,
cwd: 'assets/components/foundation/js/vendor/',
src: '**',
flatten: 'true',
dest: 'assets/javascript/vendor/'
},

iconfonts: {
expand: true,
cwd: 'assets/components/fontawesome/fonts',
src: ['**'],
dest: 'assets/fonts/'
}

},

'string-replace': {

fontawesome: {
files: {
'assets/fontawesome/scss/_variables.scss': 'assets/fontawesome/scss/_variables.scss'
},

options: {
replacements: [
{
pattern: '../fonts',
replacement: '../assets/fonts'
}
]
}

}

},

concat: {

options: {
separator: ';'
},

dist: {

src: [

// Foundation core
'assets/components/foundation/js/foundation/foundation.js',

// Pick the componenets you need in your project
'assets/components/foundation/js/foundation/foundation.abide.js',
'assets/components/foundation/js/foundation/foundation.accordion.js',
'assets/components/foundation/js/foundation/foundation.alert.js',
'assets/components/foundation/js/foundation/foundation.clearing.js',
'assets/components/foundation/js/foundation/foundation.dropdown.js',
'assets/components/foundation/js/foundation/foundation.equalizer.js',
'assets/components/foundation/js/foundation/foundation.interchange.js',
'assets/components/foundation/js/foundation/foundation.joyride.js',
'assets/components/foundation/js/foundation/foundation.magellan.js',
'assets/components/foundation/js/foundation/foundation.offcanvas.js',
'assets/components/foundation/js/foundation/foundation.orbit.js',
'assets/components/foundation/js/foundation/foundation.reveal.js',
'assets/components/foundation/js/foundation/foundation.slider.js',
'assets/components/foundation/js/foundation/foundation.tab.js',
'assets/components/foundation/js/foundation/foundation.tooltip.js',
'assets/components/foundation/js/foundation/foundation.topbar.js',

// Include your own custom scripts (located in the custom folder)
'assets/javascript/custom/*.js'

],

// Finally, concatinate all the files above into one single file
dest: 'assets/javascript/foundation.js'

}

},

uglify: {

dist: {
files: {
// Shrink the file size by removing spaces
'assets/javascript/foundation.js': ['assets/javascript/foundation.js']
}
}

},

watch: {
grunt: {files: ['Gruntfile.js']},

sass: {
files: 'assets/scss/**/*.scss',
tasks: ['sass'],
options: {
livereload: true
}
},

js: {
files: 'assets/javascript/custom/**/*.js',
tasks: ['concat', 'uglify'],
options: {
livereload: true
}
},

all: {
files: '**/*.php',
options: {
livereload: true
}
}

}
});

grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-string-replace');

grunt.registerTask('build', ['copy', 'string-replace:fontawesome', 'sass', 'concat', 'uglify']);
grunt.registerTask('default', ['watch']);
};
16 changes: 8 additions & 8 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,27 @@ And you're set!

* `style.css`: Do not worry about this file. (For some reason) it's required by WordPress. All styling are handled in the Sass files described below

* `scss/foundation.scss`: Imports for Foundation components and your custom styles.
* `scss/config/_settings.scss`: Original Foundation 5 base settings
* `scss/config/_custom-settings.scss`: Copy the settings you will modify to this file. Make it your own
* `scss/site/*.scss`: Unleash your creativity. Create the files you need (and remember to make import statements for all your files in scss/foundation.scss)
* `assets/scss/foundation.scss`: Imports for Foundation components and your custom styles.
* `assets/scss/config/_settings.scss`: Original Foundation 5 base settings
* `assets/scss/config/_custom-settings.scss`: Copy the settings you will modify to this file. Make it your own
* `assets/scss/site/*.scss`: Unleash your creativity. Create the files you need (and remember to make import statements for all your files in assets/scss/foundation.scss)

Please note that you **must** run `$npm run build` in your terminal for the styles to be copied and concatinated. See [Gruntfile.js](https://github.com/olefredrik/FoundationPress/blob/master/Gruntfile.js) for details

### How to structure your scripts

* `js/custom`: This is the folder where you put all your custom scripts. Every .js file you put in this directory will be minified and concatinated one single .js file. (This is good for site speed and performance)
* `assets/javascript/custom`: This is the folder where you put all your custom scripts. Every .js file you put in this directory will be minified and concatinated one single .js file. (This is good for site speed and performance)

Please note that you must run `npm run build` in your terminal for the scripts to be copied and concatinated. See [Gruntfile.js](https://github.com/olefredrik/FoundationPress/blob/master/Gruntfile.js) for details

### The styles and scripts generated by the build

Version control on these files are turned off because they are automatically generated as part of the build process.

* `css/foundation.css`: All Sass files are minified and compiled to this file
* `css/foundation.css.map`: CSS source maps
* `assets/stylesheets/foundation.css`: All Sass files are minified and compiled to this file
* `assets/stylesheets/foundation.css.map`: CSS source maps

* `js/vendor`: Vendor scripts are copied from `bower_components/` to this directory. We use this path for enqueing the vendor scripts in WordPress.
* `assets/javascript/vendor`: Vendor scripts are copied from `assets/javascript/components/` to this directory. We use this path for enqueing the vendor scripts in WordPress.

## Demo

Expand Down
Empty file modified archive.php
100644 → 100755
Empty file.
Binary file removed assets/fontawesome/fonts/FontAwesome.otf
Binary file not shown.
Binary file removed assets/fontawesome/fonts/fontawesome-webfont.eot
Binary file not shown.
Loading