-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(posts): archives page for all posts
- Loading branch information
Showing
10 changed files
with
173 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<template> | ||
<div :class="$style.container"> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<style module scoped> | ||
.container { | ||
justify-content: center; | ||
padding: 1rem 4rem 0; | ||
} | ||
@media (min-width: 768px) { | ||
.container { | ||
padding: 3rem 6rem 0; | ||
} | ||
} | ||
@media (min-width: 960px) { | ||
.container { | ||
padding: 3rem 4rem 0; | ||
display: flex; | ||
} | ||
} | ||
@media (min-width: 1280px) { | ||
.container { | ||
padding: 4rem 8rem 0; | ||
display: flex; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
// https://vitepress.dev/guide/custom-theme | ||
import Theme from "vitepress/theme"; | ||
import "./style.css"; | ||
// import Archives from "./components/Archives.vue"; | ||
// import Tags from "./components/Tags.vue"; | ||
import Home from "./pages/Home.vue"; | ||
import Layout from "./pages/Layout.vue"; | ||
import Posts from "./pages/Posts.vue"; | ||
// import Tags from "./components/Tags.vue"; | ||
|
||
export default { | ||
extends: Theme, | ||
Layout, | ||
enhanceApp({ app }) { | ||
app.component("Home", Home); | ||
app.component("Posts", Posts); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,49 @@ | ||
<template> | ||
<div :class="$style.column"> | ||
<Container> | ||
<div :class="$style.aside"> | ||
<Profile /> | ||
</div> | ||
<div :class="$style.homefeed"> | ||
<HomeFeed /> | ||
</div> | ||
</div> | ||
</Container> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import Container from "../components/Container.vue"; | ||
import Profile from "../components/Profile.vue"; | ||
import HomeFeed from "../components/HomeFeed.vue"; | ||
</script> | ||
|
||
<style scoped module> | ||
.column { | ||
justify-content: center; | ||
} | ||
.aside { | ||
padding: 2rem 3rem; | ||
} | ||
.homefeed { | ||
padding: 0 4rem; | ||
padding: 2rem; | ||
padding-top: 0; | ||
} | ||
@media (min-width: 768px) { | ||
.aside { | ||
padding: 3rem; | ||
} | ||
.homefeed { | ||
padding: 0 6rem; | ||
padding: 0 3rem 3rem; | ||
} | ||
} | ||
@media (min-width: 960px) { | ||
.column { | ||
padding: 0rem 4rem; | ||
display: flex; | ||
} | ||
.aside { | ||
padding: 3rem; | ||
} | ||
.homefeed { | ||
max-width: 38rem; | ||
min-width: 38rem; | ||
padding: 3rem 3rem 0; | ||
padding: 0 3rem; | ||
} | ||
} | ||
@media (min-width: 1280px) { | ||
.column { | ||
padding: 0rem 8rem; | ||
display: flex; | ||
} | ||
.aside { | ||
padding: 4rem; | ||
padding: 0 4rem; | ||
} | ||
.homefeed { | ||
max-width: 48rem; | ||
min-width: 48rem; | ||
padding: 4rem 4rem 0; | ||
padding: 0 4rem; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<template> | ||
<Container :class="$style.container"> | ||
<div :class="$style.main"> | ||
<div :class="$style.amountBox"> | ||
<div :class="$style.amountBadge"> | ||
All Posts | ||
<span :class="$style.number">{{ allPosts.length }}</span> | ||
</div> | ||
</div> | ||
<div | ||
v-for="year of years" | ||
:key="year" | ||
> | ||
<h1 :class="$style.year"> | ||
<a | ||
:id="year" | ||
:href="`#${year}`" | ||
>{{ year }}</a> | ||
</h1> | ||
<div :class="$style.yearPosts"> | ||
<PostList | ||
date-format="MMM DD" | ||
:post-list="postsByYear[year]" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</Container> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { data as allPosts } from "../posts.data"; | ||
import Container from "../components/Container.vue"; | ||
import PostList from "../components/PostList.vue"; | ||
const postsByYear = {}; | ||
allPosts.forEach((post) => { | ||
const year = post.frontmatter.datetime.slice(0, 4); | ||
postsByYear[year] = postsByYear[year] || []; | ||
postsByYear[year].push(post); | ||
}); | ||
const years = Object.keys(postsByYear).sort().reverse(); | ||
</script> | ||
|
||
<style module scoped> | ||
.container { | ||
display: block; | ||
} | ||
.main { | ||
margin: 0 auto; | ||
max-width: 42rem; | ||
padding: 0 0 2rem; | ||
} | ||
.amountBox { | ||
color: var(--vp-c-default-1); | ||
text-align: right; | ||
} | ||
.amountBadge { | ||
background-color: var(--vp-c-default-soft); | ||
border-radius: 4px; | ||
padding: 0 0 0 7px; | ||
display: inline-block; | ||
} | ||
.number { | ||
color: var(--vp-c-text-3); | ||
background-color: var(--vp-c-default-soft); | ||
padding: 2px 7px 2px 6px; | ||
margin-left: 1px; | ||
border-radius: 0 4px 4px 0; | ||
} | ||
.year { | ||
color: var(--vp-c-neutral); | ||
font-size: 1.4rem; | ||
font-weight: 500; | ||
font-style: italic; | ||
padding-top: 1rem; | ||
} | ||
.yearPosts { | ||
padding-left: 2rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ description: All Posts | |
layout: page | ||
--- | ||
|
||
👷 🚧 | ||
<Posts /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
date: 2019-12-18 | ||
location: 深圳,创维半导体设计大厦 | ||
sort: Computer Science | ||
tags: | ||
- Network | ||
- HTTPS | ||
--- | ||
|
||
# [WIP] 一次 ADAS 设备上的 HTTPS 排障过程 | ||
|
||
> pending |