{"action":"created","issue":{"url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin/issues/23","repository_url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin","labels_url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin/issues/23/comments","events_url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin/issues/23/events","html_url":"https://github.com/iGitScor/critical-webpack-plugin/issues/23","id":218366243,"number":23,"title":"Critical CSS and Twig Files","user":{"login":"JakeHenshall","id":4720782,"avatar_url":"https://avatars2.githubusercontent.com/u/4720782?v=3","gravatar_id":"","url":"https://api.github.com/users/JakeHenshall","html_url":"https://github.com/JakeHenshall","followers_url":"https://api.github.com/users/JakeHenshall/followers","following_url":"https://api.github.com/users/JakeHenshall/following{/other_user}","gists_url":"https://api.github.com/users/JakeHenshall/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeHenshall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeHenshall/subscriptions","organizations_url":"https://api.github.com/users/JakeHenshall/orgs","repos_url":"https://api.github.com/users/JakeHenshall/repos","events_url":"https://api.github.com/users/JakeHenshall/events{/privacy}","received_events_url":"https://api.github.com/users/JakeHenshall/received_events","type":"User","site_admin":false},"labels":[{"id":550742615,"url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin/labels/Skill:%20intermediate","name":"Skill: intermediate","color":"0967C3","default":false},{"id":550742606,"url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin/labels/Status:%20need%20a%20contributor","name":"Status: need a contributor","color":"000000","default":false},{"id":550742629,"url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin/labels/Task:%20much%20work","name":"Task: much work","color":"7BCDA0","default":false},{"id":550742613,"url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin/labels/Work:%20enhancement","name":"Work: enhancement","color":"8307C0","default":false},{"id":550742597,"url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin/labels/Workflow:%20pending","name":"Workflow: pending","color":"F5AC00","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-03-31T00:35:22Z","updated_at":"2017-04-07T14:39:47Z","closed_at":null,"body":"Hi,\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\n\r\nCan this plugin work with timber and WordPress\r\n\r\n**What is the current behavior?**\r\n\r\nI would like to know if it is possible to create critical css files for:\r\n\r\n- Common Twig Templates like (Index / Page / Front Page / Single / Archive / Blog / Woocommerce).\r\n- If we can add in the page names that we want the critical CSS to appear on. \r\n\r\nHere is what we currently have for Gulp\r\n\r\n**manifest.json**\r\n\r\n```\r\n\"loadCss.js\": {\r\n            \"bower\": [\r\n                \"loadcss\"\r\n            ]\r\n        },\r\n\r\n\"config\": {\r\n        \"devUrl\": \"http://test.co.uk/\",\r\n        \"criticalCss\": {\r\n            \"home\": \"http://test.co.uk/\",\r\n            \"page-about-you\": \"http://test.co.uk/about-you/\",\r\n            \"page-latest-news\": \"http://test.co.uk/latest-news/\",\r\n            \"page-contact\": \"http://test.co.uk/contact-us/\"\r\n        }\r\n    }\r\n```\r\n\r\n**Gulpfile.js**\r\n\r\n```\r\nvar critical = require('critical');\r\n\r\ngulp.task('build', function (callback) {\r\n    runSequence('styles',\r\n        'modernizr',\r\n        'scripts',\r\n        'svgsprite',\r\n        'critical',\r\n        ['fonts', 'images'],\r\n        callback);\r\n});\r\n\r\ngulp.task('critical', function(){\r\n    var c = [];\r\n    for (var page in manifest.config.criticalCss) {\r\n        c.push(critical.generate({\r\n            src: manifest.config.criticalCss[page] + '?criticalcss=1',\r\n            dest: './views/partials/critical/' + page + '.twig',\r\n            extract: true,\r\n            minify: false\r\n        }));\r\n    }\r\n\r\n    return Promise.all(c).then(function(){\r\n        gulp.src(path.views + 'partials/critical/*.twig')\r\n            .pipe(concat('critical.twig'))\r\n            .pipe(cleancss())\r\n            .pipe(gulp.dest(path.views + 'partials'));\r\n    });\r\n});\r\n```\r\n\r\n**views / partials / html-head.twig**\r\n\r\n```\r\n{% if critical_request %}\r\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"{{ theme.uri }}/dist/css/main.min.css\">\r\n    {% else %}\r\n    <link rel=\"preload\" type=\"text/css\" as=\"style\" href=\"{{ theme.uri }}/dist/css/main.min.css\" onload=\"this.rel='stylesheet'\">\r\n    <script>\r\n        {% include \"dist/js/loadCss.js\" %}\r\n    </script>\r\n    {% endif %}\r\n```\r\n\r\n![image1](https://cloud.githubusercontent.com/assets/4720782/24531432/0102606a-15b1-11e7-9d71-a001ce5748eb.png)\r\n\r\n**What is the expected behavior?**\r\n\r\n_Describe the expected behavior_\r\n\r\nTo create separate twig files that will have:\r\n\r\n<style>\r\nThis Critical CSS Code\r\n</style>\r\n\r\nThis will then be based from the twig name to match the page name,\r\n\r\nAny help would be much appreciated.\r\n\r\nThank you !\r\n"},"comment":{"url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin/issues/comments/292554985","html_url":"https://github.com/iGitScor/critical-webpack-plugin/issues/23#issuecomment-292554985","issue_url":"https://api.github.com/repos/iGitScor/critical-webpack-plugin/issues/23","id":292554985,"user":{"login":"iGitScor","id":2276944,"avatar_url":"https://avatars3.githubusercontent.com/u/2276944?v=3","gravatar_id":"","url":"https://api.github.com/users/iGitScor","html_url":"https://github.com/iGitScor","followers_url":"https://api.github.com/users/iGitScor/followers","following_url":"https://api.github.com/users/iGitScor/following{/other_user}","gists_url":"https://api.github.com/users/iGitScor/gists{/gist_id}","starred_url":"https://api.github.com/users/iGitScor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iGitScor/subscriptions","organizations_url":"https://api.github.com/users/iGitScor/orgs","repos_url":"https://api.github.com/users/iGitScor/repos","events_url":"https://api.github.com/users/iGitScor/events{/privacy}","received_events_url":"https://api.github.com/users/iGitScor/received_events","type":"User","site_admin":false},"created_at":"2017-04-07T14:39:47Z","updated_at":"2017-04-07T14:39:47Z","body":"Hi @JakeHenshall, I've started the #2 issue, then I'll work on your demand.\r\nNormally, it'll be good running next week 😉 "}}
{"actor":{"display_login":"iGitScor"}}