Skip to content

Commit

Permalink
fix: Add a wrapper element to dates in PageList. (jackyzha0#1345)
Browse files Browse the repository at this point in the history
* Add a wrapper span to dates in PageList.

This means there is a placeholder when date is not specified, so the values in grid-template-columns always line up correctly.

* Use a <div> instead -- better practice to stick to block elements.
  • Loading branch information
ndrooo authored Aug 24, 2024
1 parent 2be9c09 commit c4cd84d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions quartz/components/PageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ export const PageList: QuartzComponent = ({ cfg, fileData, allFiles, limit, sort
return (
<li class="section-li">
<div class="section">
{page.dates && (
<p class="meta">
<Date date={getDate(cfg, page)!} locale={cfg.locale} />
</p>
)}
<div>
{page.dates && (
<p class="meta">
<Date date={getDate(cfg, page)!} locale={cfg.locale} />
</p>
)}
</div>
<div class="desc">
<h3>
<a href={resolveRelative(fileData.slug!, page.slug!)} class="internal">
Expand Down
2 changes: 1 addition & 1 deletion quartz/components/styles/listPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ li.section-li {
background-color: transparent;
}

& > .meta {
& .meta {
margin: 0 1em 0 0;
opacity: 0.6;
}
Expand Down

0 comments on commit c4cd84d

Please sign in to comment.