### Install LaTeX dependencies Source: https://astro-paper.pages.dev/posts/how-to-add-latex-equations-in-blog-posts Install the required remark and rehype plugins for KaTeX support. ```bash pnpm install rehype-katex remark-math katex ``` -------------------------------- ### Example git diff output Source: https://astro-paper.pages.dev/posts/setting-dates-via-git-hooks Sample output showing a file that has been added to the staging area. ```text A src/content/blog/setting-dates-via-git-hooks.md ``` -------------------------------- ### Example: Changing Light Color Scheme Source: https://astro-paper.pages.dev/posts/customizing-astropaper-theme-color-schemes An example demonstrating how to modify the light color scheme by updating the CSS variables within the `:root, html[data-theme="light"]` block in `global.css`. This allows for quick visual changes to the website's light theme. ```css /* ... */ :root, html[data-theme="light"] { --background: #f6eee1; --foreground: #012c56; --accent: #e14a39; --muted: #efd8b0; --border: #dc9891; } /* ... */ ``` -------------------------------- ### Install Giscus React dependencies Source: https://astro-paper.pages.dev/posts/how-to-integrate-giscus-comments Install the required Giscus React package and add React support to the Astro project. ```bash npm i @giscus/react && npx astro add react ``` -------------------------------- ### Sample Blog Post Frontmatter Source: https://astro-paper.pages.dev/posts/adding-new-posts-in-astropaper-theme An example of frontmatter for a blog post in AstroPaper. It includes common properties like title, author, publication date, slug, tags, and description. ```yaml --- title: The title of the post author: your name pubDatetime: 2022-09-21T05:17:19Z slug: the-title-of-the-post featured: true draft: false tags: - some - example - tags ogImage: ../../assets/images/example.png # src/assets/images/example.png # ogImage: "https://example.org/remote-image.png" # remote URL description: This is the example description of the example post. canonicalURL: https://example.org/my-article-was-already-posted-here --- ``` -------------------------------- ### Import modules using the updated alias Source: https://astro-paper.pages.dev/posts/astro-paper-v5 Example of using the new @/ import alias syntax in Astro components. ```javascript --- import { slugifyStr } from "@/utils/slugify"; import IconHash from "@/assets/icons/IconHash.svg"; --- ``` -------------------------------- ### Check for All Remaining Dependency Updates Source: https://astro-paper.pages.dev/posts/how-to-update-dependencies This command checks for any remaining updates, including major versions, and prompts for interactive installation. Be cautious with major updates as they may introduce breaking changes. ```bash ncu -iCopy ``` -------------------------------- ### Blog Post Structure and URL Examples Source: https://astro-paper.pages.dev/posts/adding-new-posts-in-astropaper-theme Illustrates how the file path of a markdown blog post determines its URL. Subdirectories typically form part of the URL, but can be excluded by prefixing them with an underscore. ```markdown src/data/blog/very-first-post.md -> mysite.com/posts/very-first-post src/data/blog/2025/example-post.md -> mysite.com/posts/2025/example-post src/data/blog/_2026/another-post.md -> mysite.com/posts/another-post src/data/blog/docs/_legacy/how-to.md -> mysite.com/posts/docs/how-to src/data/blog/Example Dir/Dummy Post.md -> mysite.com/posts/example-dir/dummy-post ``` -------------------------------- ### Install npm-check-updates Globally Source: https://astro-paper.pages.dev/posts/how-to-update-dependencies Install the npm-check-updates package globally to use its commands. This is a prerequisite for managing dependency updates. ```bash npm install -g npm-check-updatesCopy ``` -------------------------------- ### Update Minor Dependencies Interactively Source: https://astro-paper.pages.dev/posts/how-to-update-dependencies Checks for minor dependency updates and allows you to select which ones to install. Review release notes for potential breaking changes. ```bash ncu -i --target minorCopy ``` -------------------------------- ### Integrating Giscus in PostDetails.astro Source: https://astro-paper.pages.dev/posts/how-to-integrate-giscus-comments Example of placing the Giscus script tag within the Astro component layout for post details. ```astro