You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 3, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: gulpconfig.js
+3-6Lines changed: 3 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,8 @@ module.exports = {
53
53
,chunks: {// Chunks are arrays of paths or globs matching a set of source files; this way you can organize a bunch of scripts that go together into pieces that can then be bundled (above)
54
54
// The core chunk is loaded no matter what; put essential scripts that you want loaded by your theme in here
55
55
core: [
56
-
src+'js/responsive-menu.js'
56
+
modules+'timeago/jquery.timeago.js'
57
+
,src+'js/responsive-menu.js'
57
58
,src+'js/core.js'
58
59
]
59
60
// The pageloader chunk provides an example of how you would add a user-configurable feature to your theme; you can delete this if you wish
@@ -84,13 +85,9 @@ module.exports = {
84
85
src: src+'scss/**/*.scss'
85
86
,dest: build
86
87
}
87
-
,dist: {
88
-
src: dist+'**/*.css'
89
-
,dest: dist
90
-
}
91
88
,compiler: 'libsass'// Choose a Sass compiler: 'libsass' or 'rubysass'
92
89
,autoprefixer: {browsers: ['> 3%','last 2 versions','ie 9','ios 6','android 4']}// This tool is magic and you should use it in all your projects :)
93
-
,minify: {keepSpecialComments: 1,roundingPrecision: 4}// Keep special comments preserves the bits we need for WordPress to recognize the theme's stylesheet
90
+
,minify: {safe: true}
94
91
,rubySass: {// Requires the Ruby implementation of Sass; run `gem install sass` if you use this; Compass is *not* included by default
95
92
loadPath: ['./src/scss',bower,modules]// Adds Bower and npm directories to the load path so you can @import directly
Copy file name to clipboardExpand all lines: readme.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Why use this project instead of any of the alternatives? A few advantages:
10
10
* You should be able to easily drop your own theme into the `src` folder and start hacking without much additional setup.
11
11
* Documentation and comments in the code assume a novice level of understanding.
12
12
* Builds on existing WordPress and Gulp best practices without doing anything too crazy.
13
-
*Will save you a ton of time and help you make better, more readilyoptimized themes once you learn how it all works.
13
+
*This kind of workflow will save you a ton of time and help you make better, more readily-optimized themes once you learn how it all works.
14
14
15
15
16
16
@@ -46,9 +46,9 @@ If you're already up and running with most of the usual Node ecosystem tools thi
46
46
47
47
Previously this project shipped without a working theme included. I figured that with all the great starter themes out there (for instance, [_s](https://github.com/Automattic/_s), [Roots](https://github.com/roots/roots), and [Bones](https://github.com/eddiemachado/bones)) it wouldn't be hard to drop one in and start theming. I don't personally use any of these so I was a little surprised to discover how tricky this can be. Starter themes, despite their "bare bones" reputation, are often bulky and opinionated. Some even ship with their own build processes already in place!
48
48
49
-
It seems there is a need for what I'd call a *minimum viable theme*: a truly bare bones WordPress starter theme featuring only the essentials to get up and running, something that you can assess at a glance. For the purposes of this project I have created such a theme, tentatively named `voidx`. It isn't pretty and isn't up to [WordPress standards](https://wordpress.org/plugins/theme-check/) but it works well enough to show off some of the power of this workflow. Feel free to play with or discard it as you wish. All files under `src` can be replaced by your own files, you just have to be sure to wire things up properly in the `gulpconfig.js` file if you swap in your own stuff.
49
+
It seems there is a need for what I'd call a *minimum viable theme*: a truly bare bones WordPress starter theme featuring only the essentials to get up and running, something that you can assess at a glance. For the purposes of this project I have created such a theme, tentatively named `voidx`. It isn't pretty and isn't up to [WordPress standards](https://wordpress.org/plugins/theme-check/) but it works well enough to show off some of the power of this workflow. Feel free to play with or discard it as you wish. All files under `src` can be replaced by your own files, you just have to be sure to wire things up properly in the `gulpconfig.js` file if you swap in your own stuff. I've already integrated [timeago](http://timeago.yarp.com/), a simple script to transform timestamps into something more human-readable, but this is easily removed if you don't like it (which is sort of the point of having such scaffolding, so you can easily swap stuff in and out).
50
50
51
-
There are two components worth a closer look, however:
51
+
There are two components worth a closer look:
52
52
53
53
* The script variable and enqueuing functions in `src/inc/assets.php`; these are tightly coupled with the output of the build process.
54
54
* The theme configuration pattern described in `functions.php` and `functions-config-defaults.php`.
@@ -131,7 +131,7 @@ Like images, PHP (and language) files can go anywhere under `src` and will be co
131
131
132
132
133
133
134
-
## A SAMPLE INTEGRATION
134
+
## EXAMPLE INTEGRATION
135
135
136
136
Let's say you run across a cool project like [Headroom.js](http://wicky.nillia.ms/headroom.js/) and decide you'd like to try it out. Here's how you would do that with the tools and workflow outlined in this repo:
137
137
@@ -142,7 +142,7 @@ Let's say you run across a cool project like [Headroom.js](http://wicky.nillia.m
142
142
* Add the switch to `inc/assets.php`: `if ( VOIDX_SCRIPTS_HEADROOM ) : $script_name .= '-hr';`.
143
143
* Add an option to `scss/_config.scss` to allow for the styling to be turned on or off: `$plugin-headroom: true;`.
144
144
* Add the necessary styling to `scss/_plugins.scss` wrapped in a conditional check: `@if ($plugin-headroom) { // Style }`.
145
-
* Create an additional script at `src/js/headroom.js` to invoke the main script (code to follow).
145
+
* Create an additional script at `src/js/headroom.js` to invoke the main script:
0 commit comments