diff --git a/my-blog/config.toml b/my-blog/config.toml index eb52713..70df872 100644 --- a/my-blog/config.toml +++ b/my-blog/config.toml @@ -16,7 +16,7 @@ auto_translate = false comment_moderation = false ask_ai = true provider = "ollama" -model = "gemma3:2b" +model = "gemma3:4b" host = "https://ollama.syui.ai" system_prompt = "you are a helpful ai assistant trained on this blog's content. you can answer questions about the articles, provide insights, and help users understand the topics discussed." ai_did = "did:plc:4hqjfn7m6n5hno3doamuhgef" diff --git a/my-blog/static/_headers b/my-blog/static/_headers index ccd13cd..cfcedae 100644 --- a/my-blog/static/_headers +++ b/my-blog/static/_headers @@ -17,7 +17,7 @@ /css/* Content-Type: text/css - Cache-Control: public, max-age=60 + Cache-Control: no-cache /*.js Content-Type: application/javascript diff --git a/my-blog/static/_redirects b/my-blog/static/_redirects index bc53dff..7353c3f 100644 --- a/my-blog/static/_redirects +++ b/my-blog/static/_redirects @@ -1,6 +1,3 @@ -# Ask-AI機能をOllamaにプロキシ -/api/ask https://ollama.syui.ai/api/generate 200 - # OAuth routes /oauth/* /oauth/index.html 200 diff --git a/my-blog/static/css/style.css b/my-blog/static/css/style.css index a1d3398..6cb092d 100644 --- a/my-blog/static/css/style.css +++ b/my-blog/static/css/style.css @@ -59,7 +59,7 @@ a.view-markdown:any-link { .container { min-height: 100vh; display: grid; - grid-template-rows: auto auto 1fr auto; + grid-template-rows: auto 0fr 1fr auto; grid-template-areas: "header" "ask-ai" @@ -158,6 +158,15 @@ a.view-markdown:any-link { background: #f6f8fa; border-bottom: 1px solid #d1d9e0; padding: 24px; + overflow: hidden; +} + +.ask-ai-panel[style*="block"] { + display: block !important; +} + +.container:has(.ask-ai-panel[style*="block"]) { + grid-template-rows: auto auto 1fr auto; } .ask-ai-content { @@ -193,13 +202,15 @@ a.view-markdown:any-link { grid-area: main; max-width: 1000px; margin: 0 auto; - padding: 24px; + /* padding: 24px; */ + padding-top: 80px; width: 100%; } @media (max-width: 1000px) { .main-content { - padding: 20px; + /* padding: 20px; */ + padding: 0px; max-width: 100%; } } @@ -324,6 +335,10 @@ a.view-markdown:any-link { margin: 0 auto; } +article.article-content { + padding: 10px; +} + .article-meta { display: flex; gap: 16px; @@ -818,13 +833,13 @@ a.view-markdown:any-link { justify-self: end; } - /* Ask AI button mobile style */ + /* Ask AI button mobile style - icon only */ .ask-ai-btn { padding: 8px; min-width: 40px; justify-content: center; - font-size: 0; gap: 0; + font-size: 0; /* Hide all text content */ } .ask-ai-btn .ai-icon { diff --git a/my-blog/static/js/ask-ai.js b/my-blog/static/js/ask-ai.js index 7afc9f7..ca3fb78 100644 --- a/my-blog/static/js/ask-ai.js +++ b/my-blog/static/js/ask-ai.js @@ -186,12 +186,7 @@ function updateAskAIButton() { const button = document.getElementById('askAiButton'); if (!button) return; - const iconSpan = button.querySelector('.ai-icon'); - - if (aiProfileData && aiProfileData.avatar && iconSpan) { - iconSpan.innerHTML = `${aiProfileData.displayName || 'AI'}`; - } - + // Only update text, never modify the icon if (aiProfileData && aiProfileData.displayName) { const textNode = button.childNodes[2] || button.lastChild; if (textNode && textNode.nodeType === Node.TEXT_NODE) { diff --git a/my-blog/templates/base.html b/my-blog/templates/base.html index 51a2953..6f4e087 100644 --- a/my-blog/templates/base.html +++ b/my-blog/templates/base.html @@ -66,7 +66,7 @@ diff --git a/oauth/.env.production b/oauth/.env.production index ab056d7..f4768d4 100644 --- a/oauth/.env.production +++ b/oauth/.env.production @@ -18,7 +18,7 @@ AILOG_COLLECTION_CHAT=ai.syui.log.chat VITE_AI_ENABLED=true VITE_AI_ASK_AI=true VITE_AI_PROVIDER=ollama -VITE_AI_MODEL=gemma3:2b +VITE_AI_MODEL=gemma3:4b VITE_AI_HOST=https://ollama.syui.ai VITE_AI_SYSTEM_PROMPT="you are a helpful ai assistant trained on this blog's content. you can answer questions about the articles, provide insights, and help users understand the topics discussed." VITE_AI_DID=did:plc:4hqjfn7m6n5hno3doamuhgef