File tree Expand file tree Collapse file tree 11 files changed +178
-45
lines changed
posts/an-https-issue-on-adas Expand file tree Collapse file tree 11 files changed +178
-45
lines changed Original file line number Diff line number Diff line change @@ -12,5 +12,8 @@ export const giscus = {
1212export const gMeasurementID = env . G_MEASUREMENT_ID || "" ;
1313
1414export function withBaseURL ( urlPath : string ) {
15+ if ( BASE_URL && urlPath . includes ( BASE_URL ) ) {
16+ return urlPath ;
17+ }
1518 return path . join ( BASE_URL || "/" , urlPath ) ;
1619}
Original file line number Diff line number Diff line change 1+ <template >
2+ <div :class =" $style.container" >
3+ <slot />
4+ </div >
5+ </template >
6+
7+ <style module scoped>
8+ .container {
9+ justify-content : center ;
10+ padding : 1rem 4rem 0 ;
11+ }
12+
13+ @media (min-width : 768px ) {
14+ .container {
15+ padding : 3rem 6rem 0 ;
16+ }
17+ }
18+
19+ @media (min-width : 960px ) {
20+ .container {
21+ padding : 3rem 4rem 0 ;
22+ display : flex ;
23+ }
24+ }
25+
26+ @media (min-width : 1280px ) {
27+ .container {
28+ padding : 4rem 8rem 0 ;
29+ display : flex ;
30+ }
31+ }
32+ </style >
Original file line number Diff line number Diff line change 11<template >
2- <div :class =" $style.elementList" >
2+ <div
3+ name =" post-elements"
4+ :class =" $style.elementList"
5+ hidden
6+ >
37 <span :class =" $style.elementItem" >
48 {{ moment(post.datetime).format("LL") }}
59 </span >
@@ -38,17 +42,33 @@ function getPostData() {
3842 return findPost (allPosts , page .value )?.frontmatter || frontmatter .value ;
3943}
4044
45+ function adjustPosition() {
46+ const elements = document .getElementsByName (" post-elements" );
47+ if (elements .length > 1 ) {
48+ return ;
49+ }
50+ const block = elements [0 ];
51+ const title = document .querySelector (" .main h1" );
52+ const parent = title ?.parentElement ;
53+ if (block && title && parent ) {
54+ const newBlock = block .cloneNode (true );
55+ (<Element >newBlock ).removeAttribute (" hidden" );
56+ parent .insertBefore (newBlock , title .nextSibling );
57+ }
58+ }
59+
4160onContentUpdated (() => {
4261 post .value = getPostData ();
62+ setTimeout (adjustPosition , 0 );
4363});
4464 </script >
4565
4666<style module scoped>
4767.elementList {
4868 border-top : 1px dashed var (--vp-c-divider );
4969 padding-top : 0.5rem ;
50- margin-top : 3 rem ;
51- margin-bottom : -5 rem ;
70+ margin-top : 0.5 rem ;
71+ margin-bottom : 2 rem ;
5272 font-size : 0.88rem ;
5373}
5474
Original file line number Diff line number Diff line change 11<template >
22 <div :class =" $style.postList" >
3+ <span :class =" [$style.date, $style.hack]" >
4+ {{ moment(new Date()).format(dateFormat) }}
5+ </span >
36 <div
47 v-for =" post in postList"
58 :key =" post.url"
@@ -64,4 +67,8 @@ defineProps({
6467 font-size : 0.85em ;
6568 color : var (--vp-c-text-3 );
6669}
70+
71+ .hack {
72+ visibility : hidden ;
73+ }
6774 </style >
Original file line number Diff line number Diff line change 11// https://vitepress.dev/guide/custom-theme
22import Theme from "vitepress/theme" ;
33import "./style.css" ;
4- // import Archives from "./components/Archives.vue";
5- // import Tags from "./components/Tags.vue";
64import Home from "./pages/Home.vue" ;
75import Layout from "./pages/Layout.vue" ;
6+ import Posts from "./pages/Posts.vue" ;
7+ // import Tags from "./components/Tags.vue";
88
99export default {
1010 extends : Theme ,
1111 Layout,
1212 enhanceApp ( { app } ) {
1313 app . component ( "Home" , Home ) ;
14+ app . component ( "Posts" , Posts ) ;
1415 } ,
1516} ;
Original file line number Diff line number Diff line change 11<template >
2- <div :class = " $style.column " >
2+ <Container >
33 <div :class =" $style.aside" >
44 <Profile />
55 </div >
66 <div :class =" $style.homefeed" >
77 <HomeFeed />
88 </div >
9- </div >
9+ </Container >
1010</template >
1111
1212<script lang="ts" setup>
13+ import Container from " ../components/Container.vue" ;
1314import Profile from " ../components/Profile.vue" ;
1415import HomeFeed from " ../components/HomeFeed.vue" ;
1516 </script >
1617
1718<style scoped module>
18- .column {
19- justify-content : center ;
20- }
21-
2219.aside {
23- padding : 2rem 3rem ;
24- }
25-
26- .homefeed {
27- padding : 0 4rem ;
20+ padding : 2rem ;
21+ padding-top : 0 ;
2822}
2923
3024@media (min-width : 768px ) {
3125 .aside {
32- padding : 3rem ;
33- }
34-
35- .homefeed {
36- padding : 0 6rem ;
26+ padding : 0 3rem 3rem ;
3727 }
3828}
3929
4030@media (min-width : 960px ) {
41- .column {
42- padding : 0rem 4rem ;
43- display : flex ;
44- }
45-
46- .aside {
47- padding : 3rem ;
48- }
49-
5031 .homefeed {
5132 max-width : 38rem ;
5233 min-width : 38rem ;
53- padding : 3 rem 3rem 0 ;
34+ padding : 0 3rem ;
5435 }
5536}
5637
5738@media (min-width : 1280px ) {
58- .column {
59- padding : 0rem 8rem ;
60- display : flex ;
61- }
62-
6339 .aside {
64- padding : 4rem ;
40+ padding : 0 4rem ;
6541 }
6642
6743 .homefeed {
6844 max-width : 48rem ;
6945 min-width : 48rem ;
70- padding : 4 rem 4rem 0 ;
46+ padding : 0 4rem ;
7147 }
7248}
7349 </style >
Original file line number Diff line number Diff line change 1+ <template >
2+ <Container :class =" $style.container" >
3+ <div :class =" $style.main" >
4+ <div :class =" $style.amountBox" >
5+ <div :class =" $style.amountBadge" >
6+ All Posts
7+ <span :class =" $style.number" >{{ allPosts.length }}</span >
8+ </div >
9+ </div >
10+ <div
11+ v-for =" year of years"
12+ :key =" year"
13+ >
14+ <h1 :class =" $style.year" >
15+ <a
16+ :id =" year"
17+ :href =" `#${year}`"
18+ >{{ year }}</a >
19+ </h1 >
20+ <div :class =" $style.yearPosts" >
21+ <PostList
22+ date-format =" MMM DD"
23+ :post-list =" postsByYear[year]"
24+ />
25+ </div >
26+ </div >
27+ </div >
28+ </Container >
29+ </template >
30+
31+ <script lang="ts" setup>
32+ import { data as allPosts } from " ../posts.data" ;
33+ import Container from " ../components/Container.vue" ;
34+ import PostList from " ../components/PostList.vue" ;
35+
36+ const postsByYear = {};
37+ allPosts .forEach ((post ) => {
38+ const year = post .frontmatter .datetime .slice (0 , 4 );
39+ postsByYear [year ] = postsByYear [year ] || [];
40+ postsByYear [year ].push (post );
41+ });
42+ const years = Object .keys (postsByYear ).sort ().reverse ();
43+ </script >
44+
45+ <style module scoped>
46+ .container {
47+ display : block ;
48+ }
49+
50+ .main {
51+ margin : 0 auto ;
52+ max-width : 42rem ;
53+ padding : 0 0 2rem ;
54+ }
55+
56+ .amountBox {
57+ color : var (--vp-c-default-1 );
58+ text-align : right ;
59+ }
60+
61+ .amountBadge {
62+ background-color : var (--vp-c-default-soft );
63+ border-radius : 4px ;
64+ padding : 0 0 0 7px ;
65+ display : inline-block ;
66+ }
67+
68+ .number {
69+ color : var (--vp-c-text-3 );
70+ background-color : var (--vp-c-default-soft );
71+ padding : 2px 7px 2px 6px ;
72+ margin-left : 1px ;
73+ border-radius : 0 4px 4px 0 ;
74+ }
75+
76+ .year {
77+ color : var (--vp-c-neutral );
78+ font-size : 1.4rem ;
79+ font-weight : 500 ;
80+ font-style : italic ;
81+ padding-top : 1rem ;
82+ }
83+
84+ .yearPosts {
85+ padding-left : 1rem ;
86+ }
87+ </style >
Original file line number Diff line number Diff line change @@ -162,11 +162,6 @@ footer a {
162162}
163163
164164/* CSS for a Post */
165- /* PostElements Workaround */
166- .main h1 {
167- margin-bottom : 5rem ;
168- }
169-
170165.main img {
171166 border-radius : 0.5rem ;
172167 box-shadow : 0 0.5rem 0.8rem var (--ct-c-shadow );
Original file line number Diff line number Diff line change 11# 🐳 WhaleVocal
22
33[ ![ Netlify Status] ( https://api.netlify.com/api/v1/badges/23e0b8dc-df98-491d-9885-d4229baa1ccb/deploy-status )] ( https://app.netlify.com/sites/octobug-blog/deploys )
4- [ ![ Badge: GitHub] ( https://github.com/Octobug/blog/actions/workflows/deploy.yml/badge.svg )] ( https://github.com/Octobug/ blog/actions )
4+ [ ![ Badge: GitHub] ( https://github.com/Octobug/blog/actions/workflows/deploy.yml/badge.svg )] ( https://octobug. github.io/ blog/ )
55
66- < https://blog.octobug.site > (hosted on [ Netlify] ( https://netlify.com/ ) )
77
Original file line number Diff line number Diff line change @@ -4,4 +4,4 @@ description: All Posts
44layout : page
55---
66
7- 👷 🚧
7+ < Posts />
You can’t perform that action at this time.
0 commit comments