Skip to content

Commit

Permalink
Merge pull request #9 from shenghuo2/main
Browse files Browse the repository at this point in the history
docs: readme completed
  • Loading branch information
shenghuo2 authored Aug 5, 2024
2 parents 2b5dd2a + 0db7958 commit dc74246
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 35 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/readme-contributors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Generate Contributors in README.md

on:
push:
branches:
- main

jobs:
contrib-readme-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
permissions:
contents: write
pull-requests: write
steps:
- name: Contribute List
uses: akhilmhdh/[email protected]
with:
image_size: 80
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
233 changes: 202 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,218 @@
# Astro Starter Kit: Minimal
# 齐鲁师范学院网络安全社团(QLNU-Sec-Team)官网

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/QLNU-Sec-Team/QLNU-Sec-Team.github.io/astro.yml)
![GitHub License](https://img.shields.io/github/license/QLNU-Sec-Team/QLNU-Sec-Team.github.io)
![GitHub deployments](https://img.shields.io/github/deployments/QLNU-Sec-Team/QLNU-Sec-Team.github.io/github-pages)
![GitHub Release](https://img.shields.io/github/v/release/QLNU-Sec-Team/QLNU-Sec-Team.github.io)

![NPM Version](https://img.shields.io/npm/v/astro)
![GitHub last commit](https://img.shields.io/github/last-commit/QLNU-Sec-Team/QLNU-Sec-Team.github.io)
![GitHub contributors](https://img.shields.io/github/contributors-anon/QLNU-Sec-Team/QLNU-Sec-Team.github.io)




运行在: https://www.qlnu-sec.cn

## About

> 本项目使用 `Astro` 作为 Web 框架进行编写
>
> 基本框架由 [shenghuo2](https://github.com/shenghuo2) 进行编写实现
>
> 于 2024.8.5 基本完成实现
## 维护提示

若需维护 `index`/`award` 页的内容

直接修改 `src/pages/index.md` / `src/pages/award.md` 即可

---

如需增加`member`页的成员

请修改`src/assets/memberList.json`

按照以下格式编写

```sh
npm create astro@latest -- --template minimal
```
{
"index": {
"level": "number",
"member": [
"name"
],
"link": {
"name": "https://link"
}
}
}
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal)
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/minimal)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/minimal/devcontainer.json)
---

> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
> 本项目使用了**ViewTransition**特性,所以请使用Astro ^4.12.2
>
> 使用nodejs v20
## 🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:
# 项目结构

```text
/
├── public/
├── src/
│ └── pages/
│ └── index.astro
└── package.json
```
.
├── public
│ ├── favicon.svg
│ ├── icon.png
│ ├── QLNU.png
│ └── wx.svg
├── src
│ ├── assets
│ │ └── memberList.json
│ ├── pages
│ │ ├── components
│ │ │ ├── footer.astro
│ │ │ ├── Navbar.astro
│ │ │ └── NavItem.astro
│ │ ├── layouts
│ │ │ ├── BaseLayout.astro
│ │ │ └── BaseMarkdownLayout.astro
│ │ ├── award.md
│ │ ├── index.md
│ │ └── member.astro
│ ├── styles
│ │ └── global.css
│ └── env.d.ts
├── astro.config.mjs
├── CNAME
├── LICENSE
├── package.json
├── package-lock.json
├── README.md
└── tsconfig.json
```

## public

此文件夹下为网站根目录可直接使用的文件

主要是存放非代码、未处理的资源

这个文件夹中的文件将会被原封不动地复制到构建文件夹中

`favicon.svg` 未使用,为Astro的icon

## src

### assets

`memberList.json` 为 member.astro所引用的成员列表JSON

结构请参考 [维护提示](#维护提示)

### pages

`Astro`将渲染在本文件夹下的文件为页面

### pages/components

基本组件,Astro使用模块化设计

可以是 `Astro 组件` 或是像 React 或 Vue 这样的 `UI 框架组件`

Navbar由NavItem组成

Footer为页脚

### pages/layouts

框架模板,两个模板几乎相同,可以再进行合并重构

BaseLayout为原模板,后改为`member.astro`独用

BaseMarkdownLayout为`index.md``award.md`的渲染模板

### styles

本文件夹下存放的`global.css`暂未实装

## 根目录

### package.json

nodejs 项目清单

名称和版本 (name 和 version): 定义项目的名称和版本号。

描述 (description): 项目简要描述。

脚本 (scripts): 定义一组可以通过 `npm run <script>` 运行的命令,如启动项目、运行测试等。

依赖项 (dependencies): 列出项目运行时所需的包和版本。

### astro.config.mjs

包括了 Astro 项目的配置。你可以在这里指定要使用的集成、构建选项、服务器选项以及其他内容


# 其他

## Contributors

Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
<!-- readme: shenghuo2,collaborators,contributors -start -->
<table>
<tbody>
<tr>
<td align="center">
<a href="https://github.com/shenghuo2">
<img src="https://avatars.githubusercontent.com/u/69127301?v=4" width="80;" alt="shenghuo2"/>
<br />
<sub><b>shenghuo2</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/CG-Jue">
<img src="https://avatars.githubusercontent.com/u/131164348?v=4" width="80;" alt="CG-Jue"/>
<br />
<sub><b>CGjue</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Yhuanhuan01">
<img src="https://avatars.githubusercontent.com/u/118103563?v=4" width="80;" alt="Yhuanhuan01"/>
<br />
<sub><b>huan</b></sub>
</a>
</td>
</tr>
<tbody>
</table>
<!-- readme: shenghuo2,collaborators,contributors -end -->

There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
### Bots

Any static assets, like images, can be placed in the `public/` directory.
<!-- readme: bots -start -->
<table>
<tbody>
<tr>
<td align="center">
<a href="https://github.com/github-actions[bot]">
<img src="https://avatars.githubusercontent.com/in/15368?v=4" width="80;" alt="github-actions[bot]"/>
<br />
<sub><b>github-actions[bot]</b></sub>
</a>
</td>
</tr>
<tbody>
</table>
<!-- readme: bots -end -->

## 🧞 Commands
## VCS

All commands are run from the root of the project, from a terminal:
本项目使用Git进行版本管理。您可以在repository查看可用版本。

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |
## License

## 👀 Want to learn more?
[AGPL3.0](LICENSE)

Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "qlnu-sec-org",
"type": "module",
"version": "0.0.1",
"version": "0.1.0",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/pages/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
// 导入导航栏组件
import Navbar from '../components/Navbar.astro';
import Footer from '../components/footer.astro';
import Footer from '../components/Footer.astro';
// 接收页面标题和当前路径作为属性
const { title, currentPath } = Astro.props;
const siteName = 'QLNU-Sec-Team';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/layouts/BaseMarkdownLayout.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import Footer from '../components/footer.astro';
import Footer from '../components/Footer.astro';
import Navbar from '../components/Navbar.astro';
const { frontmatter } = Astro.props;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/member.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const sortedIndexes = Object.keys(memberList).sort((a, b) => parseInt(a) - parse
---
<BaseLayout title="成员 Members" currentPath="/member">
<h2>社团师傅们的博客</h2>
<p>部分师傅因隐私原因未在此处</p>
<p>部分师傅因隐私原因未在此处出现</p>

{sortedIndexes.map(index => {
const group = memberList[index];
Expand Down

0 comments on commit dc74246

Please sign in to comment.