Compare commits
45 Commits
1b2fa8b518
...
python
| Author | SHA1 | Date | |
|---|---|---|---|
| 24dc04287e | |||
| 8373794f11 | |||
| 4266c8ac5c | |||
| 8ca06abe4a | |||
| 7c94590c40 | |||
| 83ad26a686 | |||
| 50199ec37f | |||
| 24643b132a | |||
| a8161d0736 | |||
| 49fe419232 | |||
| 7e44fe8a2a | |||
| 582f8a9234 | |||
| f35aed0f65 | |||
| 0ad1069e65 | |||
| 1a11fa4ab9 | |||
| 96582b0822 | |||
| e289c2fb59 | |||
| 432ea17e40 | |||
| 7ebaa73415 | |||
| c63bb3e6ad | |||
| 45f3cf0474 | |||
| b40c68063c | |||
| 0c70b66966 | |||
| 7727a97e4a | |||
| eb2d2778d4 | |||
| ee17bf5edd | |||
| 9510f7320c | |||
| 21810fe3ae | |||
| 6e79e2ee40 | |||
| e62ae0968d | |||
| bb58c12208 | |||
| 9a0a900d2e | |||
| 14fceea63c | |||
| 11ac279c88 | |||
| ef2c204bae | |||
| c25ae6bdca | |||
|
|
2882260a48 | ||
| 7b3eec0af9 | |||
|
|
06145e7c59 | ||
|
|
be322b86a9 | ||
|
|
8f6e09cf0f | ||
|
|
3ee0131b0e | ||
|
|
11b8592abf | ||
| 1eff2ea4d7 | |||
|
|
8388cf5925 |
11
.gitignore
vendored
Normal file → Executable file
11
.gitignore
vendored
Normal file → Executable file
@@ -1,2 +1,11 @@
|
||||
**/__pycache__
|
||||
**/*.db
|
||||
**/*.sql
|
||||
**/*.db.back
|
||||
databases/*
|
||||
src/*
|
||||
mirrors/*
|
||||
blueprint/kami_views.py
|
||||
templates/kami/*
|
||||
static/upload/*
|
||||
templates/message/*
|
||||
blueprint/massage_views.py
|
||||
30
README.md
Normal file → Executable file
30
README.md
Normal file → Executable file
@@ -1,10 +1,34 @@
|
||||
### 2025.7.20
|
||||
<a href="https://ww3.tw/">点击访问</a>
|
||||
|
||||
## 2025.12.23
|
||||
迁移后端至python
|
||||
现已完毕
|
||||
--
|
||||
|
||||
# 感谢列表:
|
||||
- 感谢bilibili麦叔的教程视频
|
||||
- 感谢互联网
|
||||
- 感谢自己
|
||||
|
||||
**署名**
|
||||
|
||||
<a href="https://wiki.ww3.tw/doku.php?id=zh_cn:skimrme">skimrme</a>
|
||||
|
||||
<hr>
|
||||
|
||||
#
|
||||
#
|
||||
|
||||
## 2025.7.20
|
||||
open-ww3-project-ww3-tw
|
||||
个人博客地址(预计)
|
||||
---
|
||||
|
||||
<br>
|
||||
# 感谢列表:
|
||||
- 感谢谷歌Genmini的指导
|
||||
- 感谢互联网
|
||||
- 感谢自己
|
||||
|
||||
**署名**
|
||||
|
||||
skimrme
|
||||
<a href="https://wiki.ww3.tw/doku.php?id=zh_cn:skimrme">skimrme</a>
|
||||
123
blueprint/blog_views.py
Executable file
123
blueprint/blog_views.py
Executable file
@@ -0,0 +1,123 @@
|
||||
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
|
||||
import os
|
||||
import sqlite3
|
||||
import time
|
||||
|
||||
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('/')
|
||||
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()
|
||||
return render_template('blog/home.html', logs=logs[::-1], posts=posts[::-1])
|
||||
|
||||
@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/<int:posts_id>/')
|
||||
def show_posts_id(posts_id):
|
||||
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:
|
||||
return f'未找到该文章{posts_id}<title>未找到该文章{posts_id}</title>', 404
|
||||
return render_template('blog/posts.html', posts=posts, message=message[::-1])
|
||||
|
||||
|
||||
|
||||
|
||||
# 数据库测试
|
||||
@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/<path:path>')
|
||||
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 '上传成功<meta http-equiv="refresh" content="1.2;url=https://ww3.tw/blog/upload/">'
|
||||
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')
|
||||
17
blueprint/index_views.py
Normal file
17
blueprint/index_views.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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/<name>/')
|
||||
def greet(name):
|
||||
return f'Hello, {name}!'
|
||||
96
blueprint/study_views.py
Executable file
96
blueprint/study_views.py
Executable file
@@ -0,0 +1,96 @@
|
||||
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/<int:posts_id>')
|
||||
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/<int:posts_id>/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/<int:posts_id>/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)
|
||||
11
database.py
Executable file
11
database.py
Executable file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
102
main.py
Executable file
102
main.py
Executable file
@@ -0,0 +1,102 @@
|
||||
from flask import Flask, render_template, redirect, url_for, send_from_directory, make_response, g
|
||||
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
|
||||
import os
|
||||
import sqlite3
|
||||
|
||||
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
|
||||
#app.secret_key = "508948973a8651f160baf3b26f18c47d"
|
||||
app.secret_key = '玩鵬畝遜溉痕叛課還擇鼇粹拜溜泉聰倡效蘭鱅都凍芝西鄂'
|
||||
|
||||
|
||||
|
||||
# 注册蓝图
|
||||
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='/')
|
||||
|
||||
|
||||
|
||||
|
||||
# 全局清理关闭数据库连接
|
||||
@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<br>'
|
||||
'请求有误,请检查参数是否正确'
|
||||
'<title>400 Bad Request</title>',
|
||||
400
|
||||
)
|
||||
|
||||
|
||||
@app.errorhandler(401)
|
||||
def unauthorized(error):
|
||||
return (
|
||||
'401 Unauthorized<br>'
|
||||
'请先登录或提供有效凭证'
|
||||
'<title>401 Unauthorized</title>',
|
||||
401
|
||||
)
|
||||
|
||||
|
||||
@app.errorhandler(403)
|
||||
def forbidden(error):
|
||||
return (
|
||||
'403 Forbidden<br>'
|
||||
'你没有权限访问此资源'
|
||||
'<title>403 Forbidden</title>',
|
||||
403
|
||||
)
|
||||
|
||||
|
||||
@app.errorhandler(404)
|
||||
def not_found(error):
|
||||
return (
|
||||
'404 Not Found<br>'
|
||||
'这里什么都没有'
|
||||
'<title>404 Not Found</title>',
|
||||
404
|
||||
)
|
||||
|
||||
|
||||
@app.errorhandler(405)
|
||||
def method_not_allowed(error):
|
||||
return (
|
||||
'405 Method Not Allowed<br>'
|
||||
'请求方法不被允许'
|
||||
'<title>405 Method Not Allowed</title>',
|
||||
405
|
||||
)
|
||||
|
||||
|
||||
@app.errorhandler(500)
|
||||
def internal_server_error(error):
|
||||
return (
|
||||
'500 Internal Server Error<br>'
|
||||
'服务器开小差了,请稍后再试'
|
||||
'<title>500 Internal Server Error</title>',
|
||||
500
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(host="0.0.0.0", port=8085, debug=True)
|
||||
0
public/about/index.html → packages/__init__.py
Executable file → Normal file
0
public/about/index.html → packages/__init__.py
Executable file → Normal file
@@ -1,107 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>首页 | ww3</title>
|
||||
<meta charset="utf-8" lang="zh-CN">
|
||||
<link rel="icon" type="image/x-icon" href="./icon/original.ico">
|
||||
</head>
|
||||
<body>
|
||||
<div id="navbar1">
|
||||
<table border="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td id="td_navbar_40px"><b><a href="https://ww3.tw/" id="url_">首页</a></b></td>
|
||||
<td id="td_navbar_40px"><b><a href="https://ww3.tw/about/" id="url_">关于</a></b></td>
|
||||
<td id="td_navbar_75px"><b><a href="https://ww3.tw/jumping-message/" id="url_">弹幕留言</a></b></td>
|
||||
<td id="td_navbar_75px"><b><a href="https://ww3.tw/short-url/" id="url_">短链生成</a></b></td>
|
||||
<td id="td_navbar_52px"><b><a href="https://gitea.ww3.tw/skimrme/" id="url_">gitea</a></b></td>
|
||||
<td id="td_navbar_135px"><b><a href="https://ww3.tw/docker-registry/" id="url_">docker-registry</a></b></td>
|
||||
<td id="td_navbar_40px"><b><a href="https://ww3.tw/api/" id="url_">api</a></b></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- 屑站日志 -->
|
||||
<div id="logs">
|
||||
<h3>屑站日志:<br></h3>
|
||||
<font size="3.2">
|
||||
<table border="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td id="td_logs">2025.07.20</td>
|
||||
<td id="td_logs_content">新增<a href="https://gitea.ww3.tw/skimrme">gitea</a>、<a href="https://ww3.tw/docker-registry/">docker-registry</a>页面</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="td_logs">2025.07.09</td>
|
||||
<td id="td_logs_content">建立页面</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</font>
|
||||
</div>
|
||||
<!-- 屑站日志 -->
|
||||
<div id="js_date"></div>
|
||||
<script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<style>
|
||||
body
|
||||
{
|
||||
background-color: rgba(147, 185, 255, 0.644);
|
||||
}
|
||||
|
||||
#url_
|
||||
{
|
||||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
#logs
|
||||
{
|
||||
height: 220px;
|
||||
width: 450px;
|
||||
overflow: auto;
|
||||
background: #ffffff;
|
||||
/* up、right、down、left */
|
||||
margin: 40px 0px 0px 0px;
|
||||
}
|
||||
|
||||
#td_navbar_40px
|
||||
{
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
#td_navbar_52px
|
||||
{
|
||||
width: 52px;;
|
||||
}
|
||||
|
||||
#td_navbar_75px
|
||||
{
|
||||
width: 75px;
|
||||
}
|
||||
|
||||
#td_navbar_135px
|
||||
{
|
||||
width: 135px;
|
||||
}
|
||||
|
||||
#td_logs
|
||||
{
|
||||
width: 75px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
#td_logs_content
|
||||
{
|
||||
color: rgb(132, 132, 132);
|
||||
padding-left: 10px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
#js_date{
|
||||
color: rgb(55, 0, 255);
|
||||
font-size: 200%;
|
||||
}
|
||||
</style>
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
// 1. 定义你的 Docker Registry 地址
|
||||
// 请将 'http://localhost:5000' 替换为你的实际 Registry 地址。
|
||||
// 例如:如果你的 Registry 是 'my-registry.io',就改为 'https://my-registry.io'
|
||||
$registryUrl = "https://regw.ww3.tw/";
|
||||
|
||||
// 2. 定义你要获取的 API 端点
|
||||
// 这个端点用于获取所有仓库列表。
|
||||
$endpoint = "/v2/_catalog";
|
||||
|
||||
// 3. 组合完整的 URL
|
||||
$fullUrl = $registryUrl . $endpoint;
|
||||
|
||||
// 4. 使用 file_get_contents() 获取 JSON 内容
|
||||
// @ 符号用来抑制可能出现的错误或警告,让输出更干净。
|
||||
$jsonContent = @file_get_contents($fullUrl);
|
||||
|
||||
// 5. 直接输出 JSON 内容
|
||||
// 如果成功获取到内容,就直接打印出来。
|
||||
// 如果获取失败,会打印一个空字符串或PHP的错误信息(如果没用@抑制)。
|
||||
header('Content-Type: application/json'); // 告诉浏览器这是一个JSON响应
|
||||
echo $jsonContent;
|
||||
|
||||
?>
|
||||
@@ -1,11 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>docker-registry</title>
|
||||
<meta charset="utf-8" lang="zh-CN">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a href="./all-images/index.php">查看所有镜像</a>
|
||||
<p>tags/list</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
<meta http-equiv="refresh" content="0.1;url=https://open-ww3-project.ww3.tw/blog/">
|
||||
@@ -1,9 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>弹幕留言 | jumping-message</title>
|
||||
<meta charset="utf-8" lang="zh-CN">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,152 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" lang="zh-CN">
|
||||
<link rel="stylesheet" type="text/css" href="./static/css/navbar/body_color.css">
|
||||
<link rel="icon" type="img/icon" href="./static/icon/original.ico">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
$title = "Message | 留言";
|
||||
// title 变量
|
||||
|
||||
echo "<title>" . "$title" . "</title>";
|
||||
// 页面标题
|
||||
?>
|
||||
<body id="body_color">
|
||||
<div id="message_block">
|
||||
<div id="content_page">
|
||||
<?php
|
||||
echo "<h1>欢迎来到 $title</h1>";
|
||||
// 欢迎语
|
||||
|
||||
echo "感谢您的访问" . " " . "<br>" . "顾名思义" . "$title" . "就是用来记录留言的地方";
|
||||
// 介绍部分
|
||||
?>
|
||||
<div id="back_blok">
|
||||
<!-- 返回主页 -->
|
||||
<a id="back_url" href="https://ww3.tw/"><b>..返回主页</b></a>
|
||||
</div>
|
||||
<div id="message_video">
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<h1>
|
||||
暂无视频
|
||||
</h1>
|
||||
</div>
|
||||
<div id="message_com">
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
评论展示区
|
||||
<div id="message_com_black">
|
||||
发送区
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- php 引入 -->
|
||||
<?php
|
||||
include "./static/css/navbar/index-css.html";
|
||||
// 引入navbar-css
|
||||
?>
|
||||
<!-- php 引入 -->
|
||||
|
||||
<style>
|
||||
/* 这里是专属css */
|
||||
#content_page
|
||||
{
|
||||
color: rgb(255, 74, 74);
|
||||
text-align: left;
|
||||
font-size: 18px;
|
||||
|
||||
}
|
||||
|
||||
#message_video
|
||||
{
|
||||
background-color: blue;
|
||||
color: white;
|
||||
text-align: center;
|
||||
width: 60%;
|
||||
height: 69%;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
top: 22%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
/* 页面边距 上、右、下、左 */
|
||||
margin: 1.89% 0px 0px 0%;
|
||||
}
|
||||
|
||||
#message_com
|
||||
{
|
||||
background-color: white;
|
||||
text-align: center;
|
||||
width: 33%;
|
||||
height: 69%;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
top: 22%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
/* 页面边距 上、右、下、左 */
|
||||
margin: 1.89% 0px 0px 63.8%;
|
||||
}
|
||||
|
||||
#message_com_black
|
||||
{
|
||||
background-color: black;
|
||||
color: white;
|
||||
width: 100%;
|
||||
height: 8%;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
/* 页面边距 上、右、下、左 */
|
||||
margin: 108% 0px 0px 0%;
|
||||
}
|
||||
|
||||
#back_blok{
|
||||
/* 返回主页 */
|
||||
color: rgb(0, 0, 0);
|
||||
width: 20%;
|
||||
height: 4%;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
/* 页面边距 上、右、下、左 */
|
||||
margin: 4% 0px 0px 36.8%;
|
||||
}
|
||||
|
||||
#back_url
|
||||
{
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
//这里是专属js
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@@ -1,49 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" lang="zh-CN">
|
||||
<link rel="stylesheet" type="text/css" href="./static/css/body_color.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<?php
|
||||
$title = "Message | 留言";
|
||||
// title 变量
|
||||
|
||||
echo "<title>" . "$title" . "</title>";
|
||||
// 页面标题
|
||||
?>
|
||||
<body id="body_color">
|
||||
<div id="message_block">
|
||||
<div id="content_page">
|
||||
<?php
|
||||
echo "<h1>欢迎来到 $title</h1>";
|
||||
// 欢迎语
|
||||
|
||||
echo "感谢您的访问" . " " . "<br>" . "顾名思义" . "$title" . "就是用来记录留言的地方";
|
||||
// 介绍部分
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!-- php 引入 -->
|
||||
<?php
|
||||
include "./static/css/navbar/index-css.html";
|
||||
// 引入navbar-css
|
||||
?>
|
||||
<!-- php 引入 -->
|
||||
|
||||
<style>
|
||||
/* 这里是专属css */
|
||||
#content_page
|
||||
{
|
||||
color: rgb(255, 74, 74);
|
||||
text-align: left;
|
||||
font-size: 18px;
|
||||
|
||||
}
|
||||
</style>
|
||||
@@ -1,52 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" lang="zh-CN">
|
||||
<!-- 引入css -->
|
||||
<link rel="stylesheet" type="text/css" href="./static/css/body.css">
|
||||
<?php
|
||||
include './static/html/content_message.html';
|
||||
//css 部分 引用 html
|
||||
?>
|
||||
<!-- 引入css -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php
|
||||
$title = "message";
|
||||
//定义变量 title
|
||||
|
||||
echo "<title>$title</title>";
|
||||
// 设定网站抬头
|
||||
|
||||
echo "<div id='init'>";
|
||||
|
||||
echo "<h1>欢迎来到 $title</h1>";
|
||||
// 欢迎语
|
||||
|
||||
echo "感谢您的访问" . " " . "<br>" . "顾名思义" . "$title" . "就是用来记录留言的地方";
|
||||
// 介绍部分
|
||||
|
||||
echo "</div>";
|
||||
|
||||
?>
|
||||
<div>
|
||||
<?php
|
||||
include './static/php/google_translate.php';
|
||||
// 引入 谷歌翻译
|
||||
?>
|
||||
<div id="content_message_block">
|
||||
|
||||
</div>
|
||||
<div id="content_message_video">
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<style>
|
||||
#init
|
||||
{
|
||||
position: fixed;
|
||||
/* 页面边距 上、右、下、左 */
|
||||
margin: 70px 0px 0px 0px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,4 +0,0 @@
|
||||
#body_color
|
||||
{
|
||||
background-color: rgba(147, 185, 255, 0.644);
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<style>
|
||||
#message_block
|
||||
{
|
||||
background-color: rgba(0, 0, 0, 0.68);
|
||||
width: 85%;
|
||||
height: 100%;
|
||||
margin: auto;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
</style>
|
||||
@@ -1,3 +0,0 @@
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 268 KiB |
@@ -1,26 +0,0 @@
|
||||
<!-- 谷歌翻译 -->
|
||||
|
||||
<div id="google_translate_element"></div>
|
||||
<!-- 翻译选项 -->
|
||||
|
||||
<!-- js 部分 -->
|
||||
<script type="text/javascript">
|
||||
function googleTranslateElementInit() {
|
||||
new google.translate.TranslateElement({pageLanguage: 'zh-CN'}, 'google_translate_element');
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
|
||||
<!-- js 部分 -->
|
||||
|
||||
<style>
|
||||
#google_translate_element
|
||||
{
|
||||
display: flex;
|
||||
position: fixed;
|
||||
/* 页面边距 上、右、下、左 */
|
||||
margin: -7.6px 0px 0px 0px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!-- 谷歌翻译 -->
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB |
@@ -1,12 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>short_url | 短链</title>
|
||||
<meta charset="utf-8" lang="zh-CN">
|
||||
<link rel="icon" type="image/x-icon" href="./icon/icon.jpg">
|
||||
</head>
|
||||
<body>
|
||||
<h1>
|
||||
ww3-short-url | 短链
|
||||
</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
<meta http-equiv="refresh" content="0.1;url=https://open-ww3-project.ww3.tw/short-url/">
|
||||
10
requirements.txt
Normal file
10
requirements.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
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
|
||||
58
static/css/main.css
Executable file
58
static/css/main.css
Executable file
@@ -0,0 +1,58 @@
|
||||
/* 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;
|
||||
}
|
||||
6
static/css/style.css
Executable file
6
static/css/style.css
Executable file
@@ -0,0 +1,6 @@
|
||||
h1 {
|
||||
border: 2px;
|
||||
color:brown;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
}
|
||||
1
static/google02f6a3f6004a32c6.html
Executable file
1
static/google02f6a3f6004a32c6.html
Executable file
@@ -0,0 +1 @@
|
||||
google-site-verification: google02f6a3f6004a32c6.html
|
||||
|
Before Width: | Height: | Size: 268 KiB After Width: | Height: | Size: 268 KiB |
BIN
static/img/my_girl.png
Executable file
BIN
static/img/my_girl.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 99 KiB |
BIN
static/img/open-ww3-project.png
Executable file
BIN
static/img/open-ww3-project.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 280 KiB |
5
static/js/alpine.js
Executable file
5
static/js/alpine.js
Executable file
File diff suppressed because one or more lines are too long
29
static/js/main.js
Executable file
29
static/js/main.js
Executable file
@@ -0,0 +1,29 @@
|
||||
// js目前不会,先靠ai
|
||||
|
||||
function resizeCanvas() {
|
||||
// 定义设计基准尺寸
|
||||
const designWidth = 1280;
|
||||
const designHeight = 800;
|
||||
|
||||
// 获取当前浏览器视口尺寸
|
||||
const currentWidth = window.innerWidth;
|
||||
const currentHeight = window.innerHeight;
|
||||
|
||||
const canvas = document.getElementById('app-canvas');
|
||||
|
||||
// 计算缩放比例
|
||||
const scaleX = currentWidth / designWidth;
|
||||
const scaleY = currentHeight / designHeight;
|
||||
const scaleFactor = Math.min(scaleX, scaleY);
|
||||
|
||||
// 确保元素中心与 left: 50%; top: 50%; 对齐
|
||||
canvas.style.transform = `translate(-50%, -50%) scale(${scaleFactor})`;
|
||||
}
|
||||
|
||||
// 首次加载时执行
|
||||
document.addEventListener('DOMContentLoaded', resizeCanvas);
|
||||
// 监听窗口大小变化时执行,保持动态缩放
|
||||
window.addEventListener('resize', resizeCanvas);
|
||||
|
||||
// 确保在某些情况下也能正确初始化
|
||||
resizeCanvas();
|
||||
7
static/robots.txt
Executable file
7
static/robots.txt
Executable file
@@ -0,0 +1,7 @@
|
||||
User-agent: *
|
||||
|
||||
Allow: /
|
||||
|
||||
Disallow: /kami/
|
||||
|
||||
Sitemap: https://open-ww3-project.ww3.tw/blog/sitemap.xml
|
||||
45
static/tui_jian/index.html
Executable file
45
static/tui_jian/index.html
Executable file
@@ -0,0 +1,45 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>推荐网页</title>
|
||||
<meta charset="utf-8" lang="zh-CN">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<center>
|
||||
<h3>漫画</h3>
|
||||
<th>
|
||||
<td id="font_a">
|
||||
<a href="https://xmanhua.com/">xmanhua</a>
|
||||
</td>
|
||||
</th>
|
||||
<th>
|
||||
<td id="font_a">
|
||||
<a href="https://komiic.com/">komiic</a>
|
||||
</td>
|
||||
</th>
|
||||
<th>
|
||||
<td id="font_a">
|
||||
<a href="https://mangadex.org/">mangadex</a>
|
||||
</td>
|
||||
</th>
|
||||
<th>
|
||||
<td id="font_a">
|
||||
<a href="https://mangabz.com/">mangabz</a>
|
||||
</td>
|
||||
</th>
|
||||
<h3>动漫</h3>
|
||||
<th>
|
||||
<td id="font_a">
|
||||
<a href="https://www.agedm.com">age动漫 | 尽量不要开梯</a>
|
||||
</td>
|
||||
</th>
|
||||
</center>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<style>
|
||||
#font_a {
|
||||
width: 50px;
|
||||
}
|
||||
</style>
|
||||
1
static/video.html
Executable file
1
static/video.html
Executable file
@@ -0,0 +1 @@
|
||||
<iframe src="//player.bilibili.com/player.html?isOutside=true&aid=115578442356850&bvid=BV12CCdBkEL6&cid=34120008494&p=1&autoplay=0" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" style="width: 100%; height: 100%;"></iframe>
|
||||
33
templates/blog/about.html
Executable file
33
templates/blog/about.html
Executable file
@@ -0,0 +1,33 @@
|
||||
{# 引入base #}
|
||||
{% extends 'blog/extension/base.html' %}
|
||||
|
||||
{# 引入标题 #}
|
||||
{% block title %}关于{% endblock %}
|
||||
|
||||
{% include 'blog/include/head.html' %}
|
||||
{% block content %}
|
||||
{% include 'blog/include/navbar.html' %}
|
||||
<br>
|
||||
<a href="{{ url_for('blog.home') }}">返回首页</a>__<a href="{{ url_for('blog.sitemap') }}">网页地图</a>
|
||||
<hr id="hr_2">
|
||||
本站建立于大概2025年8月前后<br>
|
||||
差不多是个人博客多次重建后的成果<br>
|
||||
如今我已经成长很多<br>
|
||||
<br>
|
||||
<a href="https://wiki.ww3.tw/doku.php?id=zh_cn:skimrme">站长介绍<a>
|
||||
<p>2025.12.22</p>
|
||||
<br>
|
||||
<br>
|
||||
<hr id="hr_2">
|
||||
忘记写了
|
||||
<br>
|
||||
所以暂时就不写了
|
||||
<p>2025.08.05</p>
|
||||
<p>over</p>
|
||||
|
||||
<style>
|
||||
#hr_2 {
|
||||
border: 0.3px solid black;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
57
templates/blog/extension/base.html
Normal file
57
templates/blog/extension/base.html
Normal file
@@ -0,0 +1,57 @@
|
||||
{# base_home模板 #}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<title>{% block title %}{% endblock %} | ww3</title>
|
||||
<body>
|
||||
<div id="content">
|
||||
{% block content %}
|
||||
{# 这里存放写入模板的数据 #}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% block move %}
|
||||
{# 这里存放更多模板的数据 #}
|
||||
{% endblock %}
|
||||
{% include 'blog/include/footer.html' %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
{# css部分 #}
|
||||
<style>
|
||||
#navbar {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
#url_ {
|
||||
margin: 0 5px 0 0;
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
#content {
|
||||
margin: 0 0 0 0;
|
||||
margin-left: 5%;
|
||||
width: 90%;
|
||||
height: 640px;
|
||||
background-color: #93B9FFA4;
|
||||
}
|
||||
#navbar1 {
|
||||
font-size: 125%;
|
||||
width: 35%;
|
||||
height: 13px;
|
||||
background-color: rgba(169, 198, 252, 0);
|
||||
}
|
||||
#navbar {
|
||||
font-size: 125%;
|
||||
width: 500px;
|
||||
height: auto;
|
||||
background-color: rgb(169, 198, 252);
|
||||
}
|
||||
html, body {
|
||||
margin: 0;
|
||||
}
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
body {
|
||||
background-color: rgb(92, 92, 92);
|
||||
}
|
||||
</style>
|
||||
115
templates/blog/home.html
Normal file
115
templates/blog/home.html
Normal file
@@ -0,0 +1,115 @@
|
||||
{# 引入base #}
|
||||
{% extends 'blog/extension/base.html' %}
|
||||
|
||||
{# 引入标题 #}
|
||||
{% block title %}首页{% endblock %}
|
||||
|
||||
{% include 'blog/include/head.html' %}
|
||||
|
||||
{% include 'blog/include/wallpaper.html' %}
|
||||
|
||||
{% block content %}
|
||||
<h1>欢迎访问open-ww3-project</h1>
|
||||
<!-- 屑站日志 -->
|
||||
<h3 style="margin: 10px 0 30px 50px;">屑站日志:<br></h3>
|
||||
<div id="logs">
|
||||
<font size="3.2">
|
||||
<table border="0">
|
||||
<tbody>
|
||||
{# 调用数据库 #}
|
||||
{% for logs in logs %}
|
||||
<tr>
|
||||
<td id="td_logs">
|
||||
<a style='font-size: 18px;'>
|
||||
{{ logs['date'].replace('.', '-') }}
|
||||
</a>
|
||||
<br>
|
||||
</td>
|
||||
<td id="td_logs_content">
|
||||
{{ logs['content'].replace('&&', '<br>') | safe }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</font>
|
||||
</div>
|
||||
<!-- 屑站日志 -->
|
||||
<div id="posts">
|
||||
<h1>全部文章</h1>
|
||||
文章如下↓
|
||||
<br>
|
||||
<br>
|
||||
<div id="posts_list">
|
||||
{% for posts in posts %}
|
||||
文章id:{{ posts['id'] }}
|
||||
<br>
|
||||
标题: {{ posts['title'] }}
|
||||
<br>
|
||||
日期: {{ posts['date'].replace('.', '-')}}
|
||||
<a href="{{ url_for('blog.posts_list') }}{{ posts['id'] }}">页面跳转</a>
|
||||
<br>
|
||||
<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- css 部分 -->
|
||||
<style>
|
||||
#posts_list {
|
||||
height: 300px;
|
||||
overflow: auto;
|
||||
}
|
||||
#posts {
|
||||
margin: -400px 0 0 60%;
|
||||
}
|
||||
/* 日志 */
|
||||
#logs
|
||||
{
|
||||
height: 50%;
|
||||
width: 40%;
|
||||
overflow: auto;
|
||||
background: #ffffffbc;
|
||||
/* up、right、down、left */
|
||||
margin: -10px 0px 0px 30px;
|
||||
}
|
||||
|
||||
#td_logs
|
||||
{
|
||||
width: 93px;
|
||||
padding-top: 1.8px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#td_logs_content
|
||||
{
|
||||
color: rgb(132, 132, 132);
|
||||
padding-left: 10px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
/* 日志 */
|
||||
|
||||
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block move %}
|
||||
<div id="class">
|
||||
<h1></h1>
|
||||
<h1>更多</h1>
|
||||
my plan
|
||||
<br>
|
||||
<br>
|
||||
essay
|
||||
</div>
|
||||
|
||||
<style>
|
||||
#class {
|
||||
margin: 0 0 0 0;
|
||||
margin-left: 5%;
|
||||
width: 90%;
|
||||
height: 640px;
|
||||
background-color: #93B9FFA4;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
40
templates/blog/include/footer.html
Normal file
40
templates/blog/include/footer.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<footer style="
|
||||
text-align: center;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
color: rgb(255, 255, 255);
|
||||
padding: 10px;
|
||||
margin-top: 0;
|
||||
">
|
||||
<div style="text-align: left;">
|
||||
无情ta站:
|
||||
<a href="https://1win.eu.org/" style="color: rgb(188, 188, 255);">1win</a>
|
||||
<a href="https://jvav.1win.eu.org/" style="color: rgb(188, 188, 255);">jvav</a>
|
||||
</div>
|
||||
<hr>
|
||||
© 2025-2026 | open-ww3-poject for ww3.tw
|
||||
<br>
|
||||
<a href="https://wiki.ww3.tw/doku.php?id=zh_cn:skimrme" style="color: rgb(188, 188, 255);">关于站长</a>
|
||||
<a href="{{ url_for('blog.sitemap') }}" style="color: rgb(188, 188, 255);">网页地图</a>
|
||||
<a href="{{ url_for('blog.messages') }}" style="color: rgb(188, 188, 255);">留言小角</a>
|
||||
<br>
|
||||
<br>
|
||||
联系:
|
||||
<br>
|
||||
电子邮件: <a style="color: rgb(188, 188, 255);">master@ww3.tw<a>
|
||||
<br>
|
||||
社交:
|
||||
<br>
|
||||
暂不提供
|
||||
<br>
|
||||
其他平台:
|
||||
<br>
|
||||
<br>
|
||||
暂不提供
|
||||
<br>
|
||||
<br>
|
||||
备案区:
|
||||
<br>
|
||||
<a href="https://icp.hentioe.dev/sites/20257900" target="_blank">喵ICP备20257900号</a>
|
||||
<br>
|
||||
<a href="https://icp.redcha.cn/beian/ICP-2026010278.html" title="茶ICP备2026010278号" target="_blank">茶ICP备2026010278号</a>
|
||||
</footer>
|
||||
5
templates/blog/include/head.html
Normal file
5
templates/blog/include/head.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<head>
|
||||
<meta charset="utf-8" lang="zh_CN">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=0.4">
|
||||
<link rel="icon" type="image/x-icon" href="/static/icon/original.ico">
|
||||
</head>
|
||||
19
templates/blog/include/navbar.html
Normal file
19
templates/blog/include/navbar.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{# navbar 部分 #}
|
||||
|
||||
{% set navbar_list = [
|
||||
{"id":1, "name": "首页", "url": url_for('blog.home')},
|
||||
{"id":2, "name": "关于", "url": url_for('blog.about')},
|
||||
{"id":3, "name": "文章", "url": url_for('blog.posts_list')},
|
||||
{"id":4, "name": "mirrors", "url": url_for('blog.autoindex')},
|
||||
{"id":5, "name": "study", "url": url_for('study.home')},
|
||||
]%}
|
||||
<div id="navbar1">
|
||||
<br>
|
||||
</div>
|
||||
<div id="navbar" style="text-align: left;">
|
||||
{% for navbar in navbar_list %}
|
||||
<a href="{{ navbar.url }}" id="url_">{{ navbar.name }}</a></td>
|
||||
{% endfor %}
|
||||
<a id="url_" href="https://api.ww3.tw">api</a>
|
||||
<a id="url_" href="https://gitea.ww3.tw">gitea</a>
|
||||
</div>
|
||||
52
templates/blog/include/wallpaper.html
Normal file
52
templates/blog/include/wallpaper.html
Normal file
@@ -0,0 +1,52 @@
|
||||
{# 壁纸部分 #}
|
||||
{% set wallpaper_apis =[
|
||||
'https://www.loliapi.com/acg/pc/',
|
||||
'https://api.sretna.cn/api/pc.php',
|
||||
'https://www.api.plus/API/dongman/',
|
||||
'https://moe.jitsu.top/img/?sort=pc',
|
||||
'https://www.dmoe.cc/random.php',
|
||||
'https://api.mtyqx.cn/tapi/random.php'] %}
|
||||
{% set wallpaper = wallpaper_apis | random %}
|
||||
<!--'https://api.r10086.com/樱道随机图片api接口.php?图片系列=猫娘1', -->
|
||||
|
||||
<head>
|
||||
<link rel="preload" href="{{ wallpaper }}" as="image">
|
||||
</head>
|
||||
<div style="display: none;">
|
||||
<p>一个致力于分享个人学习到的知识的记录形式的屑站</p>
|
||||
<p>在这里,我会分享我学到的计算机知识或者记录一些自己经常碰到的问题</p>
|
||||
</div>
|
||||
<div id="wallpaper">
|
||||
{% include 'blog/include/navbar.html' %}
|
||||
<br>
|
||||
<div style="text-align: center;
|
||||
font-weight: bolder;
|
||||
text-shadow:
|
||||
3px 3px 0 rgba(0,0,0,0.2),
|
||||
6px 6px 0 rgba(0,0,0,0.1);
|
||||
font-size: 300%;
|
||||
color: rgb(240, 248, 255);
|
||||
">
|
||||
<p>open-ww3-poject</p>
|
||||
</div>
|
||||
<div>
|
||||
<p style="text-align: right; margin: 420px 0 0 0;">图片来源: <a href="{{ wallpaper }}" style="color: rgb(247, 74, 74);">{{ wallpaper }}<a></p>
|
||||
</div>
|
||||
<div style="text-align: center; color: rgba(255, 255, 255, 0.664); margin: -400px 0 0 0; text-shadow: 3px 3px 5px rgba(47, 79, 79, 0.7);">
|
||||
<p>一个致力于分享个人学习到的知识的记录形式的屑站</p>
|
||||
<p>在这里,我会分享我学到的计算机知识或者记录一些自己经常碰到的问题</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
#wallpaper {
|
||||
margin-left: 5%;
|
||||
width: 90%;
|
||||
height: 640px;
|
||||
background-color: #93B9FFA4;
|
||||
background-image: url('{{ wallpaper }}');
|
||||
background-size: 100% 100%;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
}
|
||||
</style>
|
||||
54
templates/blog/list.html
Executable file
54
templates/blog/list.html
Executable file
@@ -0,0 +1,54 @@
|
||||
{# 引入base #}
|
||||
{% extends 'blog/extension/base.html' %}
|
||||
|
||||
{# 引入标题 #}
|
||||
{% block title %}文章列表{% endblock %}
|
||||
|
||||
{% include 'blog/include/head.html' %}
|
||||
|
||||
{# 随机变换图床api #}
|
||||
{% set wallpaper_apis =[
|
||||
'https://www.loliapi.com/acg/pc/',
|
||||
'https://api.sretna.cn/api/pc.php',
|
||||
'https://www.api.plus/API/dongman/',
|
||||
'https://moe.jitsu.top/img/?sort=pc',
|
||||
'https://www.dmoe.cc/random.php',
|
||||
'https://api.r10086.com/樱道随机图片api接口.php?图片系列=猫娘1',
|
||||
'https://api.mtyqx.cn/tapi/random.php'] %}
|
||||
{% set wallpaper = wallpaper_apis | random %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'blog/include/navbar.html' %}
|
||||
<center><b><h2>全部文章</h2></b></center>
|
||||
文章如下↓
|
||||
<br>
|
||||
<br>
|
||||
<div style="overflow: auto; height: 460px; width: 900px;">
|
||||
{% for posts in posts %}
|
||||
<br>
|
||||
文章id:{{ posts['id'] }}
|
||||
<br>
|
||||
文章标题:{{ posts['title'] }}
|
||||
<br>
|
||||
<a href="{{ url_for('blog.posts_list') }}{{ posts['id'] }}">页面跳转</a>__{{ posts['date'].replace('.', '-') }}
|
||||
<br>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<style>
|
||||
#content{
|
||||
/* background-image: url('{{ wallpaper }}'); */
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.div123content {
|
||||
background-color: blue;
|
||||
width: auto;
|
||||
height: 300px;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
28
templates/blog/mirrors.html
Executable file
28
templates/blog/mirrors.html
Executable file
@@ -0,0 +1,28 @@
|
||||
{% extends '__autoindex__/autoindex.html' %}
|
||||
|
||||
{% block header %}
|
||||
<h1 style="width: 80%; background-color: #fbecec7d; margin-left: auto; margin-right: auto;">index of .</h1>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<style>
|
||||
body {
|
||||
background-image: url('https://moe.jitsu.top/img/?sort=pc');
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat; /*禁止平铺*/
|
||||
margin: 0; /* 外边框为0 */
|
||||
}
|
||||
table {
|
||||
width: 80%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
<hr>
|
||||
<div style="color: #fb8888; text-align: center;">
|
||||
© 2025 open-ww3-project
|
||||
</div>
|
||||
{% endblock %}
|
||||
33
templates/blog/posts.html
Executable file
33
templates/blog/posts.html
Executable file
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ posts['title'] }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="/blog">返回主页</a>
|
||||
<br>
|
||||
<h1>{{ posts['title'] }}</h1>
|
||||
<br>
|
||||
<br>
|
||||
{{ posts['content'].replace('&a&a','<style>a{text-decoration: none;}</style>') | safe}}
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<h2>留言区: </h2>
|
||||
{% for message in message %}
|
||||
[ {{ message['name'] }} ] >$
|
||||
{{ message['content'] }}<br>
|
||||
{{ message['date'] }}
|
||||
<br>
|
||||
<br>
|
||||
{% endfor %}
|
||||
</body>
|
||||
</html>
|
||||
<style>
|
||||
body {
|
||||
background-color: rgb(175, 223, 255);
|
||||
}
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
29
templates/blog/sitemap.xml
Executable file
29
templates/blog/sitemap.xml
Executable file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>{{ base_url }}</loc>
|
||||
<lastmod>2025-12-22</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
{% for post in posts %}
|
||||
<url>
|
||||
<loc>{{ base_url }}posts/{{ post['id'] }}/</loc>
|
||||
<lastmod>{{ post['date'].replace('.', '-') }}</lastmod>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
{% endfor %}
|
||||
<url>
|
||||
<loc>{{ base_url }}posts/</loc>
|
||||
<lastmod>2025-12-23</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>{{ base_url }}mirrors/</loc>
|
||||
<lastmod>2025-12-23</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
</urlset>
|
||||
19
templates/blog/upload.html
Normal file
19
templates/blog/upload.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<title>上传文件</title>
|
||||
上传文件
|
||||
<br>
|
||||
目前只支持jpg, jpeg, png, gif
|
||||
<form id="upload-form" enctype="multipart/form-data" method="post" action="./">
|
||||
<input type="file" name="img" required>
|
||||
<button type="submit">上传文件</button>
|
||||
</form>
|
||||
<br>
|
||||
<br>
|
||||
已上传图片
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
{% for image in images %}
|
||||
<a href="{{ url_for('static', filename='upload/img/' + image) }}">
|
||||
<img src="{{ url_for('static', filename='upload/img/' + image) }}" style="width: 10%;" alt="{{ image }}">
|
||||
</a>
|
||||
{% endfor %}
|
||||
12
templates/study/about.html
Executable file
12
templates/study/about.html
Executable file
@@ -0,0 +1,12 @@
|
||||
{# 引入base #}
|
||||
{% extends 'study/base.html' %}
|
||||
|
||||
{# 网站标签 #}
|
||||
{% block title %} 关于页面 {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
大家好......
|
||||
没有了
|
||||
|
||||
{% endblock %}
|
||||
61
templates/study/base.html
Executable file
61
templates/study/base.html
Executable file
@@ -0,0 +1,61 @@
|
||||
{# base模板 #}
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" lang="zh_CN">
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
<!--link rel="stylesheet" href="/static/css/style.css"-->
|
||||
{# 建立一个url,来源于static文件夹的,文件名字为css文件夹下的style.css #}
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<div style="width: 100%; background-color: rgb(122, 91, 246);">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="url">
|
||||
<a href="/study" class="url">home</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="url">
|
||||
<!--a href="/study/about" class="url">about</a-->
|
||||
<a href="{{ url_for('study.about')}}" class="url">about</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="margin: -5px 0 0 10px;" class="url" x-data="{ open: false }">
|
||||
<div class="url" @click="open = true">子功能</div>
|
||||
<div x-show="open" @click.away="open = false">
|
||||
<div>
|
||||
<a href="/study/posts/new" class="url">新建文章</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{% for message in get_flashed_messages() %}
|
||||
<div>{{ message }}</div>
|
||||
{% endfor %}
|
||||
|
||||
{% block content %} {% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<style>
|
||||
body {
|
||||
margin: 0 0 0 0;
|
||||
background-color: rgb(157, 209, 255);
|
||||
}
|
||||
|
||||
.url {
|
||||
height: 40px;
|
||||
margin: 10px 0 0 10px;
|
||||
color: rgb(0, 0, 0);
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="{{ url_for('static', filename='js/alpine.js') }}">vue_global</script>
|
||||
5
templates/study/delete.html
Executable file
5
templates/study/delete.html
Executable file
@@ -0,0 +1,5 @@
|
||||
<b>确定要删除 "{{ posts['title'] }}" 吗?</b>
|
||||
|
||||
<form action="{{ url_for('study.delete_posts_id', posts_id=posts['id']) }}" method="post">
|
||||
<input type="submit" value="删除文章" class="btn btn-danger htn-sm" onclick="return confirm('确定要删除吗')">
|
||||
</form>
|
||||
25
templates/study/edit.html
Executable file
25
templates/study/edit.html
Executable file
@@ -0,0 +1,25 @@
|
||||
{# 引入base #}
|
||||
{% extends 'study/base.html' %}
|
||||
|
||||
{# 网站标签 #}
|
||||
{% block title %} 编辑 "{{ posts['title'] }}" {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<form method="post">
|
||||
<div class="form-group">
|
||||
<label for="title">标题</label>
|
||||
<input type="text" name="title" placeholder="标题" class="form-control" value="{{ request.form['title'] or posts['title'] }}">
|
||||
</inpit>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="content">内容</label>
|
||||
<textarea name="content" placeholder="文章内容" class="form-control">{{ request.form['content'] or posts['content'] }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
20
templates/study/home.html
Executable file
20
templates/study/home.html
Executable file
@@ -0,0 +1,20 @@
|
||||
{# 引入base #}
|
||||
{% extends 'study/base.html' %}
|
||||
|
||||
{# 网站标签 #}
|
||||
{% block title %}study学习{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>学习如何搭建一个blog</h1>
|
||||
<h2>欢迎访问一个学习如何搭建一个blog的页面</h2>
|
||||
|
||||
{% for posts in posts %}
|
||||
<a href="/study/posts/{{ posts['id'] }}">
|
||||
<!--a href="{{ url_for('study.show_posts_id', posts_id=posts['id']) }}"-->
|
||||
<h2>{{ posts['title'] }}</h2>
|
||||
</a>
|
||||
<span>{{ posts['created_8'] }}</span>
|
||||
<hr>
|
||||
<br>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
27
templates/study/new.html
Executable file
27
templates/study/new.html
Executable file
@@ -0,0 +1,27 @@
|
||||
{# 引入base #}
|
||||
{% extends 'study/base.html' %}
|
||||
|
||||
{# 网站标签 #}
|
||||
{% block title %} 新建文章 {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<form method="post">
|
||||
<div class="form-group">
|
||||
<label for="title">标题</label>
|
||||
<input type="text" name="title" placeholder="标题" class="form-control" value="{{ request.form['title'] }}">
|
||||
</inpit>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="content">内容</label>
|
||||
<textarea name="content" placeholder="文章内容" class="form-control">{{ request.form['content'] }}</textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
19
templates/study/posts.html
Executable file
19
templates/study/posts.html
Executable file
@@ -0,0 +1,19 @@
|
||||
{# 引入base #}
|
||||
{% extends 'study/base.html' %}
|
||||
|
||||
{# 网站标签 #}
|
||||
{% block title %} {{ posts['title'] }} {% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ posts['title'] }}</h1>
|
||||
<span>{{ posts['created_8'] }}</span>
|
||||
<a href="./{{ posts['id'] }}/edit">
|
||||
<span>编辑</span>
|
||||
</a>
|
||||
<hr>
|
||||
|
||||
<p>{{ posts['content'] }}</p>
|
||||
|
||||
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user