添加 Hlink;ReadMe 界面焕然一新!

This commit is contained in:
xushier 2022-11-25 00:31:50 +08:00
parent 630c40278e
commit 2e079d2d79
4 changed files with 179 additions and 108 deletions

170
README.md

File diff suppressed because one or more lines are too long

71
_TEMPLATE.md Normal file
View File

@ -0,0 +1,71 @@
<p align="center">
<h3 align = "center" > 高清仪表盘图标 </h3>
<p align="center">
<a href="https://www.jsdelivr.com/package/gh/xushier/HD-Icons">
<img src="https://data.jsdelivr.com/v1/package/gh/xushier/HD-Icons/badge?style=rounded"/>
</a>
</p>
<p align="center">
1024x1024 分辨率,已经过无损压缩处理。
<br/>
<a href="#图标预览"> <strong > 已有图标预览 »</strong> </a>
<a href="issues/new/choose"> <strong > 请求新图标 »</strong> </a>
<br/>
<br/>
</p>
# 目录
- [项目说明](#项目说明)
- [使用方法](#使用方法)
- [图标预览](#图标预览)
- [声明](#声明)
<!-- GETTING STARTED -->
# 项目说明
- 本项目建立初衷是为了用于 `Unraid Docker` 容器使用,当然,任何需要的地方也都可以用。
- 图标分辨率为 `1024x1024`。所有图标都已经过 **无损压缩** 处理。
- 图标主体适当放大Unraid 系统上看起来更加明确。
- `border-radius` 文件夹包含圆角矩形图标,`circle` 文件夹包含圆形图标。
- 下面是几个常见的仪表盘程序,其中添加的链接可使用该项目图标。
- [Dashy](https://github.com/Lissy93/dashy)
- [Homer Dashboard](https://github.com/bastienwirtz/homer)
- [Heimdall](https://github.com/linuxserver/Heimdall)
- [Organizr(v2)](https://github.com/causefx/Organizr)
- [Flame](https://github.com/pawelmalak/flame)
- [SUI](https://github.com/jeroenpardon/sui)
- **需要使用新图标可以加微信、加 QQ 群或者发 `Issues` 申请,如果有能力做的就会添加。**<a href="issues/new/choose"> <strong > 请求新图标 »</strong></a>
- B站煦诗儿<a href="https://space.bilibili.com/32313260"> <strong >前往 B 站 »</strong></a>
- 公众号:小迪同学
- QQ群647605169
- 微信群dxyxddsbds备注加群
# 使用方法
## 使用在线链接(后续更新不影响在线链接,推荐使用)
- 使用 Github 原始的图标链接,适用于墙外环境。例如:`https://raw.githubusercontent.com/xushier/HD-Icons/main/border-radius/xxxxx.png`
- 使用代理加速地址,适用于墙内环境。例如:`https://ghproxy.com/raw.githubusercontent.com/xushier/HD-Icons/main/border-radius/xxxxx.png`,又或者`https://cdn.jsdelivr.net/gh/xushier/HD-Icons/border-radius/xxxxx.png`
- 将以上地址最后的 xxxxx 换成对应的图标名称即可。<a href="#图标预览"><strong>图标名称预览在此 »</strong></a>
## 使用本地链接(后续更新不同步到本地,不推荐使用)
将图片下载到本地,使用本地链接调用。例如,图标文件在 `/mnt/user/appdata/icons` 下,则图标地址填写 `/mnt/user/appdata/icons/xxxxx.png` 或者 `http://127.0.0.1/mnt/user/appdata/icons/xxxxx.png`,将 xxxxx 换成对应的图标名称即可,<a href="#图标预览"><strong>图标名称预览在此 »</strong></a>
# 图标预览(当前共计 0 个)
## 圆角矩形图标
<!-- START BORDER-RADIUS ICONS -->
<!-- END BORDER-RADIUS ICONS -->
## 圆形图标
<!-- START CIRCLE ICONS -->
<!-- END CIRCLE ICONS -->
<!-- LEGAL -->
# 声明
(Almost) All product names, trademarks and registered trademarks in the images in this repository, are property of their respective owners. All images in this repository are used by the users of the Dashboard Icons project for identification purposes only.
The use of these names, trademarks and brands appearing in these image files, do not imply endorsement.

46
_ci.py Normal file
View File

@ -0,0 +1,46 @@
import pathlib
from pathlib import Path
root = pathlib.Path(__file__).parent.resolve()
template_path = root / "_TEMPLATE.md"
readme_path = root / "README.md"
def generate_img_tag(file,folder,radius):
return f'<div style="width: 105px;text-align: center;display: inline-block;font-size: 12px;margin: 5px;"><img style="border: 1.5px dashed white;border-radius: {radius};" src="{folder}/{file.name}" alt="{file.stem}" /><br/>{file.stem}</div>'
imgs = sorted(Path("./border-radius").glob("*.png"))
img_tags = [generate_img_tag(x,"border-radius","25px") for x in imgs]
circle_imgs = sorted(Path("./circle").glob("*.png"))
circle_img_tags = [generate_img_tag(x,"circle","50px") for x in circle_imgs]
line_number = 0
all_nums = len(img_tags) + len(circle_img_tags)
# Read the template file
with open(template_path, "r", encoding="UTF-8") as f:
lines = f.readlines()
# Find the line that starts with "<!-- ICONS -->"
for line in lines:
if line.startswith("<!-- START BORDER-RADIUS ICONS -->"):
line_number = lines.index(line)
break
for line in lines:
if line.startswith("<!-- START CIRCLE ICONS -->"):
circle_line_number = lines.index(line)
break
# Insert the icons after the line
lines.insert(line_number + 1, " ".join(img_tags))
lines.insert(circle_line_number + 1, " ".join(circle_img_tags))
lines = ["# 图标预览(当前共计 " + str(all_nums) + " 个)" if '# 图标预览(当前共计 0 个)' in i else i for i in lines]
# Write the new file
with open(readme_path, "w", encoding="UTF-8") as f:
f.write("".join(lines))
f.write("\n")
print("Done!")
print("Please commit the new README.md file.")

BIN
border-radius/Hlink_A.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB