Skip to content

Commit

Permalink
A big change
Browse files Browse the repository at this point in the history
- Change theme name to Memory.
- Migrate less to scss.
- Support sidebar.
- Support Table of Content.
  • Loading branch information
artchen committed May 3, 2020
1 parent 5d62358 commit c38ef80
Show file tree
Hide file tree
Showing 55 changed files with 1,795 additions and 1,565 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.DS_Store
.idea
*.iml
34 changes: 14 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,48 @@
# Hexo Theme Typescript
# Hexo Theme Memory

Typescript is a minimal theme for [Hexo](http://hexo.io).
Memory is a minimal theme for [Hexo](http://hexo.io).

This theme is also available on:

* Ghost version: [ghost-theme-typescript](https://github.com/artchen/ghost-theme-typescript)
* Ghost version: [ghost-theme-memory](https://github.com/artchen/ghost-theme-memory)

## Dependencies

Recommended list of plugins:
Install these Hexo plugins to unlock the full potential of this theme:

* hexo-all-minifier
* hexo-autoprefixer
* hexo-front-matter
* hexo-generator-archive
* hexo-generator-category
* hexo-generator-feed
* hexo-generator-index
* hexo-generator-tag
* hexo-pagination
* hexo-renderer-less
* hexo-renderer-ejs
* hexo-renderer-scss
* hexo-renderer-marked
* hexo-pagination
* hexo-toc

## Customization

Typescript is customizable via `_config.yml` file under the theme directory.
The theme is customizable via `_config.yml` file under the theme directory.

The global `_config.yml` for Hexo may also need customization. In particular:

* Set `disqus_shortname` field to your disqus short name.
* Set `theme` field to `hexo-theme-typescript`.
* Set `theme` field to `hexo-theme-memory`.

In addition to these settings, users may also want to edit/replace the following files:

* Replace the site logo: `source/images/logo.png`, `source/images/logo.psd`
* Replace the site logo: `source/img/logo.png`, `source/img/logo.psd`
* The icon fonts are from [icomoon](https://icomoon.io/).
* The default English font is Futura PT via Adobe Typekit. If you are using Typekit like me, please change the embedded javascript code in `layout/_partial/head.ejs`, else you can delete the corresponding code.

This theme currently support 3 search services:
This theme supports the following search services:

* Google custom search
* Algolia search
* Microsoft Azure search

For information about how to setup searching, please refer to another project of mine, [universal-search](https://github.com/artchen/universal-search).
Refer to [universal-search](https://github.com/artchen/universal-search) series to learn how to set up search.

## Demo

![Typescript Demo](http://artifact.me/images/ghost-theme-typescript-screenshot.png)
![Memory Demo](https://cdn.otakism.com/assets/hexo-theme-memory/demo/ghost-theme-memory-screenshot.jpg)

## Copyright

Expand All @@ -60,7 +54,7 @@ Public resources used in this theme:

Copyright © Art Chen

Please do not remove the "Theme Typescript designed by Art Chen" text and links.
Please do not remove the "Theme Memory designed by Art Chen" text and links.

请不要删除页面底部的作者信息和链接。

Expand Down
51 changes: 26 additions & 25 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# Meta
description: A minimal hexo theme.
keywords: hexo,theme,minimal,otakism
site_desc: your catch phrase
keywords: hexo,theme,otakism,otaku
site_desc: otaku keeps alive

# Navigation
navigation:
- name: Home
slug: home
url: /
menu:
- name: About
slug: about
url: /about
Expand All @@ -17,8 +14,8 @@ navigation:

# Search
search:
enable: true
service: google # google/hexo/algolia/azure/baidu
enable: false
service: #google/hexo/algolia/azure
# google
google_api_key:
google_engine_id:
Expand All @@ -33,36 +30,40 @@ search:

# Miscellaneous
google_analytics:
favicon: /favicon.png
author_url: https://example.com
author_url: https://artifact.me

# Less
less:
compress: true
# Scss
node_sass:
debug: false
outputStyle: nested
precision: 5
sourceComments: false

# use url, not username
social:
- slug: email
url: #mailto:[email protected]
url:
- slug: github
url: #https://github.com/<id>
url: https://github.com/artchen
- slug: twitter
url: #https://twitter.com/<id>
url:
- slug: rss
url: /atom.xml
url: /atom.xml
- slug: google
url:
- slug: facebook
url: #https://www.facebook.com/<id>
url:
- slug: linkedin
url: #https://www.linkedin.com/in/<id>
url:
- slug: sina-weibo
url: #http://weibo.com/<id>
url:
- slug: tumblr
url: #http://<id>.tumblr.com
url:
- slug: dribbble
url: #https://dribbble.com/<id>
url:
- slug: pinterest
url: #https://www.pinterest.com/<id>
url:
- slug: instagram
url: #https://instagram.com/<id>
url:
- slug: behance
url: #https://www.behance.net/<id>
url:
File renamed without changes
File renamed without changes
11 changes: 5 additions & 6 deletions layout/_partial/archive.ejs
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<% if (is_tag()) { %>
<section class="page-header tag">
<section class="page-header tag">
<h1>- <span><%= page.tag %></span> -</h1>
</section>
<% } %>

<% if (is_archive()) { %>
<section class="page-header archive">
<section class="page-header archive">
<h1>- <span><%= page.year %><%= page.month ? '.' + page.month : '' %></span> -</h1>
</section>
<% } %>

<% if (is_category()) { %>
<section class="page-header category">
<section class="page-header category">
<h1>- <span><%= page.category %></span> -</h1>
</section>
<% } %>

<section class="post-list">
<% page.posts.each(function(post){ %>
<% page.posts.each(function(post){ %>
<%- partial('post', {post: post}) %>
<% }) %>
</section>

<% if (page.total > 1) { %>
<nav id="page-nav">
<nav id="page-nav" class="clearfix">
<% if (page.prev != 0) { %>
<a class="prev" rel="prev" href="<%= url_for(page.prev_link) %>">
<span class="icon icon-chevron-left"></span>
Expand All @@ -37,5 +37,4 @@
</a>
<% } %>
</nav>
<% } %>
57 changes: 28 additions & 29 deletions layout/_partial/article.ejs
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
<article id="<%= post.layout %>-<%= post.slug %>"
class="post article white-box article-type-<%= post.layout %>"
itemscope itemprop="blogPost">
<h2 class="title">
<a href="<%- url_for(post.path) %>">
<%= post.title %>
</a>
</h2>
<time>
<%= date(post.date, 'MMM D, YYYY') %>
</time>
<section class="content">
<div class="article-entry" itemprop="articleBody">
<%- post.content %>
</div>

<div class="article-tags tags">
<% if (post.tags && post.tags.length){ %>
<%- list_tags(post.tags, {
show_count: false,
style: 'none',
separator: ''
}) %>
<% } %>
</div>
</section>
class="post article white-box article-type-<%= post.layout %>"
itemscope itemprop="blogPost">
<h2 class="title">
<a href="<%- url_for(post.path) %>">
<%= post.title %>
</a>
</h2>
<time>
<%= date(post.date, 'MMM D, YYYY') %>
</time>
<section class="content">
<div class="article-entry" itemprop="articleBody">
<%- post.content %>
</div>
<div class="article-tags tags">
<% if (post.tags && post.tags.length){ %>
<%- list_tags(post.tags, {
show_count: false,
style: 'none',
separator: ''
}) %>
<% } %>
</div>
</section>
</article>

<% if (post.comments && config.disqus_shortname){ %>
<section id="comments">
<div id="disqus_thread"></div>
</section>
<section id="comments">
<div id="disqus_thread"></div>
</section>
<% } %>

<% if (post.comments && config.duoshuo_shortname){ %>
<div class="duoshuo" id="comments">
<div id="comment-box" ></div>
<div class="ds-thread" id="ds-thread" data-thread-key="<%=post.path%>" data-title="<%=post.title%>" data-url="<%=url%>"></div>
</div>
<% } %>
<% } %>
52 changes: 27 additions & 25 deletions layout/_partial/footer.ejs
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
<footer id="footer" class="clearfix">

<% if (theme.search.enable === true) { %>
<div class="search">
<form name="searchform" id="searchform" class="u-search-form">
<input type="text" id="searchinput" class="u-search-input" placeholder="Looking for something?" />
<button type="submit" id="u-search-btn-submit" class="u-search-btn-submit">
<span class="icon icon-search"></span>
</button>
</form>
</div>
<% } %>

<div class="social-wrapper">
<% if (theme.social) { %>
<% theme.social.forEach(function(value) {
if (value.url && value.slug) { %>
<a href="<%= value.url %>" class="social <%= value.slug %>"
target="_blank" rel="external">
<span class="icon icon-<%= value.slug %>"></span>
</a>
<% } }); %>
<% if (theme.search.enable === true) { %>
<div class="search">
<form name="searchform" id="searchform" class="u-search-form">
<input type="text" id="searchinput" class="u-search-input" placeholder="Looking for something?"/>
<button type="submit" id="u-search-btn-submit" class="u-search-btn-submit">
<span class="icon icon-search"></span>
</button>
</form>
</div>
<% } %>
</div>

<div>Theme <span class="codename">Typescript</span> designed by <a href="http://rakugaki.me/" target="_blank">Art Chen</a>.</div>
<div>&copy; <a href="/"><%= config.title %></a></div>


<div class="social-wrapper">
<% if (theme.social) { %>
<% theme.social.forEach(function(value) {
if (value.url && value.slug) { %>
<a href="<%= value.url %>" class="social <%= value.slug %>"
target="_blank" rel="external">
<span class="icon icon-<%= value.slug %>"></span>
</a>
<% } }); %>
<% } %>
</div>

<div class="theme-by">Theme <span class="codename">Memory</span> designed by <a href="https://artifact.me/"
target="_blank">Art Chen</a>.
</div>
<div>&copy; <a href="<%= url_for('/') %>"><%= config.title %></a></div>

</footer>

24 changes: 11 additions & 13 deletions layout/_partial/google-analytics.ejs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<% 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 -->
<% } %>
<!-- 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 -->
<% } %>
Loading

0 comments on commit c38ef80

Please sign in to comment.