diff --git a/my-blog/static/css/style.css b/my-blog/static/css/style.css index 6591d80..52b9ed2 100644 --- a/my-blog/static/css/style.css +++ b/my-blog/static/css/style.css @@ -248,7 +248,7 @@ a.view-markdown:any-link { } .post-title a { - color: #1f2328; + color: var(--theme-color); text-decoration: none; font-size: 18px; font-weight: 600; diff --git a/my-blog/templates/index.html b/my-blog/templates/index.html index 1de63ca..2ba6f82 100644 --- a/my-blog/templates/index.html +++ b/my-blog/templates/index.html @@ -20,19 +20,6 @@ {{ post.title }} - {% if post.excerpt %} -

{{ post.excerpt }}

- {% endif %} - -
- Read more - {% if post.markdown_url %} - .md - {% endif %} - {% if post.translation_url %} - 🌐 - {% endif %} -
{% endfor %} diff --git a/oauth/src/App.tsx b/oauth/src/App.tsx index 928a565..f3d471a 100644 --- a/oauth/src/App.tsx +++ b/oauth/src/App.tsx @@ -431,17 +431,24 @@ function App() { if (user.did && user.did.includes('-placeholder')) { // Resolving placeholder DID try { - const profileResponse = await fetch(`${appConfig.bskyPublicApi}/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(user.handle)}`); - if (profileResponse.ok) { - const profileData = await profileResponse.json(); - if (profileData.did) { - // Resolved DID - return { - ...user, - did: profileData.did - }; + let profileData; + if (agent) { + const profileResponse = await agent.getProfile({ actor: user.handle }); + profileData = profileResponse.data; + } else { + // フォールバック:public API + const profileResponse = await fetch(`${appConfig.bskyPublicApi}/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(user.handle)}`); + if (profileResponse.ok) { + profileData = await profileResponse.json(); } } + if (profileData.did) { + // Resolved DID + return { + ...user, + did: profileData.did + }; + } } catch (err) { // Failed to resolve DID } @@ -580,23 +587,29 @@ function App() { sortedComments.map(async (record) => { if (!record.value.author?.avatar && record.value.author?.handle) { try { - // Public API でプロフィール取得 - const profileResponse = await fetch(`${appConfig.bskyPublicApi}/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(record.value.author.handle)}`); - - if (profileResponse.ok) { - const profileData = await profileResponse.json(); - return { - ...record, - value: { - ...record.value, - author: { - ...record.value.author, - avatar: profileData.avatar, - displayName: profileData.displayName || record.value.author.handle, - } - } - }; + let profileData; + if (agent) { + // 認証されたAPIでプロフィール取得 + const profileResponse = await agent.getProfile({ actor: record.value.author.handle }); + profileData = profileResponse.data; + } else { + // フォールバック:public API + const profileResponse = await fetch(`${appConfig.bskyPublicApi}/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(record.value.author.handle)}`); + if (profileResponse.ok) { + profileData = await profileResponse.json(); + } } + return { + ...record, + value: { + ...record.value, + author: { + ...record.value.author, + avatar: profileData.avatar, + displayName: profileData.displayName || record.value.author.handle, + } + } + }; } catch (err) { // Ignore enhancement errors } @@ -796,14 +809,21 @@ function App() { let resolvedDid = `did:plc:${handle.replace(/\./g, '-')}-placeholder`; // フォールバック try { - // Public APIでプロフィールを取得してDIDを解決 - const profileResponse = await fetch(`${appConfig.bskyPublicApi}/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(handle)}`); - if (profileResponse.ok) { - const profileData = await profileResponse.json(); - if (profileData.did) { - resolvedDid = profileData.did; + let profileData; + if (agent) { + // 認証されたAPIでプロフィールを取得してDIDを解決 + const profileResponse = await agent.getProfile({ actor: handle }); + profileData = profileResponse.data; + } else { + // フォールバック:public API + const profileResponse = await fetch(`${appConfig.bskyPublicApi}/xrpc/app.bsky.actor.getProfile?actor=${encodeURIComponent(handle)}`); + if (profileResponse.ok) { + profileData = await profileResponse.json(); } } + if (profileData.did) { + resolvedDid = profileData.did; + } } catch (err) { } @@ -1079,7 +1099,38 @@ function App() { /> - ) : ( + ) : null} + + {/* Tab Navigation */} +
+ + + + +
+ + {/* User Section - moved below tab navigation */} + {user && (
@@ -1187,38 +1238,9 @@ function App() {
)} -
)} - {/* Tab Navigation */} -
- - - - -
- {/* Comments List */} {activeTab === 'comments' && (
@@ -1534,13 +1556,91 @@ function App() {
)} - {/* Show authentication status on non-post pages */} - {user && !appConfig.rkey && ( -
-

✅ Authenticated as @{user.handle}

-

Visit a post page to comment

-
- )} + {/* Admin Section - User Management */} + {isAdmin(user) && ( +
+

管理者機能 - ユーザーリスト管理

+ + {/* User List Form */} +
+