aboutsummaryrefslogtreecommitdiff
path: root/lume/src/blog.jsx
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-05-14 20:08:04 -0500
committerXe Iaso <me@xeiaso.net>2024-05-14 20:08:04 -0500
commit6e3143a5b291cd2ff212042e1a512139fdfa2fda (patch)
tree9713f479db585d1a4fe6eb6e2d22876b0b47fae3 /lume/src/blog.jsx
parentba25894b92cfdb0d7a95bb40aeb6bffe4ace09d3 (diff)
downloadxesite-6e3143a5b291cd2ff212042e1a512139fdfa2fda.tar.xz
xesite-6e3143a5b291cd2ff212042e1a512139fdfa2fda.zip
filter non-indexed posts from blog view
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'lume/src/blog.jsx')
-rw-r--r--lume/src/blog.jsx20
1 files changed, 11 insertions, 9 deletions
diff --git a/lume/src/blog.jsx b/lume/src/blog.jsx
index 8e3ee43..137bf66 100644
--- a/lume/src/blog.jsx
+++ b/lume/src/blog.jsx
@@ -15,15 +15,17 @@ export default ({ search }, { date }) => {
</p>
<ul class="list-disc ml-4 mb-4">
- {search.pages("type=blog", "order date=desc").map((post) => {
- const url = post.redirect_to ? post.redirect_to : post.url;
- return (
- <li>
- <time datetime={date(post.date)} className="font-mono">{post.date.toLocaleDateString("en-US", dateOptions)}</time> -{" "}
- <a href={url}>{post.title}</a>
- </li>
- );
- })}
+ {search.pages("type=blog", "order date=desc")
+ .filter((post) => post.index)
+ .map((post) => {
+ const url = post.redirect_to ? post.redirect_to : post.url;
+ return (
+ <li>
+ <time datetime={date(post.date)} className="font-mono">{post.date.toLocaleDateString("en-US", dateOptions)}</time> -{" "}
+ <a href={url}>{post.title}</a>
+ </li>
+ );
+ })}
</ul>
</>
);