1
0
mirror of https://github.com/ascribe/wp-theme synced 2024-12-23 01:30:09 +01:00
This commit is contained in:
Sarah Etter 2015-09-17 16:25:05 -06:00
commit b7211ce1f1
19 changed files with 506 additions and 0 deletions

6
.ftppass Normal file
View File

@ -0,0 +1,6 @@
{
"key1": {
"username": "ascribe",
"password": "zS!wfsBm9FK$"
}
}

9
.gitignore vendored
View File

@ -1,3 +1,4 @@
<<<<<<< HEAD
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion
@ -48,3 +49,11 @@ crashlytics.properties
crashlytics-build.properties
=======
node_modules
release
vendor
composer.lock
phpunit.xml
.idea
>>>>>>> otherTheme

1
.idea/ascribe.iml generated
View File

@ -4,5 +4,6 @@
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="ascribe node_modules" level="project" />
</component>
</module>

187
Gruntfile.js Normal file
View File

@ -0,0 +1,187 @@
module.exports = function( grunt ) {
// Project configuration
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
concat: {
options: {
stripBanners: true,
banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' +
' * <%= pkg.homepage %>\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %>;' +
' * Licensed GPLv2+' +
' */\n'
},
main: {
src: [
'assets/js/src/ascribe.js'
],
dest: 'assets/js/ascribe.js'
}
},
jshint: {
all: [
'Gruntfile.js',
'assets/js/src/**/*.js',
'assets/js/test/**/*.js'
]
},
uglify: {
all: {
files: {
'assets/js/ascribe.min.js': ['assets/js/ascribe.js']
},
options: {
banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' +
' * <%= pkg.homepage %>\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %>;' +
' * Licensed GPLv2+' +
' */\n',
mangle: {
except: ['jQuery']
}
}
}
},
less: {
all: {
options: {
sourceMap: false
},
files: {
'assets/css/ascribe.css': 'assets/css/less/ascribe.less'
}
}
},
postcss: {
dist: {
options: {
processors: [
require('autoprefixer-core')({browsers: 'last 2 versions'})
]
},
files: {
'assets/css/ascribe.css': [ 'assets/css/ascribe.css' ]
}
}
},
cssmin: {
options: {
banner: '/*! <%= pkg.title %> - v<%= pkg.version %>\n' +
' * <%=pkg.homepage %>\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %>;' +
' * Licensed GPLv2+' +
' */\n'
},
minify: {
expand: true,
cwd: 'assets/css/',
src: ['ascribe.css'],
dest: 'assets/css/',
ext: '.min.css'
}
},
watch: {
livereload: {
files: ['assets/css/*.css'],
options: {
livereload: true
}
},
styles: {
files: ['assets/css/less/**/*.less'],
tasks: ['less', 'autoprefixer', 'cssmin'],
options: {
debounceDelay: 500
}
},
scripts: {
files: ['assets/js/src/**/*.js', 'assets/js/vendor/**/*.js'],
tasks: ['jshint', 'concat', 'uglify'],
options: {
debounceDelay: 500
}
}
},
'sftp-deploy': {
css: {
auth: {
host: 'server.territorial.ca',
port: 22,
authKey: 'key1'
},
cache: 'sftpCache.json',
src: '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/css/',
dest: '/home/ascribe/public_html/wp-content/themes/ascribe/assets/css',
exclusions: ['/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/node_modules',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/release',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/vendor',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/.git',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/.idea',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/**/.DS_Store'],
serverSep: '/',
concurrency: 4,
progress: true
},
js: {
auth: {
host: 'server.territorial.ca',
port: 22,
authKey: 'key1'
},
cache: 'sftpCache.json',
src: '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/js/',
dest: '/home/ascribe/public_html/wp-content/themes/ascribe/assets/js',
exclusions: ['/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/node_modules',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/release',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/vendor',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/.git',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/.idea',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/**/.DS_Store'],
serverSep: '/',
concurrency: 4,
progress: true
},
controller: {
auth: {
host: 'server.territorial.ca',
port: 22,
authKey: 'key1'
},
cache: 'sftpCache.json',
src: '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/controller/',
dest: '/home/ascribe/public_html/wp-content/themes/ascribe/controller/',
exclusions: ['/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/node_modules',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/release',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/vendor',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/.git',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/.idea',
'/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/**/.DS_Store'],
serverSep: '/',
concurrency: 4,
progress: true
}
}
} );
// Load tasks
require('load-grunt-tasks')(grunt);
// Register tasks
grunt.registerTask( 'css', ['less', 'postcss', 'cssmin', 'sftp-deploy:css'] );
grunt.registerTask( 'js', ['jshint', 'concat', 'uglify', 'sftp-deploy:js'] );
grunt.registerTask( 'controller', ['sftp-deploy:controller'] );
grunt.registerTask( 'default', ['css', 'js', 'controller'] );
grunt.util.linefeed = '\n';
};

0
assets/css/ascribe.css Normal file
View File

0
assets/css/ascribe.min.css vendored Normal file
View File

View File

8
assets/js/ascribe.js Normal file
View File

@ -0,0 +1,8 @@
/*! ascribe - v0.0.1
* http://wordpress.org/themes
* Copyright (c) 2015; * Licensed GPLv2+ */
( function( window, undefined ) {
'use strict';
} )( this );

4
assets/js/ascribe.min.js vendored Normal file
View File

@ -0,0 +1,4 @@
/*! ascribe - v0.0.1
* http://wordpress.org/themes
* Copyright (c) 2015; * Licensed GPLv2+ */
!function(a,b){"use strict"}(this);

13
assets/js/src/ascribe.js Normal file
View File

@ -0,0 +1,13 @@
/**
* ascribe
* http://wordpress.org/themes
*
* Copyright (c) 2015 Territorial
* Licensed under the GPLv2+ license.
*/
( function( window, undefined ) {
'use strict';
} )( this );

31
bootstrap.php.dist Normal file
View File

@ -0,0 +1,31 @@
<?php
if ( ! defined( 'PROJECT' ) ) {
define( 'PROJECT', __DIR__ . '/includes/' );
}
if ( ! defined( 'WPTHEME_DIR' ) ) {
define( 'WPTHEME_DIR', __DIR__ . '/' );
}
// Place any additional bootstrapping requirements here for PHP Unit.
if ( ! defined( 'WP_LANG_DIR' ) ) {
define( 'WP_LANG_DIR', 'lang_dir' );
}
if ( ! defined( 'WPTHEME_PATH' ) ) {
define( 'WPTHEME_PATH', 'path' );
}
if ( ! file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
throw new PHPUnit_Framework_Exception(
'ERROR' . PHP_EOL . PHP_EOL .
'You must use Composer to install the test suite\'s dependencies!' . PHP_EOL
);
}
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/tests/phpunit/test-tools/TestCase.php';
WP_Mock::setUsePatchwork( true );
WP_Mock::bootstrap();
WP_Mock::tearDown();

23
bower.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "ascribe",
"version": "0.0.1",
"main": "/",
"license": "GPLv2+",
"ignore": [
"**/.*",
"*.md",
"assets/css/sass/*",
"assets/css/src/*",
"assets/js/src/*",
"assets/js/vendor/*",
"images/src/*",
"tests",
"bootstrap.php",
"Gruntfile.js",
"package.json",
"composer.json",
"phpunit.xml.dist"
],
"devDependencies": {},
"keywords": []
}

27
composer.json Normal file
View File

@ -0,0 +1,27 @@
{
"name": "ascribe",
"description": "The best WordPress theme ever made!",
"version": "0.0.1",
"type": "wordpress-theme",
"keywords": [],
"homepage": "http://wordpress.org/themes",
"license": "GPLv2.0+",
"authors": [
{
"name": "Territorial",
"email": "us@territorial.ca",
"homepage": "http://territorial.ca",
"role": "Developer"
}
],
"minimum-stability": "dev",
"require": {
"php": ">=5.4"
},
"require-dev": {
"antecedent/patchwork": "1.2.*",
"phpunit/phpunit" : "*@stable",
"brianium/paratest" : "dev-master",
"10up/wp_mock" : "dev-master"
}
}

29
functions.php Normal file
View File

@ -0,0 +1,29 @@
<?php
/**
* ascribe functions and definitions
*
* When using a child theme (see http://codex.wordpress.org/Theme_Development and
* http://codex.wordpress.org/Child_Themes), you can override certain functions
* (those wrapped in a function_exists() call) by defining them first in your child theme's
* functions.php file. The child theme's functions.php file is included before the parent
* theme's file, so the child theme functions would be used.
*
* @package ascribe
* @since 0.1.0
*/
// Useful global constants
define( 'WPTHEME_VERSION', '0.1.0' );
define( 'WPTHEME_URL', get_stylesheet_directory_uri() );
define( 'WPTHEME_TEMPLATE_URL', get_template_directory_uri() );
define( 'WPTHEME_PATH', get_template_directory() . '/' );
define( 'WPTHEME_INC', WPTHEME_PATH . 'includes/' );
// Include compartmentalized functions
require_once WPTHEME_INC . 'functions/core.php';
// Include lib classes
// Run the setup functions
TenUp\ascribe\Core\setup();

View File

@ -0,0 +1,95 @@
<?php
namespace TenUp\ascribe\Core;
/**
* Set up theme defaults and register supported WordPress features.
*
* @since 0.1.0
*
* @uses add_action()
*
* @return void.
*/
function setup() {
$n = function( $function ) {
return __NAMESPACE__ . "\\$function";
};
add_action( 'after_setup_theme', $n( 'i18n' ) );
add_action( 'wp_head', $n( 'header_meta' ) );
add_action( 'wp_enqueue_scripts', $n( 'scripts' ) );
add_action( 'wp_enqueue_scripts', $n( 'styles' ) );
}
/**
* Makes WP Theme available for translation.
*
* Translations can be added to the /lang directory.
* If you're building a theme based on WP Theme, use a find and replace
* to change 'wptheme' to the name of your theme in all template files.
*
* @uses load_theme_textdomain() For translation/localization support.
*
* @since 0.1.0
*
* @return void.
*/
function i18n() {
load_theme_textdomain( 'wptheme', WPTHEME_PATH . '/languages' );
}
/**
* Enqueue scripts for front-end.
*
* @uses wp_enqueue_script() to load front end scripts.
*
* @since 0.1.0
*
* @return void.
*/
function scripts( $debug = false ) {
$min = ( $debug || defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
wp_enqueue_script(
'wptheme',
WPTHEME_TEMPLATE_URL . "/assets/js/ascribe{$min}.js",
array(),
WPTHEME_VERSION,
true
);
}
/**
* Enqueue styles for front-end.
*
* @uses wp_enqueue_style() to load front end styles.
*
* @since 0.1.0
*
* @return void.
*/
function styles( $debug = false ) {
$min = ( $debug || defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
wp_enqueue_style(
'wptheme',
WPTHEME_URL . "/assets/css/ascribe{$min}.css",
array(),
WPTHEME_VERSION
);
}
/**
* Add humans.txt to the <head> element.
*
* @uses apply_filters()
*
* @since 0.1.0
*
* @return void.
*/
function header_meta() {
$humans = '<link type="text/plain" rel="author" href="' . WPTHEME_TEMPLATE_URL . '/humans.txt" />';
echo apply_filters( 'wptheme_humans', $humans );
}

16
languages/wptheme.pot Normal file
View File

@ -0,0 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: ascribe\n"
"POT-Creation-Date: 2015-09-16T23:52:34.272Z\n"
"PO-Revision-Date: 2015-09-16T23:52:34.274Z\n"
"Last-Translator: 10up <info@10up.com>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
"_n_noop:1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
"esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ..\n"

37
package.json Normal file
View File

@ -0,0 +1,37 @@
{
"name": "ascribe",
"title": "ascribe",
"description": "The best WordPress theme ever made!",
"version": "0.0.1",
"homepage": "http://wordpress.org/themes",
"repository": {
"type": "git",
"url": ""
},
"author": {
"name": "Territorial",
"email": "us@territorial.ca",
"url": "http://territorial.ca"
},
"devDependencies": {
"autoprefixer-core": "^5.2.1",
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-compress": "^0.13.0",
"grunt-contrib-concat": "^0.5.1",
"grunt-contrib-copy": "^0.8.0",
"grunt-contrib-cssmin": "^0.12.3",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-less": "^1.0.1",
"grunt-contrib-qunit": "^0.7.0",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-phpunit": "^0.3.6",
"grunt-postcss": "^0.5.4",
"grunt-sass": "^1.0.0",
"grunt-sftp-deploy": "^0.2.4",
"load-grunt-tasks": "^3.2.0",
"qunitjs": "~1.18.0"
},
"keywords": []
}

1
sftpCache.json Normal file
View File

@ -0,0 +1 @@
{"/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/css//ascribe.css":"2015-09-17T22:20:29.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/css//ascribe.min.css":"2015-09-17T22:20:29.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/css//readme.md":"2015-09-16T23:52:34.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/css//less/ascribe.less":"2015-09-17T22:05:05.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/js//ascribe.js":"2015-09-17T22:20:36.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/js//ascribe.min.js":"2015-09-17T22:20:36.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/js//src/ascribe.js":"2015-09-16T23:52:34.000Z","/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/js//vendor/readme.md":"2015-09-16T23:52:34.000Z"}

19
style.css Normal file
View File

@ -0,0 +1,19 @@
/**
* Theme Name: ascribe
* Theme URI: http://wordpress.org/themes
* Description: The best WordPress theme ever made!
* Author: Territorial
* Author URI: http://territorial.ca
* Version: 0.1.0
* Tags:
* Text Domain: wptheme
*
* License: GPLv2+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
/**
* Built using yo wp-make:theme
* Copyright (c) 2014 10up, LLC
* https://github.com/lkwdwrd/generator-wp-make
*/