Title: robertbcalhoun's Replies | WordPress.org

---

# robertbcalhoun

  [  ](https://wordpress.org/support/users/robertbcalhoun/)

 *   [Profile](https://wordpress.org/support/users/robertbcalhoun/)
 *   [Topics Started](https://wordpress.org/support/users/robertbcalhoun/topics/)
 *   [Replies Created](https://wordpress.org/support/users/robertbcalhoun/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/robertbcalhoun/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/robertbcalhoun/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/robertbcalhoun/engagements/)
 *   [Favorites](https://wordpress.org/support/users/robertbcalhoun/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Simply Static - The Static Site Generator] Missing index.html File](https://wordpress.org/support/topic/missing-indexhtml-file/)
 *  [robertbcalhoun](https://wordpress.org/support/users/robertbcalhoun/)
 * (@robertbcalhoun)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/missing-indexhtml-file/#post-6955706)
 * It appears there is a bug that leaves a trailing “.” in the temporary directory
   name. If you disable “delete temporary files”, you will find index.html in <wpdir
   >/wp-content/plugins/simply-static/static-files/simply-static-1-timestamp-blogname.(
   with a period). You can just copy that file over.
 * Here is my fix. Probably more lines than required, but I get lost in all of these
   short-circuit operators. I will send them to the plugin author for a real fix.
 *     ```
       ~/wp-content/plugins/simply-static/includes]% diff -u class-simply-static-archive-creator.php.broken class-simply-static-archive-creator.php
       --- class-simply-static-archive-creator.php.broken	2016-01-18 17:20:38.000000000 +0000
       +++ class-simply-static-archive-creator.php	2016-01-18 17:22:21.000000000 +0000
       @@ -314,10 +314,12 @@
        	 * @return boolean $success Did we successfully save the file?
        	 */
        	protected function save_url_to_file( $path, $content, $is_html ) {
       -		$path_info = pathinfo( $path && $path != '/' ? $path : 'index.html' );
       -
       +
       +	  $relpath = ($path && $path != '/') ? $path : 'index.html';
       +	  $abspath = $this->archive_dir . DIRECTORY_SEPARATOR . $relpath;
       +	  $path_info = pathinfo( $abspath );
        		// Create file directory if it doesn't exist
       -		$file_dir = untrailingslashit( $this->archive_dir ) . ( $path_info['dirname'] ? $path_info['dirname'] : '' );
       +		$file_dir = untrailingslashit( $path_info['dirname']  );
        		if ( empty( $path_info['extension'] ) && $path_info['basename'] == $path_info['filename'] ) {
        			$file_dir .= DIRECTORY_SEPARATOR . $path_info['basename'];
        			$path_info['filename'] = 'index';
       ```
   

Viewing 1 replies (of 1 total)