--
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
{% extends "/base.html" %}
|
||||
{% block title %}About Nercone{% endblock %}
|
||||
{% block title_prefix %}About{% endblock %}
|
||||
{% block description %}Nerconeについて{% endblock %}
|
||||
{% block content %}
|
||||
<p>思いついたものを適当に作っているただの学生です。</p>
|
||||
<p>作ろうと思ったものをとりあえず作ってみていったらいつの間にかこうなってました。</p>
|
||||
<p>低レイヤに興味を持ちつつ結局いつもPythonを使ってしまう残念な人です。</p>
|
||||
<p>名前からもわかると思いますが圧倒的猫派です。理由?可愛いからに決まってるじゃないですか。</p>
|
||||
<h3>今の目標</h3>
|
||||
<p><!-- てとらさんと結婚することと、-->カーネルレベルからOSを作ることと、Linuxディストリビューションを作ることと、会社建てるかAppleに入ること。</p>
|
||||
<h3>興味</h3>
|
||||
<p><!-- てとらさん, -->Apple, macOS, ARM, Linux, 自作OS, OSINT, 機械学習 など</p>
|
||||
<!-- <p>好きな人: てとらさん</p> -->
|
||||
<!-- <p>大好きな人: てとらさん</p> -->
|
||||
<!-- <p>最高な人: てとらさん</p> -->
|
||||
<!-- <p>この世で一番好きな人: てとらさん</p> -->
|
||||
<!-- <p>性癖: てとらさん</p> -->
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
title: About Nercone
|
||||
title_prefix: About
|
||||
description: Nerconeについて
|
||||
---
|
||||
|
||||
思いついたものを適当に作っているただの学生です。
|
||||
|
||||
作ろうと思ったものをとりあえず作ってみていったらいつの間にかこうなってました。
|
||||
|
||||
低レイヤに興味を持ちつつ結局いつもPythonを使ってしまう残念な人です。
|
||||
|
||||
名前からもわかると思いますが圧倒的猫派です。理由?可愛いからに決まってるじゃないですか。
|
||||
|
||||
### 今の目標
|
||||
<!-- てとらさんと結婚することと、-->カーネルレベルからOSを作ることと、Linuxディストリビューションを作ることと、会社建てるかAppleに入ること。
|
||||
|
||||
### 興味
|
||||
<!-- てとらさん, -->Apple, macOS, ARM, Linux, 自作OS, OSINT, 機械学習 など
|
||||
|
||||
<!-- ### その他 -->
|
||||
<!-- **好きな人:** てとらさん -->
|
||||
<!-- **大好きな人:** てとらさん -->
|
||||
<!-- **最高な人:** てとらさん -->
|
||||
<!-- **この世で一番好きな人:** てとらさん -->
|
||||
<!-- **性癖:** てとらさん -->
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="_レイヤー_1" data-name="レイヤー 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 256">
|
||||
<defs>
|
||||
<style>
|
||||
.cls-1 {
|
||||
font-family: MesloBIZUD-Regular, 'Meslo BIZUD';
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.cls-1, .cls-2, .cls-3, .cls-4 {
|
||||
fill: #939393;
|
||||
}
|
||||
|
||||
.cls-3 {
|
||||
font-family: InterBIZUD-Regular, 'Inter BIZUD';
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.cls-4 {
|
||||
font-family: InterBIZUD-Bold, 'Inter BIZUD';
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.cls-5, .cls-8 {
|
||||
fill: #c84040;
|
||||
}
|
||||
|
||||
.cls-5 {
|
||||
font-family: InterBIZUD-Bold, 'Inter BIZUD';
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.cls-6 {
|
||||
fill: #4d4d4d;
|
||||
}
|
||||
|
||||
.cls-9 {
|
||||
fill: #333;
|
||||
}
|
||||
|
||||
.cls-10 {
|
||||
fill: #1a1a1a;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<rect class="cls-10" width="512" height="256"/>
|
||||
<g>
|
||||
<polygon class="cls-9" points="0 128 0 256 512 256 512 213.33 0 128"/>
|
||||
<polygon class="cls-6" points="512 128 512 256 256 256 512 128"/>
|
||||
</g>
|
||||
<path class="cls-2" d="M483.6,230.12h-14.05v-3.01h11.04v-5.39l-10.16-3.4-11.8,11.8h-26.22v-27.69l37.21,12.44,13.99-13.99v29.24ZM435.41,227.11h21.96l9.86-9.86-31.82-10.64v20.5ZM472.8,215.94l7.78,2.6v-10.39l-7.78,7.78Z"/>
|
||||
<rect class="cls-8" width="512" height="8"/>
|
||||
<text class="cls-5" transform="translate(465.2 23.25)"><tspan x="0" y="0">ERROR</tspan></text>
|
||||
<text class="cls-1" transform="translate(14.57 23.25)"><tspan x="0" y="0">__PATH__</tspan></text>
|
||||
<text class="cls-4" transform="translate(13.72 54.58)"><tspan x="0" y="0">__TITLE__</tspan></text>
|
||||
<text class="cls-3" transform="translate(14.34 72.64)"><tspan x="0" y="0">__DESCRIPTION__</tspan></text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="_レイヤー_1" data-name="レイヤー 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 256">
|
||||
<defs>
|
||||
<style>
|
||||
.cls-1 {
|
||||
font-family: MesloBIZUD-Regular, 'Meslo BIZUD';
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.cls-1, .cls-2, .cls-3, .cls-4 {
|
||||
fill: #939393;
|
||||
}
|
||||
|
||||
.cls-3 {
|
||||
font-family: InterBIZUD-Regular, 'Inter BIZUD';
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.cls-5 {
|
||||
fill: #4d4d4d;
|
||||
}
|
||||
|
||||
.cls-4 {
|
||||
font-family: InterBIZUD-Bold, 'Inter BIZUD';
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.cls-6 {
|
||||
fill: #333;
|
||||
}
|
||||
|
||||
.cls-7 {
|
||||
fill: #1a1a1a;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<rect class="cls-7" width="512" height="256"/>
|
||||
<g>
|
||||
<polygon class="cls-6" points="0 128 0 256 512 256 512 213.33 0 128"/>
|
||||
<polygon class="cls-5" points="512 128 512 256 256 256 512 128"/>
|
||||
</g>
|
||||
<path class="cls-2" d="M483.6,230.12h-14.05v-3.01h11.04v-5.39l-10.16-3.4-11.8,11.8h-26.22v-27.69l37.21,12.44,13.99-13.99v29.24ZM435.41,227.11h21.96l9.86-9.86-31.82-10.64v20.5ZM472.8,215.94l7.78,2.6v-10.39l-7.78,7.78Z"/>
|
||||
<text class="cls-1" transform="translate(14.57 23.25)"><tspan x="0" y="0">__PATH__</tspan></text>
|
||||
<text class="cls-4" transform="translate(13.72 54.58)"><tspan x="0" y="0">__TITLE__</tspan></text>
|
||||
<text class="cls-3" transform="translate(14.34 72.64)"><tspan x="0" y="0">__DESCRIPTION__</tspan></text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
+2
-2
@@ -29,14 +29,14 @@
|
||||
<meta property="og:site_name" content="nercone's website">
|
||||
<meta property="og:title" content="{{ self.title() }}">
|
||||
<meta property="og:description" content="{{ self.description() }}">
|
||||
<meta property="og:image" content="https://nercone.dev/assets/images/nercone.png">
|
||||
<meta property="og:image" content="https://nercone.dev/assets/thumbnail/{{ request.url.path.lstrip('/') }}?title={{ self.title() | urlencode }}&description={{ self.description() | urlencode }}&template={% block thumbnail_template %}normal{% endblock %}">
|
||||
<meta property="og:url" content="https://nercone.dev/">
|
||||
<meta property="og:type" content="website">
|
||||
<!-- Twitter -->
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="{{ self.title() }}">
|
||||
<meta name="twitter:description" content="{{ self.description() }}">
|
||||
<meta name="twitter:image" content="https://nercone.dev/assets/images/nercone.png">
|
||||
<meta name="twitter:image" content="https://nercone.dev/assets/thumbnail/{{ request.url.path.lstrip('/') }}?title={{ self.title() | urlencode }}&description={{ self.description() | urlencode }}&template={{ self.thumbnail_template() }}">
|
||||
<!-- PWA (Progressive Web App) -->
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
<link rel="apple-touch-icon" href="/assets/images/favicon.png" sizes="1200x1200">
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
{% block title %}{{ status_code }} {{ status_code_name }} - Nercone{% endblock %}
|
||||
{% block title_suffix %}{{ status_code }}{% endblock %}
|
||||
{% block header_desc %}<span class="text-tx-alt">{{ joke_message }}</span>{% endblock %}
|
||||
{% block description %}{{ message }}{% endblock %}
|
||||
{% block thumbnail_template %}error{% endblock %}
|
||||
{% block content %}
|
||||
<h1 class="font-bold">{{ status_code }} {{ status_code_name }}</h1>
|
||||
<p>{{ message }}</p>
|
||||
|
||||
@@ -7,6 +7,7 @@ name = "nercone-website"
|
||||
version = "1.0.0"
|
||||
requires-python = ">=3.8"
|
||||
dependencies = [
|
||||
"resvg-py",
|
||||
"rjsmin",
|
||||
"rcssmin",
|
||||
"mistune",
|
||||
|
||||
@@ -3,6 +3,8 @@ import json
|
||||
import yaml
|
||||
import random
|
||||
import mistune
|
||||
import resvg_py
|
||||
from html import escape
|
||||
from pathlib import Path
|
||||
from bs4 import BeautifulSoup
|
||||
from markitdown import MarkItDown
|
||||
@@ -99,6 +101,32 @@ welcome to nercone.dev!
|
||||
async def fake_error_page(request: Request, code: str):
|
||||
return error_page(templates=templates, request=request, status_code=int(code))
|
||||
|
||||
@app.api_route("/assets/thumbnail/{path:path}", methods=["GET"])
|
||||
async def thumbnail(request: Request, path: str) -> Response:
|
||||
title = request.query_params.get("title", "Untitled Page")
|
||||
description = request.query_params.get("description", "No description.")
|
||||
template_type = request.query_params.get("template", "normal")
|
||||
|
||||
parts = [p for p in path.strip("/").split("/") if p]
|
||||
path_display = "nercone.dev / " + " / ".join(parts) if parts else "nercone.dev"
|
||||
|
||||
svg_filename = "error.svg" if template_type == "error" else "normal.svg"
|
||||
fonts_dir = Path.cwd().joinpath("public", "assets", "fonts")
|
||||
|
||||
svg_path = Path.cwd().joinpath("public", "assets", "thumbnails", svg_filename)
|
||||
svg = svg_path.read_text(encoding="utf-8")
|
||||
svg = svg.replace("__PATH__", escape(path_display))
|
||||
svg = svg.replace("__TITLE__", escape(title))
|
||||
svg = svg.replace("__DESCRIPTION__", escape(description))
|
||||
|
||||
font_files = [
|
||||
str(fonts_dir / "MesloBIZUD-Regular.ttf"),
|
||||
str(fonts_dir / "InterBIZUD-Regular.ttf"),
|
||||
str(fonts_dir / "InterBIZUD-Bold.ttf"),
|
||||
]
|
||||
png = resvg_py.svg_to_bytes(svg, font_files=font_files, width=1200, height=600)
|
||||
return Response(content=png, media_type="image/png")
|
||||
|
||||
@app.api_route("/{full_path:path}", methods=["GET", "POST", "HEAD"])
|
||||
async def default_response(request: Request, full_path: str) -> Response:
|
||||
if not full_path.endswith(".html") and not full_path.endswith(".md"):
|
||||
|
||||
Reference in New Issue
Block a user