chore: update theme guides and project comments, add astro-compress to remove comments

This commit is contained in:
radishzzz 2025-05-19 00:25:26 +01:00
parent 1db68e8716
commit ef192c4545
21 changed files with 319 additions and 101 deletions

View file

@ -41,6 +41,7 @@ function initWaline() {
init({
el: '#waline',
serverURL,
// Share comments on posts in different languages
path: window.location.pathname.replace(/^\/([a-z]{2}(-[a-z]{2})?)\//, '/'),
lang: walineLang,
emoji,

View file

@ -4,6 +4,7 @@ function setupGithubCards() {
if (githubCards.length === 0)
return
// Create an intersection observer to lazy load GitHub repo data when cards enter viewport
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {

View file

@ -10,8 +10,10 @@ function setupPostPageAnimation() {
const tocContainer = document.getElementById('toc-container')
const isLargeScreen = window.matchMedia('(min-width: 1024px)').matches
const isSmallScreen = window.matchMedia('(max-width: 1535px)').matches
// Post Content + Tags + Comments (First 15 elements)
// Post Content + Tags + Comments
// First 15 elements
gsap.from(allElements.slice(0, 15), {
opacity: 0,
y: '3rem',
@ -20,8 +22,7 @@ function setupPostPageAnimation() {
ease: 'power2.out',
stagger: 0.05,
})
// Post Content + Tags + Comments (Rest elements)
// Rest elements as the 16 element
if (allElements.length > 15) {
gsap.from(allElements.slice(15), {
opacity: 0,
@ -32,8 +33,9 @@ function setupPostPageAnimation() {
})
}
// Desktop Animations
if (isLargeScreen) {
// Desktop Post Date
// Post Date
if (dateElement) {
gsap.from(dateElement, {
opacity: 0,
@ -44,7 +46,7 @@ function setupPostPageAnimation() {
})
}
// Desktop TOC Icon
// TOC Icon
if (tocIcon) {
gsap.from(tocIcon, {
opacity: 0,
@ -55,7 +57,7 @@ function setupPostPageAnimation() {
})
}
// Desktop Toc List
// Toc List
if (tocListChildren.length > 0) {
gsap.from(tocListChildren, {
opacity: 0,
@ -67,7 +69,7 @@ function setupPostPageAnimation() {
})
}
// Desktop Back Button
// Back Button
if (backButton) {
gsap.from(backButton, {
opacity: 0,
@ -78,17 +80,16 @@ function setupPostPageAnimation() {
})
}
}
else {
// Mobile TOC Container
if (tocContainer) {
gsap.from(tocContainer, {
opacity: 0,
y: '3rem',
duration: 0.5,
delay: 0.1,
ease: 'power2.out',
})
}
// Mobile Animation (for screens smaller than 1536px)
if (isSmallScreen && tocContainer) {
gsap.from(tocContainer, {
opacity: 0,
y: '3rem',
duration: 0.5,
delay: 0.1,
ease: 'power2.out',
})
}
}

View file

@ -19,25 +19,30 @@ const filteredHeadings = headings.filter(heading =>
---
{filteredHeadings.length > 0 && (
// TOC Container
<div
id="toc-container"
class="mb-4 uno-round-border bg-secondary/5 2xl:(fixed left-0 top-43.5 max-w-[min(calc(50vw-38rem),13rem)] border-none bg-secondary/0)"
>
{/* Hidden Checkbox */}
<input
type="checkbox"
id="toc-toggle"
class="accordion-toggle"
hidden
/>
{/* TOC Toggle */}
<div class="relative h-12 w-full">
<label
for="toc-toggle"
class="absolute inset-0 flex cursor-pointer items-center 2xl:(static flex c-secondary/40 transition-colors ease-out hover:c-secondary/80)"
>
{/* Title on Mobile */}
<span class="toc-title">
{currentUI.toc}
</span>
{/* Icon on Desktop */}
<TocIcon
id="toc-icon"
aria-hidden="true"
@ -47,13 +52,14 @@ const filteredHeadings = headings.filter(heading =>
</label>
</div>
{/* Expandable content wrapper */}
{/* Expandable Content Wrapper with Accordion Animation */}
<div class="accordion-wrapper">
<nav
id="toc-content"
class="accordion-content"
aria-label="Table of Contents"
>
{/* TOC List */}
<ul
id="toc-list"
class="toc-list"

View file

@ -17,9 +17,9 @@ To create automatic figure captions, use the standard Markdown image syntax `![a
### Syntax
```
![Image description](./full/or/relative/path/of/image)
![Image description](https://image.example.com/image-01.webp)
![_Image description](./full/or/relative/path/of/image)
![_Image description](https://image.example.com/image-01.webp)
```
### Output

View file

@ -17,9 +17,9 @@ Para crear leyendas automáticas para figuras, utilice la sintaxis estándar de
### Sintaxis
```
![Descripción de la imagen](./full/or/relative/path/of/image)
![Descripción de la imagen](https://image.example.com/image-01.webp)
![_Descripción de la imagen](./full/or/relative/path/of/image)
![_Descripción de la imagen](https://image.example.com/image-01.webp)
```
### Resultado

View file

@ -17,9 +17,9 @@ abbrlink: markdown-extended-features
### 構文
```
![画像の説明](./full/or/relative/path/of/image)
![画像の説明](https://image.example.com/image-01.webp)
![_画像の説明](./full/or/relative/path/of/image)
![_画像の説明](https://image.example.com/image-01.webp)
```
### 効果

View file

@ -17,9 +17,9 @@ abbrlink: markdown-extended-features
### Синтаксис
```
![Описание изображения](./full/or/relative/path/of/image)
![Описание изображения](https://image.example.com/image-01.webp)
![_Описание изображения](./full/or/relative/path/of/image)
![_Описание изображения](https://image.example.com/image-01.webp)
```
### Результат

View file

@ -17,9 +17,9 @@ abbrlink: markdown-extended-features
### 語法
```
![圖片描述](./full/or/relative/path/of/image)
![圖片描述](https://image.example.com/image-01.webp)
![_圖片描述](./full/or/relative/path/of/image)
![_圖片描述](https://image.example.com/image-01.webp)
```
### 效果

View file

@ -17,9 +17,9 @@ abbrlink: markdown-extended-features
### 语法
```
![图片描述](./full/or/relative/path/of/image)
![图片描述](https://image.example.com/image-01.webp)
![_图片描述](./full/or/relative/path/of/image)
![_图片描述](https://image.example.com/image-01.webp)
```
### 效果

View file

@ -61,7 +61,9 @@ To add an image, add an exclamation mark `!`, followed by alt text in brackets `
### Syntax
```
![Image Description](./full/or/relative/path/of/image)
![Image Description](../_images/image-01.jpeg)
![Image Description](https://image.example.com/image-01.webp)
```
### Output
@ -211,51 +213,3 @@ To create a code block, add three backticks ```` ``` ```` at the start and end o
- Milk
- Cheese
```
#### Output
- Fruit
- Apple
- Orange
- Banana
- Dairy
- Milk
- Cheese
## Other Elements
Including `<sup>` superscript, `<sub>` subscript, `<abbr>` abbreviation, `<del>` strikethrough, `<u>` wavy underline, `<kbd>` keyboard input, and `<mark>` highlight.
### Syntax
```html
H<sub>2</sub>O
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
Good writers always check for <u title="spelling">speling</u> mistakes.
Press <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>Delete</kbd> to end the session.
There is <del>nothing</del> no code either good or bad, but running it makes it so.
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.
```
### Output
H<sub>2</sub>O
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
Good writers always check for <u title="spelling">speling</u> mistakes.
Press <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>Delete</kbd> to end the session.
There is <del>nothing</del> no code either good or bad, but running it makes it so.
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms, and other small creatures.

View file

@ -61,7 +61,9 @@ Para agregar una imagen, añada un signo de exclamación `!`, seguido de texto a
### Sintaxis
```
![Descripción de la Imagen](./full/or/relative/path/of/image)
![Descripción de la Imagen](../_images/image-01.jpeg)
![Descripción de la Imagen](https://image.example.com/image-01.webp)
```
### Resultado

View file

@ -61,7 +61,9 @@ abbrlink: markdown-style-guide
### 構文
```
![画像の説明](./full/or/relative/path/of/image)
![画像の説明](../_images/image-01.jpeg)
![画像の説明](https://image.example.com/image-01.webp)
```
### 効果

View file

@ -61,7 +61,9 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap
### Синтаксис
```
![Описание изображения](./full/or/relative/path/of/image)
![Описание изображения](../_images/image-01.jpeg)
![Описание изображения](https://image.example.com/image-01.webp)
```
### Результат

View file

@ -61,7 +61,9 @@ abbrlink: markdown-style-guide
### 語法
```
![圖片描述](./full/or/relative/path/of/image)
![圖片描述](../_images/image-01.jpeg)
![圖片描述](https://image.example.com/image-01.webp)
```
### 效果

View file

@ -61,7 +61,9 @@ abbrlink: markdown-style-guide
### 语法
```
![图片描述](./full/or/relative/path/of/image)
![图片描述](../_images/image-01.jpeg)
![图片描述](https://image.example.com/image-01.webp)
```
### 效果

View file

@ -9,11 +9,11 @@ import GsapAnimation from '@/components/Widgets/GsapAnimation.astro'
import themeConfig from '@/config'
import Head from '@/layouts/Head.astro'
import { getPageInfo } from '@/utils/page'
import '@/styles/animation.css'
import '@/styles/extend.css'
import '@/styles/font.css'
import '@/styles/global.css'
import '@/styles/markdown.css'
import '@/styles/transition.css'
interface Props {
postTitle?: string
@ -26,8 +26,8 @@ const { postTitle, postDescription, postSlug, supportedLangs = [] } = Astro.prop
const { isPost } = getPageInfo(Astro.url.pathname)
const fontStyle = themeConfig.global.fontStyle === 'serif' ? 'font-serif' : 'font-sans'
const MarginBottom = isPost && themeConfig.comment?.enabled
? 'mb-10' // Post page with comment system
: 'mb-12' // Other pages without comment system
? 'mb-10' // Post page with comments
: 'mb-12' // Other pages without comments
---
<html