修改主页,感觉还可以

This commit is contained in:
2025-12-27 13:35:20 +08:00
parent 7c94590c40
commit 8ca06abe4a
20 changed files with 353 additions and 337 deletions

31
templates/blog/about.html Executable file
View File

@@ -0,0 +1,31 @@
<html>
<head>
<!--meta http-equiv="refresh" content="2.0;url={{ url_for('blog.home') }}"-->
<title>关于</title>
<meta charset="utf-8" lang="zh-CN">
</head>
<body>
<a href="{{ url_for('blog.home') }}">返回首页</a>__<a href="{{ url_for('blog.sitemap') }}">网页地图</a>
<hr>
本站建立于大概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>
忘记写了
<br>
所以暂时就不写了
<p>2025.08.05</p>
<p>over</p>
</body>
</html>
<style>
a {
text-decoration: none;
}
</style>

83
templates/blog/home.html Normal file
View File

@@ -0,0 +1,83 @@
{# 引入base #}
{% extends 'blog/home_base.html' %}
{# 引入标题 #}
{% block title %}首页{% endblock %}
{% block logs_and_page %}
<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>
{% 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>
<!-- css 部分 -->
<style>
#posts {
margin: -20% 0 0 60%;
}
/* 日志 */
#logs
{
height: 220px;
width: 460px;
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 %}

View File

@@ -0,0 +1,142 @@
{# base模板 #}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" lang="zh_CN">
<link rel="icon" type="image/x-icon" href="/static/icon/original.ico">
<link rel="preload" href="{{ wallpaper }}" as="image">
<title>{% block title %}{% endblock %} | ww3</title>
</head>
<body>
{% 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')},
]%}
{% 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 %}
<div style="display: none;">
<p>一个致力于分享个人学习到的知识的记录形式的屑站</p>
<p>在这里,我会分享我学到的计算机知识或者记录一些自己经常碰到的问题</p>
</div>
<div id="wallpaper">
<div id="navbar1">
<br>
</div>
<div id="navbar">
{% 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>
<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>
<div id="logs_and_page">
{% block logs_and_page %}
{# 这里存放写入模板的数据 #}
{% endblock %}
</div>
<footer style="
text-align: center;
background-color: rgba(0, 0, 0, 0);
color: rgb(255, 255, 255);
padding: 10px;
margin-top: 0;
">
© 2025 | 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>
<br>
<br>
联系:
<br>
电子邮件: <a style="color: rgb(188, 188, 255);">master@ww3.tw<a>
<br>
社交:
<br>
暂不提供
</footer>
</body>
</html>
{# css部分 #}
<style>
#navbar {
width: 100%;
text-align: center;
}
#url_ {
margin: 0 5px 0 0;
color: black;
font-weight: bold;
}
#logs_and_page {
margin: 0 0 0 0;
margin-left: 5%;
width: 90%;
height: 640px;
background-color: #93B9FFA4;
}
#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;
}
#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>

100
templates/blog/list.html Executable file
View File

@@ -0,0 +1,100 @@
<!DOCTYPE id="html" html>
<html>
<head>
<link rel="icon" type="image/x-icon" href="https://ww3.tw/blog/icon/original.ico">
<title>文章列表</title> <!-- 标题 -->
</head>
<body id="wallpaper" >
<!-- 背景 -->
<div id="div_1">
<a href='{{ url_for("blog.home") }}' style='background-color: rgba(147, 185, 255, 0)'>返回首页</a>
<center id="center_2"><b><h2>全部文章</h2></b></center>
<br>
<div id="posts_list">文章如下↓</div>
<br>
<br>
<br>
<div id='content'>
{% for posts in posts %}
<div id="posts_bian_kuang">
<br>
<br>
文章id:{{ posts['id'] }}
<br>
文章标题:{{ posts['title'] }}
<br>
<a href="{{ url_for('blog.posts_list') }}{{ posts['id'] }}">页面跳转</a>__{{ posts['date'] }}
</div>
<br>
<br>
{% endfor %}
</div>
</div>
</body>
{# 随机变换图床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 %}
</html>
<style>
#center_2 {
width: 100%;
height: 40px;
background-color: rgba(255, 255, 255, 0.415);
text-align: center;
margin: -55px 0 0 0;
}
#posts_list {
width: 90px;
height: 30px;
background-color: rgba(255, 255, 255, 0.415);
}
#posts_bian_kuang {
width: 600px;
height: 200px;
background-color: rgba(255, 255, 255, 0.415);
}
a {
text-decoration: none;
}
html {
margin: 0 0 0 0;
}
#wallpaper {
background-image: url('{{ wallpaper }}');
background-size: cover;
background-repeat: no-repeat; /*禁止平铺*/
background-size: 100% 100%; /*图片占满100%*/
margin: 0; /* 外边框为0 */
/*padding: 0;*/
}
#div_1 {
height: 100%;
color: rgb(0, 0, 0);
font-size: 19px;
background-color: rgba(169, 169, 169, 0.212);
overflow-y: auto;
}
#content {
/* up、right、down、left */
margin: 0px 0px 0px 100px;
}
#wallpaper_url {
color: rgba(255, 0, 0, 0.354);
/* up、right、down、left */
margin: 20% 0px 0px 75%;
}
</style>

28
templates/blog/mirrors.html Executable file
View 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 %}

19
templates/blog/posts.html Executable file
View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<title>{{ posts['title'] }}</title>
</head>
<body>
<a href="../">返回上级</a>
<br>
<h1>{{ posts['title'] }}</h1>
<br>
<br>
{{ posts['content'].replace('&a&a','<style>a{text-decoration: none;}</style>') | safe}}
</body>
</html>
<style>
body {
background-color: rgb(175, 223, 255);
}
</style>

29
templates/blog/sitemap.xml Executable file
View 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>

View 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 %}