-
Notifications
You must be signed in to change notification settings - Fork 15
PKG_VERSION placeholder seems not to work in markup files #34
Comments
Okay, it works in comments, but not somewhere else. Wanted behaviour? |
It works in markup files (in comments and in the code) but it looks like it works only for the first replacement in every file. Example: src:
dist:
|
This might only work if you remove the comment in the head of the default template. I've already tested to set a variable at start, after the first replacement which is the comment. How about reading the package.json in PHP separately and setting a global variable for use in markup files? I'm bothered that there is a performance drop in compilation if the replace script of gulp would have to replace all instances of all markup files. |
By default, we add the current version to the theme's style.css (https://github.com/whatwedo/gulp-wp-theme/blob/master/src/resources/stylus/style.styl#L6) Therefore, you can use a WordPress internal function to get the current theme version: https://codex.wordpress.org/Function_Reference/wp_get_theme#Display_the_Current_Theme.27s_Version But anyway this bug should be fixed |
Uhh.... didn't know about that. Solves the problem entirely and IMHO should be used instead of replaces in markup. |
e.g. using it in functions.php, it doesn't get replaced on compilation.
The text was updated successfully, but these errors were encountered: