AstroPaper-S is a fork of satnaing/astro-paper v4.5.0, based on Astro.
Main changes:
- Hexo compatibility, includes routing and markdown frontmatter.
- Auto-generated post descriptions, based on word count or until the
<!--more-->
tag. - Sidebar table of contents with tocbot.
- Code block syntax highlighter with rehype-pretty-code.
- Added
loading="lazy"
attribute to<img>
tags and added<figcaption>
. - Added Disqus for comments.
- Static i18n (internationalization) support.
- Tweaked some layout and styles.
- Comment out a few components like the scroll progress bar and breadcrumb.
Most of the other features, such as light/dark mode, fuzzy search, sitemap generation, and more, remain largely unchanged.
Usage
For development:
To build static site:
Config
src/config.ts
website
: Replace this with your deployed domainauthor
: Your nameprofile
: Your profile URLdesc
: Website descriptiontitle
: Website titleogImage
: Open Graph image pathlightAndDarkMode
: Enable light & dark modepostPerIndex
: Number of posts per index pagepostPerPage
: Number of posts per /page.postPerArchive
: Number of posts per archive pagescheduledPostMargin
: In Production mode, posts with a future date time will not be visible. However, if a post’s date time is within the nextscheduledPostMargin
ms, it will be visible.genDescriptionCount
: Word count for auto-generated post descriptionsenableTransitionName
: Enable Astro Naming a transitionenableGenOgImage
: Enable Open Graph image generation for each posts
Disqus
Please replace your shortname in src/components/Disqus.astro
Static i18n
Look at src/lang/lang.ts
Modify translations
to add new language, and set the desired language using the USED_LANG
constant
Markdown Frontmatter
Property | Desc | Remark |
---|---|---|
author | Author of the post | default = SITE.author |
title | Title of the post | required* |
subtitle | Subtitle of the post | optional |
description | Description of the post. Used in post excerpt and site description of the post | optional, auto-generated if not given |
date | published datetime in ISO 8601 format | required* |
updated | Modified datetime in ISO 8601 format | optional |
featured | Whether or not display this post in featured section of home page | default = false |
draft | Mark this post ‘unpublished’ | default = false |
tags | Related keywords for this post. Written in array YAML format | default = ["others"] |
categories | Categories for this post. Written in array YAML format | optional |
ogImage | OG image of the post. Useful for social media sharing and SEO | default = SITE.ogImage or generated OG image |
toc | Enable table of contents for this post | default = true |
comments | Enable comments for this post | default = true |
math | Enable KaTeX for this post | default = false |
canonicalURL | Canonical URL (absolute), in case the article already exists on other source | default = Astro.site + Astro.url.pathname |
slug | Slug for the post. This field is optional but CANNOT be an empty string ("" ) | default = slugified file name |
Also see Adding new posts in AstroPaper theme | AstroPaper and
src/content/config.ts