diff options
author | Freya Murphy <freya@freyacat.org> | 2024-09-18 15:03:04 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-09-18 15:03:04 -0400 |
commit | f52c257d41d1b65acef1402df543ea8848951dbf (patch) | |
tree | 1fd500d7853244148ad6069826dfce589b4a9328 /src | |
parent | refactor (diff) | |
download | website-f52c257d41d1b65acef1402df543ea8848951dbf.tar.gz website-f52c257d41d1b65acef1402df543ea8848951dbf.tar.bz2 website-f52c257d41d1b65acef1402df543ea8848951dbf.zip |
fix sitemap, drop old tables
Diffstat (limited to 'src')
-rw-r--r-- | src/db/migrations/0001.sql | 14 | ||||
-rw-r--r-- | src/web/_controller/_meta.php | 3 | ||||
-rw-r--r-- | src/web/_model/blog.php | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/src/db/migrations/0001.sql b/src/db/migrations/0001.sql new file mode 100644 index 0000000..f2bb5f6 --- /dev/null +++ b/src/db/migrations/0001.sql @@ -0,0 +1,14 @@ +BEGIN TRANSACTION; +SET search_path = public; + +-- Migration Start +DROP TABLE admin.request_log; +DROP TYPE admin.request_log_method_type; +DROP SEQUENCE sys.request_log_id_seq; +DROP TABLE admin.banned; +-- Migration End; + +-- Set Current Revision +UPDATE sys.database_info SET curr_revision = 2 WHERE name = current_database(); + +COMMIT TRANSACTION; diff --git a/src/web/_controller/_meta.php b/src/web/_controller/_meta.php index 891bf69..4500175 100644 --- a/src/web/_controller/_meta.php +++ b/src/web/_controller/_meta.php @@ -39,7 +39,8 @@ class _meta_controller extends Controller { $blog = $blog_modal->get_data()['blog']; foreach ($blog as $name => $_) { - $this->sitemap_page("blog/post?name={$name}", 0.5); + $name = substr($name, 0, -3); + $this->sitemap_page("blog/post/{$name}", 0.5); } echo "</urlset>\n"; diff --git a/src/web/_model/blog.php b/src/web/_model/blog.php index 6dc1316..2890263 100644 --- a/src/web/_model/blog.php +++ b/src/web/_model/blog.php @@ -29,7 +29,7 @@ class Blog_model extends Model { $data['blog'] = $blog; } - public function get_data(): ?array { + public function get_data(): array { $data = parent::get_base_data('blog'); $this->load_blog($data); $data['title'] = lang('title'); |