Personal Site
0
fork

Configure Feed

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

Remove old post layout so i can rewrite it

-132
-132
src/components/home/feeds/Post.astro
··· 68 68 })(); 69 69 --- 70 70 71 - <div class="post" style={`--box-tlbr-png: url(${BoxTlbr.src});`}> 72 - { 73 - author.avatar && ( 74 - <img 75 - src={author.avatar} 76 - style="float: left; height: 2em; padding: 5px;" 77 - /> 78 - ) 79 - } 80 - {author.displayName ? author.displayName : null}<pre>@{author.handle}</pre> 81 - <div 82 - class="post-text" 83 - style="clear:both;" 84 - set:text={post.text.replace(/^\s*/g, "").replace(/\s*$/, "")} 85 - /> 86 - 87 - { 88 - embed 89 - ? await (async () => { 90 - switch (embed?.$type) { 91 - case "app.bsky.embed.images": { 92 - return embed.images.map((image) => ( 93 - <img src={cidSrc(image.cid, author.did)} alt={image.alt} /> 94 - )); 95 - } 96 - 97 - case "app.bsky.embed.video": { 98 - return ( 99 - <video 100 - controls 101 - src={cidSrc(embed.cid, author.did)} 102 - crossorigin="anonymous" 103 - > 104 - {embed.subtitles && 105 - embed.subtitles.map((track, i) => { 106 - return ( 107 - <track 108 - default={i === 0} 109 - kind="captions" 110 - srclang={track.lang} 111 - src={cidSrc(track.cid, author.did)} 112 - /> 113 - ); 114 - })} 115 - </video> 116 - ); 117 - } 118 - 119 - case "app.bsky.embed.external": { 120 - return ( 121 - <a href={embed.url}> 122 - <pre 123 - set:html={`${embed.title}${embed.thumb ? `\n<img src="${cidSrc(embed.thumb, author.did)}" />` : ""}`} 124 - /> 125 - </a> 126 - ); 127 - } 128 - 129 - case "app.bsky.embed.record": { 130 - return ( 131 - <ul> 132 - <li> 133 - {embed.record && embed.author ? ( 134 - <Astro.self 135 - post={embed.record} 136 - author={embed.author} 137 - nested 138 - /> 139 - ) : ( 140 - <div class="post">Read More</div> 141 - )} 142 - </li> 143 - </ul> 144 - ); 145 - } 146 - 147 - case "app.bsky.embed.recordWithMedia": { 148 - return ( 149 - <> 150 - {embed.media.$type === "app.bsky.embed.images" ? ( 151 - embed.media.images.map((image) => ( 152 - <img 153 - src={cidSrc(image.cid, author.did)} 154 - alt={image.alt} 155 - /> 156 - )) 157 - ) : embed.media.$type === "app.bsky.embed.video" ? ( 158 - <video 159 - controls 160 - src={cidSrc(embed.media.cid, author.did)} 161 - crossorigin="anonymous" 162 - > 163 - {embed.media.subtitles && 164 - embed.media.subtitles.map((track, i) => { 165 - return ( 166 - <track 167 - default={i === 0} 168 - kind="captions" 169 - srclang={track.lang} 170 - src={cidSrc(track.cid, author.did)} 171 - /> 172 - ); 173 - })} 174 - </video> 175 - ) : ( 176 - <a href={embed.media.url}> 177 - <pre 178 - set:html={`${embed.media.title}${embed.media.thumb ? `\n<img src="${cidSrc(embed.media.thumb, author.did)}" />` : ""}`} 179 - /> 180 - </a> 181 - )} 182 - <ul> 183 - <li> 184 - {embed.record.record && embed.record.author ? ( 185 - <Astro.self 186 - post={embed.record.record} 187 - author={embed.record.author} 188 - nested 189 - /> 190 - ) : ( 191 - <div class="post">Read More</div> 192 - )} 193 - </li> 194 - </ul> 195 - </> 196 - ); 197 - } 198 - } 199 - })() 200 - : null 201 - } 202 - </div> 203 71 204 72 <style> 205 73 .post {