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 Issues

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!

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.

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.

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

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

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?

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.

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.

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

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 !

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?

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.

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?

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().

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!

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.

"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?

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");

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?

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()) {

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.

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?

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

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?

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.

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?

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}");

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.

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,
  ),
),

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?

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?

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.