Skip to content

Commit

Permalink
PR for v1.0.0 (#45)
Browse files Browse the repository at this point in the history
* change .gitignore for IntelliJ

* added that README.md only supports node 7 or below.

hexo-renderer-bourbon v1.0.4 isn't support Node v8.

* Theme initialization task

In the existing document, the command to copy the configuration file with command cp, which does not consider the Windows user.
Since there is no way to determine the OS in the npm script, I made it into a separate js file and run it on the node.

There is also a problem that when the user pushes files to their github page,
the theme does not come up in github,
due to the .git directory existing in this theme directory.
Therefore, init.js also deletes the .git directory.

I had to delete the .gitignore in init.js because the .gitignore file did not get the details of the theme changes.

* Add font

Previously, we had to install noto-sans-kr, spoqa-han-sans-kr, and spoqa-han-sans-jp fonts. I also clone all font related files in the spoqa-han-sans repository, so I
need to get hundreds of megabytes of files, so I only get the files related to web fonts.

Also, when cloning the repository, there is a problem that the .git directory is created and does not go to the github repository, so we have to delete the .git direc
tories inside the font directory in rm-git.js.

* Update package.json

* fix error of rel attribute value

alternative -> alternate

* fix error for npm script

split build task by each command and re-integrate

* fix accessibility

remove limitted maximum-scale from viewport setting

* fix the difference between canonical url and opengraph url

* apply 100% height layout

* add LiveRe Platform (소셜덧글 플랫폼)

* Migrate SASS to PostCSS 👼

And, FINALLY remove the bourbon.
This commit fixes #35, and #44.

* Embed font and icon files

Now users don't need to clone repos. So I delete commands which clone repos.
This fixes #30.

* Delete unneeded scripts

* Change .jade to .pug

* Update README

* Fix some bugs

* Fix page indicator margin

* Fix syntax which is not supported in pug anymore

* Fix missing `&` operators

* Add githook for build process

*  Add missing `&` operator

* Change built CSS file

* Fix some bugs, Improve article layout

* Add extra data for twitter and slack

* Improve meta:description

* Fix <hr> style bug
  • Loading branch information
HyunSeob authored Oct 8, 2017
1 parent 6efc843 commit 954d9c0
Show file tree
Hide file tree
Showing 263 changed files with 11,389 additions and 4,875 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ node_modules
npm-debug.log
source/libs/noto-sans-kr
source/libs/spoqa-han-sans
.idea
*.iml
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

The Overdose is minimalistic, simple and beatiful hexo theme, specialized in Korean blogs.

This theme works with hexo v3.2 or later.
This theme works with hexo v3.2 or later and Node v7 or lower.

## Features

- Responsive design
- Lightweight, not using jQuery or underscore.js, etc.
- Various code highlighting theme (Thanks to @SungYeolWoo), Set [Dracula](https://draculatheme.com/) theme by default
- Font setting
- [Font setting](#font-setting)
- noto-sans-kr
- spoqa-han-sans-kr
- spoqa-han-sans-jp
Expand All @@ -42,14 +42,9 @@ $ cd your/hexo/directory
$ git clone https://github.com/HyunSeob/hexo-theme-overdose.git themes/overdose
```

The overdose theme is using jade/sass(with bourbon). So install renderers.
This theme is using pug. So install renderer.
```
$ npm install --save hexo-renderer-jade hexo-renderer-bourbon
```

And clone vendor repositories.
```
$ cd themes/overdose;npm run clone
$ npm install --save hexo-renderer-pug # or you can still use hexo-renderer-jade, too.
```

Then, copy the configuration example file.
Expand All @@ -72,13 +67,29 @@ $ hexo server

See the [_config.yml.example](https://github.com/HyunSeob/hexo-theme-overdose/blob/master/_config.yml.example) file.

## Disqus
### Disqus

``` yml
# _config.yml of base, not theme config
# Please put your shortname of disqus here.
disqus_shortname:
```
### LiveRe
LiveRe is social media comment platcform suitable for Korean SNS, like disqus. <br>
see [LiveRe](https://livere.com/). <br>
You can get your uid from livere setting code as below.
``` html
<div id="lv-container" data-id="city" data-uid="your uid code">
```
how to set

``` yml
# Please put your uid of live here.
liveRe:
uid:
```
### Post Front matter
Expand All @@ -104,7 +115,7 @@ tags:

- [x] Chrome
- [x] Edge
- [x] IE 9+ (CSS3 Animation is not worked in IE9)
- [x] IE 10+
- [x] Firefox
- [x] Safari
- [x] Android Browser
Expand All @@ -113,6 +124,5 @@ tags:
## To Do

- i18n
- LiveRe
- Facebook Comments
- Featured posts
4 changes: 4 additions & 0 deletions _config.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ facebook:
fb_admin:
twitter:
google_plus:

#liveRe
liveRe:
uid:
File renamed without changes.
File renamed without changes.
49 changes: 31 additions & 18 deletions layout/includes/article.jade → layout/includes/article.pug
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ article#article.article(itemscope itemtype="https://schema.org/BlogPosting")
span.article__meta__categories__separator >
unless (page.banner && page.banner.url) || (page.photos && page.photos.length)
hr

.article__contents
!= page.content

if page.tags && page.tags.length
.article__tags
- page.tags.each(function(tag) {
Expand All @@ -35,7 +35,7 @@ article#article.article(itemscope itemtype="https://schema.org/BlogPosting")
alt=config.author)
a.article__author__link(
href=theme.profile.link
title="About #{config.author}"
title=`About ${config.author}`
rel="author"
)= config.author
p.article__author__desc= theme.profile.description || config.description
Expand All @@ -44,13 +44,26 @@ article#article.article(itemscope itemtype="https://schema.org/BlogPosting")
if url
a.article__author__socials__item(
href=url
title="#{label}"
title=label
target="_blank")
i(class="fa fa-#{label}")
meta(itemprop="name" content="#{config.author}")
i(class=`fa fa-${label}`)
meta(itemprop="name" content=config.author)

include sharer


if theme.liveRe && theme.liveRe.uid
#lv-container(data-id="city", data-uid=theme.liveRe.uid)
script.
(function(d, s) {
var j, e = d.getElementsByTagName(s)[0];
if (typeof LivereTower === 'function') { return; }
j = d.createElement(s);
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
j.async = true;
e.parentNode.insertBefore(j, e);
})(document, 'script');


// Disqus Code
if config.disqus_shortname
#disqus_thread
Expand All @@ -62,21 +75,21 @@ article#article.article(itemscope itemtype="https://schema.org/BlogPosting")
(d.head || d.body).appendChild(s);
})();
noscript Enable JavaScript to see comments.

// Meta Tags for Structured Data
- var truncOptions = { length: 200, separator: ' ' };
- var banner = page.banner || theme.default;
meta(itemprop="dateModified" content="#{date_xml(page.updated)}")
meta(itemprop="articleBody" content="#{truncate(strip_html(page.content), truncOptions)}")
meta(itemprop="url" content="#{config.url + '/' + page.path}")
meta(itemprop="mainEntityOfPage" content="#{config.url + '/' + page.path}")
meta(itemprop="dateModified" content=date_xml(page.updated))
meta(itemprop="articleBody" content=truncate(strip_html(page.content), truncOptions))
meta(itemprop="url" content=config.url + '/' + page.path)
meta(itemprop="mainEntityOfPage" content=config.url + '/' + page.path)
div(itemscope itemtype="https://schema.org/Organization" itemprop="publisher")
meta(itemprop="name" content="#{config.title}")
meta(itemprop="name" content=config.title)
div(itemscope itemprop="logo" itemtype="https://schema.org/ImageObject")
meta(itemprop="url" content="#{config.url + theme.favicon}")
meta(itemprop="url" content=config.url + theme.favicon)
div(itemscope itemtype="https://schema.org/ImageObject" itemprop="image")
meta(itemprop="contentUrl" content="#{config.url + banner.url}")
meta(itemprop="url" content="#{config.url + banner.url}")
meta(itemprop="contentUrl" content=config.url + banner.url)
meta(itemprop="url" content=config.url + banner.url)
meta(itemprop="width" content=banner.width)
meta(itemprop="height" content=banner.height)

File renamed without changes.
38 changes: 24 additions & 14 deletions layout/includes/head.jade → layout/includes/head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,62 @@
- if (is_year()) pageTitle += ': ' + page.year;
- pageTitle = pageTitle ? pageTitle += ' | ' + config.title : config.title;
- var banner = bannerOf(page) || theme.default.url;
-
var description = truncate(
strip_html(page.content) || config.description || theme.profile.description,
{
length: 140,
separator: ' ',
omission: '',
}
)
-
var openGraph = open_graph({
description: page.content || config.description || theme.profile.description,
description,
image: banner,
fb_app_id: theme.facebook,
fb_admins: theme.fb_admin,
twitter_id: theme.twitter,
google_plus: theme.google_plus
google_plus: theme.google_plus,
url: config.url.replace(/($|\/$)/, "/") + page.canonical_path.replace('index.html', '')
});
- var highlight = (theme.highlight && (typeof theme.highlight === 'string')) ? theme.highlight : 'dracula';

meta(charset='UTF-8')
meta(http-equiv="X-UA-Compatible" content="IE=edge")
meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1")
meta(name="viewport" content="width=device-width, initial-scale=1")

title= pageTitle

if theme.font === 'spoqa-han-sans-kr'
link(rel="stylesheet" href="/libs/spoqa-han-sans/css/SpoqaHanSans-kr.css")
link(rel="stylesheet" href="/libs/spoqa-han-sans-kr/css/SpoqaHanSans-kr.css")
else if theme.font === 'spoqa-han-sans-jp'
link(rel="stylesheet" href="/libs/spoqa-han-sans/css/SpoqaHanSans-jp.css")
link(rel="stylesheet" href="/libs/spoqa-han-sans-jp/css/SpoqaHanSans-jp.css")
else if theme.font === 'noto-sans-kr'
link(rel="stylesheet" href="/libs/noto-sans-kr/styles.css")

if theme.font
link(rel="stylesheet" href="/css/font.css")

link(rel="stylesheet" href="/libs/normalize.min.css")
link(rel="stylesheet" href="/libs/font-awesome-4.6.3/css/font-awesome.min.css")

link(rel="stylesheet" href="/libs/font-awesome/css/font-awesome.min.css")
link(rel="stylesheet" href="/css/index.css")
link(rel="stylesheet" href="/css/highlights/" + highlight + ".css")

| !{ canonical(config, page) }
| !{ openGraph }
if is_post()
meta(property="article:author" content=theme.profile.social.facebook || config.author)
meta(property="twitter:label1" content="Published at")
meta(property="twitter:data1" content=full_date(page.date))
meta(property="twitter:label2" content="Written by")
meta(property="twitter:data2" content=config.author)

if theme.favicon
link(rel="icon" href=theme.favicon)
if theme.profile.social.rss
link(rel="alternative" href=theme.profile.social.rss type="application/atom+xml" title=config.title)
link(rel="alternate" href=theme.profile.social.rss type="application/atom+xml" title=config.title)

if theme.google_site_verification
meta(name="google-site-verification" content="#{theme.google_site_verification}")
meta(name="google-site-verification" content=theme.google_site_verification)
if theme.naver_site_verification
meta(name="naver-site-verification" content="#{theme.naver_site_verification}")
meta(name="naver-site-verification" content=theme.naver_site_verification)
if theme.google_analytics
script.
(function(i,s,o,g,r,a,m) {i['GoogleAnalyticsObject']=r;i[r]=i[r]||function() {
Expand Down
13 changes: 7 additions & 6 deletions layout/includes/layout.jade → layout/includes/layout.pug
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ html(lang=config.language)
body(itemscope itemtype="https://schema.org/WebPage")
include menu
.page-background
.content-outer
.content-inner(itemscope itemtype="https://schema.org/Blog")
if body
div!= body
else
block content
.content-container
.content-outer
.content-inner(itemscope itemtype="https://schema.org/Blog")
if body
div!= body
else
block content
include footer

if theme.dynamic_menu
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ section.post-list
.post-list__item__col-1
a.post-list__item__link(href=url_for(post.path))
- var banner = bannerOf(post) || theme.default.url;
.post-list__item__link__background(style="background-image: url('#{ banner }')")
.post-list__item__link__background(style={
'background-image': `url('${banner}')`
})
.post-list__item__col-2
.post-list__item__meta
if post.categories && post.categories.length
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion layout/post.jade → layout/post.pug
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ block content
.related-posts__item__wrapper
a.related-posts__item(href=url_for(post.path))
- var banner = bannerOf(post) || theme.default.url;
.related-posts__item__background(style="background-image: url('#{ banner }')")
.related-posts__item__background(style={
'background-image': `url('${banner}')`
})
.related-posts__item__overlay
span.related-posts__item__title= post.title || 'Untitled'
File renamed without changes.
15 changes: 12 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@
"description": "The theme which you must be overdosed.",
"private": true,
"scripts": {
"clone": "git clone https://github.com/spoqa/spoqa-han-sans ./source/libs/spoqa-han-sans;git clone https://github.com/hyunseob/noto-sans-kr ./source/libs/noto-sans-kr",
"build": "node_modules/.bin/uglifyjs ./source/js/dynamicMenu.js -m -o ./source/js/dynamicMenu.min.js;node_modules/.bin/uglifyjs ./source/js/sharer.js -m -o ./source/js/sharer.min.js;cat ./source/js/dynamicMenu.min.js ./source/js/sharer.min.js > ./source/js/index.min.js"
"precommit": "npm build",
"build-dynamicMenu": "node_modules/.bin/uglifyjs ./source/js/dynamicMenu.js -m -o ./source/js/dynamicMenu.min.js",
"build-share": "node_modules/.bin/uglifyjs ./source/js/sharer.js -m -o ./source/js/sharer.min.js",
"build-index": "cat ./source/js/dynamicMenu.min.js ./source/js/sharer.min.js > ./source/js/index.min.js",
"build": "npm run build-dynamicMenu && npm run build-share && npm run build-index && npm run cssbuild",
"cssbuild": "postcss \"src/css/index.css\" --output \"source/css/index.css\""
},
"dependencies": {},
"devDependencies": {
"cssnano": "^3.10.0",
"husky": "^0.14.3",
"normalize.css": "^7.0.0",
"postcss-cli": "^4.1.1",
"postcss-cssnext": "^3.0.2",
"postcss-import": "^10.0.0",
"uglify-js": "^2.7.3"
}
}
11 changes: 11 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
plugins: [
require('postcss-import')({
parh: 'src/css',
}),
require('postcss-cssnext')({
browsers: ['> 1%', 'last 2 versions'],
}),
require('cssnano')(),
]
};
8 changes: 0 additions & 8 deletions source/css/_custom-mixin.scss

This file was deleted.

26 changes: 0 additions & 26 deletions source/css/_variables.scss

This file was deleted.

8 changes: 0 additions & 8 deletions source/css/footer.scss

This file was deleted.

Loading

0 comments on commit 954d9c0

Please sign in to comment.