diff --git a/backend/app/controllers/wiki_pages_controller.rb b/backend/app/controllers/wiki_pages_controller.rb
index 4c1f364..c1d9a17 100644
--- a/backend/app/controllers/wiki_pages_controller.rb
+++ b/backend/app/controllers/wiki_pages_controller.rb
@@ -49,4 +49,22 @@ class WikiPagesController < ApplicationController
render json: q.limit(20)
end
+
+ def changes
+ id = params[:id]
+ log = id.present? ? wiki.page("#{ id }.md").versions : wiki.repo.log('main', nil, max_count: 50)
+ render json: log.map { |commit|
+ { sha: commit.id,
+ author: commit.author.name,
+ message: commit.message,
+ timestamp: commit.authored_date } }
+ end
+
+ private
+
+ WIKI_PATH = Rails.root.join('wiki').to_s
+
+ def wiki
+ @wiki ||= Gollum::Wiki.new(WIKI_PATH)
+ end
end
diff --git a/backend/config/routes.rb b/backend/config/routes.rb
index 91f8c56..ded41c3 100644
--- a/backend/config/routes.rb
+++ b/backend/config/routes.rb
@@ -6,6 +6,7 @@ Rails.application.routes.draw do
get 'preview/thumbnail', to: 'preview#thumbnail'
get 'wiki/title/:title', to: 'wiki_pages#show_by_title'
get 'wiki/search', to: 'wiki_pages#search'
+ get 'wiki/changes', to: 'wiki_pages#changes'
get 'wiki/:id', to: 'wiki_pages#show'
post 'wiki', to: 'wiki_pages#create'
put 'wiki/:id', to: 'wiki_pages#update'
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 4d678a0..4fa83b6 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -11,6 +11,7 @@ import WikiPage from '@/pages/WikiPage'
import WikiNewPage from '@/pages/WikiNewPage'
import WikiEditPage from '@/pages/WikiEditPage'
import WikiDetailPage from '@/pages/WikiDetailPage'
+import WikiHistoryPage from '@/pages/WikiHistoryPage'
import { API_BASE_URL } from '@/config'
import axios from 'axios'
import { Toaster } from '@/components/ui/toaster'
@@ -66,6 +67,7 @@ export default () => {
} />
} />
} />
+ } />
diff --git a/frontend/src/components/TopNav.tsx b/frontend/src/components/TopNav.tsx
index 27b0b82..428a7d7 100644
--- a/frontend/src/components/TopNav.tsx
+++ b/frontend/src/components/TopNav.tsx
@@ -130,7 +130,7 @@ const TopNav: React.FC = ({ user, setUser }: Props) => {
<>
投稿
- 履歴
+ 履歴
編輯
>}
)
diff --git a/frontend/src/pages/WikiHistoryPage.tsx b/frontend/src/pages/WikiHistoryPage.tsx
new file mode 100644
index 0000000..eaf0389
--- /dev/null
+++ b/frontend/src/pages/WikiHistoryPage.tsx
@@ -0,0 +1,8 @@
+import MainArea from '@/components/layout/MainArea'
+
+
+export default () => {
+ return (
+
+ )
+}