{"action":"created","issue":{"url":"https://api.github.com/repos/jekyll/jekyll/issues/5407","repository_url":"https://api.github.com/repos/jekyll/jekyll","labels_url":"https://api.github.com/repos/jekyll/jekyll/issues/5407/labels{/name}","comments_url":"https://api.github.com/repos/jekyll/jekyll/issues/5407/comments","events_url":"https://api.github.com/repos/jekyll/jekyll/issues/5407/events","html_url":"https://github.com/jekyll/jekyll/issues/5407","id":179008278,"number":5407,"title":"[Feature Request] semantic liquid filters for assets","user":{"login":"ashmaroli","id":12479464,"avatar_url":"https://avatars.githubusercontent.com/u/12479464?v=3","gravatar_id":"","url":"https://api.github.com/users/ashmaroli","html_url":"https://github.com/ashmaroli","followers_url":"https://api.github.com/users/ashmaroli/followers","following_url":"https://api.github.com/users/ashmaroli/following{/other_user}","gists_url":"https://api.github.com/users/ashmaroli/gists{/gist_id}","starred_url":"https://api.github.com/users/ashmaroli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashmaroli/subscriptions","organizations_url":"https://api.github.com/users/ashmaroli/orgs","repos_url":"https://api.github.com/users/ashmaroli/repos","events_url":"https://api.github.com/users/ashmaroli/events{/privacy}","received_events_url":"https://api.github.com/users/ashmaroli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"benbalter","id":282759,"avatar_url":"https://avatars.githubusercontent.com/u/282759?v=3","gravatar_id":"","url":"https://api.github.com/users/benbalter","html_url":"https://github.com/benbalter","followers_url":"https://api.github.com/users/benbalter/followers","following_url":"https://api.github.com/users/benbalter/following{/other_user}","gists_url":"https://api.github.com/users/benbalter/gists{/gist_id}","starred_url":"https://api.github.com/users/benbalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbalter/subscriptions","organizations_url":"https://api.github.com/users/benbalter/orgs","repos_url":"https://api.github.com/users/benbalter/repos","events_url":"https://api.github.com/users/benbalter/events{/privacy}","received_events_url":"https://api.github.com/users/benbalter/received_events","type":"User","site_admin":true},"assignees":[{"login":"benbalter","id":282759,"avatar_url":"https://avatars.githubusercontent.com/u/282759?v=3","gravatar_id":"","url":"https://api.github.com/users/benbalter","html_url":"https://github.com/benbalter","followers_url":"https://api.github.com/users/benbalter/followers","following_url":"https://api.github.com/users/benbalter/following{/other_user}","gists_url":"https://api.github.com/users/benbalter/gists{/gist_id}","starred_url":"https://api.github.com/users/benbalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbalter/subscriptions","organizations_url":"https://api.github.com/users/benbalter/orgs","repos_url":"https://api.github.com/users/benbalter/repos","events_url":"https://api.github.com/users/benbalter/events{/privacy}","received_events_url":"https://api.github.com/users/benbalter/received_events","type":"User","site_admin":true}],"milestone":null,"comments":2,"created_at":"2016-09-24T03:36:04Z","updated_at":"2016-09-26T13:50:56Z","closed_at":null,"body":"Placing a request to have semantic filters to pull in assets from a theme gem.\r\nClose on the heels of the newly added `{{ 'abc' | absolute_url }}` & `{{ 'abc' | relative_url }}`, I'd like to suggest the following as well:\r\n\r\n- [asset_url](#asset-url)\r\n- [img_url](#img-url)\r\n- [javascript_url](#javascript-url)\r\n- [stylesheet_url](#stylesheet-url)\r\n\r\n---\r\n\r\n## asset_url\r\nthis filter adds any file that is an immediate child of `assets/` directory:\r\n\r\n```html\r\n<!-- \r\nlook for \"assets/style.css\" or \"assets/logo.png\" or \r\n\"assets/script.js\" or \"assets/font.ttf\"\r\n -->\r\n\r\n{{ 'style.css' | asset_url }}\r\n{{ 'logo.png' | asset_url }}\r\n{{ 'script.js' | asset_url }}\r\n{{ 'font.ttf' | asset_url }}\r\n```\r\n\r\n--\r\n## img_url\r\nthis filter adds an image file from within `assets/img/` or `assets/image/` :\r\n\r\n```html\r\n<!-- look for \"assets/img/logo.png\" or \"assets/images/logo.png\" -->\r\n\r\n{{ 'logo.png' | img_url }}\r\n```\r\n\r\n--\r\n## javascript_url\r\nthis filter adds a script file from `assets/js/` or `assets/scripts/`\r\n\r\n```html\r\n<!-- look for \"assets/js/script.js\" or \"assets/scripts/script.js\" -->\r\n\r\n{{ 'script.js' | javascript_url }}\r\n```\r\n\r\n--\r\n## stylesheet_url\r\nthis filter adds the stylesheet from `assets/css/` or `assets/styles/`\r\n\r\n```html\r\n<!-- look for \"assets/css/style.css\" or \"assets/styles/style.css\" -->\r\n\r\n{{ 'style.css' | stylesheet_url }}\r\n```\r\n\r\n---\r\nN.B. I'm aware of existing similars via `jekyll-assets` plugin\r\n\r\n--\r\n/cc @jekyll/ecosystem\r\n"},"comment":{"url":"https://api.github.com/repos/jekyll/jekyll/issues/comments/249574913","html_url":"https://github.com/jekyll/jekyll/issues/5407#issuecomment-249574913","issue_url":"https://api.github.com/repos/jekyll/jekyll/issues/5407","id":249574913,"user":{"login":"benbalter","id":282759,"avatar_url":"https://avatars.githubusercontent.com/u/282759?v=3","gravatar_id":"","url":"https://api.github.com/users/benbalter","html_url":"https://github.com/benbalter","followers_url":"https://api.github.com/users/benbalter/followers","following_url":"https://api.github.com/users/benbalter/following{/other_user}","gists_url":"https://api.github.com/users/benbalter/gists{/gist_id}","starred_url":"https://api.github.com/users/benbalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benbalter/subscriptions","organizations_url":"https://api.github.com/users/benbalter/orgs","repos_url":"https://api.github.com/users/benbalter/repos","events_url":"https://api.github.com/users/benbalter/events{/privacy}","received_events_url":"https://api.github.com/users/benbalter/received_events","type":"User","site_admin":true},"created_at":"2016-09-26T13:50:56Z","updated_at":"2016-09-26T13:50:56Z","body":"I like this. I'd be weary to make the behavior too fungible (e.g., via config) or too smart (e.g., via alternate paths), to avoid accidentally implementing something that approaches magic. `assest_url` makes 100% sense, as a purpose-built extension of `absolute_url`. As we start getting into `img_url` or `javascript_url`, especially with multiple potential resolution paths, I'm worried we may make it harder for users to know where their assets are (and suspect the first thing people will want is to be able to customize that path, meaning we're getting net more complexity).\r\n\r\nComing at the problem from a different perspective, if Themes (and JekyllAssets) have a special assets folder in the resulting site, we may be able to get away with just `assets_url` (which is simply `| prepend: \"/assets/\" | absolute_url`, as then images can be `/foo.img | assets_url` or `/img/foo.img | assets_url` without the need for four new filters and corresponding config flags."}}
{"actor":{"display_login":"benbalter"}}