コミットを比較

...

3 コミット

作成者 SHA1 メッセージ 日付
みてるぞ 7d2cd85754 Merge branch 'main' of https://git.miteruzo.com/miteruzo/btrc-hub 2025-07-21 17:25:26 +09:00
みてるぞ f3bd9bea77 #80 画像読込の優先度 2025-07-21 17:25:18 +09:00
みてるぞ ede46fda82 細部 2025-07-21 17:24:01 +09:00
3個のファイルの変更20行の追加3行の削除
+10 -2
ファイルの表示
@@ -19,8 +19,16 @@ class PostsController < ApplicationController
posts = posts.first(limit)
end
render json: { posts: posts.as_json(include: { tags: { only: [:id, :name, :category, :post_count] } }),
next_cursor: }
render json: { posts: posts.map { |post|
post.as_json(include: { tags: { only: [:id, :name, :category, :post_count] } }).tap { |json|
json['thumbnail'] =
if post.thumbnail.attached?
rails_storage_proxy_url(post.thumbnail, only_path: false)
else
nil
end
}
}, next_cursor: }
end
def random
+6
ファイルの表示
@@ -1,3 +1,9 @@
<IfModule mod_headers.c>
<FilesMatch "\.(css|js|jpg|png|webp|woff2?)$">
Header set Cache-Control "max-age=31536000, public"
</FilesMatch>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
+4 -1
ファイルの表示
@@ -94,13 +94,16 @@ export default () => {
{posts.length
? (
<div className="flex flex-wrap gap-4 gap-y-8 p-4 justify-between">
{posts.map (post => (
{posts.map ((post, i) => (
<Link to={`/posts/${ post.id }`}
key={post.id}
className="w-40 h-40 overflow-hidden rounded-lg shadow-md hover:shadow-lg">
<img src={post.thumbnail || post.thumbnailBase || undefined}
alt={post.title || post.url}
title={post.title || post.url || undefined}
loading="eager"
fetchPriority="high"
decoding="async"
className="object-none w-full h-full" />
</Link>))}
</div>)