This repository has been archived on 2024-09-01. You can view files and clone it, but cannot push or open issues or pull requests.
study-area-cn.old/theme/index.hbs

240 lines
8.7 KiB
Handlebars
Raw Normal View History

<!DOCTYPE HTML>
<html lang="{{ language }}" dir="{{ text_direction }}" class="mdui-theme-auto" style="height:100%;width:100%">
2024-05-30 22:06:26 +08:00
<head>
2024-06-23 10:07:38 +08:00
<meta NAME="ROBOTS" CONTENT="INDEX,FOLLOW">
2024-08-25 16:08:59 +08:00
<!-- mdbook 内容 -->
2024-05-30 22:06:26 +08:00
<meta charset="UTF-8">
<title>{{ title }}</title>
{{#if is_print }}
<meta name="robots" content="noindex">
{{/if}}
{{#if base_url}}
<base href="{{ base_url }}">
{{/if}}
2024-08-25 16:08:59 +08:00
<!-- 自定义头部 html -->
2024-05-30 22:06:26 +08:00
{{> head}}
<!-- MDUI CSS&JS -->
<meta charset="UTF-8">
2024-08-25 17:40:52 +08:00
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="renderer" content="webkit" />
<link rel="stylesheet" href="{{ ../path_to_root }}theme/css/mdui.css">
<script src="{{ ../path_to_root }}theme/js/mdui.global.js"></script>
<link href="{{ ../path_to_root }}theme/css/icons.css" rel="stylesheet">
2024-08-25 16:08:59 +08:00
<!-- 搜索引擎描述 -->
2024-06-29 22:09:37 +08:00
<meta name="description" content="Study Area CN {{ description }}">
2024-05-30 22:06:26 +08:00
<meta name="theme-color" content="#ffffff">
2024-06-29 22:09:37 +08:00
<meta name="keywords"
content="Study-area, study-area, study-area-cn Study Area CN, study area cn, 酷学园, 酷学园 CN , 酷!学园, netman, linux, mdbook, rockylinux">
2024-05-30 22:06:26 +08:00
2024-08-25 16:08:59 +08:00
<!-- favicon -->
2024-05-30 22:06:26 +08:00
{{#if favicon_svg}}
2024-08-25 17:40:52 +08:00
<link rel="icon" href="{{ ../path_to_root }}favicon.png">
2024-05-30 22:06:26 +08:00
{{/if}}
{{#if favicon_png}}
2024-08-25 17:40:52 +08:00
<link rel="shortcut icon" href="{{ ../path_to_root }}favicon.png">
2024-05-30 22:06:26 +08:00
{{/if}}
2024-05-30 22:06:26 +08:00
{{#if print_enable}}
<link rel="stylesheet" href="{{ path_to_root }}css/print.css" media="print">
{{/if}}
<!-- Highlight.js Stylesheets -->
<link rel="stylesheet" href="{{ ../path_to_root }}theme/css/highlight.min.css">
<script src="{{ ../path_to_root }}theme/js/highlight.min.js"></script>
2024-05-30 22:06:26 +08:00
{{#if mathjax_support}}
<!-- MathJax -->
<script async src="{{ ../path_to_root }}theme/js/mathjax.js"></script>
2024-05-30 22:06:26 +08:00
{{/if}}
<link rel="stylesheet" href="{{ ../path_to_root }}theme/css/page.css">
2024-08-25 17:40:52 +08:00
<!-- 自定义字体 -->
<link href="{{ ../path_to_root }}theme/css/font.css" rel="stylesheet">
2024-05-30 22:06:26 +08:00
</head>
<body style="margin:0;padding:0;">
2024-08-25 16:08:59 +08:00
<!-- 打印页面输出目录 -->
{{#if is_print }}
{{#toc}}{{/toc}}
{{/if}}
<mdui-layout>
{{#unless is_print }}
2024-08-25 16:08:59 +08:00
<!-- 顶栏 -->
<mdui-top-app-bar class="topbar" scroll-behavior="elevate">
<mdui-button-icon icon="menu" id="open-drawer"></mdui-button-icon>
<mdui-button class="hideonmobile" id="open-study-env">实验环境</mdui-button>
<mdui-top-app-bar-title>{{ book_title }}</mdui-top-app-bar-title>
2024-08-25 16:08:59 +08:00
<div style="flex-grow: 1"></div> <!-- 横向填充 -->
<!-- 翻页 -->
2024-08-12 14:46:11 +08:00
<div class="navbtn" style="display: flex;">
2024-08-25 16:08:59 +08:00
{{#previous}}
<mdui-button id="previous—page" class="hideonmobile" href="javascript:void(0);" onclick="prevPage()"
style="margin-right:8px;">上一章</mdui-button>
<a style="display:none;" href="{{ path_to_root }}{{link}}" id="helper_prevpage" class="helper"></a>
{{/previous}}
{{#next}}
<mdui-button id="next—page" class="next—page" href="javascript:void(0);"
onclick="nextPage()">下一章</mdui-button>
<a style="display:none;" href="{{ path_to_root }}{{link}}" id="helper_nextpage"
class="next—pagehelper"></a>
{{/next}}
2024-08-12 14:46:11 +08:00
</div>
2024-08-25 16:08:59 +08:00
<!-- 仓库按钮 -->
{{#if git_repository_url}}
<mdui-button-icon icon="web" href="{{git_repository_url}}"></mdui-button-icon>
{{/if}}
2024-08-25 16:08:59 +08:00
<!-- 打印按钮 -->
{{#if print_enable}}
<mdui-button-icon class="hideonmobile" href="{{ path_to_root }}print.html" title="Print this book"
aria-label="Print this book" icon="print">
</mdui-button-icon>
{{/if}}
</mdui-top-app-bar>
2024-08-25 16:08:59 +08:00
<!-- 菜单栏 -->
<mdui-navigation-drawer close-on-overlay-click class="toc-drawer" id="toc-drawer" placement="left">
2024-08-25 16:08:59 +08:00
<!-- JS 填充内容 -->
</mdui-navigation-drawer>
{{/unless}}
{{#unless is_print }}
<!-- Render toc -->
<div style="display:none;" id="helperframe" class="helperframe">
{{#toc}}{{/toc}}
</div>
<script src="{{ ../path_to_root }}theme/js/tocrender.js"></script>
<!-- Render toc finish -->
{{/unless}}
2024-08-25 16:08:59 +08:00
<!-- 展开菜单按钮 -->
{{#unless is_print }}
<script>
const navigationDrawer = document.querySelector(".toc-drawer");
const openButton = document.getElementById("open-drawer");
openButton.addEventListener("click", () => navigationDrawer.open = !navigationDrawer.open);
</script>
{{/unless}}
2024-08-25 16:08:59 +08:00
<!-- 主要内容 -->
<mdui-layout-main class="example-layout-main" style="min-height: 100%">
2024-08-25 16:08:59 +08:00
<!-- 内容区 -->
<div class="mdui-prose">
{{{ content }}}
</div>
2024-08-25 16:08:59 +08:00
<!-- 学习环境页面 -->
{{#unless is_print }}
<mdui-dialog headline="Study Env" close-on-esc close-on-overlay-click id="study-env-dialog">
<iframe src="about:blank" style="height:80%;width:99%" id="study-env-iframe"></iframe>
</mdui-dialog>
<script>
document.getElementById("open-study-env").addEventListener("click", () => {
document.getElementById("study-env-dialog").open = true
document.getElementById("study-env-iframe").src = "http://jslinux.cxykevin.top"
});
</script>
{{/unless}}
2024-08-25 16:08:59 +08:00
<!-- 下部翻页按钮 -->
2024-08-12 09:07:37 +08:00
<div class="navcard" style="height:10em;display:flex;max-width: 78%;margin: auto;margin-top:2em;">
{{#previous}}
2024-08-12 06:23:30 +08:00
<mdui-card clickable style="width:49%;height: 100%" href="javascript:void(0);" onclick="prevPage()">
<div style="display:flex;font-size:1.2em;margin-top: 10px;margin-left: 4px;">
<mdui-icon name="navigate_before" style="font-size:1.5em;"></mdui-icon> 上一章
</div>
<div style="text-align:center;font-size:1.8em;margin-top: 12px;">
{{title}}
</div>
</mdui-card>
{{/previous}}
<div style="flex-grow:1"></div>
{{#next}}
<mdui-card clickable style="width:49%;height: 100%" href="javascript:void(0);" onclick="nextPage()">
<div style="display:flex;font-size:1.2em;margin-top: 10px;margin-right: 4px;">
<div style="flex-grow:1"></div>下一章<mdui-icon name="navigate_next"
style="font-size:1.5em"></mdui-icon>
</div>
<div style="text-align:center;font-size:1.8em;margin-top: 12px;">
{{title}}
</div>
</mdui-card>
{{/next}}
</div>
</mdui-layout-main>
2024-08-25 16:08:59 +08:00
<!-- 动态更新内容 -->
{{#if live_reload_endpoint}}
<!-- Livereload script (if served using the cli tool) -->
<script>
const wsProtocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
const wsAddress = wsProtocol + "//" + location.host + "/" + "{{{live_reload_endpoint}}}";
const socket = new WebSocket(wsAddress);
socket.onmessage = function (event) {
if (event.data === "reload") {
socket.close();
location.reload();
}
};
2024-05-30 22:06:26 +08:00
window.onbeforeunload = function () {
socket.close();
}
</script>
{{/if}}
{{#if is_print}}
{{#if mathjax_support}}
<script>
2024-05-30 22:06:26 +08:00
window.addEventListener('load', function () {
MathJax.Hub.Register.StartupHook('End', function () {
window.setTimeout(window.print, 100);
});
});
</script>
{{else}}
<script>
2024-05-30 22:06:26 +08:00
window.addEventListener('load', function () {
window.setTimeout(window.print, 100);
});
</script>
{{/if}}
{{/if}}
</mdui-layout>
<!-- 留白 -->
<div style="height:2em"></div>
2024-08-25 16:08:59 +08:00
<!-- 高亮 -->
<script>
window.addEventListener('load', function () {
hljs.highlightAll();
});
</script>
2024-08-25 16:08:59 +08:00
<!-- 页面 JS -->
<script src="{{ ../path_to_root }}theme/js/page.js"></script>
2024-05-30 22:06:26 +08:00
</body>
</html>