{"id":1944,"date":"2017-01-26T22:24:56","date_gmt":"2017-01-26T21:24:56","guid":{"rendered":"http:\/\/hesmid.nl\/test\/?p=1944"},"modified":"2019-07-13T18:54:18","modified_gmt":"2019-07-13T16:54:18","slug":"sage-installation-update-for-version-9","status":"publish","type":"post","link":"https:\/\/hesmid.nl\/test\/sage-installation-update-for-version-9\/","title":{"rendered":"Sage Installation &#8211; Update for version 9"},"content":{"rendered":"\n<p><\/p>\n\n\n<ul>\n<li><span style=\"color: #ff0000;\">Update: 4-12-2018<\/span><\/li>\n<\/ul>\n<p>For older versions of Sage see <a href=\"https:\/\/hesmid.nl\/test\/web-development-2\/wordpress-web-development-2\/sage-installation\/\">this<\/a> post<\/p>\n<p><a href=\"https:\/\/github.com\/roots\/sage\">https:\/\/github.com\/roots\/sage<\/a><\/p>\n<p><a href=\"https:\/\/roots.io\/sage\/docs\">https:\/\/roots.io\/sage\/docs<\/a><\/p>\n<h3>Changes in Sage 9<\/h3>\n<ul>\n<li><strong>Laravel\u2019s Blade as a templating engine.<\/strong><br>Learn about <a href=\"https:\/\/laravel.com\/docs\/5.3\/blade\" target=\"_blank\" rel=\"noopener\">Blade<\/a>. Check out the <a href=\"https:\/\/github.com\/roots\/sage\/tree\/master\/templates\">templates directory<\/a>.\n<p>You can opt-out of Blade templates by replacing them with regular PHP ones (you could copy over the templates from Sage 8 if you really wanted to).<\/p>\n<\/li>\n<li><strong>Replaced gulp and Bower with <a href=\"https:\/\/webpack.js.org\/\">Webpack<\/a> and npm.<br><\/strong>Bower is dead and all packages should be available on npm.\n<p>Webpack is responsible for:<\/p>\n<ul>\n<li>Compiling assets\n<ul>\n<li>Sass to css with <a href=\"http:\/\/cssnano.co\/\">ccsnano<\/a><\/li>\n<li>ES6 to JavaScript that can be run in today&#8217;s browsers with <a href=\"https:\/\/gitlab.com\/Rich-Harris\/buble\">buble<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Optimizing images with optipng, gifsicle, pngquant, and svgo<\/li>\n<\/ul>\n<\/li>\n<li><strong>ES6 for Javascript<br><\/strong>Great resource for learning about ES6:&nbsp;Wes Bos\u2019 <a href=\"https:\/\/roots.io\/r\/es6\">ES6 for Everyone<\/a><br>Convert existing JS to ES6 with <a href=\"https:\/\/lebab.io\/\">Lebab<\/a><\/li>\n<li><strong>Bootstrap 4<br><\/strong>It&#8217;s still in&nbsp;<a href=\"http:\/\/blog.getbootstrap.com\/2017\/01\/06\/bootstrap-4-alpha-6\/\">alpha<\/a>, but there\u2019s <em>so<\/em> many improvements over Bootstrap 3.<strong><br><\/strong><\/li>\n<li><strong>PSR-2 coding standards.<\/strong><br>Roots projects switched to <a href=\"http:\/\/www.php-fig.org\/psr\/psr-2\/\">PSR-2<\/a> last year. Previously we had used a modified PSR-2 ruleset, but we stopped caring about 2-spaces in our PHP files and fully adopted PSR-2.<\/li>\n<li><strong>Restructured theme files.<\/strong><br>All theme templates are finally out of the theme root! Our implementation is a little hacky because a <a href=\"https:\/\/core.trac.wordpress.org\/ticket\/13239\">7 year old WordPress Trac ticket<\/a> still hasn\u2019t landed, but we believe our implementation is the best we can do at this time.<\/li>\n<li><strong>Introduced Yarn.<\/strong><br>Yarn is a drop in npm client replacement. With Yarn, the installation of Node dependencies is quicker &amp; the <code>node_modules<\/code> directory is smaller.<\/li>\n<\/ul>\n<h3>Theme Installation<\/h3>\n<ol>\n<li>Make sure all dependencies have been installed before moving on:<br><a href=\"http:\/\/php.net\/manual\/en\/install.php\">PHP<\/a> &gt;= <del>5.6.4<\/del> 7.1.3 (with php-mbstring enabled)<br>&#8211; Add the wamp php (at least 7.1.3) to Windows PATH (and no other php in the path).<br>&#8211; make sure extension=php_mbstring.dll is enabled in the php.ini of the php version you are using (default= enabled)<br><a href=\"https:\/\/getcomposer.org\/download\/\">Composer<\/a> (Dependency manager)<br><a href=\"http:\/\/nodejs.org\/\">Node.js<\/a> &gt;= 6.9.x<br>&#8211; If necessary install Node (with npm). I used the Windows installer&nbsp;<a href=\"http:\/\/nodejs.org\/download\/\">here<\/a>&nbsp;(x64 version)<br><a href=\"https:\/\/yarnpkg.com\/en\/docs\/install\">Yarn<\/a><\/li>\n<li>From your WordPress themes directory,&nbsp;run the following composer command:\n<pre>composer create-project roots\/sage your-theme-name dev-master<\/pre>\n<p>During theme installation you will have the options to:<\/p>\n<p>&#8211; Update theme headers (theme name, description, author, etc.)<br>&#8211; Select a CSS framework (Bootstrap, Foundation, none)<br>&#8211; Add Font Awesome<\/p>\n<p><strong>Update:&nbsp;<\/strong>Newest version of Sage9 (9.0.5 at the time of writing) gives the following error:&nbsp;<\/p>\n<p><code>TTY mode is not supported on Windows platform<\/code><\/p>\n<p>Solution: run this from the <em>theme<\/em> directory<\/p>\n<pre><code>.\/vendor\/bin\/sage meta        # or edit style.css directly\n.\/vendor\/bin\/sage config      # or edit resources\/assets\/config.json\n.\/vendor\/bin\/sage preset      # Install css framework<br><\/code><\/pre>\n<\/li>\n<li>Navigate to the theme directory then run yarn, and yarn build (to refresh files):\n<p><code>yarn &amp;&amp; yarn build<\/code><\/p>\n<p>You now have all the necessary dependencies to run the build process.<\/p>\n<p><strong>About dependencies:<\/strong><br>If you open<code> package.json<\/code> you&#8217;ll see both <code>devDependencies<\/code> and <code>dependencies<\/code> that Sage uses.&nbsp;<code>devDependencies&nbsp;<\/code>are used by the build process, whereas <code>dependencies<\/code> are packages that are used in the front-end theme assets.<\/p>\n<p><code>dependencies<\/code> includes the front-end options you selected during install, such as Bootstrap and Font Awesome<\/p>\n<p><code>\"dependencies\": {<\/code><br><code>&nbsp; \"bootstrap\": \"^4.0.0-beta\",<\/code><br><code>&nbsp; \"font-awesome\": \"~4.7\",<\/code><br><code>&nbsp; \"jquery\": \"1.12.4 - 3\",<\/code><br><code>&nbsp; \"popper.js\": \"~1.11\"<\/code><br><code>}<\/code><\/p>\n<p><\/p>\n<\/li>\n<\/ol>\n<p><strong>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/strong><\/p>\n<h3>Install WordPress and activate plugins<\/h3>\n<p>Optionally import test data with WP Test. See here<\/p>\n<h3><strong>Warning when activating&nbsp;i-themes Security:<\/strong><\/h3>\n<p>When activiating this plugin, it will write to your wp-config.php. <br>This causes an error with the Bedrock config setup and make you website\/admin unaccesible. <br>Solution: <br>&#8211; activate i-themes<br>&#8211; edit wp-config.php -&gt; remove file permissions added by i-themes (we use config\/application.php for that)<br>&#8211; WP admin should be accesible again<br>&#8211; Go to i-themes settings-&gt; WordPress Tweaks -&gt; File Editor -&gt; uncheck the box<\/p>\n<p><!--more--><\/p>\n<ul>\n<li>Test by running one of the build commands:<\/li>\n<li>\n<h3>Build commands<\/h3>\n<ul>\n<li><code>yarn start<\/code> \u2014 Compile assets when file changes are made, start Browsersync session<\/li>\n<li><code>yarn build<\/code> \u2014 Compile and optimize the files in your assets directory<\/li>\n<li><code>yarn build:production<\/code> \u2014 Compile assets for production<\/li>\n<\/ul>\n<\/li>\n<li>\n<h4>Additional commands<\/h4>\n<ul>\n<li><code>yarn run rmdist<\/code> \u2014 Remove your <code>dist\/<\/code> folder<\/li>\n<li><code>yarn run lint<\/code> \u2014 Run ESLint against your assets and build scripts<\/li>\n<li><code>composer test<\/code> \u2014 Check your PHP for PSR-2 compliance with <code>phpcs<br>\n<\/code><\/li>\n<\/ul>\n<\/li>\n<li>To use BrowserSync you need to update&nbsp;devUrl&nbsp;at the bottom of&nbsp;assets\/config.json&nbsp;to reflect your local development hostname.If your local development URL is <code>https:\/\/project-name.dev<\/code>, update the file to read:\n<pre><span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>devUrl<span class=\"pl-pds\">\"<\/span><\/span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>https:\/\/project-name.dev<span class=\"pl-pds\">\"<\/span><\/span>,<\/pre>\n<\/li>\n<li>If you are not using Bedrock, update publicPath to reflect your folder structure:\n<pre><span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>publicPath<span class=\"pl-pds\">\"<\/span><\/span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>\/wp-content\/themes\/sage\/<span class=\"pl-pds\">\"<\/span><\/span><\/pre>\n<\/li>\n<li><strong>Problem:<\/strong> no update after blade template changes.&nbsp; Fixed thanks to this comment:<br>\n<blockquote>\n<p><\/p>\n<div class=\"expanded-quote\">\n<p>I was running into a similar problem, and adding the following lines to <code>module.exports<\/code> in <code>webpack.config.watch.js<\/code> solved it:<\/p>\n<pre><code class=\"hljs css\">    <span class=\"hljs-selector-tag\">devServer<\/span>: {\n        <span class=\"hljs-attribute\">watchOptions<\/span>: {\n            poll: true,\n        },\n    },\n<\/code><\/pre>\n<p>In my case, I believe the issue had to do with my OS\u2019s ability to watch multiple files for changes in the way Webpack\/BrowserSync wanted by default.<\/p>\n<\/div>\n<\/blockquote>\n<\/li>\n<li><strong>Problem<\/strong>: Console connection error after manual page reload\/change. Also the page is switching quickly between unstyled and styled for a few seconds.\n<p><code>The connection to http:\/\/localhost:3000\/__webpack_hmr was interrupted while the page was loading.<br><\/code><br>Installing a newer version of Node (10.x instead of 6.9) and subsequently node-sass seems to have made the problem far less worse. The unstyled page is only visible for a short moment now. Connection to webpack is still lost, but that might be expected behaviour<\/p>\n<\/li>\n<li><strong>update:<\/strong> not sure if the text below is relevant anymore.<br>By default, Browsersync will use webpack&#8217;s <a href=\"https:\/\/webpack.github.io\/docs\/hot-module-replacement.html\">HMR<\/a>, which won&#8217;t trigger a page reload in your browser.If you would like to force Browsersync to reload the page whenever certain file types are edited, then add them to <code>watch<\/code> in <code>assets\/config.json<\/code>.\n<div class=\"highlight highlight-source-json\">\n<pre>...\n  <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>watch<span class=\"pl-pds\">\"<\/span><\/span>: [\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>assets\/scripts\/**\/*.js<span class=\"pl-pds\">\"<\/span><\/span>,\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>templates\/**\/*.php<span class=\"pl-pds\">\"<\/span><\/span>,\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>src\/**\/*.php<span class=\"pl-pds\">\"<\/span><\/span>\n  ],\n...<\/pre>\n<\/div>\n<\/li>\n<\/ul>\n<h3>Customize Bootstrap&nbsp;<\/h3>\n<p>Strip out Bootstrap scss:<\/p>\n<ol>\n<li>Open theme\/node_modules\/bootstrap\/scss\/bootstrap.scss<\/li>\n<li>Grab all the imports and paste them into main.scss in the theme, while commenting out the main Bootstrap import<\/li>\n<li>Search and replace <em><span class=\"mention\">@import<\/span> &#8220;<\/em> with <em><span class=\"mention\">@import<\/span> &#8220;~bootstrap\/scss\/<\/em> on the Bootstrap imports only<\/li>\n<li>Comment out\/delete those lines you don\u2019t need<\/li>\n<\/ol>\n<p>quote: Reduced my compiled CSS from 195K to 142K.<\/p>\n<p>Example, if you only want a reset and the grid:<\/p>\n<pre><code class=\"hljs cpp\"><span class=\"hljs-comment\">\/\/ Import npm dependencies<\/span>\n@<span class=\"hljs-keyword\">import<\/span> <span class=\"hljs-string\">\"~bootstrap\/scss\/bootstrap-reboot\"<\/span>;\n@<span class=\"hljs-keyword\">import<\/span> <span class=\"hljs-string\">\"~bootstrap\/scss\/bootstrap-grid\"<\/span>;<\/code><\/pre>\n<p><strong>BS4 JS<\/strong><\/p>\n<p><code>scripts\/autoload\/_bootstrap.js<\/code>&nbsp;imports all bootstrap with all functionalities at that location in <code>main.scss<\/code>.<\/p>\n<p>To remove all Bootstrap 4 JS remove this line in main.js:<\/p>\n<p><code>\/\/ Import everything from autoload<\/code><br><code>import '.\/autoload\/**\/*'<\/code><\/p>\n<p>loading individual components:<\/p>\n<p><code>\/\/ Required<\/code><br><code>@import \"~bootstrap\/scss\/functions\";<\/code><br><code>@import \"~bootstrap\/scss\/variables\";<\/code><br><code>@import \"~bootstrap\/scss\/mixins\";<\/code><\/p>\n<p><code>\/\/ Optional<\/code><br><code>@import \"~bootstrap\/scss\/root\";<\/code><br><code>@import \"~bootstrap\/scss\/reboot\";<\/code><br><code>@import \"~bootstrap\/scss\/type\";<\/code><br><code>@import \"~bootstrap\/scss\/images\";<\/code><br><code>@import \"~bootstrap\/scss\/code\";<\/code><br><code>@import \"~bootstrap\/scss\/grid\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/tables\";<\/code><br><code>@import \"~bootstrap\/scss\/forms\";<\/code><br><code>@import \"~bootstrap\/scss\/buttons\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/transitions\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/dropdown\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/button-group\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/input-group\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/custom-forms\";<\/code><br><code>@import \"~bootstrap\/scss\/nav\";<\/code><br><code>@import \"~bootstrap\/scss\/navbar\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/card\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/breadcrumb\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/pagination\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/badge\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/jumbotron\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/alert\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/progress\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/media\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/list-group\";<\/code><br><code>@import \"~bootstrap\/scss\/close\";<\/code><br><code>@import \"~bootstrap\/scss\/modal\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/tooltip\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/popover\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/carousel\";<\/code><br><code>@import \"~bootstrap\/scss\/utilities\";<\/code><br><code>\/\/ @import \"~bootstrap\/scss\/print\";<\/code><\/p>\n<h3><strong>Documentation<\/strong><\/h3>\n<p><a href=\"https:\/\/roots.io\/sage\/docs\">https:\/\/roots.io\/sage\/docs<\/a><\/p>\n<h3>Editor Setup<\/h3>\n<p>Recommende packages for Sublime\/ Atom etc:<\/p>\n<ul>\n<li><a href=\"https:\/\/editorconfig.org\/\">Editorconfig<\/a> -&gt;&nbsp; Sage and the other Roots projects use the .editorconfig file to help enforce spacing consistency.<br>(EditorConfig plugins look for a file named .editorconfig in the directory of the opened file and in every parent directory).<\/li>\n<li><a href=\"https:\/\/emmet.io\/\">Emmet<\/a>&nbsp;&#8211; Improves HTML &amp; CSS workflow<\/li>\n<li>highlight-selected &#8211; Higlight current selected word everywhere it appears in the file (not a Sublime package)<\/li>\n<li>language-blade&nbsp;(not a Sublime package) -&gt; use Laravel Blade Highlighter instead<\/li>\n<li><code><\/code><\/li>\n<\/ul>\n<p><strong>Coding standards:<\/strong><\/p>\n<ul>\n<li>Sage uses 4 spaces for PHP files, with the exception of template files, as it follows the <a href=\"http:\/\/www.php-fig.org\/psr\/psr-2\/\">PSR-2<\/a> coding standards.<\/li>\n<li>Two spaces are used for everything else, including Sass, JavaScript, and JSON.<\/li>\n<li>Mark Otto, the creator of Bootstrap, has a well-documented code guide for front-end developers at <a href=\"http:\/\/codeguide.co\/\">http:\/\/codeguide.co\/<\/a>&nbsp;. Some examples:\n<ul>\n<li>Avoid superfluous parent elements when writing HTML<\/li>\n<li>Keep classes lowercase and use dashes for class names<\/li>\n<li>Keep classes as short and succinct as possible<\/li>\n<li>Use meaningful names; use structural or purposeful names over presentational<\/li>\n<li>Prefix classes based on the closest parent or base class<\/li>\n<li>Use soft-tabs set to two spaces<\/li>\n<li>Avoid unnecessary nesting<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Javascript E6<\/strong><\/p>\n<ul>\n<li>Sage uses ES6 for the JavaScript that&#8217;s included in the theme. Since Sage strives to use the current best practices for<br>modern front-end development, the theme allows the usage of ES6 and also enforces coding standards with ESLint.<\/li>\n<li>The <a href=\"http:\/\/eslint.org\/docs\/user-guide\/configuring\">ESLint configuration<\/a> is located at <code>assets\/build\/.eslintrc<\/code>, where you might want to make changes that fit your own<br>coding styles.<\/li>\n<li>We&#8217;ve picked <a href=\"https:\/\/github.com\/airbnb\/javascript\">Airbnb&#8217;s JavaScript<\/a> standard as the basis for ours.<\/li>\n<li>To disable the linting in a specific file or within a file, use inline comments:<br><code>\/* eslint-disable *\/<\/code><br><code>alert('foo');<\/code><br><code>\/* eslint-enable *\/<\/code><\/li>\n<li>I had to add this file to the project root to remove eslint warnings<br><code>.jshintrc<\/code><br><code>{<\/code><br><code>&nbsp; &nbsp; 'eslintversion': 6<\/code><br><code>}<\/code><\/li>\n<\/ul>\n<h3>Theme&nbsp;Configuration and Setup<\/h3>\n<p><code>app\/setup.php<\/code> is used to enqueue stylesheets and scripts, register support for theme features with <code>add_theme_support<\/code>, and register navigation menus and sidebars.<\/p>\n<p><strong>NOTE:&nbsp;<\/strong>If you see Jquery not found errors in the console (I had this &nbsp;problem with gravity forms), you might want to disable &nbsp;the line with<\/p>\n<p><code>add_theme_support(<span class=\"hljs-string\">'soil-jquery-cdn'<\/span>);<\/code><\/p>\n<p><code><\/code>jQuery will then be put in the head and load before other plugins. A better solution is probable to properly enqueue the plugin assets?<\/p>\n<p>NOTE:&nbsp; If you don\u2019t use Bedrock as your WordPress stack, you\u2019ll want to add the following to your wp-config.php on your development installation:<br>define(&#8216;WP_ENV&#8217;, &#8216;development&#8217;);Note: If WP_ENV is not defined WP_ENV will be set to production, which may be just what you want. See <a href=\"https:\/\/hesmid.nl\/test\/workflow\/wordpress-with-git-wp-skeleton-and-roots-101\/\">other<\/a> post<\/p>\n<h4><strong>Stylesheets and scripts<\/strong><\/h4>\n<p>Manage your front-end theme assets from the <code>app\/setup.php<\/code> file:<\/p>\n<pre class=\" language-php\"><code class=\" language-php\"><span class=\"token function\">add_action<\/span><span class=\"token punctuation\">(<\/span><span class=\"token single-quoted-string string\">'wp_enqueue_scripts'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\n    <span class=\"token function\">wp_enqueue_style<\/span><span class=\"token punctuation\">(<\/span><span class=\"token single-quoted-string string\">'sage\/main.css'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token function\">asset_path<\/span><span class=\"token punctuation\">(<\/span><span class=\"token single-quoted-string string\">'styles\/main.css'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">false<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token function\">wp_enqueue_script<\/span><span class=\"token punctuation\">(<\/span><span class=\"token single-quoted-string string\">'sage\/main.js'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token function\">asset_path<\/span><span class=\"token punctuation\">(<\/span><span class=\"token single-quoted-string string\">'scripts\/main.js'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token single-quoted-string string\">'jquery'<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">null<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">100<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><br>See <a href=\"https:\/\/roots.io\/sage\/docs\/theme-development-and-building\/#theme-assets\">theme assets<\/a> for more on how these assets are built. <code>asset_path<\/code> is a helper function that returns versioned asset filenames from the <code>dist\/<\/code> directory.<br><br><\/pre>\n<h3 id=\"theme-features\">Theme features<\/h3>\n<p id=\"soil\"><strong>Soil<\/strong><\/p>\n<p>We recommend using the <a href=\"https:\/\/roots.io\/plugins\/soil\">Soil<\/a> Plugin with every WordPress install for additional features:<\/p>\n<ul>\n<li>Load jQuery from the jQuery CDN*<\/li>\n<li>Cleaner WordPress markup*<\/li>\n<li>Cleaner HTML output of navigation menus*<\/li>\n<li>Root relative URLs*<\/li>\n<li>Nice search*<\/li>\n<li>Google Analytics snippet from HTML5 Boilerplate<\/li>\n<li>Move all JS to the footer<\/li>\n<li>Disable trackbacks and pingbacks<\/li>\n<\/ul>\n<p><small>\u2217If Soil is installed and activated on your WordPress install, Sage will enable these features by default.<\/small><\/p>\n<p id=\"title-tag-support\"><strong>Title tag support<\/strong><\/p>\n<p><code>add_theme_support('title-tag')<\/code> is a feature added in WordPress 4.1 that allows themes and plugins to manage the document title. This means that there&#8217;s no <code>&lt;title&gt;<\/code> tag found in the head template since it&#8217;s automatically added by <code>wp_head()<\/code>.<\/p>\n<p id=\"register-navigation-menus\"><strong>Register navigation menus<\/strong><\/p>\n<p>Sage registers a navigation menu called Primary Navigation. Additional menus should be added in the <code>register_nav_menus<\/code> locations array.<\/p>\n<p id=\"post-thumbnails\"><strong>Post thumbnails<\/strong><\/p>\n<p>Post thumbnails are enabled with <code>add_theme_support('post-thumbnails')<\/code>, but they aren&#8217;t output on any of the default templates. Add custom post thumbnail sizes with <code>add_image_size()<\/code>.<\/p>\n<p id=\"html5-markup\"><strong>HTML5 markup<\/strong><\/p>\n<p>Sage enables HTML5 markup for captions, comment forms, comment lists, galleries, and the search form.<\/p>\n<p id=\"editor-stylesheet\"><strong>Editor stylesheet<\/strong><\/p>\n<p>The TinyMCE editor in WordPress allows loading a custom stylesheet which is registered with <code>add_editor_style()<\/code>. The editor stylesheet is automatically generated from your main theme stylesheet when you run the build script.<\/p>\n<p id=\"register-sidebars\"><strong>Register sidebars<\/strong><\/p>\n<p>Sage registers two sidebars by default: Primary &amp; Footer. Add additional sidebars with <code>register_sidebar()<\/code>.<\/p>\n<h3 id=\"theme-structure\">Theme structure<\/h3>\n<pre class=\" language-shell\"><code class=\" language-shell\">themes\/your-theme-name\/   <span class=\"token comment\"># \u2192 Root of your Sage based theme<\/span>\n\u251c\u2500\u2500 app\/                  <span class=\"token comment\"># \u2192 Theme PHP<\/span>\n\u2502   \u251c\u2500\u2500 controllers\/      <span class=\"token comment\"># \u2192 Controller files<\/span>\n\u2502   \u251c\u2500\u2500 admin.php         <span class=\"token comment\"># \u2192 Theme customizer setup<\/span>\n\u2502   \u251c\u2500\u2500 filters.php       <span class=\"token comment\"># \u2192 Theme filters<\/span>\n\u2502   \u251c\u2500\u2500 helpers.php       <span class=\"token comment\"># \u2192 Helper functions<\/span>\n\u2502   \u2514\u2500\u2500 setup.php         <span class=\"token comment\"># \u2192 Theme setup<\/span>\n\u251c\u2500\u2500 config\/               <span class=\"token comment\"># \u2192 Theme configuration<\/span>\n\u251c\u2500\u2500 composer.json         <span class=\"token comment\"># \u2192 Autoloading for `app\/` files<\/span>\n\u251c\u2500\u2500 composer.lock         <span class=\"token comment\"># \u2192 Composer lock file (never edit)<\/span>\n\u251c\u2500\u2500 dist\/                 <span class=\"token comment\"># \u2192 Built theme assets (never edit)<\/span>\n\u251c\u2500\u2500 node_modules\/         <span class=\"token comment\"># \u2192 Node.js packages (never edit)<\/span>\n\u251c\u2500\u2500 package.json          <span class=\"token comment\"># \u2192 Node.js dependencies and scripts<\/span>\n\u251c\u2500\u2500 resources\/            <span class=\"token comment\"># \u2192 Theme assets and templates<\/span>\n\u2502   \u251c\u2500\u2500 assets\/           <span class=\"token comment\"># \u2192 Front-end assets<\/span>\n\u2502   \u2502   \u251c\u2500\u2500 config.json   <span class=\"token comment\"># \u2192 Settings for compiled assets<\/span>\n\u2502   \u2502   \u251c\u2500\u2500 build\/        <span class=\"token comment\"># \u2192 Webpack and ESLint config<\/span>\n\u2502   \u2502   \u251c\u2500\u2500 fonts\/        <span class=\"token comment\"># \u2192 Theme fonts<\/span>\n\u2502   \u2502   \u251c\u2500\u2500 images\/       <span class=\"token comment\"># \u2192 Theme images<\/span>\n\u2502   \u2502   \u251c\u2500\u2500 scripts\/      <span class=\"token comment\"># \u2192 Theme JS<\/span>\n\u2502   \u2502   \u2514\u2500\u2500 styles\/       <span class=\"token comment\"># \u2192 Theme stylesheets<\/span>\n\u2502   \u251c\u2500\u2500 functions.php     <span class=\"token comment\"># \u2192 Composer autoloader, theme includes<\/span>\n\u2502   \u251c\u2500\u2500 index.php         <span class=\"token comment\"># \u2192 Never manually edit<\/span>\n\u2502   \u251c\u2500\u2500 screenshot.png    <span class=\"token comment\"># \u2192 Theme screenshot for WP admin<\/span>\n\u2502   \u251c\u2500\u2500 style.css         <span class=\"token comment\"># \u2192 Theme meta information<\/span>\n\u2502   \u2514\u2500\u2500 views\/            <span class=\"token comment\"># \u2192 Theme templates<\/span>\n\u2502       \u251c\u2500\u2500 layouts\/      <span class=\"token comment\"># \u2192 Base templates<\/span>\n\u2502       \u2514\u2500\u2500 partials\/     <span class=\"token comment\"># \u2192 Partial templates<\/span>\n\u2514\u2500\u2500 vendor\/               <span class=\"token comment\"># \u2192 Composer packages (never edit)<\/span>\n<\/code><\/pre>\n<dl class=\"dl-horizontal\">\n<dd>\n<p><\/p>\n<\/dd>\n<\/dl>\n<header>\n<h2 class=\"entry-title\">Customizing templates<\/h2>\n<\/header>\n<p>The <code>resources\/views\/<\/code> directory contains files that you can further extend with the normal <a href=\"http:\/\/codex.wordpress.org\/Template_Hierarchy\">WordPress Template Hierarchy<\/a><\/p>\n<p>Here&#8217;s what&#8217;s happening with these hooks:&nbsp;<\/p>\n<ol>\n<li>WordPress detects theme in <code>themes\/sage\/resources<\/code><\/li>\n<li>When we activate, we tell WordPress that the theme is actually in <code>themes\/sage\/resources\/views<\/code><\/li>\n<li>When we call <code>get_template_directory()<\/code> or <code>get_template_directory_uri()<\/code>, we point it back to <code>themes\/sage\/resources<\/code><\/li>\n<\/ol>\n<p>We do this so that the Template Hierarchy will look in <code>themes\/sage\/resources\/views<\/code> for core WordPress themes, but&nbsp;<code>functions.php<\/code>, <code>style.css<\/code>, and<code> index.php<\/code> are all still located in <code>themes\/sage\/resources<\/code>.<\/p>\n<p>This is not compatible with the WordPress Customizer theme preview prior to theme activation<\/p>\n<hr>\n<p>Note that <code>functions.php<\/code>, <code>screenshot.png<\/code> and <code>style.css<\/code> exist in the&nbsp;&nbsp;<code>resources\/ directory<\/code> and not the theme root. <strong>This does&nbsp;<\/strong><strong>currently come with some tradeoffs<\/strong>. <a href=\"https:\/\/github.com\/roots\/sage-installer\/issues\/3\">sage-installer Issue #3<\/a> is tracking an option to move the required theme files back&nbsp;to the theme root folder. You&#8217;ll need to follow the instructions from dmgawel if allowing your theme to be uploaded via zip&nbsp;to the WordPress admin is a requirement.<\/p>\n<h3>Blade Templates<\/h3>\n<p>Sage uses <a href=\"https:\/\/laravel.com\/docs\/5.5\/blade\">Laravel&#8217;s Blade<\/a> templating engine. Some of the benefits that come with using a templating engine include:<\/p>\n<ul>\n<li><strong>Template inheritance<\/strong> In previous versions of Sage we accomplished template inheritance with the theme&nbsp;wrapper.<\/li>\n<li><strong>Separation of data from views<\/strong> Pass your logic to template files instead of including PHP in your views files<\/li>\n<li><strong>Automatically escaped data<\/strong> When you include data with Blade, such as with&nbsp;<code>{{ get_post_meta(get_the_ID(), 'example', true) }}<\/code> (or <code>{{ get_field('example') }}<\/code> if you use ACF), the data is&nbsp;automatically escaped.<br>This means that you don&#8217;t need to use <code>esc_url<\/code> or other sanitizing functions in WordPress when outputting data&nbsp;in templates.<\/li>\n<li><strong>Beautiful looking code<\/strong> The Blade syntax is pretty clean!<br><code><\/code><\/li>\n<\/ul>\n<p><strong>Template inheritance<\/strong><\/p>\n<p>One of the biggest benefits of using Blade templates is the ability to remove any repeated markup from individual&nbsp;templates and put it into a single file. This file, <code>resources\/views\/layouts\/app.blade.ph<\/code>p, becomes the base layout file. By&nbsp;doing this we can put the focus entirely on the page specific markup and loop, simplifying our templates.<\/p>\n<p><strong>Passing data to templates<\/strong><\/p>\n<p>Sage includes a <code>sage\/template\/{$class}\/data<\/code> filter that can be used to pass data to templates. This is the most simple way&nbsp;to pass data. The filter is based of body classes and can be used to target specific templates, for example:<\/p>\n<ul>\n<li><code>sage\/template\/home\/data<\/code> \u2014 Home page<\/li>\n<li><code>sage\/template\/about\/data<\/code> \u2014 About page<\/li>\n<li><code>sage\/template\/page\/data<\/code> \u2014 All pages<\/li>\n<li><code>sage\/template\/post-type-archive-event\/data<\/code> \u2014 event post type archive<\/li>\n<li><code>sage\/template\/single-event\/data<\/code> \u2014 event single post template<\/li>\n<\/ul>\n<p>Note: Sage comes ready for you to modify the <code>body_class<\/code> by editing the filter at the top of <code>app\/filters.php<\/code>.&nbsp;<\/p>\n<p>In the example below we&#8217;re passing the the values of two ACF fields, <code>header_image<\/code> and <code>header_content<\/code>, to all pages:<\/p>\n<pre class=\"php\">add_filter('sage\/template\/page\/data', function (array $data) {<br>    $data['header_image'] = get_field('header_image');<br>    $data['header_content'] = get_field('header_content');<br>    return $data;<br>});<\/pre>\n<p>In your Blade templates for pages you can now use <code>{{ $header_image }}<\/code> and <code>{{ $header_content }}<\/code> to output the data.<\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<dl class=\"dl-horizontal\">\n<dt><code>404.blade.php<\/code><\/dt>\n<dd>Error 404 page<\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>index.blade.php<\/code><\/dt>\n<dd>Archive page (used by blog page, category archives, author archives and more)<\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>page.blade.php<\/code><\/dt>\n<dd>Single page<\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>search.blade.php<\/code><\/dt>\n<dd>Search results page<\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>single.blade.php<\/code><\/dt>\n<dd>Single post page<\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>template-custom.blade.php<\/code><\/dt>\n<dd>An example single page template<\/dd>\n<\/dl>\n<p>All templates are wrapped by a base file in the <code>layouts\/<\/code> directory:<\/p>\n<dl class=\"dl-horizontal\">\n<dt><code>app.blade.php<\/code><\/dt>\n<dd>The base template which wraps the base markup around all template files<\/dd>\n<\/dl>\n<p>These files include templates from the <code>resources\/views\/partials\/<\/code> directory which is where you\u2019ll be making most of your customizations:<\/p>\n<dl class=\"dl-horizontal\">\n<dt><code>comments.blade.php<\/code><\/dt>\n<dd>Markup for comments<\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>content-page.blade.php<\/code><\/dt>\n<dd>Markup included from <code>resources\/views\/page.blade.php<\/code><\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>content-search.blade.php<\/code><\/dt>\n<dd>Markup included from <code>resources\/views\/search.blade.php<\/code><\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>content-single.blade.php<\/code><\/dt>\n<dd>Markup included from <code>resources\/views\/single.blade.php<\/code><\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>content.blade.php<\/code><\/dt>\n<dd>Markup included from <code>resources\/views\/index.blade.php<\/code><\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>entry-meta.blade.php<\/code><\/dt>\n<dd>Post entry meta information included from <code>resources\/views\/content-single.blade.php<\/code><\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>footer.blade.php<\/code><\/dt>\n<dd>Footer markup included from <code>layouts\/base.blade.php<\/code><\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>head.blade.php<\/code><\/dt>\n<dd><code>&lt;head&gt;<\/code> markup included from <code>layouts\/base.blade.php<\/code><\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>header.blade.php<\/code><\/dt>\n<dd>Header markup included from <code>layouts\/base.blade.php<\/code><\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>page-header.blade.php<\/code><\/dt>\n<dd>Page title markup included from most of the files in the <code>resources\/views\/<\/code> directory<\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>sidebar.blade.php<\/code><\/dt>\n<dd>Sidebar markup included from <code>layouts\/base.blade.php<\/code><\/dd>\n<\/dl>\n<h3 id=\"extending-templates\">Extending templates<\/h3>\n<p>The normal <a href=\"http:\/\/codex.wordpress.org\/Template_Hierarchy\">WordPress Template Hierarchy<\/a> is still intact. Here\u2019s some examples:<\/p>\n<ul>\n<li>Copy <code>index.blade.php<\/code> to <code>author.blade.php<\/code> for customizing author archives<\/li>\n<li>Copy <code>index.blade.php<\/code> to <code>home.blade.php<\/code> for customizing the Home page if you\u2019re showing the latest posts (under Reading Settings) instead of a static front page<\/li>\n<li>Copy <code>index.blade.php<\/code> to <code>archive-gallery.blade.php<\/code> for customizing the archive page for a custom post type registered as <code>gallery<\/code><\/li>\n<li>Copy <code>page.blade.php<\/code> to <code>front-page.blade.php<\/code> for customizing the static front page<\/li>\n<li>Copy <code>page.blade.php<\/code> to <code>page-about.blade.php<\/code> for customizing a page called About<\/li>\n<\/ul>\n<header>\n<h2 class=\"entry-title\">Blade Templates<\/h2>\n<\/header>\n<p>Sage uses <a href=\"https:\/\/laravel.com\/docs\/5.6\/blade\">Laravel&#8217;s Blade<\/a> templating engine.<\/p>\n<h3 id=\"passing-data-to-templates\">Passing data to templates<\/h3>\n<p>Sage includes a <code>sage\/template\/{$class}\/data<\/code> filter that can be used to pass data to templates. This is the most simple way to pass data.<\/p>\n<pre class=\" language-php\"><code class=\" language-php\"><span class=\"token function\">add_filter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token single-quoted-string string\">'sage\/template\/page\/data'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">array<\/span> <span class=\"token variable\">$data<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\n    <span class=\"token variable\">$data<\/span><span class=\"token punctuation\">[<\/span><span class=\"token single-quoted-string string\">'header_image'<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token function\">get_field<\/span><span class=\"token punctuation\">(<\/span><span class=\"token single-quoted-string string\">'header_image'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token variable\">$data<\/span><span class=\"token punctuation\">[<\/span><span class=\"token single-quoted-string string\">'header_content'<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token function\">get_field<\/span><span class=\"token punctuation\">(<\/span><span class=\"token single-quoted-string string\">'header_content'<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n    <span class=\"token keyword\">return<\/span> <span class=\"token variable\">$data<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/soberwp\/controller\">Controller<\/a> can also be used to pass data to templates.<\/p>\n<h3 id=\"wp-cli-utility\">WP-CLI utility<\/h3>\n<p><a href=\"https:\/\/github.com\/alwaysblank\/blade-generate\"><code>blade-generate<\/code><\/a> is a WP-CLI package that can be used to compile, wipe, and clear Blade templates. Install <code>blade-generate<\/code> by running:<\/p>\n<pre class=\" language-bash\"><code class=\" language-bash\">wp package <span class=\"token function\">install<\/span> git@github.com:alwaysblank\/blade-generate.git\n<\/code><\/pre>\n<p>After installing <code>blade-generate<\/code> you can run the following commands:<\/p>\n<ul>\n<li><code>wp blade compile<\/code><\/li>\n<li><code>wp blade clear<\/code><\/li>\n<li><code>wp blade wipe<\/code><\/li>\n<\/ul>\n<header>\n<h2 class=\"entry-title\">Theme Sidebar<\/h2>\n<\/header>\n<h3 id=\"displaying-the-sidebar\">Displaying the sidebar<\/h3>\n<p>The <code>sage\/display_sidebar<\/code> filter can be used to define which conditions to enable the primary sidebar on.<\/p>\n<pre class=\" language-php\"><code class=\" language-php\"><span class=\"token function\">add_filter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token single-quoted-string string\">'sage\/display_sidebar'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">function<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token variable\">$display<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span>\n    <span class=\"token keyword\">static<\/span> <span class=\"token variable\">$display<\/span><span class=\"token punctuation\">;<\/span>\n\n    <span class=\"token function\">isset<\/span><span class=\"token punctuation\">(<\/span><span class=\"token variable\">$display<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">||<\/span> <span class=\"token variable\">$display<\/span> <span class=\"token operator\">=<\/span> <span class=\"token function\">in_array<\/span><span class=\"token punctuation\">(<\/span><span class=\"token boolean\">true<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">[<\/span>\n      <span class=\"token comment\">\/\/ The sidebar will be displayed if any of the following return true<\/span>\n      <span class=\"token function\">is_single<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span>\n      <span class=\"token function\">is_404<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span>\n      <span class=\"token function\">is_page_template<\/span><span class=\"token punctuation\">(<\/span><span class=\"token single-quoted-string string\">'template-custom.php'<\/span><span class=\"token punctuation\">)<\/span>\n    <span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n\n    <span class=\"token keyword\">return<\/span> <span class=\"token variable\">$display<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<br><br><\/span>\n<\/code><\/pre>\n<p style=\"padding-left: 60px;\"><code class=\"hljs python\"><\/code><\/p>\n<h2 class=\"entry-title\">Theme Functionality<\/h2>\n<p>The <code>app\/<\/code> directory contains all of the theme functionality. Since Sage is a starter theme, it\u2019s okay for you to modify files within <code>app\/<\/code> to meet the needs of the site you\u2019re building.<\/p>\n<p>The PHP code in Sage is namespaced, so make sure to <a href=\"https:\/\/roots.io\/upping-php-requirements-in-your-wordpress-themes-and-plugins\/\">use namespaced functions and classes<\/a>.<\/p>\n<dl class=\"dl-horizontal\">\n<dt><code>app\/setup.php<\/code><\/dt>\n<dd>Enqueue stylesheets and scripts, register support for theme features with <code>add_theme_support<\/code>, register navigation menus and sidebars. See <a href=\"https:\/\/roots.io\/sage\/docs\/theme-configuration-and-setup\/\">Theme Configuration and Setup<\/a>.<\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>app\/admin.php<\/code><\/dt>\n<dd>Placeholder code for the WordPress theme customizer. You can also use this file for anything related to the WordPress admin.<\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>app\/filters.php<\/code><\/dt>\n<dd>\n<p>Add WordPress filters in this file. Filters included by default:<\/p>\n<ul>\n<li><code>body_class<\/code> \u2014 add <code>&lt;body&gt;<\/code> classes<\/li>\n<li><code>excerpt_more<\/code> \u2014 add &#8220;\u2026 Continued&#8221; to excerpts<\/li>\n<li><code>template_include<\/code> \u2014 enable the theme wrapper<\/li>\n<li>Various filters for the Blade implementation<\/li>\n<\/ul>\n<\/dd>\n<\/dl>\n<dl class=\"dl-horizontal\">\n<dt><code>app\/helpers.php<\/code><\/dt>\n<dd>\n<p>Helper functions used throughout the theme:<\/p>\n<ul>\n<li><code>asset_path<\/code> \u2014 used when enqueueing theme assets to provide the correct versioned asset filenames<\/li>\n<li><code>display_sidebar<\/code> \u2014 used to control displaying the sidebar<\/li>\n<li><code>title<\/code> \u2014 used to return page titles<\/li>\n<\/ul>\n<\/dd>\n<\/dl>\n<h3><strong>Deployment:<\/strong><\/h3>\n<ul>\n<li>These are the primary projects that make up the Sage workflow:\n<ul>\n<li><a href=\"https:\/\/webpack.github.io\/\">Webpack<\/a> is used as a build tool for compiling stylesheets, checking for JavaScript errors, optimizing images, and concatenating and minifying files. In previous versions of the theme we used Grunt and Gulp as our build tools.<\/li>\n<li><a href=\"https:\/\/www.npmjs.com\/\">npm<\/a> npm is a front-end package manager. Sage uses npm to pull in Bootstrap and jQuery as dependencies.<\/li>\n<li><a href=\"http:\/\/www.browsersync.io\/\">BrowserSync<\/a> with Webpack Hot Module ReplacementBrowserSync with WHR keeps multiple browsers and devices synchronized while developing, along with injecting updated CSS and JS. In previous versions of the theme we used LiveReload for injecting assets.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>the dist folder is gitignored by default. The reason for this is that it is good practice to never check compiled files into source control (it is called <em>source<\/em> control for a reason). The ideal setup would be a CI (continuous integration) server that builds the project after deployment and than pushes it onto the server. The next ideal solution is deployment on the production server itself. Of course you need to be able to install the dependencies on the server and take into account that building the project will put some strain on the server.The most straightforward solution is to built the project locally, push&nbsp;with Git and upload the compiled files (that are not in the Git repo) with src.<\/li>\n<li>To deploy a Sage theme you&#8217;ll need to make sure two things are covered:\n<ol>\n<li>Run <code>composer install<\/code> from the theme directory on the remote server (if possible)<\/li>\n<li>Copy over production theme assets<\/li>\n<\/ol>\n<\/li>\n<li>What (not) to ignore if you are <em>not<\/em> building anything on the server\n<ul>\n<li>Remove from <code>.gitignore<\/code>\n<ul>\n<li>The normal dependencies in vendor. But keep ignoring the dev-dependencies:\n<ul>\n<li>&nbsp;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Add to the <em>main<\/em>&nbsp;<code>.gitignore <\/code>(but only for deployment. you need these files in your theme repo of course)\n<ul>\n<li>\/composer.*<\/li>\n<li>\/vendor\/composer\/installers<\/li>\n<li>\/vendor\/squizlabs<\/li>\n<li>\/vendor\/roave<\/li>\n<li>\/*.md<\/li>\n<li>wp-cli.yml<\/li>\n<\/ul>\n<\/li>\n<li>Add to the <em>theme<\/em> <code>.gitignore<\/code>\n<ul>\n<li>\/resources\/assets&nbsp;<\/li>\n<li>.editorconfig<\/li>\n<li>.eslintrc<\/li>\n<li>.travis.yml<\/li>\n<li>LICENSE.md<\/li>\n<li>package.json<\/li>\n<li>yarn.lock<\/li>\n<li>\n<p>\/vendor\/roots\/sage-installer<\/p>\n<\/li>\n<li>\n<p>\/vendor\/squizlabs<\/p>\n<\/li>\n<li>\n<p>\/vendor\/composer\/installers<\/p>\n<\/li>\n<li>\n<p>\/.github<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>Optionally add plugins and WordPress to your gitignore, if you want to update these from the WP dashboard on the production site<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Bootstrap Navwalker menu<\/strong><\/p>\n<p>Update Dec 2018:<\/p>\n<p>All you need to do is include this composer package in your Sage theme and the navwalker will be available to use.<\/p>\n<p><a href=\"https:\/\/github.com\/MWDelaney\/sage-bootstrap4-navwalker\">https:\/\/github.com\/MWDelaney\/sage-bootstrap4-navwalker<\/a><\/p>\n<ul>\n<li>To install, run the following in your Sage9-based theme directory:<br><code>composer <span class=\"hljs-built_in\" style=\"color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">require<\/span> <span class=\"hljs-string\" style=\"color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">\"mwdelaney\/sage-bootstrap4-navwalker\"<br>\n<\/span><\/code><p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><code><\/code><\/p>\n<\/li>\n<li>Include the navwalker in your <code>wp_nav_menu<\/code> function in the blade template for the header:<br><code>{!! wp_nav_menu( <span class=\"hljs-keyword\" style=\"color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">array<\/span><span style=\"background-color: #f3f4f5; color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">(<br><\/span>&nbsp; &nbsp;<span class=\"hljs-string\" style=\"color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">'menu'<\/span><span style=\"background-color: #f3f4f5; color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\"> =&gt; <\/span><span class=\"hljs-string\" style=\"color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">'primary'<\/span><span style=\"background-color: #f3f4f5; color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">, <br><\/span>&nbsp; &nbsp;<span class=\"hljs-string\" style=\"color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">'theme_location'<\/span><span style=\"background-color: #f3f4f5; color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\"> =&gt; <\/span><span class=\"hljs-string\" style=\"color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">'primary_navigation'<\/span><span style=\"background-color: #f3f4f5; color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">,<br><\/span>&nbsp; &nbsp;<span class=\"hljs-string\" style=\"color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">'walker'<\/span><span style=\"background-color: #f3f4f5; color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\"> =&gt; <\/span><span class=\"hljs-keyword\" style=\"color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\">new<\/span><span style=\"background-color: #f3f4f5; color: #23282d; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; white-space: pre-wrap;\"> wp_bootstrap4_navwalker(),<br><\/span>&nbsp; &nbsp;'menu_class' =&gt; 'nav navbar-nav')<\/code><br><code>) !!}<br>\n<\/code><p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><code><\/code><\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>At the top of the blade template add:&nbsp;<br><code>&lt;?php namespace: app ?&gt;<br>\n<\/code><p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><\/p>\n<p><code><\/code><\/p>\n<\/li>\n<li>If you want to use the &#8216;clean walker&#8217;, just make sure you have <a href=\"https:\/\/github.com\/roots\/soil\">soil<\/a> installed and activated on your site. bootstrap navs work fine with just the clean walker as long as you don&#8217;t need dropdown support.<\/li>\n<\/ul>\n<p><\/p>\n<h3>Theme assets<\/h3>\n<p>The <code>config.json<\/code> file in the <code>assets<\/code> directory controls the different theme assets that get built. By default, Sage builds two JS files and one CSS file:<\/p>\n<ul>\n<li><code>assets\/stylesheets\/main.scss<\/code> \u2014 primary theme CSS, barebones partials are imported to help get your styling started<\/li>\n<li><code>assets\/scripts\/main.js<\/code> \u2014 primary theme JS<\/li>\n<li><code>assets\/scripts\/customizer.js<\/code> \u2014 theme customizer JS, used only in the customizer<\/li>\n<\/ul>\n<p>Look at <code>entry<\/code> in <code>assets\/config.json<\/code> to see how they&#8217;re built:<\/p>\n<div class=\"highlight highlight-source-json\">\n<pre><span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>entry<span class=\"pl-pds\">\"<\/span><\/span>: {\n  <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>main<span class=\"pl-pds\">\"<\/span><\/span>: [\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>.\/scripts\/main.js<span class=\"pl-pds\">\"<\/span><\/span>,\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>.\/styles\/main.scss<span class=\"pl-pds\">\"<\/span><\/span>\n  ],\n  <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>customizer<span class=\"pl-pds\">\"<\/span><\/span>: [\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>.\/scripts\/customizer.js<span class=\"pl-pds\">\"<\/span><\/span>\n  ]\n}<\/pre>\n<\/div>\n<p>To create additional CSS or JS files, you&#8217;ll need to:<\/p>\n<ol>\n<li>Create the files within the <code>assets\/scripts\/<\/code> or <code>assets\/styles\/<\/code> directories<\/li>\n<li>Open <code>assets\/config.json<\/code> and add the new files to <code>entry<\/code> in a new array. In the example below we&#8217;ve added <code>scripts\/checkout.js<\/code>:\n<div class=\"highlight highlight-source-json\">\n<pre><span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>entry<span class=\"pl-pds\">\"<\/span><\/span>: {\n  <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>main<span class=\"pl-pds\">\"<\/span><\/span>: [\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>.\/scripts\/main.js<span class=\"pl-pds\">\"<\/span><\/span>,\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>.\/styles\/main.scss<span class=\"pl-pds\">\"<\/span><\/span>\n  ],\n  <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>customizer<span class=\"pl-pds\">\"<\/span><\/span>: [\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>.\/scripts\/customizer.js<span class=\"pl-pds\">\"<\/span><\/span>\n  ],\n  <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>checkout<span class=\"pl-pds\">\"<\/span><\/span>: [\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>.\/scripts\/checkout.js<span class=\"pl-pds\">\"<\/span><\/span>\n  ]\n}<\/pre>\n<\/div>\n<\/li>\n<li>Enqueue the new file in <code>src\/setup.php<\/code> In the example below we&#8217;ve added a conditional to only enqueue <code>scripts\/checkout.js<\/code> on the checkout page:\n<div class=\"highlight highlight-text-html-php\">\n<pre><span class=\"pl-s1\"><span class=\"pl-c\"><span class=\"pl-c\">\/**<\/span><\/span><\/span>\n<span class=\"pl-s1\"><span class=\"pl-c\"> * Theme assets<\/span><\/span>\n<span class=\"pl-s1\"><span class=\"pl-c\"> <span class=\"pl-c\">*\/<\/span><\/span><\/span>\n<span class=\"pl-s1\">add_action(<span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>wp_enqueue_scripts<span class=\"pl-pds\">'<\/span><\/span>, <span class=\"pl-k\">function<\/span> () {<\/span>\n<span class=\"pl-s1\">    wp_enqueue_style(<span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>sage\/main.css<span class=\"pl-pds\">'<\/span><\/span>, asset_path(<span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>styles\/main.css<span class=\"pl-pds\">'<\/span><\/span>), <span class=\"pl-c1\">false<\/span>, <span class=\"pl-c1\">null<\/span>);<\/span>\n<span class=\"pl-s1\">    wp_enqueue_script(<span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>sage\/main.js<span class=\"pl-pds\">'<\/span><\/span>, asset_path(<span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>scripts\/main.js<span class=\"pl-pds\">'<\/span><\/span>), [<span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>jquery<span class=\"pl-pds\">'<\/span><\/span>], <span class=\"pl-c1\">null<\/span>, <span class=\"pl-c1\">true<\/span>);<\/span>\n\n<span class=\"pl-s1\">    <span class=\"pl-k\">if<\/span> (is_page(<span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>checkout<span class=\"pl-pds\">'<\/span><\/span>)) {<\/span>\n<span class=\"pl-s1\">        wp_enqueue_script(<span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>sage\/checkout.js<span class=\"pl-pds\">'<\/span><\/span>, asset_path(<span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>scripts\/checkout.js<span class=\"pl-pds\">'<\/span><\/span>), [<span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>jquery<span class=\"pl-pds\">'<\/span><\/span>], <span class=\"pl-c1\">null<\/span>, <span class=\"pl-c1\">true<\/span>);<\/span>\n<span class=\"pl-s1\">    }<\/span>\n<span class=\"pl-s1\">}, <span class=\"pl-c1\">100<\/span>);<\/span><\/pre>\n<\/div>\n<\/li>\n<li>From the theme directory, run the build script:\n<div class=\"highlight highlight-source-shell\">\n<pre><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> web\/app\/themes\/your-theme-name\/<\/span>\n$ yarn run build<\/pre>\n<\/div>\n<\/li>\n<\/ol>\n<h3>3rd party packages<\/h3>\n<p>Example of how to add 3rd party packages* and have them included in the theme:<\/p>\n<ol>\n<li>From the theme directory, run:\n<div class=\"highlight highlight-source-shell\">\n<pre><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> @ themes\/your-theme-name\/<\/span>\n$ yarn add <span class=\"pl-k\">&lt;<\/span>package name<span class=\"pl-k\">&gt;<\/span>\n\n<span class=\"pl-c\"><span class=\"pl-c\">#<\/span> Install Slick carousel:<\/span>\n$ yarn add slick-carousel<\/pre>\n<\/div>\n<\/li>\n<li>Open up <code>main.js<\/code> and <code>main.css<\/code> to add the entry points for the package. If you&#8217;re using the Slick Carousel then your theme JS and CSS would look like:\n<div class=\"highlight highlight-source-js\">\n<pre><span class=\"pl-c\"><span class=\"pl-c\">\/**<\/span> import external dependencies <span class=\"pl-c\">*\/<\/span><\/span>\n<span class=\"pl-k\">import<\/span> <span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>jquery<span class=\"pl-pds\">'<\/span><\/span>;\n<span class=\"pl-k\">import<\/span> <span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>bootstrap\/dist\/js\/bootstrap<span class=\"pl-pds\">'<\/span><\/span>;\n\n<span class=\"pl-c\"><span class=\"pl-c\">\/\/<\/span> Import Slick<\/span>\n<span class=\"pl-k\">import<\/span> <span class=\"pl-s\"><span class=\"pl-pds\">'<\/span>slick-carousel\/slick\/slick.min<span class=\"pl-pds\">'<\/span><\/span>;<\/pre>\n<\/div>\n<div class=\"highlight highlight-source-scss\">\n<pre><span class=\"pl-c\">\/* sage\/assets\/styles\/main.scss *\/<\/span>\n<span class=\"pl-k\">@import<\/span> \"<span class=\"pl-v\">common\/variables<\/span>\";\n\n<span class=\"pl-c\">\/\/ Import npm dependencies<\/span>\n<span class=\"pl-k\">@import<\/span> \"<span class=\"pl-v\">~bootstrap\/scss\/bootstrap<\/span>\";\n<span class=\"pl-k\">@import<\/span> \"<span class=\"pl-v\">~font-awesome\/scss\/font-awesome<\/span>\";\n<span class=\"pl-c\">\/\/ Import Slick<\/span>\n<span class=\"pl-k\">@import<\/span> \"<span class=\"pl-v\">~slick-carousel\/slick\/slick.scss<\/span>\";\n<span class=\"pl-k\">@import<\/span> \"<span class=\"pl-v\">~slick-carousel\/slick\/slick-theme.scss<\/span>\";<\/pre>\n<\/div>\n<\/li>\n<li>After running <code>yarn run build<\/code> from the theme directory, your package will be built with your theme assets. The <code>dist<\/code>folder will contain a <code>_\/node_modules\/<\/code> directory that has any assets referenced from your packages. The compiled CSS and JS will reference these assets without having to manually edit paths. <img loading=\"lazy\" decoding=\"async\" class=\"emoji\" src=\"https:\/\/assets-cdn.github.com\/images\/icons\/emoji\/unicode\/2728.png\" alt=\":sparkles:\" width=\"20\" height=\"20\"><\/li>\n<li>Running <code>yarn run build:production<\/code> will fail if 3rd party package&#8217;s relative paths are not configured before imported. In example to load Slick Carousel&#8217;s paths add the following line in your common\/_variables.scss file:\n<div class=\"highlight highlight-source-scss\">\n<pre><span class=\"pl-c\">\/* sage\/assets\/styles\/common\/_variables.scss *\/<\/span>\n<span class=\"pl-c\">\/\/ Slick Carousel font path<\/span>\n<span class=\"pl-smi\">$slick-font-path<\/span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>~slick-carousel\/slick\/fonts\/<span class=\"pl-pds\">\"<\/span><\/span>;\n\n<span class=\"pl-c\">\/\/ Slick Carousel ajax-loader.gif path<\/span>\n<span class=\"pl-smi\">$slick-loader-path<\/span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>~slick-carousel\/slick\/<span class=\"pl-pds\">\"<\/span><\/span>;<\/pre>\n<\/div>\n<\/li>\n<\/ol>\n<p>\u2217Note: WordPress Plugins are installed elsewhere or with Composer when using <a href=\"https:\/\/github.com\/roots\/docs\/blob\/sage-9\/bedrock\/docs\/composer\">Bedrock<\/a><\/p>\n<p><a id=\"user-content-additional-examples\" class=\"anchor\" href=\"https:\/\/github.com\/roots\/docs\/blob\/sage-9\/sage\/theme-development-and-building.md#additional-examples\"><\/a><strong>Additional examples<\/strong><\/p>\n<p><a id=\"user-content-font-awesome\" class=\"anchor\" href=\"https:\/\/github.com\/roots\/docs\/blob\/sage-9\/sage\/theme-development-and-building.md#font-awesome\"><\/a>Font Awesome:<\/p>\n<div class=\"highlight highlight-source-shell\">\n<pre><span class=\"pl-c\"><span class=\"pl-c\">#<\/span> @ themes\/your-theme-name\/<\/span>\n$ yarn add font-awesome<\/pre>\n<\/div>\n<div class=\"highlight highlight-source-scss\">\n<pre><span class=\"pl-c\">\/* sage\/assets\/styles\/main.scss *\/<\/span>\n<span class=\"pl-k\">@import<\/span> \"<span class=\"pl-v\">common\/variables<\/span>\";\n\n<span class=\"pl-c\">\/\/ Import Font Awesome from node_modules<\/span>\n<span class=\"pl-k\">@import<\/span> \"<span class=\"pl-v\">~font-awesome\/scss\/font-awesome.scss<\/span>\";<\/pre>\n<\/div>\n<h3>Images in template files<\/h3>\n<p>Use the <code>@asset<\/code> directive to call images from template files:<\/p>\n<div class=\"highlight highlight-text-html-php\">\n<pre><span class=\"pl-s1\"><span class=\"pl-k\">&lt;<\/span><span class=\"pl-c1\">img<\/span> <span class=\"pl-c1\">src<\/span><span class=\"pl-k\">=<\/span><span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>@asset('images\/example.jpg')<span class=\"pl-pds\">\"<\/span><\/span><span class=\"pl-k\">&gt;\n<\/span><\/span><\/pre>\n<\/div>\n<h3><strong>ES6<\/strong><\/h3>\n<p><\/p>\n<h3><strong>Tips:<\/strong><\/h3>\n<ul>\n<li>If some plugin is causing problems because of lint errors, you can ignore it by putting this at the top of the file:&nbsp;<code>\/* jshint ignore:start *\/<\/code><\/li>\n<\/ul>\n<h3><strong>Recommended Forks<\/strong><\/h3>\n<ul>\n<li><a href=\"https:\/\/github.com\/schikulski\/gromf\">Gromf<\/a> \u2014 Sage with <a href=\"http:\/\/foundation.zurb.com\/\">Foundation<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/peiche\/sage-mdl\">sage-mdl<\/a> \u2014 Sage with <a href=\"http:\/\/www.getmdl.io\/\">Material Design Lite<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/oompt\/sage-lost-stylus\">sage-lost-stylus<\/a> \u2014 Sage with <a href=\"https:\/\/github.com\/corysimmons\/lost\">Lost Grid<\/a> and Stylus<\/li>\n<li><a href=\"https:\/\/github.com\/studiorabota\/sage-twig-theme\">sage-twig-theme<\/a> \u2014 Sage with Twig and Timber<\/li>\n<\/ul>\n<p><\/p>\n<div class=\"highlight highlight-text-html-php\">\n<pre><\/pre>\n<\/div>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update: 4-12-2018 For older versions of Sage see this post https:\/\/github.com\/roots\/sage https:\/\/roots.io\/sage\/docs Changes in Sage 9 Laravel\u2019s Blade as a templating engine.Learn about Blade. Check out the templates directory. You can opt-out of Blade templates by replacing them with regular PHP ones (you could copy over the templates from Sage 8 if you really wanted [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17],"tags":[3,98,33,97,99,5],"acf":[],"_links":{"self":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts\/1944"}],"collection":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/comments?post=1944"}],"version-history":[{"count":42,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts\/1944\/revisions"}],"predecessor-version":[{"id":11344,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/posts\/1944\/revisions\/11344"}],"wp:attachment":[{"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/media?parent=1944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/categories?post=1944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hesmid.nl\/test\/wp-json\/wp\/v2\/tags?post=1944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}