diff --git a/.gitignore b/.gitignore deleted file mode 100755 index 75569aa..0000000 --- a/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -# python/cache -**/__pycache__ -**/venv/* -**/.venv/* - -# databases -**/*.db -**/*.sql -**/*.db.back -databases/* - -# flask folder -mirrors/* -blueprint/kami_views.py -blueprint/massage_views.py -templates/kami/* -templates/message/* -static/upload/* -static/counter.txt -static/message/* -static/test/* \ No newline at end of file diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 index c7a9fcc..518a216 --- a/README.md +++ b/README.md @@ -1,34 +1,13 @@ 点击访问 -## 2025.12.23 -迁移后端至python -现已完毕 --- - -# 感谢列表: - - 感谢bilibili麦叔的教程视频 - - 感谢互联网 - - 感谢自己 - - **署名** - -skimrme - -
- -# -# - ## 2025.7.20 open-ww3-project-ww3-tw 个人博客地址(预计) --- -# 感谢列表: - - 感谢谷歌Genmini的指导 - - 感谢互联网 - - 感谢自己 +
**署名** + +skimrme -skimrme \ No newline at end of file diff --git a/api/api.py b/api/api.py deleted file mode 100644 index 0319eef..0000000 --- a/api/api.py +++ /dev/null @@ -1,41 +0,0 @@ -from flask import Blueprint -import json -import sqlite3 - -api_api = Blueprint('/api/', __name__) -json_title = {'Content-Type': 'application/json'} # 设定json的类型 - -# 引入数据库 -def get_owp_db_conn(): - conn = sqlite3.connect('/var/open-ww3-project-ww3-tw/databases/sqlite/owp.db') - conn.row_factory = sqlite3.Row - return conn - - -# 获取日志内容 -@api_api.get("/get/logs/") -def get_logs(): - # 获取并查询数据库日志内容 - conn = get_owp_db_conn() - sql_logs = "SELECT * FROM logs;" - logs = conn.execute(sql_logs).fetchall() - conn.close() - - data_logs = [ - dict(row) for row in logs - ] - return (json.dumps(data_logs, ensure_ascii=False), json_title) - - -@api_api.get("/get/posts/") -def get_posts(): - # 获取并查询数据库日志内容 - conn = get_owp_db_conn() - sql_posts = "SELECT * FROM posts WHERE status=1;" - posts = conn.execute(sql_posts).fetchall() - conn.close() - - data_posts = [ - dict(row) for row in posts - ] - return (json.dumps(data_posts, ensure_ascii=False), json_title) \ No newline at end of file diff --git a/api/docs.py b/api/docs.py deleted file mode 100644 index 2f6dd21..0000000 --- a/api/docs.py +++ /dev/null @@ -1,7 +0,0 @@ -from flask import Blueprint - -docs_api = Blueprint('/api/docs', __name__) - -@docs_api.get("/") -def home(): - return "123" \ No newline at end of file diff --git a/blueprint/blog_views.py b/blueprint/blog_views.py deleted file mode 100755 index d41e8a1..0000000 --- a/blueprint/blog_views.py +++ /dev/null @@ -1,205 +0,0 @@ -from flask import Blueprint, render_template, request, url_for, flash, redirect, send_from_directory, make_response, current_app -from database import get_owp_db -from flask_autoindex import AutoIndex -from werkzeug.utils import secure_filename -from datetime import datetime -import os -import sqlite3 -import time -import json -import shutil - -def get_owp_db_conn(): - conn = sqlite3.connect('/var/open-ww3-project-ww3-tw/databases/sqlite/owp.db') - conn.row_factory = sqlite3.Row - return conn - -def get_message_db_conn(): - conn = sqlite3.connect('/var/open-ww3-project-ww3-tw/databases/sqlite/message.db') - conn.row_factory = sqlite3.Row - return conn - -blog_bp = Blueprint('blog', __name__) - -index_path = '/var/open-ww3-project-ww3-tw/mirrors/' -index = AutoIndex(blog_bp, browse_root=index_path, add_url_rules=False) - -# 重定向 -@blog_bp.route('/mirrors/re/') -def re(): - return('404 not found
这是你不该知道的地方
') - -@blog_bp.route('/mirrors/paint/2024.2.13/临摹出来的乐色/不好说的人物/') -@blog_bp.route('/mirrors/paint/2024.2.13/临摹出来的乐色/不好说的人物/') -def no_say_man(subpath=None): - return redirect(url_for('blog.re')) - -@blog_bp.route('/mirrors/game/') -@blog_bp.route('/mirrors/game/') -def no_game(subpath=None): - return redirect(url_for('blog.re')) -# 重定向 - -@blog_bp.route('/') -def home(): - db = get_owp_db() - conn = get_owp_db_conn() - sql_logs = "SELECT * from logs;" - sql_posts = "SELECT * from posts where status= 1;" - logs = conn.execute(sql_logs).fetchall() - posts = conn.execute(sql_posts).fetchall() - conn.close() - count_file = '/var/open-ww3-project-ww3-tw/static/counter.txt' - def load_couter(): - if os.path.exists(count_file): - with open(count_file, 'r') as f: - return int(f.read().strip()) - return 0 - def save_couter(couter): - with open(count_file, 'w') as f: - f.write(str(couter)) - counter = load_couter() - counter += 1 - save_couter(counter) - return render_template('blog/home.html', logs=logs[::-1], posts=posts[::-1], counter=counter) - -@blog_bp.route('/about/') -def about(): - return render_template('blog/about.html') - pass - -@blog_bp.route('/posts/') -def posts_list(): - conn = get_owp_db_conn() - sql_posts = "SELECT * from posts where status= 1;" - posts = conn.execute(sql_posts).fetchall() - conn.close() - return render_template('blog/list.html', posts=posts[::-1]) - -@blog_bp.route('/posts//') -def show_posts_id(posts_id): - message_path = f"/var/open-ww3-project-ww3-tw/static/message/{posts_id}" - - if not os.path.exists(message_path): - os.makedirs(message_path) - message_json = f"{message_path}/chat.json" - if not os.path.exists(message_json): - with open(message_json, 'w', encoding='utf-8') as file: - json.dump([], file, ensure_ascii=False) - message_ss = json.load(open(message_json, 'r', encoding='utf-8')) - - - conn = get_owp_db_conn() - conn_message = get_message_db_conn() - sql_posts = "SELECT * FROM posts WHERE status = 1 AND id = ?" - posts = conn.execute(sql_posts, (posts_id,)).fetchone() - sql_message = "SELECT * FROM messages WHERE posts_id = ?" - message = conn_message.execute(sql_message, (posts_id,)).fetchall() - conn.close() - conn_message.close() - if posts is None: - shutil.rmtree(message_path) - return f'未找到该文章{posts_id}未找到该文章{posts_id}/', 404 - return render_template('blog/posts.html', posts=posts, message=message[::-1], message_ss=message_ss[::-1]) - -# posts 留言 -@blog_bp.route('/posts//chat/', methods=['POST', 'GET']) -def posts_chat(posts_id): - message_path = f"/var/open-ww3-project-ww3-tw/static/message/{posts_id}/chat.json" - if request.method == "POST": - name = request.form.get("name", None) - data = request.form.get("data", None) - - date = datetime.now().strftime("%Y-%m-%d %H:%M:%S") - - json_push = { - "name": name, - "data": data, - "date": date - } - - with open(message_path, 'r', encoding='utf-8') as f: - old_date_data = json.load(f) - old_date_data.append(json_push) - with open(message_path, 'w', encoding='utf-8') as f: - json.dump(old_date_data, f, ensure_ascii=False, indent=4) - return "留言成功
返回文章" - return "GET" - -# 数据库测试 -@blog_bp.route('/db_test/') -def test_db(): - db = get_owp_db() - - try: - cur = db.execute('SELECT sqlite_version();') - ver = cur.fetchone()[0] - return f"数据库连接成功!SQLite 版本是: {ver}" - except Exception as e: - return f"连接失败: {str(e)}" - -###### -## 网站地图 及其 robots 配置 - -@blog_bp.route('/robots.txt/') -def robots(): - return send_from_directory(current_app.static_folder, 'robots.txt') - -@blog_bp.route('/google02f6a3f6004a32c6.html') -def google02f6a3f6004a32c6(): - return send_from_directory(blog_bp.static_folder, 'google02f6a3f6004a32c6.html') - - -@blog_bp.route('/sitemap.xml/') -def sitemap(): - conn = get_owp_db_conn() - sql_posts = "SELECT * from posts where status = 1;" - posts = conn.execute(sql_posts).fetchall() - conn.close() - template = render_template('blog/sitemap.xml', posts=posts[::-1], base_url="https://open-ww3-project.ww3.tw/blog/") - response = make_response(template) - response.headers['Content-Type'] = 'application/xml' - return response - -@blog_bp.route('/kami/') -def kami(): - return redirect(url_for('kami.home')) - -@blog_bp.route('/mirrors/') -@blog_bp.route('/mirrors/') -def autoindex(path='.'): - return index.render_autoindex(path, template='blog/mirrors.html') - - -@blog_bp.route('/upload/', methods=['POST' , 'GET']) -def upload(): - if request.method == "POST": - f = request.files.get('img') - filename = f.filename - with open(f'/var/open-ww3-project-ww3-tw/static/upload/img/{filename}', 'wb') as tf: - tf.write(f.read()) - return '上传成功' - img_files = '/var/open-ww3-project-ww3-tw/static/upload/img/' - images = [img for img in os.listdir(img_files) if img.endswith(('.png', '.jpg', '.jpeg', '.gif'))] - return render_template('blog/upload.html', images=images) - -@blog_bp.route('/message/') -def messages(): - return render_template('message/home.html') - -@blog_bp.route('/paint/') -def paint(): - paint_path = "/var/open-ww3-project-ww3-tw/static/upload/paint_data" - paint_json = f"{paint_path}/paint.json" - paint_open = json.load(open(paint_json, 'r', encoding='utf-8')) - return render_template('blog/paint.html', paint_open=paint_open) - -@blog_bp.route('/paint/upload/', methods=['POST',]) -def paint_upload(): - if request.method == "POST": - return "POST" - -@blog_bp.route('/new_page/') -@blog_bp.route('/new_page//') -def new_page(page_name=None): - return send_from_directory(os.path.join(current_app.static_folder, 'new_page'), f'{page_name}.html') diff --git a/blueprint/index_views.py b/blueprint/index_views.py deleted file mode 100644 index 2ea4b18..0000000 --- a/blueprint/index_views.py +++ /dev/null @@ -1,17 +0,0 @@ -from flask import Blueprint, render_template, url_for, redirect -import sqlite3 -import os - -index_bp = Blueprint('/', __name__) - -@index_bp.route('/') -def repage(): - return redirect(url_for('blog.home')) - -@index_bp.route('/mirrors/') -def mirrors(): - return redirect(url_for('blog.autoindex')) - -@index_bp.route('/greet//') -def greet(name): - return f'Hello, {name}!' \ No newline at end of file diff --git a/blueprint/study_views.py b/blueprint/study_views.py deleted file mode 100755 index 75564f5..0000000 --- a/blueprint/study_views.py +++ /dev/null @@ -1,96 +0,0 @@ -from flask import Blueprint, render_template, request, url_for, flash, redirect -import os -import sqlite3 - -study_bp = Blueprint('study', __name__) - -def get_db_conn(): - conn = sqlite3.connect('/var/open-ww3-project-ww3-tw/databases/database.db') - conn.row_factory = sqlite3.Row - return conn - -def get_posts(posts_id): - conn = get_db_conn() - posts = conn.execute("SELECT *, datetime(created, '+8 hours') AS created_8 FROM posts WHERE id = ?", (posts_id,)).fetchone() - conn.close() - return posts - -@study_bp.route('/') -def home(): - conn = get_db_conn() - sql = "SELECT *, datetime(created, '+8 hours') AS created_8 FROM posts;" - posts = conn.execute(sql).fetchall() - conn.close() - return render_template('study/home.html', posts=posts[::-1]) - -@study_bp.route('/about/') -def about(): - return render_template('study/about.html') - -@study_bp.route('/posts/') -def show_posts_id(posts_id): - conn = get_db_conn() - posts = get_posts(posts_id) - if posts is None: - return '抱歉,未查到该文章' - - return render_template('study/posts.html', posts=posts) - -@study_bp.route('/posts/new/', methods=('GET', 'POST')) -def new(): - if request.method == "POST": - title = request.form['title'] - content = request.form['content'] - - if not title: - flash('标题不能为空') - elif not content: - flash('内容不能为空') - else: - conn = get_db_conn() - conn.execute('insert into posts (title, content) values (?, ?)', (title, content)) - conn.commit() - conn.close() - flash('文章发布成功') - return redirect(url_for('study.home')) - - return render_template('study/new.html') - -@study_bp.route('/posts//edit', methods=('GET', 'POST')) -def edit_posts_id(posts_id): - posts = get_posts(posts_id) - if request.method == "POST": - title = request.form['title'] - content = request.form['content'] - - if not title: - flash('标题不能为空') - elif not content: - flash('内容不能为空') - else: - conn = get_db_conn() - conn.execute('update posts set title= ?, content = ? where id = ?', (title, content, posts_id)) - conn.commit() - conn.close() - return redirect(url_for('study.home')) - - return render_template('study/edit.html', posts=posts) - -@study_bp.route('/posts//delete/', methods=['POST' , 'GET']) -def delete_posts_id(posts_id): - if request.method == "POST": - posts = get_posts(posts_id) - conn = get_db_conn() - conn.execute('DELETE FROM posts WHERE id = ?', (posts_id,)) - conn.commit() - conn.close() - flash('删除成功') - return redirect(url_for('study.home')) - - elif request.method == "GET": - posts = get_posts(posts_id) - conn = get_db_conn() - conn.execute('DELETE FROM posts WHERE id = ?', (posts_id,)) - conn.commit() - conn.close() - return render_template('study/delete.html', posts=posts) \ No newline at end of file diff --git a/database.py b/database.py deleted file mode 100755 index a2221dc..0000000 --- a/database.py +++ /dev/null @@ -1,11 +0,0 @@ -import sqlite3 -from flask import g - -DATABASE_owp = '/var/open-ww3-project-ww3-tw/databases/sqlite/owp.db' - -def get_owp_db(): - db = getattr(g, '_database', None) - if db is None: - db = g._database = sqlite3.connect(DATABASE_owp) - db.row_factory = sqlite3.Row - return db \ No newline at end of file diff --git a/main.py b/main.py deleted file mode 100755 index 42597da..0000000 --- a/main.py +++ /dev/null @@ -1,110 +0,0 @@ -from flask import Flask, render_template, redirect, url_for, send_from_directory, make_response, g -import os -import sqlite3 -import secrets -# 引入蓝图 -from blueprint.blog_views import blog_bp -from blueprint.study_views import study_bp -from flask_autoindex import AutoIndex -from blueprint.kami_views import kami_bp -from blueprint.index_views import index_bp -# 引入api -from api.docs import docs_api -from api.api import api_api - -def get_owp_db_conn(): - conn = sqlite3.connect('/var/open-ww3-project-ww3-tw/databases/sqlite/owp.db') - conn.row_factory = sqlite3.Row - return conn - -app = Flask(__name__, static_url_path='/static/') - - -# session -# 随机数生成 -key_hex = secrets.token_hex(32) -app.secret_key = key_hex - - -# 注册蓝图 -app.register_blueprint(blog_bp, url_prefix='/blog') -app.register_blueprint(study_bp, url_prefix='/study') -app.register_blueprint(kami_bp, url_prefix='/kami') -app.register_blueprint(index_bp, url_prefix='/') - -# 注册api -app.register_blueprint(docs_api, url_prefix='/api/docs') -app.register_blueprint(api_api, url_prefix='/api/s/') - - - -# 全局清理关闭数据库连接 -@app.teardown_appcontext -def close_connection(exception): - db = getattr(g, '_database', None) - if db is not None: - db.close() - - - -@app.errorhandler(400) -def bad_request(error): - return ( - '400 Bad Request
' - '请求有误,请检查参数是否正确' - '400 Bad Request', - 400 - ) - - -@app.errorhandler(401) -def unauthorized(error): - return ( - '401 Unauthorized
' - '请先登录或提供有效凭证' - '401 Unauthorized', - 401 - ) - - -@app.errorhandler(403) -def forbidden(error): - return ( - '403 Forbidden
' - '你没有权限访问此资源' - '403 Forbidden', - 403 - ) - - -@app.errorhandler(404) -def not_found(error): - return ( - '404 Not Found
' - '这里什么都没有' - '404 Not Found', - 404 - ) - - -@app.errorhandler(405) -def method_not_allowed(error): - return ( - '405 Method Not Allowed
' - '请求方法不被允许' - '405 Method Not Allowed', - 405 - ) - - -@app.errorhandler(500) -def internal_server_error(error): - return ( - '500 Internal Server Error
' - '服务器开小差了,请稍后再试' - '500 Internal Server Error', - 500 - ) - -if __name__ == '__main__': - app.run(host="0.0.0.0", port=8085, debug=True) \ No newline at end of file diff --git a/packages/__init__.py b/public/about/index.html old mode 100644 new mode 100755 similarity index 100% rename from packages/__init__.py rename to public/about/index.html diff --git a/static/icon/original.ico b/public/blog/icon/original.ico similarity index 100% rename from static/icon/original.ico rename to public/blog/icon/original.ico diff --git a/public/blog/index.php b/public/blog/index.php new file mode 100755 index 0000000..51865f1 --- /dev/null +++ b/public/blog/index.php @@ -0,0 +1,120 @@ + + + 首页 | ww3 + + + + + +
+ +
+ +
+

屑站日志:

+ + + + + + + + + + + + + + + + +
2025.07.26新增wiki页面
2025.07.20新增giteadocker-registry页面
2025.07.09建立页面
+
+
+ +
+ +
+ + + + + + \ No newline at end of file diff --git a/public/docker-registry/all-images/index.php b/public/docker-registry/all-images/index.php new file mode 100755 index 0000000..70d40e6 --- /dev/null +++ b/public/docker-registry/all-images/index.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/public/docker-registry/index.html b/public/docker-registry/index.html new file mode 100755 index 0000000..d47de77 --- /dev/null +++ b/public/docker-registry/index.html @@ -0,0 +1,11 @@ + + + docker-registry + + + + + 查看所有镜像 +

tags/list

+ + \ No newline at end of file diff --git a/public/index.html b/public/index.html new file mode 100755 index 0000000..2fadafb --- /dev/null +++ b/public/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/jumping-message/index.html b/public/jumping-message/index.html new file mode 100755 index 0000000..aefe96e --- /dev/null +++ b/public/jumping-message/index.html @@ -0,0 +1,9 @@ + + + 弹幕留言 | jumping-message + + + + + + \ No newline at end of file diff --git a/public/message/index.php b/public/message/index.php new file mode 100755 index 0000000..279d5a6 --- /dev/null +++ b/public/message/index.php @@ -0,0 +1,173 @@ + + + + + + + + + + " . "$title" . ""; + // 页面标题 + ?> + +
+
+ 欢迎来到 $title"; + // 欢迎语 + + echo "感谢您的访问" . " " . "
" . "顾名思义" . "$title" . "就是用来记录留言的地方"; + // 介绍部分 + ?> + +
+ +
+
+
+ + + +
+

弹幕列表

+

+                        
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/public/message/static/css/message.css b/public/message/static/css/message.css new file mode 100755 index 0000000..e69de29 diff --git a/public/message/static/css/navbar/body_color.css b/public/message/static/css/navbar/body_color.css new file mode 100755 index 0000000..6e0283e --- /dev/null +++ b/public/message/static/css/navbar/body_color.css @@ -0,0 +1,4 @@ +#body_color +{ + background-color: rgba(147, 185, 255, 0.644); +} \ No newline at end of file diff --git a/public/message/static/css/navbar/index-css.html b/public/message/static/css/navbar/index-css.html new file mode 100755 index 0000000..0e16f06 --- /dev/null +++ b/public/message/static/css/navbar/index-css.html @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/public/message/static/css/video.css b/public/message/static/css/video.css new file mode 100755 index 0000000..e69de29 diff --git a/public/message/static/html/content_message.html b/public/message/static/html/content_message.html new file mode 100755 index 0000000..b31081e --- /dev/null +++ b/public/message/static/html/content_message.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/public/message/static/icon/original.ico b/public/message/static/icon/original.ico new file mode 100755 index 0000000..167d718 Binary files /dev/null and b/public/message/static/icon/original.ico differ diff --git a/public/message/static/js/video.js b/public/message/static/js/video.js new file mode 100755 index 0000000..e69de29 diff --git a/public/message/static/php/google_translate.php b/public/message/static/php/google_translate.php new file mode 100755 index 0000000..0bbf314 --- /dev/null +++ b/public/message/static/php/google_translate.php @@ -0,0 +1,26 @@ + + +
+ + + + + + + + + + \ No newline at end of file diff --git a/public/message/static/txt/message.txt b/public/message/static/txt/message.txt new file mode 100755 index 0000000..dfd4eef --- /dev/null +++ b/public/message/static/txt/message.txt @@ -0,0 +1 @@ +这是测试 \ No newline at end of file diff --git a/public/message/static/txt/测试.txt b/public/message/static/txt/测试.txt new file mode 100644 index 0000000..61de0ed --- /dev/null +++ b/public/message/static/txt/测试.txt @@ -0,0 +1 @@ +测试 \ No newline at end of file diff --git a/public/short-url/icon/icon.jpg b/public/short-url/icon/icon.jpg new file mode 100755 index 0000000..1425c00 Binary files /dev/null and b/public/short-url/icon/icon.jpg differ diff --git a/public/short-url/index.php b/public/short-url/index.php new file mode 100755 index 0000000..20bb90d --- /dev/null +++ b/public/short-url/index.php @@ -0,0 +1,12 @@ + + + short_url | 短链 + + + + +

+ ww3-short-url | 短链 +

+ + \ No newline at end of file diff --git a/public/short_url/index.php b/public/short_url/index.php new file mode 100755 index 0000000..e03ec7a --- /dev/null +++ b/public/short_url/index.php @@ -0,0 +1 @@ + diff --git a/public/static/html/black-block.html b/public/static/html/black-block.html new file mode 100644 index 0000000..d0fa1b5 --- /dev/null +++ b/public/static/html/black-block.html @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index f227d2c..0000000 --- a/requirements.txt +++ /dev/null @@ -1,10 +0,0 @@ -blinker==1.9.0 -click==8.3.1 -Flask==3.1.2 -Flask-AutoIndex==0.6.6 -Flask-Silk==0.2 -future==1.0.0 -itsdangerous==2.2.0 -Jinja2==3.1.6 -MarkupSafe==3.0.3 -Werkzeug==3.1.4 diff --git a/static/css/main.css b/static/css/main.css deleted file mode 100755 index ee6c3a2..0000000 --- a/static/css/main.css +++ /dev/null @@ -1,58 +0,0 @@ -/* css页面蓝图 */ - -/* 外部背景 */ -html, body { - height: 100%; - width: 100%; - margin: 0; /*外边框*/ - padding: 0; /*内边框*/ - overflow: hidden; /* 防止滚动条 */ - background-color: #333; /* 背景颜色 */ -} - -/* 内部容器 */ -#app-canvas { - width: 1280px; - height: 800px; - - background-color: rgba(147, 185, 255, 0.644); - border: 5px solid #0056b3; /* 定义边框 5px 实线 蓝色 */ - /* transform-origin: 0 0; /* 定义缩放起点 左上角 */ - - position:fixed; /* 固定页面,不滚动 */ - left: 50%; /* 调整左边缘位置到中央 */ - top: 50%; /* 调整上边缘位置到中央 */ - - padding: 30px; /* 内部间距 30px */ - - -} - -header { - margin-bottom: 30px; /* 外部间距 30px */ - text-align: center; /* 文字居中 */ -} - -h1 { - font-size: 48px; - color: #fff; - text-shadow: 2px 2px 4px rgba(0,0,0,0.5); -} - -#content-area { - display: flex; - justify-content: space-around; - gap: 40px; -} - -/* 自带 */ -.box { - width: 500px; - height: 600px; - background-color: #ffffffcc; - border: 1px solid #ccc; - padding: 20px; - font-size: 20px; - text-align: left; - overflow: auto; -} diff --git a/static/css/style.css b/static/css/style.css deleted file mode 100755 index 5d8b238..0000000 --- a/static/css/style.css +++ /dev/null @@ -1,6 +0,0 @@ -h1 { - border: 2px; - color:brown; - text-align: center; - padding: 10px; -} \ No newline at end of file diff --git a/static/google02f6a3f6004a32c6.html b/static/google02f6a3f6004a32c6.html deleted file mode 100755 index 9005144..0000000 --- a/static/google02f6a3f6004a32c6.html +++ /dev/null @@ -1 +0,0 @@ -google-site-verification: google02f6a3f6004a32c6.html \ No newline at end of file diff --git a/static/img/my_girl.png b/static/img/my_girl.png deleted file mode 100755 index 14c967a..0000000 Binary files a/static/img/my_girl.png and /dev/null differ diff --git a/static/img/open-ww3-project.png b/static/img/open-ww3-project.png deleted file mode 100755 index 214e4a8..0000000 Binary files a/static/img/open-ww3-project.png and /dev/null differ diff --git a/static/js/alpine.js b/static/js/alpine.js deleted file mode 100755 index 2a6849c..0000000 --- a/static/js/alpine.js +++ /dev/null @@ -1,5 +0,0 @@ -(()=>{var nt=!1,it=!1,G=[],ot=-1;function Ut(e){In(e)}function In(e){G.includes(e)||G.push(e),$n()}function Wt(e){let t=G.indexOf(e);t!==-1&&t>ot&&G.splice(t,1)}function $n(){!it&&!nt&&(nt=!0,queueMicrotask(Ln))}function Ln(){nt=!1,it=!0;for(let e=0;ee.effect(t,{scheduler:r=>{st?Ut(r):r()}}),at=e.raw}function ct(e){N=e}function Yt(e){let t=()=>{};return[n=>{let i=N(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),F(i))},i},()=>{t()}]}function Oe(e,t){let r=!0,n,i=N(()=>{let o=e();JSON.stringify(o),r?n=o:queueMicrotask(()=>{t(o,n),n=o}),r=!1});return()=>F(i)}var Xt=[],Zt=[],Qt=[];function er(e){Qt.push(e)}function re(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,Zt.push(t))}function Re(e){Xt.push(e)}function Te(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function lt(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}function tr(e){for(e._x_effects?.forEach(Wt);e._x_cleanups?.length;)e._x_cleanups.pop()()}var ut=new MutationObserver(mt),ft=!1;function pe(){ut.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),ft=!0}function dt(){jn(),ut.disconnect(),ft=!1}var de=[];function jn(){let e=ut.takeRecords();de.push(()=>e.length>0&&mt(e));let t=de.length;queueMicrotask(()=>{if(de.length===t)for(;de.length>0;)de.shift()()})}function m(e){if(!ft)return e();dt();let t=e();return pe(),t}var pt=!1,Ce=[];function rr(){pt=!0}function nr(){pt=!1,mt(Ce),Ce=[]}function mt(e){if(pt){Ce=Ce.concat(e);return}let t=[],r=new Set,n=new Map,i=new Map;for(let o=0;o{s.nodeType===1&&s._x_marker&&r.add(s)}),e[o].addedNodes.forEach(s=>{if(s.nodeType===1){if(r.has(s)){r.delete(s);return}s._x_marker||t.push(s)}})),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{lt(s,o)}),n.forEach((o,s)=>{Xt.forEach(a=>a(s,o))});for(let o of r)t.some(s=>s.contains(o))||Zt.forEach(s=>s(o));for(let o of t)o.isConnected&&Qt.forEach(s=>s(o));t=null,r=null,n=null,i=null}function Me(e){return k(B(e))}function D(e,t,r){return e._x_dataStack=[t,...B(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function B(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?B(e.host):e.parentNode?B(e.parentNode):[]}function k(e){return new Proxy({objects:e},Fn)}var Fn={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(r=>Object.prototype.hasOwnProperty.call(r,t)||Reflect.has(r,t))},get({objects:e},t,r){return t=="toJSON"?Bn:Reflect.get(e.find(n=>Reflect.has(n,t))||{},t,r)},set({objects:e},t,r,n){let i=e.find(s=>Object.prototype.hasOwnProperty.call(s,t))||e[e.length-1],o=Object.getOwnPropertyDescriptor(i,t);return o?.set&&o?.get?o.set.call(n,r)||!0:Reflect.set(i,t,r)}};function Bn(){return Reflect.ownKeys(this).reduce((t,r)=>(t[r]=Reflect.get(this,r),t),{})}function ne(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0||typeof s=="object"&&s!==null&&s.__v_skip)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function Ne(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>zn(n,i),s=>ht(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function zn(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function ht(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),ht(e[t[0]],t.slice(1),r)}}var ir={};function y(e,t){ir[e]=t}function K(e,t){let r=Hn(t);return Object.entries(ir).forEach(([n,i])=>{Object.defineProperty(e,`$${n}`,{get(){return i(t,r)},enumerable:!1})}),e}function Hn(e){let[t,r]=_t(e),n={interceptor:Ne,...t};return re(e,r),n}function or(e,t,r,...n){try{return r(...n)}catch(i){ie(i,e,t)}}function ie(...e){return sr(...e)}var sr=Kn;function ar(e){sr=e}function Kn(e,t,r=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message} - -${r?'Expression: "'+r+`" - -`:""}`,t),setTimeout(()=>{throw e},0)}var oe=!0;function De(e){let t=oe;oe=!1;let r=e();return oe=t,r}function T(e,t,r={}){let n;return x(e,t)(i=>n=i,r),n}function x(...e){return cr(...e)}var cr=xt;function lr(e){cr=e}var ur;function fr(e){ur=e}function xt(e,t){let r={};K(r,e);let n=[r,...B(e)],i=typeof t=="function"?Vn(n,t):Un(n,t,e);return or.bind(null,e,t,i)}function Vn(e,t){return(r=()=>{},{scope:n={},params:i=[],context:o}={})=>{if(!oe){me(r,t,k([n,...e]),i);return}let s=t.apply(k([n,...e]),i);me(r,s)}}var gt={};function qn(e,t){if(gt[e])return gt[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,o=(()=>{try{let s=new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`);return Object.defineProperty(s,"name",{value:`[Alpine] ${e}`}),s}catch(s){return ie(s,t,e),Promise.resolve()}})();return gt[e]=o,o}function Un(e,t,r){let n=qn(t,r);return(i=()=>{},{scope:o={},params:s=[],context:a}={})=>{n.result=void 0,n.finished=!1;let c=k([o,...e]);if(typeof n=="function"){let l=n.call(a,n,c).catch(u=>ie(u,r,t));n.finished?(me(i,n.result,c,s,r),n.result=void 0):l.then(u=>{me(i,u,c,s,r)}).catch(u=>ie(u,r,t)).finally(()=>n.result=void 0)}}}function me(e,t,r,n,i){if(oe&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(s=>me(e,s,r,n)).catch(s=>ie(s,i,t)):e(o)}else typeof t=="object"&&t instanceof Promise?t.then(o=>e(o)):e(t)}function dr(...e){return ur(...e)}function pr(e,t,r={}){let n={};K(n,e);let i=[n,...B(e)],o=k([r.scope??{},...i]),s=r.params??[];if(t.includes("await")){let a=Object.getPrototypeOf(async function(){}).constructor,c=/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(async()=>{ ${t} })()`:t;return new a(["scope"],`with (scope) { let __result = ${c}; return __result }`).call(r.context,o)}else{let a=/^[\n\s]*if.*\(.*\)/.test(t.trim())||/^(let|const)\s/.test(t.trim())?`(()=>{ ${t} })()`:t,l=new Function(["scope"],`with (scope) { let __result = ${a}; return __result }`).call(r.context,o);return typeof l=="function"&&oe?l.apply(o,s):l}}var wt="x-";function C(e=""){return wt+e}function mr(e){wt=e}var ke={};function d(e,t){return ke[e]=t,{before(r){if(!ke[r]){console.warn(String.raw`Cannot find directive \`${r}\`. \`${e}\` will use the default order of execution`);return}let n=J.indexOf(r);J.splice(n>=0?n:J.indexOf("DEFAULT"),0,e)}}}function hr(e){return Object.keys(ke).includes(e)}function _e(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,c])=>({name:a,value:c})),s=Et(o);o=o.map(a=>s.find(c=>c.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),t=t.concat(o)}let n={};return t.map(xr((o,s)=>n[o]=s)).filter(br).map(Gn(n,r)).sort(Jn).map(o=>Wn(e,o))}function Et(e){return Array.from(e).map(xr()).filter(t=>!br(t))}var yt=!1,he=new Map,_r=Symbol();function gr(e){yt=!0;let t=Symbol();_r=t,he.set(t,[]);let r=()=>{for(;he.get(t).length;)he.get(t).shift()();he.delete(t)},n=()=>{yt=!1,r()};e(r),n()}function _t(e){let t=[],r=a=>t.push(a),[n,i]=Yt(e);return t.push(i),[{Alpine:z,effect:n,cleanup:r,evaluateLater:x.bind(x,e),evaluate:T.bind(T,e)},()=>t.forEach(a=>a())]}function Wn(e,t){let r=()=>{},n=ke[t.type]||r,[i,o]=_t(e);Te(e,t.original,o);let s=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),yt?he.get(_r).push(n):n())};return s.runCleanups=o,s}var Pe=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),Ie=e=>e;function xr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=yr.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var yr=[];function se(e){yr.push(e)}function br({name:e}){return wr().test(e)}var wr=()=>new RegExp(`^${wt}([^:^.]+)\\b`);function Gn(e,t){return({name:r,value:n})=>{let i=r.match(wr()),o=r.match(/:([a-zA-Z0-9\-_:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var bt="DEFAULT",J=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",bt,"teleport"];function Jn(e,t){let r=J.indexOf(e.type)===-1?bt:e.type,n=J.indexOf(t.type)===-1?bt:t.type;return J.indexOf(r)-J.indexOf(n)}function Y(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}function P(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>P(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)P(n,t,!1),n=n.nextElementSibling}function E(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var Er=!1;function vr(){Er&&E("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),Er=!0,document.body||E("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's ` diff --git a/templates/blog/sitemap.xml b/templates/blog/sitemap.xml deleted file mode 100755 index 274cf0e..0000000 --- a/templates/blog/sitemap.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - {{ base_url }} - 2025-12-22 - daily - 1.0 - - {% for post in posts %} - - {{ base_url }}posts/{{ post['id'] }}/ - {{ post['date'].replace('.', '-') }} - monthly - 0.8 - - {% endfor %} - - {{ base_url }}posts/ - 2025-12-23 - daily - 0.8 - - - {{ base_url }}mirrors/ - 2025-12-23 - daily - 0.8 - - \ No newline at end of file diff --git a/templates/blog/upload.html b/templates/blog/upload.html deleted file mode 100644 index 29dc6a6..0000000 --- a/templates/blog/upload.html +++ /dev/null @@ -1,19 +0,0 @@ -上传文件 -上传文件 -
-目前只支持jpg, jpeg, png, gif -
- - -
-
-
-已上传图片 -
-
-
-{% for image in images %} - - {{ image }} - -{% endfor %} \ No newline at end of file diff --git a/templates/study/about.html b/templates/study/about.html deleted file mode 100755 index 92d4ce5..0000000 --- a/templates/study/about.html +++ /dev/null @@ -1,12 +0,0 @@ -{# 引入base #} -{% extends 'study/base.html' %} - -{# 网站标签 #} -{% block title %} 关于页面 {% endblock %} - -{% block content %} - -大家好...... -没有了 - -{% endblock %} \ No newline at end of file diff --git a/templates/study/base.html b/templates/study/base.html deleted file mode 100755 index f0499e3..0000000 --- a/templates/study/base.html +++ /dev/null @@ -1,61 +0,0 @@ -{# base模板 #} - - - - - {% block title %}{% endblock %} - - {# 建立一个url,来源于static文件夹的,文件名字为css文件夹下的style.css #} - - - -
- - - - - - -
-
- home -
-
-
- - about -
-
-
-
子功能
-
- -
-
-
-
- {% for message in get_flashed_messages() %} -
{{ message }}
- {% endfor %} - - {% block content %} {% endblock %} - - - - - - \ No newline at end of file diff --git a/templates/study/delete.html b/templates/study/delete.html deleted file mode 100755 index 9a7af25..0000000 --- a/templates/study/delete.html +++ /dev/null @@ -1,5 +0,0 @@ -确定要删除 "{{ posts['title'] }}" 吗? - -
- -
\ No newline at end of file diff --git a/templates/study/edit.html b/templates/study/edit.html deleted file mode 100755 index d06557c..0000000 --- a/templates/study/edit.html +++ /dev/null @@ -1,25 +0,0 @@ -{# 引入base #} -{% extends 'study/base.html' %} - -{# 网站标签 #} -{% block title %} 编辑 "{{ posts['title'] }}" {% endblock %} - -{% block content %} - -
-
- - - -
-
- - -
-
- -
-
- - -{% endblock %} \ No newline at end of file diff --git a/templates/study/home.html b/templates/study/home.html deleted file mode 100755 index 7f946a0..0000000 --- a/templates/study/home.html +++ /dev/null @@ -1,20 +0,0 @@ -{# 引入base #} -{% extends 'study/base.html' %} - -{# 网站标签 #} -{% block title %}study学习{% endblock %} - -{% block content %} -

学习如何搭建一个blog

-

欢迎访问一个学习如何搭建一个blog的页面

- - {% for posts in posts %} - - -

{{ posts['title'] }}

-
- {{ posts['created_8'] }} -
-
- {% endfor %} -{% endblock %} \ No newline at end of file diff --git a/templates/study/new.html b/templates/study/new.html deleted file mode 100755 index 9f306cb..0000000 --- a/templates/study/new.html +++ /dev/null @@ -1,27 +0,0 @@ -{# 引入base #} -{% extends 'study/base.html' %} - -{# 网站标签 #} -{% block title %} 新建文章 {% endblock %} - -{% block content %} -
-
-
-
-
- - - -
-
- - -
-
- -
-
- - -{% endblock %} \ No newline at end of file diff --git a/templates/study/posts.html b/templates/study/posts.html deleted file mode 100755 index 6635489..0000000 --- a/templates/study/posts.html +++ /dev/null @@ -1,19 +0,0 @@ -{# 引入base #} -{% extends 'study/base.html' %} - -{# 网站标签 #} -{% block title %} {{ posts['title'] }} {% endblock %} - -{% block content %} -

{{ posts['title'] }}

-{{ posts['created_8'] }} - - 编辑 - -
- -

{{ posts['content'] }}

- - - -{% endblock %} \ No newline at end of file