Skip to content

Commit

Permalink
update: 修复footer & 部分格式化
Browse files Browse the repository at this point in the history
  • Loading branch information
Parsifa1 committed Dec 22, 2023
1 parent ddc8573 commit 0fc1ded
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 145 deletions.
15 changes: 15 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
trailingComma: "es5"
tabWidth: 2
semi: false
singleQuote: true
plugins:
- prettier-plugin-astro
- prettier-plugin-tailwindcss
overrides:
- files:
- "*.ts"
- "*.tsx"
- "*.jsx"
- "*.js"
options:
tabWidth: 2
24 changes: 12 additions & 12 deletions astro.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
import react from "@astrojs/react";
import remarkToc from "remark-toc";
import remarkCollapse from "remark-collapse";
import sitemap from "@astrojs/sitemap";
import { SITE } from "./src/config";
import { defineConfig } from 'astro/config'
import tailwind from '@astrojs/tailwind'
import react from '@astrojs/react'
import remarkToc from 'remark-toc'
import remarkCollapse from 'remark-collapse'
import sitemap from '@astrojs/sitemap'
import { SITE } from './src/config'

// https://astro.build/config
export default defineConfig({
Expand All @@ -22,19 +22,19 @@ export default defineConfig({
[
remarkCollapse,
{
test: "Table of contents",
test: 'Table of contents',
},
],
],
shikiConfig: {
theme: "one-dark-pro",
theme: 'one-dark-pro',
wrap: true,
},
},
vite: {
optimizeDeps: {
exclude: ["@resvg/resvg-js"],
exclude: ['@resvg/resvg-js'],
},
},
scopedStyleStrategy: "where",
});
scopedStyleStrategy: 'where',
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"lint-staged": "^14.0.1",
"prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.0",
"prettier-plugin-tailwindcss": "^0.5.4",
"prettier-plugin-tailwindcss": "^0.5.9",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
195 changes: 95 additions & 100 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
---
import Hr from "./Hr.astro";
import Socials from "./Socials.astro";
import Hr from './Hr.astro'
import Socials from './Socials.astro'
const currentYear = new Date().getFullYear();
const currentYear = new Date().getFullYear()
export interface Props {
noMarginTop?: boolean;
noMarginTop?: boolean
}
const { noMarginTop = false } = Astro.props;
const { noMarginTop = false } = Astro.props
---

<footer class={`${noMarginTop ? "" : "mt-auto"}`}>
<footer class={`${noMarginTop ? '' : 'mt-auto'}`}>
<Hr noPadding />
<div class="footer-wrapper">
<Socials centered />
<div class="copyright-wrapper">
<span>Copyright &#169; {currentYear}</span>
<span>&#169;Copyright By Parsifa1</span>
<span class="separator">&nbsp;|&nbsp;</span>
<span>Build with Astro🦄 </span>
<span>Build with Astro🦄</span>
<span class="separator">&nbsp;|&nbsp;</span>
<a href="https://512kb.club"
><img src="https://512kb.club/assets/images/orange-team.svg" /></a
>
</div>
</div>
</footer>
Expand All @@ -28,7 +32,7 @@ const { noMarginTop = false } = Astro.props;
@apply w-full;
}
.footer-wrapper {
@apply flex flex-col items-center justify-between py-6 sm:flex-row-reverse sm:py-4;
@apply flex flex-col items-center justify-between py-6 sm:flex-col-reverse sm:py-4;
}
.link-button {
@apply my-1 p-2 hover:rotate-6;
Expand Down
18 changes: 9 additions & 9 deletions src/layouts/AboutLayout.astro
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
import { SITE } from "@config";
import Breadcrumbs from "@components/Breadcrumbs.astro";
import Footer from "@components/Footer.astro";
import Header from "@components/Header.astro";
import Layout from "./Layout.astro";
import { SITE } from '@config'
import Breadcrumbs from '@components/Breadcrumbs.astro'
import Footer from '@components/Footer.astro'
import Header from '@components/Header.astro'
import Layout from './Layout.astro'
export interface Props {
frontmatter: {
title: string;
description?: string;
};
title: string
description?: string
}
}
const { frontmatter } = Astro.props;
const { frontmatter } = Astro.props
---

<Layout title={`${frontmatter.title} | ${SITE.title}`}>
Expand Down
24 changes: 12 additions & 12 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
import { LOCALE, SITE } from "@config";
import "@styles/base.css";
import { ViewTransitions } from "astro:transitions";
import { LOCALE, SITE } from '@config'
import '@styles/base.css'
import { ViewTransitions } from 'astro:transitions'
const googleSiteVerification = import.meta.env.PUBLIC_GOOGLE_SITE_VERIFICATION;
const googleSiteVerification = import.meta.env.PUBLIC_GOOGLE_SITE_VERIFICATION
export interface Props {
title?: string;
author?: string;
description?: string;
ogImage?: string;
canonicalURL?: string;
title?: string
author?: string
description?: string
ogImage?: string
canonicalURL?: string
}
const {
Expand All @@ -19,12 +19,12 @@ const {
description = SITE.desc,
ogImage = SITE.ogImage,
canonicalURL = new URL(Astro.url.pathname, Astro.site).href,
} = Astro.props;
} = Astro.props
const socialImageURL = new URL(
ogImage ?? SITE.ogImage ?? "og.png",
ogImage ?? SITE.ogImage ?? 'og.png',
Astro.url.origin
).href;
).href
---

<!doctype html>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const posts = await getCollection("blog");
const sortedPosts = getSortedPosts(posts);
const featuredPosts = sortedPosts.filter(({ data }) => data.featured);
const socialCount = SOCIALS.filter(social => social.active).length;
const socialCount = SOCIALS.filter((social) => social.active).length;
---

<Layout>
Expand Down Expand Up @@ -90,7 +90,7 @@ const socialCount = SOCIALS.filter(social => social.active).length;
frontmatter={data}
secHeading={false}
/>
)
),
)
}
</ul>
Expand Down

0 comments on commit 0fc1ded

Please sign in to comment.