mirror of
https://github.com/walkxcode/dashboard-icons.git
synced 2024-11-10 07:27:21 +01:00
Co-authored-by: Bjorn Lammers <walkxnl@gmail.com> Co-authored-by: Prakash Palanisamy <prakash_gitea@itsprakash.in> Co-authored-by: Prakash Palanisamy <51423001+itsprakashp@users.noreply.github.com> Co-authored-by: Dashboard Icons Bot <noreply@walkx.fyi>
This commit is contained in:
parent
65be446af5
commit
c7a85b2278
8
.github/workflows/_readme_generator.yml
vendored
8
.github/workflows/_readme_generator.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: 🚀 Generates README
|
name: 🚀 Generates ICONS
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -17,10 +17,10 @@ jobs:
|
|||||||
python-version: "3.9"
|
python-version: "3.9"
|
||||||
architecture: "x64"
|
architecture: "x64"
|
||||||
|
|
||||||
- name: Readme Generator
|
- name: ICONS Generator
|
||||||
run: |-
|
run: |-
|
||||||
python _ci.py
|
python _ci.py
|
||||||
cat README.md
|
cat ICONS.md
|
||||||
|
|
||||||
- name: Load to GitHub
|
- name: Load to GitHub
|
||||||
run: |-
|
run: |-
|
||||||
@ -28,5 +28,5 @@ jobs:
|
|||||||
git config --global user.email "noreply@walkx.fyi"
|
git config --global user.email "noreply@walkx.fyi"
|
||||||
git config --global user.name "Dashboard Icons Bot"
|
git config --global user.name "Dashboard Icons Bot"
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "🚀 Generates README" || exit 0
|
git commit -m "🚀 Generates ICONS" || exit 0
|
||||||
git push
|
git push
|
||||||
|
20
_ICONS_TEMPLATE.md
Normal file
20
_ICONS_TEMPLATE.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<p align="center">
|
||||||
|
<h2 align="center"> 🟣 Dashboard Icons </h3>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://www.jsdelivr.com/package/gh/walkxcode/dashboard-icons">
|
||||||
|
<img src="https://img.shields.io/jsdelivr/gh/hy/walkxcode/dashboard-icons?color=%23A020F0" alt="JSdelivr weekly downloads badge">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<p align="center">
|
||||||
|
🚀 The best place to find icons for your dashboards.
|
||||||
|
<br />
|
||||||
|
<a href="https://github.com/walkxcode/dashboard-icons/"><strong>⬅️ Back to repo</strong></a> • <a href="https://shop.walkx.fyi/l/donate" target="_blank"><strong>🙌🏻 Donate</strong></a>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
</p>
|
||||||
|
</p>
|
||||||
|
<div align="center">
|
||||||
|
<!-- ICONS -->
|
||||||
|
|
||||||
|
<!-- END ICONS -->
|
||||||
|
</div>
|
10
_ci.py
10
_ci.py
@ -2,8 +2,8 @@ import pathlib
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
root = pathlib.Path(__file__).parent.resolve()
|
root = pathlib.Path(__file__).parent.resolve()
|
||||||
template_path = root / "_TEMPLATE.md"
|
icons_template_path = root / "_ICONS_TEMPLATE.md"
|
||||||
readme_path = root / "README.md"
|
icons_path = root / "ICONS.md"
|
||||||
|
|
||||||
|
|
||||||
def generate_img_tag(file):
|
def generate_img_tag(file):
|
||||||
@ -15,7 +15,7 @@ img_tags = [generate_img_tag(x) for x in imgs]
|
|||||||
line_number = 0
|
line_number = 0
|
||||||
|
|
||||||
# Read the template file
|
# Read the template file
|
||||||
with open(template_path, "r", encoding="UTF-8") as f:
|
with open(icons_template_path, "r", encoding="UTF-8") as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
# Find the line that starts with "<!-- ICONS -->"
|
# Find the line that starts with "<!-- ICONS -->"
|
||||||
for line in lines:
|
for line in lines:
|
||||||
@ -25,8 +25,8 @@ for line in lines:
|
|||||||
# Insert the icons after the line
|
# Insert the icons after the line
|
||||||
lines.insert(line_number + 1, " ".join(img_tags))
|
lines.insert(line_number + 1, " ".join(img_tags))
|
||||||
# Write the new file
|
# Write the new file
|
||||||
with open(readme_path, "w", encoding="UTF-8") as f:
|
with open(icons_path, "w", encoding="UTF-8") as f:
|
||||||
f.write("".join(lines))
|
f.write("".join(lines))
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
print("Done!")
|
print("Done!")
|
||||||
print("Please commit the new README.md file.")
|
print("Please commit the new ICONS.md file.")
|
||||||
|
Loading…
Reference in New Issue
Block a user