第三次作业题目和答案(未公布)
This commit is contained in:
commit
b01ba87404
102 changed files with 8693 additions and 0 deletions
25
themes/landscape/layout/_partial/after-footer.ejs
Normal file
25
themes/landscape/layout/_partial/after-footer.ejs
Normal file
|
@ -0,0 +1,25 @@
|
|||
<% if (config.disqus_shortname){ %>
|
||||
<script>
|
||||
var disqus_shortname = '<%= config.disqus_shortname %>';
|
||||
<% if (page.permalink){ %>
|
||||
var disqus_url = '<%= page.permalink %>';
|
||||
<% } %>
|
||||
(function(){
|
||||
var dsq = document.createElement('script');
|
||||
dsq.type = 'text/javascript';
|
||||
dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/<% if (page.comments) { %>embed.js<% } else { %>count.js<% } %>';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<% } %>
|
||||
|
||||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
|
||||
|
||||
<% if (theme.fancybox){ %>
|
||||
<%- css('fancybox/jquery.fancybox') %>
|
||||
<%- js('fancybox/jquery.fancybox.pack') %>
|
||||
<% } %>
|
||||
|
||||
<%- js('js/script') %>
|
||||
<%- partial('gauges-analytics') %>
|
8
themes/landscape/layout/_partial/archive-post.ejs
Normal file
8
themes/landscape/layout/_partial/archive-post.ejs
Normal file
|
@ -0,0 +1,8 @@
|
|||
<article class="archive-article archive-type-<%= post.layout %>">
|
||||
<div class="archive-article-inner">
|
||||
<header class="archive-article-header">
|
||||
<%- partial('post/date', {class_name: 'archive-article-date', date_format: 'MMM D'}) %>
|
||||
<%- partial('post/title', {class_name: 'archive-article-title'}) %>
|
||||
</header>
|
||||
</div>
|
||||
</article>
|
34
themes/landscape/layout/_partial/archive.ejs
Normal file
34
themes/landscape/layout/_partial/archive.ejs
Normal file
|
@ -0,0 +1,34 @@
|
|||
<% if (pagination == 2){ %>
|
||||
<% page.posts.each(function(post){ %>
|
||||
<%- partial('article', {post: post, index: true}) %>
|
||||
<% }) %>
|
||||
<% } else { %>
|
||||
<% var last; %>
|
||||
<% page.posts.each(function(post, i){ %>
|
||||
<% var year = post.date.year(); %>
|
||||
<% if (last != year){ %>
|
||||
<% if (last != null){ %>
|
||||
</div></section>
|
||||
<% } %>
|
||||
<% last = year; %>
|
||||
<section class="archives-wrap">
|
||||
<div class="archive-year-wrap">
|
||||
<a href="<%- url_for(config.archive_dir + '/' + year) %>" class="archive-year"><%= year %></a>
|
||||
</div>
|
||||
<div class="archives">
|
||||
<% } %>
|
||||
<%- partial('archive-post', {post: post, even: i % 2 == 0}) %>
|
||||
<% }) %>
|
||||
<% if (page.posts.length){ %>
|
||||
</div></section>
|
||||
<% } %>
|
||||
<% } %>
|
||||
<% if (page.total > 1){ %>
|
||||
<nav id="page-nav">
|
||||
<% var prev_text = "« " + __('prev');var next_text = __('next') + " »"%>
|
||||
<%- paginator({
|
||||
prev_text: prev_text,
|
||||
next_text: next_text
|
||||
}) %>
|
||||
</nav>
|
||||
<% } %>
|
44
themes/landscape/layout/_partial/article.ejs
Normal file
44
themes/landscape/layout/_partial/article.ejs
Normal file
|
@ -0,0 +1,44 @@
|
|||
<article id="<%= post.layout %>-<%= post.slug %>" class="article article-type-<%= post.layout %>" itemscope itemprop="blogPost">
|
||||
<div class="article-meta">
|
||||
<%- partial('post/date', {class_name: 'article-date', date_format: null}) %>
|
||||
<%- partial('post/category') %>
|
||||
</div>
|
||||
<div class="article-inner">
|
||||
<%- partial('post/gallery') %>
|
||||
<% if (post.link || post.title){ %>
|
||||
<header class="article-header">
|
||||
<%- partial('post/title', {class_name: 'article-title'}) %>
|
||||
</header>
|
||||
<% } %>
|
||||
<div class="article-entry" itemprop="articleBody">
|
||||
<% if (post.excerpt && index){ %>
|
||||
<%- post.excerpt %>
|
||||
<% if (theme.excerpt_link){ %>
|
||||
<p class="article-more-link">
|
||||
<a href="<%- url_for(post.path) %>#more"><%= theme.excerpt_link %></a>
|
||||
</p>
|
||||
<% } %>
|
||||
<% } else { %>
|
||||
<%- post.content %>
|
||||
<% } %>
|
||||
</div>
|
||||
<footer class="article-footer">
|
||||
<a data-url="<%- post.permalink %>" data-id="<%= post._id %>" class="article-share-link"><%= __('share') %></a>
|
||||
<% if (post.comments && config.disqus_shortname){ %>
|
||||
<a href="<%- post.permalink %>#disqus_thread" class="article-comment-link"><%= __('comment') %></a>
|
||||
<% } %>
|
||||
<%- partial('post/tag') %>
|
||||
</footer>
|
||||
</div>
|
||||
<% if (!index){ %>
|
||||
<%- partial('post/nav') %>
|
||||
<% } %>
|
||||
</article>
|
||||
|
||||
<% if (!index && post.comments && config.disqus_shortname){ %>
|
||||
<section id="comments">
|
||||
<div id="disqus_thread">
|
||||
<noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
</div>
|
||||
</section>
|
||||
<% } %>
|
11
themes/landscape/layout/_partial/footer.ejs
Normal file
11
themes/landscape/layout/_partial/footer.ejs
Normal file
|
@ -0,0 +1,11 @@
|
|||
<footer id="footer">
|
||||
<% if (theme.sidebar === 'bottom'){ %>
|
||||
<%- partial('_partial/sidebar') %>
|
||||
<% } %>
|
||||
<div class="outer">
|
||||
<div id="footer-info" class="inner">
|
||||
© <%= date(new Date(), 'YYYY') %> <%= config.author || config.title %><br>
|
||||
<%= __('powered_by') %> <a href="http://hexo.io/" target="_blank">Hexo</a>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
18
themes/landscape/layout/_partial/gauges-analytics.ejs
Normal file
18
themes/landscape/layout/_partial/gauges-analytics.ejs
Normal file
|
@ -0,0 +1,18 @@
|
|||
<% if (theme.gauges_analytics){ %>
|
||||
<!-- Gaug.es Analytics -->
|
||||
<script type="text/javascript">
|
||||
var _gauges = _gauges || [];
|
||||
(function() {
|
||||
var t = document.createElement('script');
|
||||
t.type = 'text/javascript';
|
||||
t.async = true;
|
||||
t.id = 'gauges-tracker';
|
||||
t.setAttribute('data-site-id', '<%= theme.gauges_analytics %>');
|
||||
t.setAttribute('data-track-path', 'https://track.gaug.es/track.gif');
|
||||
t.src = 'https://d36ee2fcip1434.cloudfront.net/track.js';
|
||||
var s = document.getElementsByTagName('script')[0];
|
||||
s.parentNode.insertBefore(t, s);
|
||||
})();
|
||||
</script>
|
||||
<!-- End Gaug.es Analytics -->
|
||||
<% } %>
|
14
themes/landscape/layout/_partial/google-analytics.ejs
Normal file
14
themes/landscape/layout/_partial/google-analytics.ejs
Normal file
|
@ -0,0 +1,14 @@
|
|||
<% if (theme.google_analytics){ %>
|
||||
<!-- Google Analytics -->
|
||||
<script type="text/javascript">
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '<%= theme.google_analytics %>', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
<!-- End Google Analytics -->
|
||||
<% } %>
|
36
themes/landscape/layout/_partial/head.ejs
Normal file
36
themes/landscape/layout/_partial/head.ejs
Normal file
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<%- partial('google-analytics') %>
|
||||
<%
|
||||
var title = page.title;
|
||||
|
||||
if (is_archive()){
|
||||
title = __('archive_a');
|
||||
|
||||
if (is_month()){
|
||||
title += ': ' + page.year + '/' + page.month;
|
||||
} else if (is_year()){
|
||||
title += ': ' + page.year;
|
||||
}
|
||||
} else if (is_category()){
|
||||
title = __('category') + ': ' + page.category;
|
||||
} else if (is_tag()){
|
||||
title = __('tag') + ': ' + page.tag;
|
||||
}
|
||||
%>
|
||||
<title><% if (title){ %><%= title %> | <% } %><%= config.title %></title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<%- open_graph({twitter_id: theme.twitter, google_plus: theme.google_plus, fb_admins: theme.fb_admins, fb_app_id: theme.fb_app_id}) %>
|
||||
<% if (theme.rss){ %>
|
||||
<link rel="alternate" href="<%= url_for(theme.rss) %>" title="<%= config.title %>" type="application/atom+xml">
|
||||
<% } %>
|
||||
<% if (theme.favicon){ %>
|
||||
<link rel="icon" href="<%- theme.favicon %>">
|
||||
<% } %>
|
||||
<% if (config.highlight.enable){ %>
|
||||
<link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
|
||||
<% } %>
|
||||
<%- css('css/style') %>
|
||||
</head>
|
32
themes/landscape/layout/_partial/header.ejs
Normal file
32
themes/landscape/layout/_partial/header.ejs
Normal file
|
@ -0,0 +1,32 @@
|
|||
<header id="header">
|
||||
<div id="banner"></div>
|
||||
<div id="header-outer" class="outer">
|
||||
<div id="header-title" class="inner">
|
||||
<h1 id="logo-wrap">
|
||||
<a href="<%- url_for() %>" id="logo"><%= config.title %></a>
|
||||
</h1>
|
||||
<% if (theme.subtitle){ %>
|
||||
<h2 id="subtitle-wrap">
|
||||
<a href="<%- url_for() %>" id="subtitle"><%= theme.subtitle %></a>
|
||||
</h2>
|
||||
<% } %>
|
||||
</div>
|
||||
<div id="header-inner" class="inner">
|
||||
<nav id="main-nav">
|
||||
<a id="main-nav-toggle" class="nav-icon"></a>
|
||||
<% for (var i in theme.menu){ %>
|
||||
<a class="main-nav-link" href="<%- url_for(theme.menu[i]) %>"><%= i %></a>
|
||||
<% } %>
|
||||
</nav>
|
||||
<nav id="sub-nav">
|
||||
<% if (theme.rss){ %>
|
||||
<a id="nav-rss-link" class="nav-icon" href="<%- url_for(theme.rss) %>" title="<%= __('rss_feed') %>"></a>
|
||||
<% } %>
|
||||
<a id="nav-search-btn" class="nav-icon" title="<%= __('search') %>"></a>
|
||||
</nav>
|
||||
<div id="search-form-wrap">
|
||||
<%- search_form({button: ''}) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
5
themes/landscape/layout/_partial/mobile-nav.ejs
Normal file
5
themes/landscape/layout/_partial/mobile-nav.ejs
Normal file
|
@ -0,0 +1,5 @@
|
|||
<nav id="mobile-nav">
|
||||
<% for (var i in theme.menu){ %>
|
||||
<a href="<%- url_for(theme.menu[i]) %>" class="mobile-nav-link"><%= i %></a>
|
||||
<% } %>
|
||||
</nav>
|
10
themes/landscape/layout/_partial/post/category.ejs
Normal file
10
themes/landscape/layout/_partial/post/category.ejs
Normal file
|
@ -0,0 +1,10 @@
|
|||
<% if (post.categories && post.categories.length){ %>
|
||||
<div class="article-category">
|
||||
<%- list_categories(post.categories, {
|
||||
show_count: false,
|
||||
class: 'article-category',
|
||||
style: 'none',
|
||||
separator: '►'
|
||||
}) %>
|
||||
</div>
|
||||
<% } %>
|
3
themes/landscape/layout/_partial/post/date.ejs
Normal file
3
themes/landscape/layout/_partial/post/date.ejs
Normal file
|
@ -0,0 +1,3 @@
|
|||
<a href="<%- url_for(post.path) %>" class="<%= class_name %>">
|
||||
<time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date, date_format) %></time>
|
||||
</a>
|
11
themes/landscape/layout/_partial/post/gallery.ejs
Normal file
11
themes/landscape/layout/_partial/post/gallery.ejs
Normal file
|
@ -0,0 +1,11 @@
|
|||
<% if (post.photos && post.photos.length){ %>
|
||||
<div class="article-gallery">
|
||||
<div class="article-gallery-photos">
|
||||
<% post.photos.forEach(function(photo, i){ %>
|
||||
<a class="article-gallery-img fancybox" href="<%- url_for(photo) %>" rel="gallery_<%= post._id %>">
|
||||
<img src="<%- url_for(photo) %>" itemprop="image">
|
||||
</a>
|
||||
<% }) %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
22
themes/landscape/layout/_partial/post/nav.ejs
Normal file
22
themes/landscape/layout/_partial/post/nav.ejs
Normal file
|
@ -0,0 +1,22 @@
|
|||
<% if (post.prev || post.next){ %>
|
||||
<nav id="article-nav">
|
||||
<% if (post.prev){ %>
|
||||
<a href="<%- url_for(post.prev.path) %>" id="article-nav-newer" class="article-nav-link-wrap">
|
||||
<strong class="article-nav-caption"><%= __('newer') %></strong>
|
||||
<div class="article-nav-title">
|
||||
<% if (post.prev.title){ %>
|
||||
<%= post.prev.title %>
|
||||
<% } else { %>
|
||||
(no title)
|
||||
<% } %>
|
||||
</div>
|
||||
</a>
|
||||
<% } %>
|
||||
<% if (post.next){ %>
|
||||
<a href="<%- url_for(post.next.path) %>" id="article-nav-older" class="article-nav-link-wrap">
|
||||
<strong class="article-nav-caption"><%= __('older') %></strong>
|
||||
<div class="article-nav-title"><%= post.next.title %></div>
|
||||
</a>
|
||||
<% } %>
|
||||
</nav>
|
||||
<% } %>
|
6
themes/landscape/layout/_partial/post/tag.ejs
Normal file
6
themes/landscape/layout/_partial/post/tag.ejs
Normal file
|
@ -0,0 +1,6 @@
|
|||
<% if (post.tags && post.tags.length){ %>
|
||||
<%- list_tags(post.tags, {
|
||||
show_count: false,
|
||||
class: 'article-tag'
|
||||
}) %>
|
||||
<% } %>
|
15
themes/landscape/layout/_partial/post/title.ejs
Normal file
15
themes/landscape/layout/_partial/post/title.ejs
Normal file
|
@ -0,0 +1,15 @@
|
|||
<% if (post.link){ %>
|
||||
<h1 itemprop="name">
|
||||
<a class="<%= class_name %>" href="<%- url_for(post.link) %>" target="_blank" itemprop="url"><%= post.title %></a>
|
||||
</h1>
|
||||
<% } else if (post.title){ %>
|
||||
<% if (index){ %>
|
||||
<h1 itemprop="name">
|
||||
<a class="<%= class_name %>" href="<%- url_for(post.path) %>"><%= post.title %></a>
|
||||
</h1>
|
||||
<% } else { %>
|
||||
<h1 class="<%= class_name %>" itemprop="name">
|
||||
<%= post.title %>
|
||||
</h1>
|
||||
<% } %>
|
||||
<% } %>
|
5
themes/landscape/layout/_partial/sidebar.ejs
Normal file
5
themes/landscape/layout/_partial/sidebar.ejs
Normal file
|
@ -0,0 +1,5 @@
|
|||
<aside id="sidebar"<% if (theme.sidebar === 'bottom'){ %> class="outer"<% } %>>
|
||||
<% theme.widgets.forEach(function(widget){ %>
|
||||
<%- partial('_widget/' + widget) %>
|
||||
<% }) %>
|
||||
</aside>
|
8
themes/landscape/layout/_widget/archive.ejs
Normal file
8
themes/landscape/layout/_widget/archive.ejs
Normal file
|
@ -0,0 +1,8 @@
|
|||
<% if (site.posts.length){ %>
|
||||
<div class="widget-wrap">
|
||||
<h3 class="widget-title"><%= __('archive_a') %></h3>
|
||||
<div class="widget">
|
||||
<%- list_archives({show_count: theme.show_count, type: theme.archive_type}) %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
8
themes/landscape/layout/_widget/category.ejs
Normal file
8
themes/landscape/layout/_widget/category.ejs
Normal file
|
@ -0,0 +1,8 @@
|
|||
<% if (site.categories.length){ %>
|
||||
<div class="widget-wrap">
|
||||
<h3 class="widget-title"><%= __('categories') %></h3>
|
||||
<div class="widget">
|
||||
<%- list_categories({show_count: theme.show_count}) %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
14
themes/landscape/layout/_widget/recent_posts.ejs
Normal file
14
themes/landscape/layout/_widget/recent_posts.ejs
Normal file
|
@ -0,0 +1,14 @@
|
|||
<% if (site.posts.length){ %>
|
||||
<div class="widget-wrap">
|
||||
<h3 class="widget-title"><%= __('recent_posts') %></h3>
|
||||
<div class="widget">
|
||||
<ul>
|
||||
<% site.posts.sort('date', -1).limit(5).each(function(post){ %>
|
||||
<li>
|
||||
<a href="<%- url_for(post.path) %>"><%= post.title || '(no title)' %></a>
|
||||
</li>
|
||||
<% }) %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
8
themes/landscape/layout/_widget/tag.ejs
Normal file
8
themes/landscape/layout/_widget/tag.ejs
Normal file
|
@ -0,0 +1,8 @@
|
|||
<% if (site.tags.length){ %>
|
||||
<div class="widget-wrap">
|
||||
<h3 class="widget-title"><%= __('tags') %></h3>
|
||||
<div class="widget">
|
||||
<%- list_tags({show_count: theme.show_count}) %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
8
themes/landscape/layout/_widget/tagcloud.ejs
Normal file
8
themes/landscape/layout/_widget/tagcloud.ejs
Normal file
|
@ -0,0 +1,8 @@
|
|||
<% if (site.tags.length){ %>
|
||||
<div class="widget-wrap">
|
||||
<h3 class="widget-title"><%= __('tagcloud') %></h3>
|
||||
<div class="widget tagcloud">
|
||||
<%- tagcloud() %>
|
||||
</div>
|
||||
</div>
|
||||
<% } %>
|
1
themes/landscape/layout/archive.ejs
Normal file
1
themes/landscape/layout/archive.ejs
Normal file
|
@ -0,0 +1 @@
|
|||
<%- partial('_partial/archive', {pagination: config.archive, index: true}) %>
|
1
themes/landscape/layout/category.ejs
Normal file
1
themes/landscape/layout/category.ejs
Normal file
|
@ -0,0 +1 @@
|
|||
<%- partial('_partial/archive', {pagination: config.category, index: true}) %>
|
1
themes/landscape/layout/index.ejs
Normal file
1
themes/landscape/layout/index.ejs
Normal file
|
@ -0,0 +1 @@
|
|||
<%- partial('_partial/archive', {pagination: 2, index: true}) %>
|
18
themes/landscape/layout/layout.ejs
Normal file
18
themes/landscape/layout/layout.ejs
Normal file
|
@ -0,0 +1,18 @@
|
|||
<%- partial('_partial/head') %>
|
||||
<body>
|
||||
<div id="container">
|
||||
<div id="wrap">
|
||||
<%- partial('_partial/header', null, {cache: !config.relative_link}) %>
|
||||
<div class="outer">
|
||||
<section id="main"><%- body %></section>
|
||||
<% if (theme.sidebar && theme.sidebar !== 'bottom'){ %>
|
||||
<%- partial('_partial/sidebar', null, {cache: !config.relative_link}) %>
|
||||
<% } %>
|
||||
</div>
|
||||
<%- partial('_partial/footer', null, {cache: !config.relative_link}) %>
|
||||
</div>
|
||||
<%- partial('_partial/mobile-nav', null, {cache: !config.relative_link}) %>
|
||||
<%- partial('_partial/after-footer') %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1
themes/landscape/layout/page.ejs
Normal file
1
themes/landscape/layout/page.ejs
Normal file
|
@ -0,0 +1 @@
|
|||
<%- partial('_partial/article', {post: page, index: false}) %>
|
1
themes/landscape/layout/post.ejs
Normal file
1
themes/landscape/layout/post.ejs
Normal file
|
@ -0,0 +1 @@
|
|||
<%- partial('_partial/article', {post: page, index: false}) %>
|
1
themes/landscape/layout/tag.ejs
Normal file
1
themes/landscape/layout/tag.ejs
Normal file
|
@ -0,0 +1 @@
|
|||
<%- partial('_partial/archive', {pagination: config.tag, index: true}) %>
|
Loading…
Add table
Add a link
Reference in a new issue