diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md deleted file mode 100644 index 8aade0f..0000000 --- a/.github/copilot-instructions.md +++ /dev/null @@ -1,59 +0,0 @@ -# Copilot Instructions for n-daisuke897-blog - -## Project Overview -This is a personal blog named "Naputo" built with Astro and Preact. The blog is designed to publish articles and content with a modern static site generation approach. - -**Repository**: https://git.n-daisuke897.com/nakada0907/n-daisuke897-blog - -## Tech Stack -- **Framework**: Astro 5.x -- **UI Library**: Preact 10.x for interactive components -- **Language**: TypeScript -- **Build Tool**: Astro CLI -- **RSS**: @astrojs/rss for RSS feed generation -- **Linting**: ESLint with TypeScript and Astro plugins - -## Project Structure -- `src/`: Source code - - `pages/`: Astro pages (routing based on file structure) - - `layouts/`: Layout components - - `components/`: Reusable components - - `blog/`: Blog content - - `styles/`: Global styles - - `scripts/`: Utility scripts - - `content.config.ts`: Content collection configuration -- `public/`: Static assets (images, fonts, etc.) -- `dist/`: Build output directory -- `buildspec.yml`: AWS CodeBuild configuration - -## Development Guidelines - -### Commands -- `npm install`: Install dependencies -- `npm run dev`: Start local development server at `localhost:4321` -- `npm run build`: Build production site to `./dist/` -- `npm run preview`: Preview production build locally -- `npm run astro`: Run Astro CLI commands - -### Coding Standards -- Use TypeScript for all new code -- Follow the ESLint configuration provided -- Use Preact components for interactive UI elements -- Keep components modular and reusable -- Use Astro's component syntax for static content - -### File Naming -- Use kebab-case for file names -- Use PascalCase for component names -- Use `.astro` extension for Astro components -- Use `.tsx` extension for Preact components - -### Best Practices -- Prefer static generation over client-side rendering when possible -- Use Astro's content collections for blog posts -- Optimize images and assets before adding to `public/` -- Keep bundle size minimal - Astro ships zero JS by default -- Use Preact only when client interactivity is needed - -## Deployment -This project uses AWS CodeBuild for deployment (see `buildspec.yml`). diff --git a/amplify-stack.yaml b/amplify-stack.yaml new file mode 100644 index 0000000..8bc55fa --- /dev/null +++ b/amplify-stack.yaml @@ -0,0 +1,61 @@ +AWSTemplateFormatVersion: '2010-09-09' +Description: 'CloudFormation template for deploying Astro site to AWS Amplify' + +Parameters: + GitHubAccessToken: + Type: String + NoEcho: true + Description: GitHub Access token for repository access + +Resources: + AmplifyApp: + Type: AWS::Amplify::App + UpdateReplacePolicy: Delete + DeletionPolicy: Delete + Properties: + Name: blog_daisuke_nakahara + Repository: https://github.com/Daisuke897/blog_daisuke_nakahara + AccessToken: !Ref GitHubAccessToken + Platform: WEB + BuildSpec: | + version: 1 + frontend: + phases: + preBuild: + commands: + - npm ci --cache .npm --prefer-offline + build: + commands: + - npm run build + artifacts: + baseDirectory: dist + files: + - '**/*' + cache: + paths: + - .npm/**/* + CustomRules: + - Source: ' **Note**: This article was translated from Japanese to English and reviewed with the assistance of AI (GitHub Copilot). diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 3e2edc3..9c72f54 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -16,5 +16,5 @@ diff --git a/src/components/Navigation.astro b/src/components/Navigation.astro index 67284b2..4257856 100644 --- a/src/components/Navigation.astro +++ b/src/components/Navigation.astro @@ -7,7 +7,7 @@ About Articles Tags - + Forgejo Icon diff --git a/src/layouts/MarkdownPostLayout.astro b/src/layouts/MarkdownPostLayout.astro index b236a24..af007b0 100644 --- a/src/layouts/MarkdownPostLayout.astro +++ b/src/layouts/MarkdownPostLayout.astro @@ -49,27 +49,18 @@ const optionsForDate = { .markdown-content { font-family: sans-serif; - font-size: 1.1rem; - line-height: 1.8; + font-size: 1.2rem; + line-height: 2.5; } .markdown-content h1 { - font-size: 1.6rem; - margin-top: 2rem; - margin-bottom: 1rem; - line-height: 1.3; + font-size: 1.9rem; } .markdown-content h2 { - font-size: 1.4rem; - margin-top: 1.8rem; - margin-bottom: 0.8rem; - line-height: 1.3; + font-size: 1.75rem; } .markdown-content h3 { - font-size: 1.2rem; - margin-top: 1.5rem; - margin-bottom: 0.6rem; - line-height: 1.3; + font-size: 1.5rem; } diff --git a/src/pages/index.astro b/src/pages/index.astro index aa7888a..06ba9b9 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -4,7 +4,6 @@ import BlogPost from "../components/BlogPost.astro"; import { getCollection } from "astro:content"; const pageTitle = "Naputo"; const allPosts = await getCollection("blog"); -const sortedPosts = allPosts.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); ---