my blog https://overreacted.io
53
fork

Configure Feed

Select the types of activity you want to include in your feed.

example tweak

+22 -19
+15 -13
public/impossible-components/index.md
··· 1031 1031 1032 1032 <Server> 1033 1033 1034 - ```js {7-11,14} 1034 + ```js {10-14} 1035 1035 import { SortableList } from './client'; 1036 1036 import { readdir } from 'fs/promises'; 1037 1037 1038 1038 async function SortablePostList() { 1039 1039 const entries = await readdir('./public/', { withFileTypes: true }); 1040 1040 const dirs = entries.filter((entry) => entry.isDirectory()); 1041 - const items = dirs.map((dir) => ({ 1042 - id: dir.name, 1043 - searchText: dir.name.replaceAll('-', ' '), 1044 - content: <PostPreview slug={dir.name} /> 1045 - })); 1046 1041 return ( 1047 1042 <div className="mb-8 flex h-72 flex-col gap-2 overflow-scroll font-sans"> 1048 - <SortableList items={items} /> 1043 + <SortableList 1044 + items={dirs.map(dir => ({ 1045 + id: dir.name, 1046 + searchText: dir.name.replaceAll('-', ' '), 1047 + content: <PostPreview slug={dir.name} /> 1048 + }))} 1049 + /> 1049 1050 </div> 1050 1051 ); 1051 1052 } ··· 1153 1154 async function SortablePostList() { 1154 1155 const entries = await readdir('./public/', { withFileTypes: true }); 1155 1156 const dirs = entries.filter((entry) => entry.isDirectory()); 1156 - const items = dirs.map((dir) => ({ 1157 - id: dir.name, 1158 - searchText: dir.name.replaceAll('-', ' '), 1159 - content: <PostPreview slug={dir.name} />, 1160 - })); 1161 1157 return ( 1162 1158 <div className="mb-8 flex h-72 flex-col gap-2 overflow-scroll font-sans"> 1163 - <SortableList items={items} /> 1159 + <SortableList 1160 + items={dirs.map(dir => ({ 1161 + id: dir.name, 1162 + searchText: dir.name.replaceAll('-', ' '), 1163 + content: <PostPreview slug={dir.name} /> 1164 + }))} 1165 + /> 1164 1166 </div> 1165 1167 ); 1166 1168 }
+7 -6
public/impossible-components/server.js
··· 137 137 export async function SortablePostList() { 138 138 const entries = await readdir("./public/", { withFileTypes: true }); 139 139 const dirs = entries.filter((entry) => entry.isDirectory()); 140 - const items = dirs.map((dir) => ({ 141 - id: dir.name, 142 - searchText: dir.name.replaceAll("-", " "), 143 - content: <PostPreview_3 slug={dir.name} />, 144 - })); 145 140 return ( 146 141 <div className="mb-8 flex h-72 flex-col gap-2 overflow-scroll font-sans"> 147 - <SortableList_4 items={items} /> 142 + <SortableList_4 143 + items={dirs.map((dir) => ({ 144 + id: dir.name, 145 + searchText: dir.name.replaceAll("-", " "), 146 + content: <PostPreview_3 slug={dir.name} />, 147 + }))} 148 + /> 148 149 </div> 149 150 ); 150 151 }