mirror of
https://github.com/zhaoolee/ChineseBQB.git
synced 2026-01-12 21:54:55 +08:00
添加图片
This commit is contained in:
38
build.py
Normal file
38
build.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import os
|
||||
|
||||
|
||||
def auto_less_to_css(file_dir):
|
||||
# 获取当前目录下所有的图片路径
|
||||
all_whole_path_files = []
|
||||
for root, dirs, files in os.walk(file_dir):
|
||||
for file in files:
|
||||
try:
|
||||
if ((file[-4:] == ".gif")or(file[-4:] == ".jpg")or(file[-4:] == ".png")):
|
||||
file_info = ["https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master", (root+'/')[1:], file]
|
||||
all_whole_path_files.append(file_info)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
# 生成文件写入的字符串
|
||||
md_content = ""
|
||||
for whole_path_file in all_whole_path_files:
|
||||
img_addr = "".join(whole_path_file)
|
||||
print(img_addr)
|
||||
md_content = md_content + "\n"+img_addr+"\n"
|
||||
|
||||
# 清除上一份文件
|
||||
if os.path.isfile("./index.md"):
|
||||
os.remove("./index.md")
|
||||
|
||||
# 生成index.md
|
||||
with open("./index.md", "ab+") as f:
|
||||
f.write(md_content.encode("utf-8"))
|
||||
|
||||
|
||||
def main():
|
||||
auto_less_to_css('.')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
38
index.md
Normal file
38
index.md
Normal file
@@ -0,0 +1,38 @@
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-4.jpg
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-5.jpg
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-1.jpg
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-1.png
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-2.jpg
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-3.jpg
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-8.gif
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-9.gif
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg.png
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg.jpg
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-7.gif
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-6.gif
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-4.gif
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-5.gif
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-1.gif
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-2.gif
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-3.gif
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg-10.gif
|
||||

|
||||
https://raw.githubusercontent.com/zhaoolee/ChineseBQB/master/动物/猫🐱/webwxgetmsgimg.gif
|
||||
Reference in New Issue
Block a user