Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hust-open-atom-club/TranslateProject
Browse files Browse the repository at this point in the history
  • Loading branch information
mudongliang committed Apr 5, 2024
2 parents a086d2d + 3d32664 commit 27fe019
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 181 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@

新加入的成员,请:

1. 修改你的飞书群昵称为“译者-您的_Github_ID”。
1. 修改你的飞书群昵称为“译者-YOUR_GITHUB_ID”。
2. 请在开始贡献前[签署CLA](https://cla-assistant.io/hust-open-atom-club/TranslateProject)
3. 阅读 [WIKI](https://github.com/hust-open-atom-club/TranslateProject/wiki/) 了解如何开始。
4. 遇到不解之处,请在飞书群内发问。

对于前端开发者,本仓库基于前端框架 `Astro`,若希望本地运行代码,请查看 [pages/README.md](./pages/README.md)

## 如何开始

**注意**,请在开始贡献前[签署 CLA](https://cla-assistant.io/hust-open-atom-club/TranslateProject),否则 PR 无法被合并。
Expand Down
141 changes: 4 additions & 137 deletions pages/README.md
Original file line number Diff line number Diff line change
@@ -1,127 +1,8 @@
# AstroPaper 📄
## Quick Start

![AstroPaper](public/astropaper-og.jpg)
![Typescript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)
![GitHub](https://img.shields.io/github/license/satnaing/astro-paper?color=%232F3741&style=for-the-badge)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white&style=for-the-badge)](https://conventionalcommits.org)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge)](http://commitizen.github.io/cz-cli/)

AstroPaper is a minimal, responsive, accessible and SEO-friendly Astro blog theme. This theme is designed and crafted based on [my personal blog](https://satnaing.dev/blog).

This theme follows best practices and provides accessibility out of the box. Light and dark mode are supported by default. Moreover, additional color schemes can also be configured.

This theme is self-documented \_ which means articles/posts in this theme can also be considered as documentations. Read [the blog posts](https://astro-paper.pages.dev/posts/) or check [the README Documentation Section](#-documentation) for more info.

## 🔥 Features

- [x] type-safe markdown
- [x] super fast performance
- [x] accessible (Keyboard/VoiceOver)
- [x] responsive (mobile ~ desktops)
- [x] SEO-friendly
- [x] light & dark mode
- [x] fuzzy search
- [x] draft posts & pagination
- [x] sitemap & rss feed
- [x] followed best practices
- [x] highly customizable
- [x] dynamic OG image generation for blog posts [#15](https://github.com/satnaing/astro-paper/pull/15) ([Blog Post](https://astro-paper.pages.dev/posts/dynamic-og-image-generation-in-astropaper-blog-posts/))

_Note: I've tested screen-reader accessibility of AstroPaper using **VoiceOver** on Mac and **TalkBack** on Android. I couldn't test all other screen-readers out there. However, accessibility enhancements in AstroPaper should be working fine on others as well._

## ✅ Lighthouse Score

<p align="center">
<a href="https://pagespeed.web.dev/report?url=https%3A%2F%2Fastro-paper.pages.dev%2F&form_factor=desktop">
<img width="710" alt="AstroPaper Lighthouse Score" src="AstroPaper-lighthouse-score.svg">
<a>
</p>

## 🚀 Project Structure

Inside of AstroPaper, you'll see the following folders and files:

```bash
/
├── public/
│ ├── assets/
│ │ └── logo.svg
│ │ └── logo.png
│ └── favicon.svg
│ └── astropaper-og.jpg
│ └── robots.txt
│ └── toggle-theme.js
├── src/
│ ├── assets/
│ │ └── socialIcons.ts
│ ├── components/
│ ├── content/
│ │ | blog/
│ │ | └── some-blog-posts.md
│ │ └── config.ts
│ ├── layouts/
│ └── pages/
│ └── styles/
│ └── utils/
│ └── config.ts
│ └── types.ts
└── package.json
```

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.

Any static assets, like images, can be placed in the `public/` directory.

All blog posts are stored in `src/content/blog` directory.

## 📖 Documentation

Documentation can be read in two formats\_ _markdown_ & _blog post_.

- Configuration - [markdown](src/content/blog/how-to-configure-astropaper-theme.md) | [blog post](https://astro-paper.pages.dev/posts/how-to-configure-astropaper-theme/)
- Add Posts - [markdown](src/content/blog/adding-new-post.md) | [blog post](https://astro-paper.pages.dev/posts/adding-new-posts-in-astropaper-theme/)
- Customize Color Schemes - [markdown](src/content/blog/customizing-astropaper-theme-color-schemes.md) | [blog post](https://astro-paper.pages.dev/posts/customizing-astropaper-theme-color-schemes/)
- Predefined Color Schemes - [markdown](src/content/blog/predefined-color-schemes.md) | [blog post](https://astro-paper.pages.dev/posts/predefined-color-schemes/)

> For AstroPaper v1, check out [this branch](https://github.com/satnaing/astro-paper/tree/astro-paper-v1) and this [live URL](https://astro-paper-v1.astro-paper.pages.dev/)
## 💻 Tech Stack

**Main Framework** - [Astro](https://astro.build/)
**Type Checking** - [TypeScript](https://www.typescriptlang.org/)
**Component Framework** - [ReactJS](https://reactjs.org/)
**Styling** - [TailwindCSS](https://tailwindcss.com/)
**UI/UX** - [Figma](https://figma.com)
**Fuzzy Search** - [FuseJS](https://fusejs.io/)
**Icons** - [Boxicons](https://boxicons.com/) | [Tablers](https://tabler-icons.io/)
**Code Formatting** - [Prettier](https://prettier.io/)
**Deployment** - [Cloudflare Pages](https://pages.cloudflare.com/)
**Illustration in About Page** - [https://freesvgillustration.com](https://freesvgillustration.com/)
**Linting** - [ESLint](https://eslint.org)

## 👨🏻‍💻 Running Locally

The easiest way to run this project locally is to run the following command in your desired directory.

```bash
# npm 6.x
npm create astro@latest --template satnaing/astro-paper

# npm 7+, extra double-dash is needed:
npm create astro@latest -- --template satnaing/astro-paper

# yarn
yarn create astro --template satnaing/astro-paper
```

## Google Site Verification (optional)

You can easily add your [Google Site Verification HTML tag](https://support.google.com/webmasters/answer/9008080#meta_tag_verification&zippy=%2Chtml-tag) in AstroPaper using environment variable. This step is optional. If you don't add the following env variable, the google-site-verification tag won't appear in the html `<head>` section.

```bash
# in your environment variable file (.env)
PUBLIC_GOOGLE_SITE_VERIFICATION=your-google-site-verification-value
```
1. 切换到 `pages` 目录下,依次运行 `npm install``npm run dev`
2. 如果是 `Windows` 系统,请删除 `pages/src/content/posts` 文件,新建 `pages/src/content/posts/` 文件夹,并将 `sources` 文件夹下的所有内容复制到新建的 `pages/src/content/posts/` 文件夹内。【注意,请不要把这处修改推送到远程仓库中】
3. 打开 `http://localhost:4321/` 网址即可在本地预览网页内容。

## 🧞 Commands

Expand All @@ -142,17 +23,3 @@ All commands are run from the root of the project, from a terminal:
| `npm run lint` | Lint with ESLint |
| `docker compose up -d` | Run AstroPaper on docker, You can access with the same hostname and port informed on `dev` command. |
| `docker compose run app npm install` | You can run any command above into the docker container. |

> **_Warning!_** Windows PowerShell users may need to install the [concurrently package](https://www.npmjs.com/package/concurrently) if they want to [run diagnostics](https://docs.astro.build/en/reference/cli-reference/#astro-check) during development (`astro check --watch & astro dev`). For more info, see [this issue](https://github.com/satnaing/astro-paper/issues/113).
## ✨ Feedback & Suggestions

If you have any suggestions/feedback, you can contact me via [my email](mailto:[email protected]). Alternatively, feel free to open an issue if you find bugs or want to request new features.

## 📜 License

Licensed under the MIT License, Copyright © 2023

---

Made with 🤍 by [Sat Naing](https://satnaing.dev) 👨🏻‍💻 and [contributors](https://github.com/satnaing/astro-paper/graphs/contributors).
8 changes: 8 additions & 0 deletions pages/src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ const blog = defineCollection({
[z.date(), z.string(), z.number()]
).default(""),
link: z.string().url().default(""),
proofreader: z.string().default(SITE.author),
proofread_date: z.union(
[z.date(), z.string(), z.number()]
).default(""),
publisher: z.string().default(SITE.author),
published_date: z.union(
[z.date(), z.string(), z.number()]
).default(""),
}),
});

Expand Down
32 changes: 30 additions & 2 deletions pages/src/layouts/PostDetails.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface Props {
const { post } = Astro.props;
const { title, author } = post.data;
const { title, author, collected_date, collector, translated_date, translator, link, proofreader, proofread_date, publisher, published_date } = post.data;
const { Content } = await post.render();
Expand Down Expand Up @@ -60,6 +60,34 @@ const layoutProps = {
<!-- /> -->
<article id="article" role="article" class="prose mx-auto mt-8 max-w-3xl">
<Content />
<hr>
<div>
<p><strong>{!translated_date ? "原文链接:": "译自:"}</strong> <a href={link}>{link}</a></p>
<p>
<strong>选题:</strong>
<a href={"https://github.com/" + collector}>{collector}</a>
{translated_date && (
<span>
&nbsp;&nbsp;
<strong>译者:</strong>
<a href={"https://github.com/" + translator}>{translator}</a>
{proofread_date && (
<span>
&nbsp;&nbsp;
<strong>校对:</strong><a href={"https://github.com/" + proofreader}>{proofreader}</a>
</span>
)}
{published_date && (
<span>
&nbsp;&nbsp;
<strong>发布:</strong><a href={"https://github.com/" + publisher}>{publisher}</a>
</span>
)}
</span>
)}
</p>
<p>本文{!translated_date && ""}由 <a href="https://github.com/hust-open-atom-club/translate-project">HCTT 翻译团队</a> 原创翻译,<a href="https://github.com/hust-open-atom-club">华中科技大学开放原子开源俱乐部</a>荣誉推出。</p>
</div>
</article>

<!-- <ul class="my-8"> -->
Expand All @@ -68,7 +96,7 @@ const layoutProps = {

<div
class="my-8 flex flex-col-reverse items-center justify-between gap-6 sm:flex-row-reverse sm:items-end sm:gap-4"
>
>
<button
id="back-to-top"
class="focus-outline whitespace-nowrap py-1 hover:opacity-75"
Expand Down
19 changes: 14 additions & 5 deletions pages/src/pages/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@ layout: ../layouts/AboutLayout.astro
title: "关于"
---

**HCTT(HUST openatom Club Translation Team)** 是“华科开放原子开源俱乐部”的翻译团队,学习[“Linux 中国”翻译项目](https://github.com/LCTT/TranslateProject)的模式,负责从国外优秀媒体翻译 Linux(特别是 Linux 内核安全)相关的技术、资讯、杂文等内容。
**HCTT(HUST openatom Club Translation Team)** 是“华科开放原子开源俱乐部”的翻译团队,学习[“Linux 中国”翻译项目](https://github.com/LCTT/TranslateProject)的运营模式,负责从国外优秀媒体翻译 Linux(特别是 Linux 内核)相关的技术、资讯、杂文等内容。

## 加入我们

请首先加入我们的[飞书群](https://applink.feishu.cn/client/chat/chatter/add_by_link?link_token=4e3g0475-2966-40c7-a713-3fcf43893a67),加群时请说明是“志愿者”。

新加入的成员,请:

1. 修改你的飞书群昵称为“译者-YOUR_GITEE_ID”。
2. 请在开始贡献前[签署CLA](https://gitee.com/organizations/hust-open-atom-club/cla/hust_open_atom_club_cla)
2. 阅读 [WIKI](https://gitee.com/hust-open-atom-club/translate-project/wikis) 了解如何开始。
3. 遇到不解之处,请在群内发问。
1. 修改你的飞书群昵称为“译者-YOUR_GITHUB_ID”。
2. 请在开始贡献前[签署CLA](https://cla-assistant.io/hust-open-atom-club/TranslateProject)
3. 阅读 [WIKI](https://github.com/hust-open-atom-club/TranslateProject/wiki/) 了解如何开始。
4. 遇到不解之处,请在飞书群内发问。

对于前端开发者,本仓库基于前端框架 `Astro`,若希望本地运行代码,请查看 [pages/README.md](https://github.com/hust-open-atom-club/TranslateProject/blob/master/pages/README.md)

## 如何开始

**注意**,请在开始贡献前[签署 CLA](https://cla-assistant.io/hust-open-atom-club/TranslateProject),否则 PR 无法被合并。

请阅读 [WIKI](https://github.com/hust-open-atom-club/TranslateProject/wiki/)。如需要协助,请在群内发问。
12 changes: 2 additions & 10 deletions sources/general/20240223 linux is a CNA.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
status: published
status: proofread
title: "Linux is a CNA"
author: Greg Kroah-Hartman
collector: mudongliang
collected_date: 20240223
translator: sun-yu-777
translator: AAtomical
translated_date: 20240223
proofreader: mudongliang
proofread_date: 20240310
Expand All @@ -24,11 +24,3 @@ CVE 组织[最近宣布](https://www.cve.org/Media/News/item/news/2024/02/13/ker
您可以在此[邮件列表](https://lore.kernel.org/linux-cve-announce/)上找到我们分配的所有 CVE,并且如果您希望自动收到所有 CVE 的通知,请订阅该列表。可以在[此处](https://git.kernel.org/pub/scm/linux/security/vulns.git/)找到它们的 git 存储库,但请注意,随着时间的推移,存储库的结构会发生变化,因为我们在学习和管理流程方面会变得更加完善,所以暂时不要认为 git 树中的任何内容会固定不变。

一旦流程正常运转并且能够顺利分配 CVE,我会在未来写更多内容。这一公告只是第一步,它使我们成为了 Linux CVE 分配流程的管理者。

___

译自:<http://www.kroah.com/log/blog/2024/02/13/linux-is-a-cna/>

译者:[sun-yu-777](https://gitee.com/sun-yu-777) 校对:[mudongliang](https://gitee.com/mudongliang)

本文由[HCTT](https://gitee.com/hust-open-atom-club/translate-project)原创翻译,[华科开放原子俱乐部](https://gitee.com/hust-open-atom-club)荣誉推出。
10 changes: 1 addition & 9 deletions sources/kernel/20240220 linux kernel CVE assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: "Linux Kernel CVE Assignment"
author: Greg Kroah-Hartman
collector: mudongliang
collected_date: 20240220
translator: yanruo
translator: gitveg
translated_date: 20240221
proofreader: mudongliang
proofread_date: 20240221
Expand Down Expand Up @@ -52,11 +52,3 @@ Linux内核中未修复的安全问题不会自动分配CVE;只有在安全修
简而言之,我们不知道您的用例,也不知道您使用的是内核的哪个部分,因此我们无法确定特定的CVE是否与您的系统相关。

与往常一样,最好采取所有发布的内核更改,因为它们是由许多社区成员在一个统一的整体中一起进行测试的,而不是作为个别的精选更改。还要注意,对于许多bug来说,整体问题的解决方案并不是在单个更改中找到的,而是在彼此之上的许多修复的总和。理想情况下,CVEs将被分配给所有问题的所有修复,但有时我们将无法注意到一些修复,因此某些修复可能在没有CVE的情况下被采取。

___

译自:<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/cve.rst>

译者:[yanruo](https://gitee.com/kyanruo) 校对:[mudongliang](https://gitee.com/mudongliang)

本文由[HCTT](https://gitee.com/hust-open-atom-club/translate-project)原创翻译,[华科开放原子俱乐部](https://gitee.com/hust-open-atom-club)荣誉推出。
13 changes: 3 additions & 10 deletions sources/kernel/20240227 Undefined Behavior Sanitizer - UBSAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
status: published
title: "Undefined Behavior Sanitizer - UBSAN"
author: Linux Kernel Community
collector: dzm91_hust
collector: mudongliang
collected_date: 20240227
translated: dzm91_hust
translated: mudongliang
translated_date: 20240227
proofread: hustsjy
proofread: JingJing1016
proofread_date: 20240302
link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/dev-tools/ubsan.rst
---
Expand Down Expand Up @@ -78,10 +78,3 @@ GCC 自 4.9.x \[[1](https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Debugging-Optio
UBSAN_SANITIZE := n

未对齐的内存访问检测由单独的选项 CONFIG_UBSAN_ALIGNMENT 控制。在支持非对齐访问(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y)的架构上,该选项默认关闭,但仍可在配置中启用,只是要注意这会产生大量 UBSAN 报告。

---
译自:<https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/dev-tools/ubsan.rst>

译者:[dzm91_hust](https://gitee.com/dzm91_hust) 校对:[hustsjy](https://gitee.com/hustsjy)

本文由[HCTT](https://gitee.com/hust-open-atom-club/translate-project)原创翻译,[华科开放原子俱乐部](https://gitee.com/hust-open-atom-club)荣誉推出。
7 changes: 0 additions & 7 deletions sources/syzkaller/executing_syzkaller_programs.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,3 @@ scp -P 10022 -i bullseye.img.key bin/linux_amd64/syz-execprog bin/linux_amd64/sy
# {Threaded:true Repeat:true RepeatTimes:0 Procs:8 Slowdown:1 Sandbox:none Leak:false NetInjection:true NetDevices:true NetReset:true Cgroups:true BinfmtMisc:true CloseFDs:true KCSAN:false DevlinkPCI:false USB:true VhciInjection:true Wifi:true IEEE802154:true Sysctl:true UseTmpDir:true HandleSegv:true Repro:false Trace:false LegacyOptions:{Collide:false Fault:false FaultCall:0 FaultNth:0}}
```
你需要基于文件头中的值调整对应的参数。其中,`Threaded`/`Procs`/`Sandbox``-threaded`/`-procs`/`-sandbox` 参数对应。如果 `Repeat` 的值为 `true`,则在 `syz-execprog` 的参数中添加 `-repeat=0`

---
译自:<https://github.com/google/syzkaller/blob/master/docs/executing_syzkaller_programs.md>

译者:[tttturtle-russ](https://gitee.com/tttturtle-russ) 校对:[dzm91_hust](https://gitee.com/dzm91_hust)

本文由[HCTT](https://gitee.com/hust-open-atom-club/translate-project)原创翻译,[华科开放原子俱乐部](https://gitee.com/hust-open-atom-club)荣誉推出。

0 comments on commit 27fe019

Please sign in to comment.