update theme

This commit is contained in:
thisLight 2020-12-27 21:17:29 +08:00
parent 57ed60df81
commit 4bcac944b3
27 changed files with 23899 additions and 1 deletions

View file

@ -100,7 +100,7 @@ ignore:
# Extensions # Extensions
## Plugins: https://hexo.io/plugins/ ## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/ ## Themes: https://hexo.io/themes/
theme: landscape theme: cmd
# Deployment # Deployment
## Docs: https://hexo.io/docs/one-command-deployment ## Docs: https://hexo.io/docs/one-command-deployment

11
themes/cmd/.editorconfig Normal file
View file

@ -0,0 +1,11 @@
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

35
themes/cmd/_config.yml Normal file
View file

@ -0,0 +1,35 @@
# html lang
language:
- zh-cn
- en
# main menu navigation
menu:
Home: /
About: /about
Contact: /contact
Archives: /archives
# stylesheets loaded in the <head>
stylesheets:
- /css/cmd.css
- /materialize/css/materialize.css
- /css/materialdesignicons.min.css
# scripts loaded in the end of the body
scripts:
- /js/cmd.js
- /materialize/js/materialize.js
copyright_addtional: "Most original contents are public under CC BY-NC-ND 4.0 or GNU Affero General Public License version 3."
copyright_year_string: "2020-2021"
theme_self_claim: true
about_this_blog: This blog is created with Classical Material Desgin theme, which is a original taste of Material Design for hexo.
footer_links:
Link 1: "https://example.org"
Link 2: "https://example.com"

View file

@ -0,0 +1,73 @@
{% extends 'includes/layout.swig' %}
{% block body %}
{% set categoriesList = list_categories({ show_count: false }) %}
{% set tagsList = list_tags({ show_count: false }) %}
{% set archivesList = list_archives({ show_count: false }) %}
{% if !is_year() %}
<div id="archive">
<h1>Archives</h1>
{% if theme.atom %}
<p>
The feed is available via
<a href="{{ theme.atom }}">atom</a>.
</p>
<br>
{% endif %}
{% if config.atom %}
<p>
The feed is available via
<a href="{{ config.atom }}">atom</a>.
</p>
<br>
{% endif %}
<aside>
<h2>Categories</h2>
{% if categoriesList %}
{% autoescape false %}{{ categoriesList }}{% endautoescape %}
{% else %}
<p>None.</p>
{% endif %}
</aside>
<br>
<aside>
<h2>Tags</h2>
{% if tagsList %}
{% autoescape false %}{{ tagsList }}{% endautoescape %}
{% else %}
<p>None.</p>
{% endif %}
</aside>
<br>
<aside>
<h2>Archives</h2>
{% if archivesList %}
{% autoescape false %}{{ archivesList }}{% endautoescape %}
{% else %}
<p>None.</p>
{% endif %}
</aside>
</div>
{% else %}
<h1>{{ page.month + '/' + page.year }}</h1>
{% for postItem in page.posts.toArray() %}
<div class="archive-item">
<a href="{{ url_for(postItem.path) }}">
{{ postItem.title }}
</a>
<time datetime="{{ date_xml(postItem.date) }}">
{{ date(postItem.date) }}
</time>
</div>
{% endfor %}
<div id="paginator">
{{ paginator() }}
</div>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,21 @@
{% extends 'includes/layout.swig' %}
{% block body %}
<div id="category">
<h1>{{ page.category }}</h1>
{% for postItem in page.posts.toArray() %}
<div class="category-item">
<a href="{{ url_for(postItem.path) }}">
{{ postItem.title }}
</a>
<time datetime="{{ date_xml(postItem.date) }}">
{{ date(postItem.date) }}
</time>
</div>
{% endfor %}
</div>
<div id="paginator">
{{ paginator() }}
</div>
{% endblock %}

View file

@ -0,0 +1,109 @@
{% set pageTitle = page.title || config.subtitle || '' %}
{% if is_archive() %}
{% set pageTitle = 'Archives' %}
{% endif %}
{% if is_tag() %}
{% set pageTitle = 'Tag: ' + page.tag %}
{% endif %}
{% if is_category() %}
{% set pageTitle = 'Category: ' + page.category %}
{% endif %}
{% if is_month() %}
{% set pageTitle = pageTitle + ': ' + page.month + '/' + page.year %}
{% endif %}
{% if is_year() %}
{% set pageTitle = pageTitle + ': ' + page.year %}
{% endif %}
{% if pageTitle == '' %}
{% set pageTitle = config.title %}
{% endif %}
<!doctype html>
<html lang="{{ config.language }}">
<head>
<meta charset="UTF-8">
<title>{{ pageTitle }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
{% if theme.stylesheets !== undefined && theme.stylesheets.length > 0 %}
{# stylesheet list from _config.yml #}
{% for url in theme.stylesheets %}
<link rel="stylesheet" href="{{ url }}">
{% endfor %}
{% endif %}
{% block add_head %}{% endblock %}
</head>
<body>
<ul id="nav-mobile" class="sidenav">
{% for key in Object.keys(theme.menu) %}
<li><a href="{{ theme.menu[key] }}">{{ key }}</a></li>
{% endfor %}
</ul>
<nav class="light-blue lighten-1" role="navigation">
<a href="#" data-target="nav-mobile" class="sidenav-trigger"><div class="mdi mdi-menu"></div></a>
<div class="nav-wrapper">
<ul class="right hide-on-med-and-down">
{% for key in Object.keys(theme.menu) %}
<li><a href="{{ theme.menu[key] }}">{{ key }}</a></li>
{% endfor %}
</ul>
</div>
</nav>
<main id="content" class="container xscontainer">
{% block body %}{% endblock %}
</main>
<footer class="page-footer light-blue darken-4">
<div class="container">
<div class="row">
{% if theme.about_this_blog %}
<div class="col s12 m4">
<h5 class="white-text">About {{config.title}}</h5>
<p>{{theme.about_this_blog}}</p>
</div>
{% endif %}
{% if theme.footer_links %}
<div class="col s6 m4">
<h5 class="white-text"> Links </h5>
<ul>
{% for name in Object.keys(theme.footer_links) %}
<li><a class="grey-text text-lighten-3" href="{{theme.footer_links[name]}}">{{name}}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if theme.theme_self_claim %}
<div class="col s6 m4">
<p>This blog uses Classical Material Design theme.</p>
</div>
{% endif %}
</div>
</div>
<div class="footer-copyright">
<div class="container truncate">
© Copyright {{ theme.copyright_year_string }} {{ config.author }}. {{ theme.copyright_addtional }}
</div>
</div>
</footer>
{% if theme.scripts !== undefined && theme.scripts.length > 0 %}
{# scripts list from config.yml #}
{% for url in theme.scripts %}
<script src="{{ url }}"></script>
{% endfor %}
{% endif %}
{% block add_scripts %}{% endblock %}
</body>
</html>

View file

@ -0,0 +1,14 @@
{% if page.posts.length > 0 %}
<div id="recent-posts">
<h1>All Posts</h1>
{% for postItem in page.posts.toArray() %}
<div class="recent-post-item">
<a href="{{ url_for(postItem.path) }}">{{ postItem.title }}</a>
<time datetime="{{ postItem.date.toJSON() }}">
{{ date(postItem.date) }}
</time>
</div>
{% endfor %}
</div>
{% endif %}

View file

@ -0,0 +1,110 @@
{% extends 'includes/layout.swig' %}
{% macro PostTags(post) %}
<div>
{% for k in Object.keys(post.tags.data) %}
<a href="{{ url_for(post.tags.data[k].path)}}"><div class="chip">
{{post.tags.data[k].name}}
</div></a>
{% endfor %}
</div>
{% endmacro %}
{% macro PostList(posts) %}
<ul class="collection">
{% for post in posts %}
<li class="collection-item hoverable no-padding">
<div class="card z-depth-0 card-small-margin">
{% if post.photos && post.photos.length > 0 %}
<div class="card-image">
<img class="responsive-img" src="{{ post.photos[0] }}" />
<span class="card-title">{{ post.title }}</span>
</div>
{% if (post.tags.length > 0) || post.excerpt != "" %}
<div class="card-content">
{{ PostTags(post) }}
{% if post.excerpt != "" %}
<p>{{ post.excerpt }}</p>
{% endif %}
</div>
{% endif %}
<div class="card-action">
<a href="{{ url_for(post.path) }}">Go to "{{post.title}}"</a>
</div>
{% else %}
<div class="card-content">
<a href="{% if post.link %}{{ post.link }}{% else %}{{ url_for(post.path) }}{% endif %}" {%if post.link%}target="_blank"{%endif%}><span class="card-title">{% if (post.title != '' && post.title !== null && post.title !== undefined) %}{{ post.title }}{% else %}{{ post.path }}{% endif %}</span></a>
<p>{{ post.excerpt }}</p>
{{ PostTags(post) }}
</div>
{% endif %}
</div>
</li>
{% endfor %}
</ul>
{% endmacro %}
{% macro MeCard(name, email, description) %}
<div class="card">
<div class="row" style="margin-bottom: 0" >
{% if email %}
<div class="col" style="padding: 12px">
<img class="circle responsive-img" src="{{ gravatar(email) }}" async />
</div>
{% else %}
<div class="col" style="padding: 12px">
<img class="circle responsive-img" src="{{ gravatar('example@foo.bar') }}" />
</div>
{% endif %}
<div class="col" style="padding-top: 12px; padding-left: 12px">
{% if name %}
<div class="row" style="margin-bottom: 0"><h6>{{ name }}</h6></div>
{% endif %}
<div class="row" style="margin-bottom: 0"><p>{%if description %}{{description}}{% else %}Nothing to say.{%endif%}</p></div>
</div>
</div>
</div>
{% endmacro %}
{% macro TagPanel(tags) %}
<div class="card-panel">
<h5>All Tags</h5>
{% for tag in tags %}
<a href="{{ url_for(tag.path)}}"><div class="chip">
{{tag.name}}
</div></a>
{% endfor %}
</div>
{% endmacro %}
{% macro Paginiation() %}
<ul class="pagination">
<li class="{% if page.current == 1 %}disabled{% else %}waves-effect{% endif %}"><a href="{% if (page.current-1) == 1 %}{{url_for('/')}}{% else %}{{ page.prev_link }}{% endif %}"><i class="mdi mdi-chevron-left"></i></a></li>
<li class="{% if page.current == 1 %}active{% else %}waves-effect{% endif %}"><a href="{{ url_for('/') }}">1</a></li>
{% for n in range(2, page.total, 1) %}
<li class="{% if page.current == n %}active{% else %}waves-effect{% endif %}"><a href="{{ url_for('page/'+n+'/') }}">{{n}}</a></li>
{% endfor %}
<li class="{% if page.current == page.total %}disabled{% else %}waves-effect{% endif %}"><a href="{{ page.next_link }}"><i class="mdi mdi-chevron-right"></i></a></li>
</ul>
{% endmacro %}
{% block body %}
<div class="row">
<div class="col m8 l9">
{% if page.current == 1 %}
{{ MeCard(config.author, config.email, theme.me_description) }}
{% endif %}
{% if page.posts.length > 0 %}
{{ PostList(page.posts.toArray()) }}
{% else %}
<span>No Post Here...</span>
{% endif %}
<div class="center">
{{ Paginiation() }}
</div>
</div>
<div class="col m4 l3 hide-on-small-only">
{{ TagPanel(site.tags) }}
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,12 @@
{% extends 'includes/layout.swig' %}
{% block body %}
<article id="page">
<h1>{{ page.title }}</h1>
{% autoescape false %}{{page.content }}{% endautoescape %}
</article>
<div id="paginator">
{{ paginator() }}
</div>
{% endblock %}

View file

@ -0,0 +1,37 @@
{% extends 'includes/layout.swig' %}
{% macro Gallery(photos) %}
<div class="row">
<div class="col">
{% set i = 0 %}
{% for p in photos %}
{% set i = i + 1 %}
<img onerror="M.toast({ html: 'Some photos could not be showed at the moment, please try again later.' });" src="{{p}}" data-caption="{{i}}" class="responsive-img materialboxed gallery-img" async />
{% endfor %}
</div>
</div>
{% endmacro %}
{% block body %}
<article id="post">
<div class="card">
<div class="card-content">
<span class="card-title">{{ page.title }}</span>
<div class="row">
<div class="col" style="padding-left:0;"><span class="mdi mdi-account">{{config.author}}</span></div>
<div class="col"><span class="mdi mdi-clock">{{date(page.date, 'YYYY/M/D')}}</span></div>
</div>
{% if page.photos && page.photos.length > 0%}
{{Gallery(page.photos)}}
{% endif %}
<div class="flow-text">
{% autoescape false %}{{ page.content }}{% endautoescape %}
</div>
</div>
</div>
</article>
<div id="paginator">
{{ paginator() }}
</div>
{% endblock %}

View file

@ -0,0 +1,21 @@
{% extends 'includes/layout.swig' %}
{% block body %}
<div id="tag">
<h1>{{ page.tag }}</h1>
{% for article in page.posts.toArray() %}
<div class="tag-item">
<a href="{{ url_for(article.path) }}">
{{ article.title }}
</a>
<time datetime="{{ date_xml(article.date) }}">
{{ date(article.date) }}
</time>
</div>
{% endfor %}
</div>
<div id="paginator">
{{ paginator() }}
</div>
{% endblock %}

View file

@ -0,0 +1,4 @@
hexo.extend.helper.register("range", function(start, stop, step){
return Array.from({ length: (stop - start) / step + 1}, (_, i) => start + (i * step));
});

View file

@ -0,0 +1,22 @@
body
display: flex
min-height: 100vh
flex-direction: column
main
flex: 1 0 auto
.collection-item .no-padding
padding: 0
.card-small-margin
margin: 0.1rem 0 0 0 !important
@media only screen and (max-width: 450px)
.xscontainer
width: 100% !important
@media only screen and (min-width: 992px)
.card .card-content
padding: 12px

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,7 @@
(function(){
"use strict";
document.addEventListener("DOMContentLoaded",() => {
M.AutoInit()
})
})()

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014-2018 Materialize
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.

View file

@ -0,0 +1,91 @@
<p align="center">
<a href="http://materializecss.com/">
<img src="http://materializecss.com/res/materialize.svg" width="150">
</a>
</p>
<h3 align="center">MaterializeCSS</h3>
<p align="center">
Materialize, a CSS Framework based on material design.
<br>
<a href="http://materializecss.com/"><strong>-- Browse the docs --</strong></a>
<br>
<br>
<a href="https://travis-ci.org/Dogfalo/materialize">
<img src="https://travis-ci.org/Dogfalo/materialize.svg?branch=master" alt="Travis CI badge">
</a>
<a href="https://badge.fury.io/js/materialize-css">
<img src="https://badge.fury.io/js/materialize-css.svg" alt="npm version badge">
</a>
<a href="https://cdnjs.com/libraries/materialize">
<img src="https://img.shields.io/cdnjs/v/materialize.svg" alt="CDNJS version badge">
</a>
<a href="https://david-dm.org/Dogfalo/materialize">
<img src="https://david-dm.org/Dogfalo/materialize/status.svg" alt="dependencies Status badge">
</a>
<a href="https://david-dm.org/Dogfalo/materialize#info=devDependencies">
<img src="https://david-dm.org/Dogfalo/materialize/dev-status.svg" alt="devDependency Status badge">
</a>
<a href="https://gitter.im/Dogfalo/materialize">
<img src="https://badges.gitter.im/Join%20Chat.svg" alt="Gitter badge">
</a>
</p>
## Table of Contents
- [Quickstart](#quickstart)
- [Documentation](#documentation)
- [Supported Browsers](#supported-browsers)
- [Changelog](#changelog)
- [Testing](#testing)
- [Contributing](#contributing)
- [Copyright and license](#copyright-and-license)
## Quickstart:
Read the [getting started guide](http://materializecss.com/getting-started.html) for more information on how to use materialize.
- [Download the latest release](https://github.com/Dogfalo/materialize/releases/latest) of materialize directly from GitHub. ([Beta](https://github.com/Dogfalo/materialize/releases/))
- Clone the repo: `git clone https://github.com/Dogfalo/materialize.git` (Beta: `git clone -b v1-dev https://github.com/Dogfalo/materialize.git`)
- Include the files via [cdnjs](https://cdnjs.com/libraries/materialize). More [here](http://materializecss.com/getting-started.html). ([Beta](https://cdnjs.com/libraries/materialize/1.0.0-beta))
- Install with [npm](https://www.npmjs.com): `npm install materialize-css` (Beta: `npm install materialize-css@next`)
- Install with [Bower](https://bower.io): `bower install materialize` ([DEPRECATED](https://bower.io/blog/2017/how-to-migrate-away-from-bower/))
- Install with [Atmosphere](https://atmospherejs.com): `meteor add materialize:materialize` (Beta: `meteor add materialize:materialize@=1.0.0-beta`)
## Documentation
The documentation can be found at <http://materializecss.com>. To run the documentation locally on your machine, you need [Node.js](https://nodejs.org/en/) installed on your computer.
### Running documentation locally
Run these commands to set up the documentation:
```bash
git clone https://github.com/Dogfalo/materialize
cd materialize
npm install
```
Then run `grunt monitor` to compile the documentation. When it finishes, open a new browser window and navigate to `localhost:8000`. We use [BrowserSync](https://www.browsersync.io/) to display the documentation.
### Documentation for previous releases
Previous releases and their documentation are available for [download](https://github.com/Dogfalo/materialize/releases).
## Supported Browsers:
Materialize is compatible with:
- Chrome 35+
- Firefox 31+
- Safari 9+
- Opera
- Edge
- IE 11+
## Changelog
For changelogs, check out [the Releases section of materialize](https://github.com/Dogfalo/materialize/releases) or the [CHANGELOG.md](CHANGELOG.md).
## Testing
We use Jasmine as our testing framework and we're trying to write a robust test suite for our components. If you want to help, [here's a starting guide on how to write tests in Jasmine](CONTRIBUTING.md#jasmine-testing-guide).
## Contributing
Check out the [CONTRIBUTING document](CONTRIBUTING.md) in the root of the repository to learn how you can contribute. You can also browse the [help-wanted](https://github.com/Dogfalo/materialize/labels/help-wanted) tag in our issue tracker to find things to do.
## Copyright and license
Code Copyright 2018 Materialize. Code released under the MIT license.

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long