diff --git a/config/config.ini.example b/config/config.ini.example index eae1ae8..ff039cb 100644 --- a/config/config.ini.example +++ b/config/config.ini.example @@ -96,6 +96,9 @@ description.char = "150" ; Post date display as, set "true" display as social media or set "false" as default timeago.format = "false" +; Custom robots.txt configuration +custom.robots = "false" + ; RSS feed count rss.count = "10" diff --git a/content/data/configList.json b/content/data/configList.json index a45e538..ffa3e76 100644 --- a/content/data/configList.json +++ b/content/data/configList.json @@ -1 +1 @@ -["site.url","timezone","date.format","language","blog.title","blog.tagline","blog.description","blog.copyright","permalink.type","static.frontpage","blog.enable","social.twitter","social.facebook","breadcrumb.home","comment.system","fb.appid","fb.num","fb.color","disqus.shortname","google.wmt.id","google.analytics.id","google.gtag.id","google.reCaptcha","google.reCaptcha.public","google.reCaptcha.private","posts.perpage","category.perpage","tag.perpage","archive.perpage","search.perpage","profile.perpage","type.perpage","json.count","category.info","related.count","recent.count","popular.count","teaser.type","read.more","teaser.char","description.char","timeago.format","rss.count","rss.char","views.counter","sitemap.priority.base","sitemap.priority.post","sitemap.priority.static","sitemap.priority.category","sitemap.priority.tag","sitemap.priority.archiveDay","sitemap.priority.archiveMonth","sitemap.priority.archiveYear","sitemap.priority.author","sitemap.priority.type","prerelease","cache.expiration","cache.off","generation.time","cache.timestamp","cache.minify","views.root","views.layout"] +["site.url", "timezone", "date.format", "language", "blog.title", "blog.tagline", "blog.description", "blog.copyright", "permalink.type", "static.frontpage", "blog.enable", "social.twitter", "social.facebook", "breadcrumb.home", "comment.system", "fb.appid", "fb.num", "fb.color", "disqus.shortname", "google.wmt.id", "google.analytics.id", "google.gtag.id", "google.reCaptcha", "google.reCaptcha.public", "google.reCaptcha.private", "posts.perpage", "category.perpage", "tag.perpage", "archive.perpage", "search.perpage", "profile.perpage", "type.perpage", "json.count", "category.info", "related.count", "recent.count", "popular.count", "teaser.type", "read.more", "teaser.char", "description.char", "timeago.format", "custom.robots", "rss.count", "rss.char", "views.counter", "sitemap.priority.base", "sitemap.priority.post", "sitemap.priority.static", "sitemap.priority.category", "sitemap.priority.tag", "sitemap.priority.archiveDay", "sitemap.priority.archiveMonth", "sitemap.priority.archiveYear", "sitemap.priority.author", "sitemap.priority.type", "prerelease", "cache.expiration", "cache.off", "generation.time", "cache.timestamp", "cache.minify", "views.root", "views.layout"] \ No newline at end of file diff --git a/system/admin/views/config-metatags.html.php b/system/admin/views/config-metatags.html.php index efbf41b..8a5d545a 100644 --- a/system/admin/views/config-metatags.html.php +++ b/system/admin/views/config-metatags.html.php @@ -5,6 +5,37 @@ $array = array(); if (file_exists($config_file)) { $array = parse_ini_file($config_file, true); } + +// robots.txt config +$backup_robots = 'content/data/robots.backup'; +$custom_robots = 'content/data/robots.custom'; + +if(!file_exists($backup_robots)) { + // backup robots.txt dulu jika belum ada backupan + $robots = file_get_contents('robots.txt'); + file_put_contents($backup_robots, $robots); +} + +if(!file_exists($custom_robots)) { + // buat custom robots.txt dulu jika belum ada + file_put_contents($custom_robots, ''); +} + +if(config('custom.robots') === 'true') +{ + unlink('robots.txt'); + // create robots.txt custom + $robots = file_get_contents($custom_robots); + file_put_contents('robots.txt', $robots); +} + +if(config('custom.robots') === 'false') +{ + unlink('robots.txt'); + $robots = file_get_contents($backup_robots); + file_put_contents('robots.txt', $robots); +} + ?>