Giter Club home page Giter Club logo

welaika / wordless Goto Github PK

View Code? Open in Web Editor NEW
1.4K 38.0 107.0 13.01 MB

All the power of Pug, Sass, Coffeescript and WebPack in your WordPress theme. Stop writing themes like it's 1998.

Home Page: https://www.wptools.it/wordless

Shell 0.74% PHP 92.35% HTML 2.01% CSS 0.63% JavaScript 1.70% XSLT 1.95% Makefile 0.04% Batchfile 0.05% Python 0.31% SCSS 0.09% Pug 0.12% Dockerfile 0.01% Procfile 0.01%
php wordpress wordpress-starter-theme sass pug pug-template-engine jade webpack yarn scss

wordless's Introduction

Wordless logo

Wordless is a junction between a WordPress plugin and a theme boilerplate that dramatically speeds up and enhances your custom theme creation. Some of its features are:

  • A structured, organized and clean theme organization
  • Bootstrap a new theme directly within wp-cli
  • Write PHP templates with Pug templating system
  • Write CSS stylesheets using the awesome SCSS syntax
  • Out-of-the-box support to Stylelint configured for SCSS syntax.
  • Write Javascript logic using modern syntax thanks to Babel
  • Automatically polyfill (with core-js) and transpile Javascript based on your support inside .browserslistrc
  • A growing set of handy and documented PHP helper functions ready to be used within your views
  • Preconfigured support to MailHog mail-catcher in development.
  • Development workflow backed by WebPack, BrowserSync (with live reload), WP-CLI, Yarn. All the standards you already know, all the customizations you may need.

Helpers tests Documentation Status

Documentation

Complete documentation

Read the complete Wordless documentation at wordless.readthedocs.io where you'll find - hopefully - all the information about installation, usage guide, in depth explanation about the stack.

If you want to contribute to the documentation.

Every subsequent make documentation will refresh your HTML.

Built-in helpers documentation

You can find it at http://welaika.github.io/wordless/docs/latest/html/index.html.

If you are interested in contributing to the documentation:

  • we are documenting php files in
 wordless/helpers/*
  • here is a list of documentation gaps :9
  • brew install doxygen
  • go and add doc following the doxygen conventions
  • compile the new doc with doxygen docs/Doxyfile (from project's root)
  • you'll have an untracked folder docs/build in GiT. Leave it alone and git checkout gh-pages instead.
  • mv docs/build docs/latest overwriting the old one
  • commit and push the branch

Development

Deploy

  • Merge your feature branch - with passing tests - in master with git checkout master && git merge --no-ff feature or by pull request
  • On master update the plugin version (SEMVER) in ./wordless.php ("Version") and readme.txt ("Stable tag") files and commit the updated files.
  • do git tag x.y.x where x.y.z equals to the previously written version.
  • git push origin master --tags to push both commits and tags
  • update the changelog for the new release at https://github.com/welaika/wordless/releases

Automations will do the leftovers, including to publish updated documentation on ReadTheDocs and the plugin on https://wordpress.org/plugins/wordless/

Changelog

A changelog for each tag/relase is mandatory to be compiled at https://github.com/welaika/wordless/releases.

Additional recommended plugins and tools

Wordmove: a great gem (from yours truly) to automatically mirror local WordPress installations and DB data back and forth from your local development machine to the remote staging server;

Known limitations

  • Wordless has not been tested on Windows

Deprecations

6.0

Dropped support for PHP <8.1

4.0

Default configuration has dropped support for CoffeeScritp and for SASS indented syntax. Obviously you are free to change Webpack's config once you've created the theme, but now we officially support ES2015 and SCSS instead.

3.0

Ruby-based preprocessors and the WORDLESS_LEGACY configuration are definitely dropped. Theme's folder structure changed.

2.5

Wordless 2.5 deprecates the old ruby preprocessor support. It is disabled by default. If you need to develop an old theme you need to explicitely activate them by setting the following in your wp-config.php:

define('WORDLESS_LEGACY', true);

We plan to completely remove this support in Wordless 3.

Localization

Wordless is available in English, German, Greek, Italian and Spanish, at the moment.

The user interface was translated by Wasilis Mandratzis-Walz (German and Greek), David Mejorado (Spanish).

Your help is welcome! Add your own language using Transifex.

Need more tools?

Visit WordPress Tools.

Third Part Libraries

Author

made with ❤️ and ☕️ by weLaika

License

(The MIT License)

Copyright © 2011-2019 weLaika

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

wordless's People

Contributors

aleonrails avatar alessandro-fazzi avatar arkham avatar arun744-newscorp avatar danielegiorgis avatar danielpk avatar daronco avatar davidmh avatar dbeard avatar delphaber avatar dew-frost avatar eliawk avatar emzo avatar endorama avatar etienne avatar evan-dickinson avatar flashingcursor avatar jhummel avatar jimmy2k avatar johanbrook avatar johnthepink avatar kylekatarnls avatar markjaquith avatar namuit avatar onnimonni avatar philiparthurmoore avatar ramensoup avatar stefanoverna avatar utkarshkukreti avatar wstucco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordless's Issues

Efficient way of handling pagination/paged archive etc

I've been using wordless on a few projects already and really enjoy it.

There are some things that are bothering me however.

  • When doing pagination I have to write the code controlling it myself for example:

index.php:

if (is_paged()) {
  render_view("posts/archive");
}

posts/archive.html.haml:

- $page_num = get_query_var( 'paged' )
- query_posts( "posts_per_page=2&paged=$page_num" )
- while (have_posts())
      - the_post()
      %li= render_partial("posts/post")

This is not the most complex code, but it would've been nice if some of Wordpress's default behavior would prepare this bit for us.

However, I encountered a more complex problem when I had to do pagination for date archive (i.e. /2012/05/23/page/2), neither is_archive(), is_paged() or is_date() returns true in this case, maybe there's another Conditional Tag that I should be using here, but I have yet to find that out.

What would a possible workaround be?

Automatic compile assets for deploy

Up to now to deploy a Wordless theme you need to get manually the compiled assets.

Is possible to handle the final build in a better way, to easy the deploy process.

Static assets not compiling properly for production on ruby-less server

I've been using wordless successfully on a server with ruby. I then pushed to my production server (as PaaS server which does not have ruby installed at all). I cannot see the static assets, like application.css.

I am seeing this error on my pages:

body::before { content: "The path /home/vagrant/.rvm/bin/wordless_compass doesn't seem to be an executable!"; font-family: monospace; }

How do I test to make sure static assets are compiled on my staging server? What should I check into my git repo?

"environments" variable

Add a folder inside config/ called environment in which specify configuration for different state of the theme ( development, staging, production ).

A doubt: what is the best way to load the proper environment file?

Update documentation for locales

I couldn't get the locales to work at first. But after a while I managed to find a solution, which could've been solved with a simple note in the documentation.

Using __() without the domain specified will not work, i.e.:
__("News")

Using the domain we will make it work, i.e:
__("News", "we")

Maybe this should be mentioned in README.mdown?

Asset cache create problems in css compilation

With assets cache enabled if you include more than one css in the page only one css is returned.

Example of this behaviour:

In _head.haml I have:

<?php
= stylesheet_link_tag("bootstrap")
= stylesheet_link_tag("screen")

Both are compiled correctly in the tmp folder, but if I click on bootstrap.css link and on screen.css I get the same file content ( which is the content of the bootstrap.css file, as it comes before the other... )

I found a workaround:
To prevent this behaviour you must DISABLE assets.cache_enabled:

<?php
Wordless::set_preference("assets.cache_enabled", false);

Possibility to pass variables to render_view() and yield()

Now is not possible to pass variables to render_view() in the same way we can do with and render_partial().

I think would be useful to edit render_view() to accept a $locals array and pass it to render_template():

<?php
function render_view($name, $locals = array(), $layout = 'default') { ... }

The same thing could be done to yield().

tag helper syntax

how do i add a class or id to a tag, such as link_to? i've tried variations such as:

link_to('link', '#', class="classname")
link_to('link', '#', {:class => 'classname'})
link_to('link', '#', ".classname")
link_to('link', '#', "class='classname'")

nothing seems to work.

css doesn't compile

everything is working fine, except that i'm not getting any css output. i'm currently running codekit to output css. please let me know what further info you need.

Make Haml optional

I know Wordless is meant to be an opinionated plugin, but would there be any objections to making Haml optional, just like Coffeescript?

How to setup Options Framework with WordLess

Hello I would like to know how to setup Options Framework with WordLess ?

I tried to put the options.php in the config/initializers, but I have the same message in wordpress admin
"Your current theme does not have support for the Options Framework plugin. Learn More | Hide Notice".

Also for example if I'm working on a WooCommerce theme, where I would had to put the woocommerce (template folder) in my WordLess theme ?

(The new structure of wordless is still a bit strange for me)

Otherwise Wordless is great !

Make docs disposable

Actually the documentation can only be build from the git repository. Could be a good idea to make it disposable online and downloadable from the git page ? :D

Issues with rbenv

This is a followup to my previous post. I cannot get wordless working with rbenv. I followed the instructions but when wordless trying to process the assets is cannot run the executables. Any advise on this would be great as I have had my site built for a month and get get it working with wordless!

render partial with variables

it looks like render_partial doesn't accept local variables right now. it would be great to add that capability so that it works like rails.

Default 404 view

Can be a good idea to add a default 404 view to the vanilla theme.

Static asset font files renders as 404 page

When I place fonts inside of <my theme>/assets/fonts directory and reference them in my stylesheet, when I inspect Firebug's NET tab, I get the WordPress custom 404 page as the SUCCESS response, instead of the actual referenced font.

If I remove the font altogether from the directory, I get an actual 404 ERROR response.

In other words, it seems that the referenced font is located when present, but somehow it's not being recognized a font.

Perhaps I've found a bug, or just need some assistance with setup.

Thanks,

Vic

Overridable options for new_post_type and new_taxonomy

Actually there are some options in new_post_type and new_taxonomy that are hardcoded and cannot be overriden in any way.

<?php
register_post_type(
      $name["singular"],
      array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'query_var' => true,
        'has_archive' => true,
        'rewrite' => array('slug' => $name["plural"]),
        'capability_type' => 'post',
        'hierarchical' => false,
        'menu_position' => null,
        'supports' => $supports
      )
    );
<?php
register_taxonomy(
      $name["singular"],
      $post_types,
      array(
        'hierarchical' => $hierarchical,
        'labels' => $labels,
        'show_ui' => true,
        'query_var' => true,
        'rewrite' => array('slug' => $name["plural"])
      )
    );

We nedd to add an option array that can override this options.

Fix for CompassPreprocessor.asset_hash

The asset_hash method in CompassPreprocessor doesn't currently work because it looks for .coffee files instead of stylesheets.

So I assume this:
$files = $this->folder_tree(dirname($base_path), "*.coffee");

Needs to be changed to:
$files = $this->folder_tree(dirname($base_path), "*.{sass,scss}");

latest_posts_of_category does not work

There is a little bug in latest_posts_of_category() which prevent it from working.

<?php
'tax_query' => array(
  'taxonomy' => $taxonomy,
  'field' => 'slug',
  'terms' => $category,
),

should be

<?php
'tax_query' => array(
  array(
    'taxonomy' => $taxonomy,
    'field' => 'slug',
    'terms' => $category,
  ),
),

Per-theme preprocessor preference

I've been playing around with adding a new preprocessor for LESS files. This got me thinking about how best to specify which preprocessor should be used for each type of asset. I imagine this would be a preference you could set in theme/config/initializers/wordless_preferences.php, but what would be the preferred way of specifying the processors?

  1. A simple array specified in a single preference, for example:
    • Wordless::set_preference("assets.preprocessors", array("SprocketsPreprocessor", "CompassPreprocessor"));
  2. Or maybe a separate preference for each asset type:
    • Wordless::set_preference("preprocessors.css", "CompassPreprocessor");
    • Wordless::set_preference("preprocessors.js", "SprocketsPreprocessor");
  3. Or as above, but with the generated asset type coming first, like:
    • Wordless::set_preference("css.preprocessor", "CompassPreprocessor");
    • Wordless::set_preference("js.preprocessor", "SprocketsPreprocessor");

latest_post_of_category() does not return last post by date

The query_helper function latest_post_of_category() does not return last post by date, as the query is done with ASC ordering parameter which return always first edited post instead of last edited one.

Fix:

<?php
function latest_post_of_category($category, $post_type = 'post', $taxonomy = 'category') {
    return latest_posts_of_category($category, 1, 0, $post_type, $taxonomy, 'date', 'DESC');
}

Probably this applies to latest_post_of_category() to.

Better versioning

I found it hard to understand which version of wordless I'm using. This cause some trouble due to the fact that the master branch changes frequently and is difficult to follow code changes, in particular is difficult to get documentation for older versions.

I think would be better if every significant commit pushed to master creates a new version, have his changelog publicly available and that the version is clearly specified in documentation/code.

Debug Configuration

Can you add an option to the wordless config file that would allow me to see the debug messages in both css and js outputs?

use wp_title() function to get page title

I think is preferable to use wp_title() instead of QueryHelper::get_page_title() to set the page title in the vanilla theme, as this would maintain compatibility with wp_title WordPress filter.

Add a preprocessor for LESS

Some people prefer using LESS than SASS/SCSS. Since the Wordless preprocessor system is built in a way that makes it easy to add new preprocessors, why not add a LESS preprocessor? Example code for such a very basic LESS preprocessor can be found here: https://gist.github.com/1924883

LoadError (Sprockets and Compass)

While setting up Wordless, I encountered these issues:

"/Users/Johan/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': 
Could not find compass (>= 0) amongst [minitest-1.6.0, rake-0.8.7, rdoc-2.5.8] (Gem::LoadError)

from /Users/Johan/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/Johan/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:1210:in `gem'
from /Users/Johan/.rvm/gems/ruby-1.9.2-p0/bin/compass:18:in `<main>'

and

/Users/Johan/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- sprockets (LoadError)
from /Users/Johan/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/Johan/Sites/dev/wordpress/wp-content/plugins/wordless/wordless/preprocessors/sprockets_preprocessor.rb:5:in `<main>'

Seems like the scripts can't use sprockets and compass, even though I have these gems installed (through RVM). I've configured my Compass and Ruby paths in the Wordless preferences file:

Wordless::set_preference("compass.compass_path", "/Users/Johan/.rvm/gems/ruby-1.9.2-p0/bin/compass");
Wordless::set_preference("sprockets.ruby_path", "/Users/Johan/.rvm/rubies/ruby-1.9.2-p0/bin/ruby");

Do I really have to create a gemset in order to make Wordless compile Sass and CoffeeScript?

can't get it working on MAMP

Hello
So i setup all like in the readme description. MAMP is also running for Apache and the Mysql, but it doesn't work,
the Sass- or Haml-files are'nt compiled, it even didn't builds any of the preset CSS.

Any Idea where's my mistake?

Greetz

css.output_style is ignored

In config/initializers/wordless_preferences.php, line 8
Wordless::set_preference("css.output_style", "expanded");

But the css.output_style option is completely ignored by compass, which renders files always with :compressed style.

Wordless pass the correct variable to the Process class, but for some reason the execution do not follow the setting.

Add defined custom post type to WordPress default feed

Could be a good idea to make Wordless automatically add user defined custom post type to the default WordPress feed? For me it seems logical, as the default feed must contains all the content posted on the website...

Maybe we could implement this with a configurable parameter?

Arguments order in DateHelper::time_tag()

The arguments order in DateHelper::time_tag() is wrong: now the code is
function time_tag($date_or_time = NULL , $text, $attributes = array()) {
In this way the first optional argument is useless, because $text needed to be specified every time.
The best way to do this is:
function time_tag($text, $date_or_time = NULL, $attributes = array()) {

Wordless gem

I think a Wordless gem would simplify many operations and bring a healthy dose of Rails culture to WordPress development.

Some example tasks I would propose:

wordless new mysite

  • Download the latest stable version of WordPress
  • Install the latest stable version of Wordless and create a Wordless theme
  • Automatically configure executable paths in config/initializers/wordless_preferences.php
  • Add a properly configured .gitignore (i.e. ignore wp-content/themes/mysite/theme/tmp/*)

Some other possible stuff:

wordless new mysite -c less: Preconfigure the theme with the LESS preprocessor, see #58
wordless new mysite -v php: Use PHP views instead of Haml views in the generated theme
wordless new mysite --edge: Use master branch of Wordless instead of latest stable
wordless compile: Compile static assets (see #59)
wordless deploy production: Compile assets and deploy using Wordmove (or some other mechanism)

Any thoughts?

Use WP_Query objects instead of query_posts()

I've found that using WP_Query to query the database leads to easier management than query_posts() as does not interfer with the main WordPress loop and does not modify the global WP_Query object, expecially if you need multiple loops, one inside the other.
I'm not sure that using WP_Query instead of query_posts everywhere is equally apreciated from all Wordless users.

I'd like to have some feedback about this. In my last project I wrote wp_reset_query() 2/3 times per view, and that leads me to this conclusion.
Maybe could be great if there is a Wordless option that lets you specify this?

Help with Less setup for Wordless.

Hey man. Hopefully it's alright for me to ask here.

Can we get a little bit of guidance on how to set Wordless up to use Less?

I feel like I did it correctly but it's not working.

Do we set the 'assets.preprocessor' to:

"Wordless::set_preference("assets.preprocessors", array("SprocketsPreprocessor", "LessPreprocessor"));

Should the compass lines be commented out?

Do we have to edit less_preprocessor.php at all? Or we can just set the path in the wordless_preferences.php file?

Sorry for the newb q's. I'm not the strongest ruby dev ever so I may be overlooking some glaring issue.

But this is an amazing piece of software, and I'm on a mission to make it work. Would appreciate any bit of guidance you can offer. I searched everywhere but wasn't finding anything except the pull request pages etc.

Thanks so much!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.