Skip to content

Commit

Permalink
cleanup: move the details of the article to the bottom of the article…
Browse files Browse the repository at this point in the history
…'s card
  • Loading branch information
GabsEdits committed Aug 29, 2024
1 parent 8231ff3 commit a81b05f
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 53 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Migrate every `px` to `rem` for better scaling (I did that once already, but they appeared again)

- Move the details of the article to the bottom of the article's card

---

### Development
Expand Down
24 changes: 17 additions & 7 deletions custom/ArticleList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.post {
article {
display: flex;
flex-direction: column;
gap: 10px;
transition: transform 0.3s ease;
border-radius: 8px;
background-color: var(--color-background-second);
Expand Down Expand Up @@ -128,12 +131,19 @@
text-decoration: none;
}

.date {
font-feature-settings: "zero", "tnum", "cv03", "cv02";
margin: 5px 0;
color: var(--color-text-secondary);
font-weight: 600;
font-size: 0.9rem;
.post-details {
display: flex;
justify-content: space-between;
border-top: 1px solid var(--color-border);
padding-top: 10px;

.date {
font-feature-settings: "zero", "tnum", "cv03", "cv02";
margin: 5px 0;
color: var(--color-text-secondary);
font-weight: 600;
font-size: 0.9rem;
}
}
}
}
Expand Down
48 changes: 25 additions & 23 deletions custom/ArticleListExample.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,32 @@
>{{ post.title }}</a
>
</h3>
<p class="date">
{{ post.date }}
<template v-if="post.type">
&middot;
<span
>{{ post.type.charAt(0).toUpperCase() + post.type.slice(1)
}}<template v-if="post.type === 'archive'">d</template>
</span>
</template>
<span v-if="post.author">
&middot;
{{ post.author.length > 1 ? "Authors:" : "Author:" }}
<template v-for="(author, index) in post.author" :key="index">
{{ author
}}<span v-if="index !== post.author.length - 1">, </span>
</template>
</span>
</p>
<p v-if="post.description">{{ post.description }}</p>
<div class="tags" v-if="post.tags">
<span v-if="typeof post.tags === 'string'" :key="post.tags">{{
post.tags
}}</span>
<span v-else v-for="tag in post.tags" :key="tag">{{ tag }}</span>
<div class="post-details">
<p class="date">
{{ post.date }}
<template v-if="post.type">
&middot;
<span
>{{ post.type.charAt(0).toUpperCase() + post.type.slice(1)
}}<template v-if="post.type === 'archive'">d</template>
</span>
</template>
<span v-if="post.author">
&middot;
{{ post.author.length > 1 ? "Authors:" : "Author:" }}
<template v-for="(author, index) in post.author" :key="index">
{{ author
}}<span v-if="index !== post.author.length - 1">, </span>
</template>
</span>
</p>
<div class="tags" v-if="post.tags">
<span v-if="typeof post.tags === 'string'" :key="post.tags">{{
post.tags
}}</span>
<span v-else v-for="tag in post.tags" :key="tag">{{ tag }}</span>
</div>
</div>
</article>
</div>
Expand Down
48 changes: 25 additions & 23 deletions docs/.vitepress/theme/ArticleList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,32 @@
>{{ post.title }}</a
>
</h3>
<p class="date">
{{ post.date }}
<template v-if="post.type">
&middot;
<span
>{{ post.type.charAt(0).toUpperCase() + post.type.slice(1)
}}<template v-if="post.type === 'archive'">d</template>
</span>
</template>
<span v-if="post.author">
&middot;
{{ post.author.length > 1 ? "Authors:" : "Author:" }}
<template v-for="(author, index) in post.author" :key="index">
{{ author
}}<span v-if="index !== post.author.length - 1">, </span>
</template>
</span>
</p>
<p v-if="post.description">{{ post.description }}</p>
<div class="tags" v-if="post.tags">
<span v-if="typeof post.tags === 'string'" :key="post.tags">{{
post.tags
}}</span>
<span v-else v-for="tag in post.tags" :key="tag">{{ tag }}</span>
<div class="post-details">
<p class="date">
{{ post.date }}
<template v-if="post.type">
&middot;
<span
>{{ post.type.charAt(0).toUpperCase() + post.type.slice(1)
}}<template v-if="post.type === 'archive'">d</template>
</span>
</template>
<span v-if="post.author">
&middot;
{{ post.author.length > 1 ? "Authors:" : "Author:" }}
<template v-for="(author, index) in post.author" :key="index">
{{ author
}}<span v-if="index !== post.author.length - 1">, </span>
</template>
</span>
</p>
<div class="tags" v-if="post.tags">
<span v-if="typeof post.tags === 'string'" :key="post.tags">{{
post.tags
}}</span>
<span v-else v-for="tag in post.tags" :key="tag">{{ tag }}</span>
</div>
</div>
</article>
</div>
Expand Down

0 comments on commit a81b05f

Please sign in to comment.