Skip to content

Commit

Permalink
use astro font util
Browse files Browse the repository at this point in the history
  • Loading branch information
Atotti committed Jan 12, 2025
1 parent 16e1b34 commit c27b11c
Show file tree
Hide file tree
Showing 12 changed files with 66 additions and 48 deletions.
48 changes: 48 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"dependencies": {
"@astrojs/check": "^0.9.4",
"@astrojs/react": "^4.1.2",
"@fontsource-variable/noto-sans-jp": "^5.1.1",
"@fontsource/hachi-maru-pop": "^5.1.1",
"@fontsource/varela-round": "^5.1.1",
"@fontsource/zen-kaku-gothic-new": "^5.1.1",
"@fortawesome/fontawesome-free": "^6.7.1",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
Expand Down
1 change: 1 addition & 0 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import { css } from '../../styled-system/css'
import '@fontsource/hachi-maru-pop';
---

<header class={css({
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProgressBar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const { percentage, color = "linear-gradient(to right, #0077cc, #00a0ff)" } = As
font-size: 1rem;
margin-bottom: 5px;
color: #333;
font-family: "Noto Sans JP", sans-serif;
font-family: 'Noto Sans JP Variable', sans-serif;
}

.progress-bar {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SkillsSection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const skillCardTextStyle = css({
"display": "flex",
"color": "#666666",
"justifyContent": "center",
"fontFamily": "Noto Sans JP, Varela Round, sans-serif",
"fontFamily": "'Noto Sans JP Variable', sans-serif",
})
---

Expand Down
3 changes: 2 additions & 1 deletion src/components/Sns/GitHubIcon.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
import { FaGithub } from "react-icons/fa";
---

<a href="https://github.com/Atotti" target="_blank" class="sns-icon">
<i class="fa-brands fa-github"></i>
<FaGithub />
</a>


Expand Down
34 changes: 0 additions & 34 deletions src/components/Sns/PixivIcon.astro

This file was deleted.

3 changes: 2 additions & 1 deletion src/components/Sns/TwitterIcon.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
import { FaTwitter } from "react-icons/fa";
---

<a href="https://x.com/aya172957" target="_blank" class="sns-icon">
<i class="fa-brands fa-twitter"></i>
<FaTwitter />
</a>

<style>
Expand Down
2 changes: 0 additions & 2 deletions src/components/SnsIcons.astro
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
---
import TwitterIcon from './Sns/TwitterIcon.astro';
import GitHubIcon from './Sns/GitHubIcon.astro';
import PixivIcon from './Sns/PixivIcon.astro';
---

<div>
<TwitterIcon />
<GitHubIcon />
<PixivIcon />
</div>


Expand Down
7 changes: 3 additions & 4 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---
import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import '@fontsource-variable/noto-sans-jp';
import '@fontsource/zen-kaku-gothic-new';
import '@fontsource/varela-round';
import { css, cx} from '../../styled-system/css'
import '../styles/global.css';
import '../index.css';
Expand All @@ -12,9 +14,6 @@ import '../index.css';
<html lang="ja">
<head>
<meta charset="UTF-8" />
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Hachi+Maru+Pop&family=Rampart+One&family=Zen+Kaku+Gothic+New&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Varela+Round&display=swap" rel="stylesheet">
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/jpg" href="/icon.jpg" />
<meta name="generator" content={Astro.generator} />
Expand Down
6 changes: 3 additions & 3 deletions src/pages/blog/index.astro
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
import Layout from '../../layouts/Layout.astro';
import { getCollection, type CollectionEntry } from 'astro:content';
import { getCollection, type CollectionEntry, type ContentCollectionKey } from 'astro:content';
// 記事一覧を取得
const posts = (await getCollection('posts')).sort((a, b) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime());
const posts = (await getCollection('posts')).sort((a: ContentCollectionKey, b: ContentCollectionKey) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime());
---

<Layout>
Expand Down Expand Up @@ -40,7 +40,7 @@ const posts = (await getCollection('posts')).sort((a, b) => new Date(b.data.pubD

/* セクションタイトル */
.section-title {
font-family: "Varela Round", sans-serif;
font-family: 'Varela Round', sans-serif;
font-size: 2rem;
text-align: center;
color: #404950;
Expand Down
2 changes: 1 addition & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ベースのスタイル */
body {
font-family: "Noto Sans JP", sans-serif;
font-family: 'Noto Sans JP Variable', sans-serif;
line-height: 1.6;
margin: 0;
padding: 0;
Expand Down

0 comments on commit c27b11c

Please sign in to comment.