Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hint the origin of the theme #84

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,38 @@
Blank Theme
===

Blank Theme is a custom blank theme created with underscore theme, which includes foundation basic grid system and some basic customizer settings which are required in almost all projects.
Blank Theme is a custom theme created with underscore theme, which includes foundation basic grid system and some basic customizer settings which are required in almost all projects. Here are some of the other more interesting things you'll find here:

* A modern workflow with a pre-made command-line interface to turn your project into a more pleasant experience.
* A just right amount of lean, well-commented, modern, HTML5 templates.
* `class-assets.php` that enqueue all your require css and js files.
* `class-blank-theme.php` file in inc/classes is where the theme is setup. This file add all the require theme supports.
* Customizer registration and settings added in `inc/classes/class-customizer.php` file.
* 2 widgets ( Sidebar & Footer ) added in `inc/classes/class-widgets.php` file.
* `inc/helpers/custom-functions.php` where you can add your custom functions.
* Custom template tags in `inc/helpers/template-tags.php` that keep your templates clean and neat and prevent code duplication.
* In `assets/src/js/admin/customizer.js` file, Theme Customizer enhancements added for a better user experience.
* `assets/src/js/components` where you can add the common components for the theme.
* You can add styles in `assets/src/sass` folder.


Getting Started
---------------

After cloning repo run
### Requirements

`Blank Theme` requires the following dependencies:

- [Node.js](https://nodejs.org/)
- [Composer](https://getcomposer.org/)

### Setup

After cloning/downloading repository, you need to install the necessary Node.js and Composer dependencies :

```bash
npm install
$ composer install
$ npm install
```

and then run the following command which will prompt for the theme name, start renaming and do cleanup.
Expand All @@ -31,7 +52,7 @@ npm run prod # When ready for production



#### Other Commands
#### Available CLI commands

```bash
# Generate pot files
Expand Down
8 changes: 8 additions & 0 deletions bin/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ const initTheme = (themeInfo) => {
blank_theme_: themeInfo.snakeCaseWithUnderscoreSuffix,
Blank_Theme_: themeInfo.pascalSnakeCaseWithUnderscoreSuffix,
BLANK_THEME_: themeInfo.macroCaseWithUnderscoreSuffix,
'Blank theme': 'Blank Theme',
'underscore theme': 'Blank Theme',
blankTheme: 'blank-theme',
};

const files = getAllFiles(getRoot());
Expand Down Expand Up @@ -239,6 +242,11 @@ const getAllFiles = (dir) => {
*/
const replaceFileContent = (files, chunksToReplace, newChunk) => {
files.forEach((file) => {

if(path.basename(file) === 'init.js' && (chunksToReplace === 'Blank theme' || chunksToReplace === 'underscore theme' || chunksToReplace === 'blankTheme')) {
return;
}

const filePath = path.resolve(getRoot(), file);

try {
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
},
"config": {
"discard-changes": true,
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
2 changes: 1 addition & 1 deletion languages/blank-theme.pot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2021 Blank Theme
# Copyright (C) 2022 Blank Theme
# This file is distributed under the same license as the Blank Theme package.
msgid ""
msgstr ""
Expand Down
3 changes: 1 addition & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what
you've learned with others.

Blank Theme is based on Underscores http://underscores.me/, (C) 2012-2015 Automattic, Inc.
Underscores is distributed under the terms of the GNU GPL v2 or later.
Blank Theme is based on Blank theme https://github.com/rtCamp/blankTheme

Normalizing styles have been helped along thanks to the fine work of
Nicolas Gallagher and Jonathan Neal http://necolas.github.com/normalize.css/
Expand Down