to the of portable.php - `bash portable.sh` to generate both index.html and feed.xml */ $site_title = 'Pineapple Blogs'; $site_desc = 'Pineapple Blogs'; $site_url = 'https://neovoid.is-cool.dev/nvpiesite'; function create_slug($string){ $string = strtolower($string); $string = strip_tags($string); $string = stripslashes($string); $string = html_entity_decode($string); $string = str_replace('\'', '', $string); $string = trim(preg_replace('/[^a-z0-9]+/', '-', $string), '-'); return $string; } $files = []; foreach (new DirectoryIterator(__DIR__.'/content/') as $file) { if ( $file->getType() == 'file' && strpos($file->getFilename(),'.md') ) { $files[] = $file->getFilename(); } } rsort($files); foreach ($files as $file) { $filename_no_ext = substr($file, 0, strrpos($file, ".")); $date = date("r", strtotime($filename_no_ext)); $file_path = __DIR__.'/content/'.$file; $file = fopen($file_path, 'r'); $post_title = trim(fgets($file),'#'); $post_slug = create_slug($post_title.$filename_no_ext); fclose($file); $items .= ' '.$post_title.' '.$date.' '.$site_url.'/#'.$post_slug.' '.$site_url.'/#'.$post_slug.' '; } ?> '; ?> <?php echo $site_title; ?> en-us