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

Fix: Linting issues and Update readme.md file #104

Merged
merged 10 commits into from
Feb 12, 2025
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
Blank Theme
===
# 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 blank theme created with the underscore theme, which includes the Foundation basic grid system and some basic customizer settings required in almost all projects.

## Getting Started


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

After cloning repo run
After cloning the repo, run the following:

```bash
npm install
```

and then run the following command which will prompt for the theme name, start renaming and do cleanup.
Then run the following command which will prompt for the theme name, start renaming, and clean up:

```bash
npm run init
```



#### Compile Assets

```
npm run dev # During development
npm run prod # When ready for production
```

To compile assets, use the following commands:

```bash
npm run build:dev # During development
npm run build:prod # When ready for production
```

#### Other Commands

```bash
# Generate pot files
npm run pot
# Generate POT files
npm run build:pot

# Lint all at once
npm run lint:all

# Lint only staged files
npm run lint:staged

# Lint CSS, JS and PHP
# Lint individual CSS, JS, PHP and package.json
npm run lint:css
npm run lint:css:fix
npm run lint:js
npm run lint:js:fix
npm run lint:js:report
npm run lint:php
npm run lint:php:fix
npm run lint:package-json
```

#### Before Commit


#### Before commit

This `precommit` script will lint your scss, js, php files and also generate pot file.
This `precommit` script will lint your SCSS, JS, PHP files and also generate the POT file:

```bash
npm run precommit
```

## Does this interest you?


Does this interest you?
---------------
<a href="https://rtcamp.com/"><img src="https://rtcamp.com/wp-content/uploads/sites/2/2019/04/[email protected]" alt="Join us at rtCamp, we specialize in providing high performance enterprise WordPress solutions"></a>
<a href="https://rtcamp.com/"><img src="https://rtcamp.com/wp-content/uploads/sites/2/2019/04/[email protected]" alt="Join us at rtCamp, we specialize in providing high performance enterprise WordPress solutions"></a>
47 changes: 24 additions & 23 deletions assets/src/js/admin/customizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,40 @@
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
* @param {Object} $ jQuery object.
*/

(($) => {
( ( $ ) => {
// Site title and description.
wp.customize('blogname', (value) => {
value.bind(function (to) {
$('.site-title a').text(to);
});
});
wp.customize( 'blogname', ( value ) => {
value.bind( function( to ) {
$( '.site-title a' ).text( to );
} );
} );

wp.customize('blogdescription', (value) => {
value.bind(function (to) {
$('.site-description').text(to);
});
});
wp.customize( 'blogdescription', ( value ) => {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );

// Header text color.
wp.customize('header_textcolor', (value) => {
value.bind(function (to) {
if ('blank' === to) {
$('.site-title, .site-description').css({
wp.customize( 'header_textcolor', ( value ) => {
value.bind( function( to ) {
if ( 'blank' === to ) {
$( '.site-title, .site-description' ).css( {
clip: 'rect(1px, 1px, 1px, 1px)',
position: 'absolute',
});
} );
} else {
$('.site-title, .site-description').css({
$( '.site-title, .site-description' ).css( {
clip: 'auto',
position: 'relative',
});
$('.site-title a, .site-description').css({
} );
$( '.site-title a, .site-description' ).css( {
color: to,
});
} );
}
});
});
} )( jQuery ); // eslint-disable-line -- no-undef
} );
} );
} )( jQuery ); // eslint-disable-line no-undef
4 changes: 2 additions & 2 deletions assets/src/js/components/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ const WebFont = {
loadWebFonts() {
const WebFontConfig = {
google: {
families: ['Open Sans:300,400,700', 'Roboto:500'],
families: [ 'Open Sans:300,400,700', 'Roboto:500' ],
},
};

WebFontLoader.load(WebFontConfig);
WebFontLoader.load( WebFontConfig );
},
};

Expand Down
3 changes: 3 additions & 0 deletions assets/src/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
* Home scripts.
*/

/**
* Internal dependencies
*/
import '../sass/home.scss';
3 changes: 3 additions & 0 deletions assets/src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* Main scripts, loaded on all pages.
*/

/**
* Internal dependencies
*/
import '../sass/main.scss';
import { common as BlankThemeCommons } from './components';

Expand Down
3 changes: 3 additions & 0 deletions assets/src/js/single.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
* Single page scripts.
*/

/**
* Internal dependencies
*/
import '../sass/single.scss';
6 changes: 3 additions & 3 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<h2 class="comments-title">
<?php
$blank_theme_comments_number = get_comments_number();
if ( 1 === $comments_number ) {
if ( 1 === $blank_theme_comments_number ) {
printf(
/* translators: %s: post title */
esc_html_x( 'One thought on &ldquo;%s&rdquo;', 'comments title', 'blank-theme' ),
Expand All @@ -42,12 +42,12 @@
_nx(
'%1$s thought on &ldquo;%2$s&rdquo;',
'%1$s thoughts on &ldquo;%2$s&rdquo;',
$comments_number,
$blank_theme_comments_number,
'comments title',
'blank-theme'
)
),
esc_html( number_format_i18n( $comments_number ) ),
esc_html( number_format_i18n( $blank_theme_comments_number ) ),
'<span>' . esc_html( get_the_title() ) . '</span>'
);
}
Expand Down