Skip to content

Commit 9ccb99a

Browse files
author
y-yamasaki
committed
ブログ追加
1 parent 30b6445 commit 9ccb99a

51 files changed

Lines changed: 3877 additions & 2770 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

WebSite/assets/data/blogList.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
[
2+
{
3+
"id": "blog_00025",
4+
"title": "Discordサーバーの運用設計について",
5+
"date": "2026-01-05T00:00:00.000Z",
6+
"category": "Discord",
7+
"description": "コミュニケーションの性質(流動情報・固定情報・継続タスクなど)ごとに最適なチャンネル種類やフォーラム活用法、カテゴリ設計、ルール策定と運用の考え方を実例とともに丁寧に解説します。コミュニティ/チームどちらの用途にも応用できる実践的な設計指針です。",
8+
"tags": [
9+
"discord"
10+
],
11+
"thumbnail": "assets/img/thumbnails/blog_00025.png",
12+
"contentPath": "blog/blog_00025.html",
13+
"recommended": true
14+
},
215
{
316
"id": "blog_00024",
417
"title": "Zed IDE keymap.jsonのすすめ",

WebSite/assets/data/blogList_en.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
[
2+
{
3+
"id": "blog_00025",
4+
"title": "Designing Discord Server Operations",
5+
"date": "2026-01-05T00:00:00.000Z",
6+
"category": "Discord",
7+
"description": "This article presents practical design principles for structuring and operating a Discord server according to the nature of communication (transient messages, static resources, ongoing tasks, and knowledge sharing). It covers appropriate channel types, forum utilization, category layout, policy definition, and operational examples applicable to both community and team contexts.",
8+
"tags": [
9+
"discord"
10+
],
11+
"thumbnail": "assets/img/thumbnails/blog_00025.png",
12+
"contentPath": "blog/en/blog_00025.html",
13+
"recommended": true
14+
},
215
{
316
"id": "blog_00024",
417
"title": "Recommended Zed `keymap.json` Settings",

WebSite/assets/dist/scripts.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
37.1 KB
Loading
70.4 KB
Loading
92 KB
Loading
32.6 KB
Loading

WebSite/assets/js/layout.js

Lines changed: 112 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,122 @@ document.addEventListener("DOMContentLoaded", () => {
2525
return window.matchMedia("(max-width: 768px)").matches;
2626
}
2727

28-
// ヘルパー: layout.js の読み込みパスから partials の相対パスを返す
28+
// ヘルパー: layout.js の読み込みパスから partials の相対パスを返す(堅牢化)
2929
function getPartialsPath() {
30-
const scripts = document.getElementsByTagName("script");
31-
for (let i = 0; i < scripts.length; i++) {
32-
const src = scripts[i].getAttribute("src");
33-
if (src && src.endsWith("layout.js")) {
34-
const prefix = src.replace(
35-
"assets/js/layout.js",
36-
"",
37-
);
30+
try {
31+
// 1) 最も確実: document.currentScript(外部スクリプト・インライン両対応)
32+
if (
33+
typeof document !== "undefined" &&
34+
document.currentScript &&
35+
document.currentScript.src
36+
) {
37+
try {
38+
const cur = document.currentScript.src || "";
39+
if (cur.indexOf("layout.js") !== -1) {
40+
// prefix を assets/js/layout.js 部分で切り出す。末尾スラッシュは常に確保する。
41+
const prefix = cur.replace(
42+
"assets/js/layout.js",
43+
"",
44+
);
45+
return (
46+
(prefix.endsWith("/") ? prefix : prefix) +
47+
"partials/"
48+
);
49+
}
50+
} catch (e) {
51+
// 無視してフォールバックへ
52+
if (window && window.__DEBUG_LAYOUT__) {
53+
console.debug(
54+
"getPartialsPath: currentScript parsing failed",
55+
e,
56+
);
57+
}
58+
}
59+
}
60+
61+
// 2) グローバルで明示的に指定されていればそれを使う(ビルドやページで注入可能)
62+
if (
63+
typeof window !== "undefined" &&
64+
window.__PARTIALS_PREFIX
65+
) {
66+
const p = window.__PARTIALS_PREFIX;
67+
const prefix = String(p).replace(/\/+$/, "") + "/";
3868
return prefix + "partials/";
3969
}
70+
71+
// 3) メタタグでページ単位に指定されていればそれを使う
72+
if (typeof document !== "undefined") {
73+
const meta = document.querySelector(
74+
'meta[name="partials-prefix"]',
75+
);
76+
if (meta) {
77+
const content =
78+
meta.getAttribute("content") || "";
79+
if (content.length > 0) {
80+
const prefix =
81+
content.replace(/\/+$/, "") + "/";
82+
return prefix + "partials/";
83+
}
84+
}
85+
}
86+
87+
// 4) 既存のスクリプトタグ探索(互換性保守)
88+
if (typeof document !== "undefined") {
89+
const scripts =
90+
document.getElementsByTagName("script");
91+
for (let i = 0; i < scripts.length; i++) {
92+
const src = scripts[i].getAttribute("src");
93+
if (src && src.indexOf("layout.js") !== -1) {
94+
// 元の実装と互換するために assets/js/layout.js 部分を取り除く
95+
try {
96+
if (
97+
src.indexOf("assets/js/layout.js") !== -1
98+
) {
99+
const prefix = src.replace(
100+
"assets/js/layout.js",
101+
"",
102+
);
103+
return (
104+
(prefix.endsWith("/") ? prefix : prefix) +
105+
"partials/"
106+
);
107+
} else {
108+
// layout.js を検出したがパスに assets/js/layout.js が含まれない場合は
109+
// src のディレクトリ部分を prefix として扱う
110+
const idx = src.lastIndexOf("/");
111+
const dir =
112+
idx !== -1 ? src.slice(0, idx + 1) : "";
113+
return (
114+
(dir.endsWith("/") ? dir : dir) +
115+
"partials/"
116+
);
117+
}
118+
} catch (e) {
119+
// 続行してフォールバック
120+
if (window && window.__DEBUG_LAYOUT__) {
121+
console.debug(
122+
"getPartialsPath: script scan parsing failed",
123+
e,
124+
);
125+
}
126+
}
127+
}
128+
}
129+
}
130+
} catch (e) {
131+
// ここまで来ても失敗した場合は下のフォールバックへ
132+
if (
133+
typeof window !== "undefined" &&
134+
window.__DEBUG_LAYOUT__
135+
) {
136+
console.debug(
137+
"getPartialsPath: unexpected error",
138+
e,
139+
);
140+
}
40141
}
142+
143+
// 5) 最終フォールバック(従来の動作を保つ)
41144
return "partials/";
42145
}
43146

WebSite/blog.amp.html

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
<!doctype html>
2-
<html amp lang="ja">
3-
<head>
4-
<meta charset="utf-8" />
5-
<meta
6-
name="viewport"
7-
content="width=device-width,minimum-scale=1,initial-scale=1"
8-
/>
1+
<!DOCTYPE html><html amp="" lang="ja"><head>
2+
<meta charset="utf-8">
3+
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
94
<title>PanKUN | Blog(AMP)</title>
10-
<link
11-
rel="canonical"
12-
href="https://breadmotion.github.io/WebSite/blog.html"
13-
/>
14-
<style amp-boilerplate>
5+
<link rel="canonical" href="https://breadmotion.github.io/WebSite/blog.amp.html">
6+
<style amp-boilerplate="">
157
body {
168
-webkit-animation: -amp-start 8s
179
steps(1, end) 0s 1 normal both;
@@ -63,21 +55,16 @@
6355
}
6456
}
6557
</style>
66-
<noscript
67-
><style amp-boilerplate>
58+
<noscript><style amp-boilerplate>
6859
body {
6960
-webkit-animation: none;
7061
-moz-animation: none;
7162
-ms-animation: none;
7263
animation: none;
7364
}
74-
</style></noscript
75-
>
76-
<script
77-
async
78-
src="https://cdn.ampproject.org/v0.js"
79-
></script>
80-
<style amp-custom>
65+
</style></noscript>
66+
<script async="" src="https://cdn.ampproject.org/v0.js"></script>
67+
<style amp-custom="">
8168
body {
8269
font-family:
8370
-apple-system, BlinkMacSystemFont,
@@ -127,12 +114,9 @@
127114
"url": "https://breadmotion.github.io/WebSite/blog.html"
128115
}
129116
</script>
130-
</head>
117+
<link rel="stylesheet" href="assets/dist/styles.min.css"><meta property="og:url" content="https://breadmotion.github.io/WebSite/blog.amp.html"></head>
131118
<body>
132-
<amp-auto-ads
133-
type="adsense"
134-
data-ad-client="ca-pub-5284984614496391"
135-
>
119+
<amp-auto-ads type="adsense" data-ad-client="ca-pub-5284984614496391">
136120
</amp-auto-ads>
137121
<div class="container">
138122
<h1>PanKUN Blog</h1>
@@ -141,14 +125,15 @@ <h1>PanKUN Blog</h1>
141125
ツール開発などゲーム制作まわりの技術メモやナレッジをまとめています。
142126
</p>
143127
<p>
144-
このページはAMP版のプレースホルダーです。<br />
128+
このページはAMP版のプレースホルダーです。<br>
145129
完全な機能を備えたブログ一覧は通常版をご覧ください。
146130
</p>
147-
<a
148-
href="https://breadmotion.github.io/WebSite/blog.html"
149-
class="btn"
150-
>ブログ一覧を見る</a
151-
>
131+
<a href="https://breadmotion.github.io/WebSite/blog.html" class="btn">ブログ一覧を見る</a>
152132
</div>
153-
</body>
154-
</html>
133+
134+
135+
136+
<script src="assets/js/layout.js"></script>
137+
<script src="assets/dist/scripts.min.js" defer=""></script>
138+
<script src="assets/js/particles.js"></script>
139+
</body></html>

0 commit comments

Comments
 (0)