Skip to content

Commit

Permalink
增加友链路由
Browse files Browse the repository at this point in the history
  • Loading branch information
s0rryy committed Feb 17, 2024
1 parent d740803 commit 564cc6c
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/assets/socialIcons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ const socialIcons = {
q-43 -8 -67 -30q-29 -25 -35 -72q-2 -14 -2 -29l25 6q31 6 65 10q48 7 93 9q42 2 92 -2q32 -2 88 -9t107 -30q49 -23 81.5 -54.5t38.5 -63.5q9 -45 13 -109q4 -46 5 -97v-41q0 -56 -14 -103q-11 -40 -32 -73q-16 -26 -38 -47q-15 -15 -32 -25q-12 -8 -14 -8
q-46 -22 -127 -33q-74 -10 -166 -11h-3zM367 267q73 0 109 56l24 39l24 -39q36 -56 109 -56q63 0 101 43t38 117v239h-95v-232q0 -74 -61 -74q-69 0 -69 88v127h-94v-127q0 -88 -69 -88q-61 0 -61 74v232h-95v-239q0 -74 38 -117t101 -43z" />
</svg>`,
Bilibili: `<svg t="1708150030923" class="icon" viewBox="100 130 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1467" width="200" height="200"><path d="M777.515 131.67a53.333 53.333 0 0 1 0 75.434l-48.768 48.725h49.92a160 160 0 0 1 160 160.043v320a160 160 0 0 1-160 160H245.333a160 160 0 0 1-160-160v-320a160 160 0 0 1 160-160h49.75L246.4 207.147a53.333 53.333 0 1 1 75.392-75.435l113.152 113.152c3.37 3.37 6.187 7.04 8.448 10.965H580.48a52.046 52.046 0 0 1 8.49-11.008L702.08 131.67a53.333 53.333 0 0 1 75.435 0z m1.152 231.253H245.333a53.333 53.333 0 0 0-53.205 49.365l-0.128 4.01v320c0 28.118 21.76 51.158 49.365 53.163l3.968 0.171h533.334a53.333 53.333 0 0 0 53.205-49.365l0.128-3.968v-320c0-29.44-23.893-53.334-53.333-53.334zM352 469.589c29.44 0 53.333 23.894 53.333 53.334v53.333a53.333 53.333 0 1 1-106.666 0v-53.333c0-29.44 23.893-53.334 53.333-53.334z m320 0c29.44 0 53.333 23.894 53.333 53.334v53.333a53.333 53.333 0 1 1-106.666 0v-53.333c0-29.44 23.893-53.334 53.333-53.334z" p-id="1468"></path></svg>`,
};

export default socialIcons;
7 changes: 6 additions & 1 deletion src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Hr from "./Hr.astro";
import LinkButton from "./LinkButton.astro";
export interface Props {
activeNav?: "posts" | "tags" | "about" | "search";
activeNav?: "posts" | "tags" | "about" | "friends" | "search";
}
const { activeNav } = Astro.props;
Expand Down Expand Up @@ -65,6 +65,11 @@ const { activeNav } = Astro.props;
Tags
</a>
</li>
<li>
<a href="/friends/" class={activeNav === "friends" ? "active" : ""}>
Friends
</a>
</li>
<li>
<a href="/about/" class={activeNav === "about" ? "active" : ""}>
About
Expand Down
18 changes: 9 additions & 9 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const SITE: Site = {
website: "https://s0rry.cn/", // replace this with your deployed domain
author: "s0rry",
desc: "A minimal, responsive and SEO-friendly Astro blog theme.",
title: "AstroPaper",
title: "s0rry's Blog",
ogImage: "astropaper-og.jpg",
lightAndDarkMode: true,
postPerPage: 3,
Expand All @@ -26,33 +26,33 @@ export const LOGO_IMAGE = {
export const SOCIALS: SocialObjects = [
{
name: "Github",
href: "https://github.com/satnaing/astro-paper",
href: "https://github.com/s0rryy",
linkTitle: ` ${SITE.title} on Github`,
active: true,
},
{
name: "Facebook",
href: "https://github.com/satnaing/astro-paper",
linkTitle: `${SITE.title} on Facebook`,
name: "Bilibili",
href: "https://space.bilibili.com/38761787",
linkTitle: `${SITE.title} on Bilibili`,
active: true,
},
{
name: "Instagram",
href: "https://github.com/satnaing/astro-paper",
linkTitle: `${SITE.title} on Instagram`,
active: true,
active: false,
},
{
name: "LinkedIn",
href: "https://github.com/satnaing/astro-paper",
linkTitle: `${SITE.title} on LinkedIn`,
active: true,
active: false,
},
{
name: "Mail",
href: "mailto:yourmail@gmail.com",
href: "mailto:s0rry.suyy@qq.com",
linkTitle: `Send an email to ${SITE.title}`,
active: false,
active: true,
},
{
name: "Twitter",
Expand Down
28 changes: 28 additions & 0 deletions src/layouts/FriendsLayout.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
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;
};
}
const { frontmatter } = Astro.props;
---

<Layout title={`${frontmatter.title} | ${SITE.title}`}>
<Header activeNav="friends" />
<Breadcrumbs />
<main id="main-content">
<section id="friends" class="prose mb-28 max-w-3xl prose-img:border-0">
<h1 class="text-2xl tracking-wider sm:text-3xl">{frontmatter.title}</h1>
<slot />
</section>
</main>
<Footer />
</Layout>
36 changes: 36 additions & 0 deletions src/pages/friends.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
layout: ../layouts/FriendsLayout.astro
title: "Friends"
---

AstroPaper is a minimal, responsive and SEO-friendly Astro blog theme. I designed and crafted this based on [my personal blog](https://satnaing.dev/blog).

This theme is aimed to be accessible out of the box. Light and dark mode are supported by
default and additional color schemes can also be configured.

This theme is self-documented \_ which means articles/posts in this theme can also be considered as documentations. So, see the documentation for more info.

<div>
<img src="/assets/dev.svg" class="sm:w-1/2 mx-auto" alt="coding dev illustration">
</div>

## Tech Stack

This theme is written in vanilla JavaScript (+ TypeScript for type checking) and a little bit of ReactJS for some interactions. TailwindCSS is used for styling; and Markdown is used for blog contents.

## Features

Here are certain features of this site.

- fully responsive and accessible
- SEO-friendly
- light & dark mode
- fuzzy search
- super fast performance
- draft posts
- pagination
- sitemap & rss feed
- highly customizable

If you like this theme, you can star/contribute to the [repo](https://github.com/satnaing/astro-paper).
Or you can even give any feedback via my [email](mailto:contact@satnaing.dev).

0 comments on commit 564cc6c

Please sign in to comment.