This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Implements hook_process_html | |
| */ | |
| function templatenamespace_process_html(&$vars) { | |
| $search = array('scripts' => 'src=', 'styles' => 'href=', 'styles' => '@import\surl\('); | |
| foreach ( $search as $var => $word ) { | |
| if ( !empty($vars[$var]) ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rewrite ^(/.*)\.html(\?.*)?$ $1$2 permanent; | |
| rewrite ^/(.*)/$ /$1 permanent; | |
| try_files $uri/index.html $uri.html $uri/ $uri =404; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Take advantage of Mix's cache busting function | |
| */ | |
| function asset( $path ) { | |
| // Asset manifest file from Mix | |
| $manifest = get_template_directory_uri() . '/dist/mix-manifest.json'; | |
| $manifest_array = json_decode(file_get_contents($manifest), true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (async () => { | |
| const sleep = ms => new Promise(r => setTimeout(r, ms)); | |
| if (!window.JSZip) { | |
| await new Promise((resolve, reject) => { | |
| const s = document.createElement('script'); | |
| s.src = 'https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js'; | |
| s.onload = resolve; | |
| s.onerror = reject; | |
| document.head.appendChild(s); |
OlderNewer