From 82e9b1d995802c511bdcc92c597e8c3a1c04b7fc Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 28 Apr 2015 15:42:40 +0200 Subject: [PATCH] Remove unnecessary files --- _config.yml | 1 + export.php | 62 ----------------------------------------------------- 2 files changed, 1 insertion(+), 62 deletions(-) delete mode 100644 export.php diff --git a/_config.yml b/_config.yml index ac5b4ac..1fe7a75 100644 --- a/_config.yml +++ b/_config.yml @@ -8,6 +8,7 @@ timezone: Europe/Budapest name: Gergely Polonkai paginate: 10 paginate_path: "/blog/page/:num" +exclude: ['README.md', 'Gemfile', 'Gemfile.lock', 'CNAME'] # Build settings markdown: kramdown diff --git a/export.php b/export.php deleted file mode 100644 index bc6d74c..0000000 --- a/export.php +++ /dev/null @@ -1,62 +0,0 @@ -select_db('gergelypolonkai'); - -$st = $my->prepare('SELECT * FROM taggit_tag'); -$st->execute(); -$res = $st->get_result(); -$tags = []; - -while ($row = $res->fetch_assoc()) { - $tags[$row['id']] = $row['slug']; -} - -$st = $my->prepare('SELECT * FROM taggit_taggeditem'); -$st->execute(); -$res = $st->get_result(); -$tagging = []; - -while ($row = $res->fetch_assoc()) { - if (!array_key_exists($row['object_id'], $tagging)) { - $tagging[$row['object_id']] = []; - } - - $tagging[$row['object_id']][] = $row['tag_id']; -} - -$st = $my->prepare('SELECT * FROM blog_post'); -$st->execute(); -$res = $st->get_result(); - -while ($row = $res->fetch_assoc()) { - $date = substr($row['created_at'], 0, 10); - preg_match('/([0-9]{4})-([0-9]{2})-([0-9]{2})/', $date, $m); - $url = sprintf("/blog/%d/%d/%d/%s", $m[1], $m[2], $m[3], $row['slug']); - $file = '_posts/' . $date . '-' . $row['slug'] . '.markdown'; - - $out = "--- -layout: post -title: \"{$row['title']}\" -date: {$row['created_at']} -"; - - if (array_key_exists($row['id'], $tagging)) { - $post_tags = []; - foreach ($tagging[$row['id']] as $tag) { - $post_tags[] = $tags[$tag]; - } - $out .= "tags: " . join(' ', $post_tags) . "\n"; - } - - $out .= "permalink: {$url} -categories: blog -published: {$row['draft']} ---- - -{$row['content']} -"; - - $fd = fopen($file, "w"); - fputs($fd, $out); - fclose($fd); -}