Skip to content
Permalink
Browse files

v1.0

  • Loading branch information...
Llf0703 committed Aug 25, 2019
0 parents commit a5861bbf497333e219a6a0956c8fa81a90065f67
Showing with 629 additions and 0 deletions.
  1. +15 −0 404.php
  2. +21 −0 LICENSE
  3. +59 −0 README.md
  4. +44 −0 archive.php
  5. +93 −0 comments.php
  6. +1 −0 css/main.css
  7. +54 −0 footer.php
  8. +38 −0 functions.php
  9. +27 −0 head.php
  10. +34 −0 index.php
  11. +2 −0 js/highlight.pack.js
  12. +35 −0 nav.php
  13. +46 −0 page-archive.php
  14. +39 −0 page.php
  15. +14 −0 post-list.php
  16. +52 −0 post.php
  17. +55 −0 sidebar.php
15 404.php
@@ -0,0 +1,15 @@
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$this->need('head.php');
$this->need('nav.php');
?>
<?php $this->header(); ?>
<div id="pjax">
<header class="intro-header relate" style="background-image: url('<?php $this->options->backgroundImage(); ?>');">
<div class="mdui-container">
<div class="site-heading">
<h1 class="header-title">404</h1>
</div>
</div>
</header>
<?php $this->need('footer.php'); ?>
21 LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Llf0703

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,59 @@
# Typecho Theme Edge

[镜像](https://git.llf0703.com/Llf0703/Typecho-Theme-Edge)(更快下载)

[示例站点](https://llf0703.com)(为个人使用版,不完全相同,近期会上线主题预览站)

## Edge

`[edʒ]`

`n.边缘;棱;角;锋`

## Feature

1. 一款棱角分明的主题。
2. `Pjax` 支持。
3. 代码高亮、文章目录支持。

## 使用

下载(或clone)后将文件夹命名为 `Typecho-Theme-Edge` ,然后放入 `/usr/themes/` 文件夹中,后台启用即可。

## 设置

### 基础设置

控制台->外观->设置外观,按照说明设置。

### 导航栏左侧元素

设置后会在导航栏的左侧,标题的右侧显示。

`nav.php:14` ,取消注释并按样例格式修改即可。

### 友链

设置后会在侧边栏显示友链。

`sidebar.php:47` ,取消注释并按样例格式修改即可。

## 推荐项目

- [KaTeX4Typecho](https://github.com/Llf0703/KaTeX4Typecho):数学公式支持。
- [Luogu-Difficulty-Tag](https://github.com/Llf0703/Luogu-Difficulty-Tag):(For ~~OIer~~ CSPer)在博客显示洛谷题目难度。
- [cdn.llf0703.com](https://github.com/Llf0703/cdn.llf0703.com):本主题静态资源汇总。

## 鸣谢

在主题的创作中,或多或少的使用了他们的创意,在此列出。

- [MDUI](https://www.mdui.org/):前端框架
- [Vijos](https://vijos.org/):导航栏样式
- [typecho-theme-amaze](https://github.com/spiritree/typecho-theme-amaze):基于该主题修改
- [materiality-typecho-theme](https://github.com/EAimTY/materiality-typecho-theme):返回顶部按钮、评论
- [MDx - Material Design WordPress Theme](https://github.com/yrccondor/mdx):搜索功能

## LICENSE

&copy;[Llf0703](https://llf0703.com) | MIT
@@ -0,0 +1,44 @@
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$this->need('head.php');
$this->need('nav.php');
?>
<?php $this->header(); ?>
<div id="pjax">
<header class="intro-header relate" style="background-image: url('<?php $this->options->backgroundImage();?>');">
<div class="mdui-container">
<div class="post-heading">
<h1 class="header-title">
<?php $this->archiveTitle(array(
'category' => _t('分类:%s'),
'search' => _t('搜索:%s'),
'tag' => _t('标签:%s'),
'author' => _t('作者:%s')
), '', ''); ?>
</h1>
</div>
</div>
</header>
<div class="mdui-container">
<div class="mdui-row">
<div class="mdui-col-md-9 mdui-col-sm-12">
<?php if ($this->have()): ?>
<?php while($this->next()): ?>
<?php $this->need('post-list.php'); ?>
<?php endwhile; ?>
<?php else: ?>
<div class="mdui-card card-fixed mdui-hoverable">
<div class="mdui-card-primary">
<a class="mdui-card-primary-title title-fixed" href="#">没有找到结果</a>
</div>
<div class="mdui-card-content nokatex">请注意空格及大小写等。</div>
</div>
<?php endif; ?>
<div class="page-nav">
<?php $this->pageNav('<span><i class="mdui-icon material-icons">&#xe5c4;</i></span>', '<span><i class="mdui-icon material-icons">&#xe5c8;</i></span>', 1, '...', 'wrapClass=pager&prevClass=prev&nextClass=next'); ?>
</div>
</div>
<?php $this->need('sidebar.php'); ?>
</div>
</div>
<?php $this->need('footer.php'); ?>
@@ -0,0 +1,93 @@
<?php function threadedComments($comments, $options) {
$commentClass = '';
if ($comments->authorId) {
if ($comments->authorId == $comments->ownerId) {
$commentClass .= ' comment-by-author';
} else {
$commentClass .= ' comment-by-user';
}
}
$commentLevelClass = $comments->levels > 0 ? ' comment-child' : ' comment-parent';
?>
<div id="<?php $comments->theId(); ?>"
class="mdui-card comment-shadow<?php if ($comments->levels > 0) { echo ' comment-child'; $comments->levelsAlt(' comment-level-odd', ' comment-level-even'); } else { echo ' comment-parent'; } $comments->alt(' comment-odd', ' comment-even'); echo $commentClass; ?>">
<div class="mdui-card-header">
<div class="mdui-card-header-avatar"><?php $comments->gravatar('40', ''); ?></div>
<div class="mdui-card-header-title mdui-text-color-theme-accent"><?php $comments->author(); ?></div>
<div class="mdui-card-header-subtitle"><?php $comments->date('Y-m-d H:i'); ?></div>
</div>
<div class="mdui-card-content"><?php $comments->content(); ?></div>
<?php $comments->reply('<div class="mdui-card-actions"><button class="mdui-btn mdui-ripple mdui-text-color-theme-accent">回复</button></div>'); ?>
<?php if ($comments->children) { ?>
<div class="mdui-container">
<?php $comments->threadedComments($options); ?>
</div>
<?php } ?>
</div>
<div class="card-spacer"></div>
<?php } ?>
<div id="comments">
<?php $this->comments()->to($comments); ?>
<?php if($this->allow('comment')): ?>
<div class="card-spacer"></div>
<div id="<?php $this->respondId(); ?>" class="comment comment-shadow">
<form method="post" action="<?php $this->commentUrl() ?>" id="comment-form" role="form">
<div class="comment-title">
<h2>新评论</h2>
</div>
<div class="comment-content">
<?php if($this->user->hasLogin()): ?>
<div class="mdui-chip mdui-typo">
<span class="mdui-chip-title">登录身份: <a
href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>&nbsp;&nbsp;<a
href="<?php $this->options->logoutUrl(); ?>" title="Logout">退出</a></span>
</div>
<?php else: ?>
<div class="comment-options">
<div class="mdui-textfield mdui-textfield-floating-label comment-option">
<i class="mdui-icon material-icons">&#xe853;</i>
<label class="mdui-textfield-label">称呼</label>
<input name="author" class="mdui-textfield-input" type="text"
value="<?php $this->remember('author'); ?>" required/>
<div class="mdui-textfield-error">称呼不能为空</div>
</div>
<div class="mdui-textfield mdui-textfield-floating-label comment-option">
<i class="mdui-icon material-icons">&#xe0be;</i>
<label class="mdui-textfield-label">Email</label>
<input name="mail" class="mdui-textfield-input" type="email"
value="<?php $this->remember('mail'); ?>" <?php if ($this->options->commentsRequireMail): ?>required<?php endif;?>/>
<div class="mdui-textfield-error">邮箱格式不合法</div>
</div>
<div class="mdui-textfield mdui-textfield-floating-label comment-option">
<i class="mdui-icon material-icons">&#xe157;</i>
<label class="mdui-textfield-label">网站</label>
<input name="url" class="mdui-textfield-input" type="url"
value="<?php $this->remember('url'); ?>" <?php if ($this->options->commentsRequireURL): ?>required<?php endif;?>>
<div class="mdui-textfield-error">网站格式不合法</div>
</div>
</div>
<?php endif; ?>
<?php $comments->cancelReply('<div class="mdui-chip mdui-typo"><span class="mdui-chip-icon"><i class="mdui-icon material-icons">&#xe5cd;</i></span><span class="mdui-chip-title">取消回复</span></div>'); ?>
<div class="mdui-textfield mdui-textfield-floating-label" style="width:auto">
<i class="mdui-icon material-icons">&#xe0d8;</i>
<label class="mdui-textfield-label">内容</label>
<textarea name="text" class="mdui-textfield-input" type="text" required><?php $this->remember('text'); ?></textarea>
<div class="mdui-textfield-error">内容不能为空</div>
</div>
</div>
<div class="mdui-card-actions">
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent mdui-float-right" type="submit">发表评论</button>
</div>
</form>
</div>
<div class="card-spacer"></div>
<?php else: ?>
<div class="mdui-chip mdui-typo">
<span class="mdui-chip-icon"><i class="mdui-icon material-icons">&#xe5cd;</i></span>
<span class="mdui-chip-title">评论已关闭</span>
</div>
<?php endif; ?>
<?php if ($comments->have()): ?>
<?php $comments->listComments(); ?>
<?php endif; ?>
</div>

Large diffs are not rendered by default.

@@ -0,0 +1,54 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->footer(); ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mdui/0.4.3/js/mdui.min.js"></script>
<?php if ($this->options->useToc): ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.5.0/tocbot.min.js"></script>
<?php endif; ?>
<?php if ($this->is('post')): ?>
<?php if ($this->options->useToc): ?>
<script>eval(function(d,f,a,c,b,e){b=function(a){return a.toString(f)};if(!"".replace(/^/,String)){for(;a--;)e[b(a)]=c[a]||b(a);c=[function(a){return e[a]}];b=function(){return"\\w+"};a=1}for(;a--;)c[a]&&(d=d.replace(new RegExp("\\b"+b(a)+"\\b","g"),c[a]));return d}("5 4='8,d,e,i',2='#n-2',0={};$(2).9(4).b(c(){5 a=$(3).f().h(/[\\s|\\~|`|\\!|\\@|\\#|\\$|\\%|\\^|\\&|\\*|\\(|\\)|\\j|\\+|\\=|\\||\\|\\[|\\]|\\{|\\}|\\;|\\:|\\\"|\\'|\\,|\\<|\\.|\\>|\\/|\\?|\\\uff1a|\\\uff0c|\\\u3002]/g,'');a=a.k();l(0[a]){$(3).6('7',a+'-'+0[a]);0[a]++}o{0[a]=1;$(3).6('7',a)}});p.q({r:'#t',u:2,v:4,w:-m});",33,33,"idArr content this headerEl var attr id h1 children each function h2 h3 text replace h4 _ toLowerCase if 400 post else tocbot init tocSelector toc contentSelector headingSelector headingsOffset".split(" "),0,{}));</script>
<?php endif; ?>
<script>$("table").addClass('mdui-table');</script>
<?php endif;?>
<?php if ($this->options->useHighline): ?><script>function loadscript(url,callback){var script=document.createElement("script");script.type="text/javascript";if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;callback()}}}else{script.onload=function(){callback()}}script.src=url;document.getElementsByTagName("head")[0].appendChild(script)}loadscript('<?php $this->options->themeUrl('js/highlight.pack.js'); ?>',function(){hljs.initHighlighting()});</script><?php endif;?>
<button class="mdui-fab mdui-fab-fixed mdui-ripple mdui-color-theme-accent mdui-fab-hide" id="scrolltop" mdui-tooltip="{content: '返回顶部',position: 'left'}"><i class="mdui-icon material-icons">&#xe316;</i></button>
<script>
<?php $this->widget('Widget_Contents_Page_List')->to($pages); $cnt=0; ?>
<?php while($pages->next()) { $cnt++; ?>
<?php if ($this->is('page', $pages->slug)) { ?>
$("#nav-<?=$cnt?>").addClass("nav-active");
<?php } else { ?>
$("#nav-<?=$cnt?>").removeClass("nav-active");
<?php } ?>
<?php } ?>
$("#nav-index").removeClass("nav-active");
<?php if ($this->is('index')) {?>
$("#nav-index").addClass("nav-active");
<?php } ?>
</script>
<script>function scrolltop(){$(window).scroll(function(e){if($(window).scrollTop()>300)document.getElementById("scrolltop").classList.remove("mdui-fab-hide");else document.getElementById("scrolltop").classList.add("mdui-fab-hide")})};$(function(){$("#scrolltop").click(function(e){$('body,html').animate({scrollTop:0},600)});scrolltop()})</script>
</div>
<script>$(".seai").click(function(){$("#SearchBar").show();$(".OutOfsearchBox").fadeIn(300);$(".fullScreen").fadeIn(300);$("#SearchBar > *").animate({opacity:'1'},200);$(".outOfSearch").css('width','75%');$(".seainput").focus();$('body').toggleClass('search-lock')});$(".sea-close").click(function(){$("#SearchBar > *").animate({opacity:'0'},200);$(".fullScreen").fadeOut(300);$(".OutOfsearchBox").fadeOut(300);$(".outOfSearch").css('width','30%');window.setTimeout("hideBar()",300);$('body').toggleClass('search-lock')});function hideBar(){$("#SearchBar").hide()}</script>
<footer class="blog-footer">
<div class="blog-text-center">
&copy; <?php echo date('Y'); ?> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title() ?></a>
<br>
Powered by <a href="http://typecho.org"> Typecho </a> | Theme is <a href="https://github.com/Llf0703/Typecho-Theme-Edge"> Edge </a> by <a href="https://llf0703.com"> Llf0703</a>
<br>
<?php $this->options->footerText(); ?>
</div>
</footer>
<script>var $body=document.body;var $toggle=document.querySelector(".navbar-toggle");var $navbar=document.querySelector("#huxblog_navbar");var $collapse=document.querySelector(".navbar-collapse");var __HuxNav__={close:function(){$navbar.className=" ";setTimeout(function(){if($navbar.className.indexOf("in")<0){$collapse.style.height="0px"}},400)},open:function(){$collapse.style.height="auto";$navbar.className+=" in"}};$toggle.addEventListener("click",function(a){if($navbar.className.indexOf("in")>0){__HuxNav__.close()}else{__HuxNav__.open()}});document.addEventListener("click",function(a){if(a.target==$toggle){return}if(a.target.className=="icon-bar"){return}__HuxNav__.close()});jQuery(document).ready(function(c){var d=1170;if(c(window).width()>d){var b=c(".navbar-custom").height(),a=c(".intro-header .container").height();c(window).on("scroll",{previousTop:0},function(){var e=c(window).scrollTop(),f=c(".side-catalog");if(e<this.previousTop){if(e>0&&c(".navbar-custom").hasClass("is-fixed")){c(".navbar-custom").addClass("is-visible")}else{c(".navbar-custom").removeClass("is-visible is-fixed")}}else{c(".navbar-custom").removeClass("is-visible");if(e>b&&!c(".navbar-custom").hasClass("is-fixed")){c(".navbar-custom").addClass("is-fixed")}}this.previousTop=e;f.show();if(e>(a+41)){f.addClass("fixed")}else{f.removeClass("fixed")}})}});</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.pjax/2.0.1/jquery.pjax.min.js"></script>
<script>
$(document).pjax('a[href^="<?php Helper::options()->siteUrl()?>"]:not(a[target="_blank"], a[no-pjax])', {
container: '#pjax',
fragment: '#pjax',
timeout: 8000
})
$(document).on('pjax:start', function () { $("#process").html("<div class=\"mdui-progress\"><div class=\"mdui-progress-indeterminate\"></div></div>"); });
$(document).on('pjax:end', function () { $("#process").empty(); mdui.updateTextFields();});
</script>
</body>
</html>
@@ -0,0 +1,38 @@
<?php
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
function themeConfig($form) {
$faviconUrl = new Typecho_Widget_Helper_Form_Element_Text('faviconUrl', NULL, NULL, _t('站点favicon.ico地址'), _t('站点favicon.ico地址'));
$form->addInput($faviconUrl);
$backgroundImage = new Typecho_Widget_Helper_Form_Element_Text('backgroundImage', NULL, NULL, _t('背景图片地址'), _t('请输入背景图片地址'));
$form->addInput($backgroundImage);
$backgroundText = new Typecho_Widget_Helper_Form_Element_Text('backgroundText', NULL, NULL, _t('背景图片大标题'), _t('请输入背景图片大标题内容'));
$form->addInput($backgroundText);
$footerText = new Typecho_Widget_Helper_Form_Element_Text('footerText', NULL, NULL, _t('底部自定义内容'), _t('如备案号等,将在页面最底部显示。支持html'));
$form->addInput($footerText);
$sidebarBlock = new Typecho_Widget_Helper_Form_Element_Checkbox('sidebarBlock',
array('showCategory' => _t('显示分类'),
'showTag' => _t('显示标签'),
'showArchive' => _t('显示归档'),
'showOther' => _t('显示更多')),
array('showCategory', 'showTag', 'showArchive', 'showOther'), _t('侧边栏显示'));
$form->addInput($sidebarBlock->multiMode());
$useHighline = new Typecho_Widget_Helper_Form_Element_Radio('useHighline',
array('1' => _t('启用'),
'0' => _t('禁止'),
),
'0', _t('代码高亮设置'), _t('默认禁止,启用则会对 ``` 进行代码高亮'));
$form->addInput($useHighline);
$useToc = new Typecho_Widget_Helper_Form_Element_Radio('useToc',
array('1' => _t('启用'),
'0' => _t('禁止'),
),
'0', _t('文章目录设置'), _t('默认禁止,会在文章右侧显示目录'));
$form->addInput($useToc);
}

0 comments on commit a5861bb

Please sign in to comment.
You can’t perform that action at this time.