Skip to content

Commit

Permalink
feat(hexo): make favicon customizable and match files via paths in fr…
Browse files Browse the repository at this point in the history
…ont matter defaults
  • Loading branch information
ourai committed Apr 12, 2024
1 parent 5610e0f commit fad6d4a
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 232 deletions.
3 changes: 1 addition & 2 deletions .knosys/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,13 @@ function copyHexoFiles() {

copyThemeAssets(`${hexoDistRoot}/source`, true);

const { devDependencies, ...pkgFields } = pick(require(`${prjRoot}/package.json`), ['version', 'description', 'repository', 'author', 'license', 'bugs', 'homepage', 'devDependencies']);
const pkgFields = pick(require(`${prjRoot}/package.json`), ['version', 'description', 'repository', 'author', 'license', 'bugs', 'homepage', 'dependencies']);

saveData(`${hexoDistRoot}/package.json`, JSON.stringify({
name: 'hexo-theme-lime',
main: 'package.json',
keywords: ['hexo', 'theme', 'lime', 'knosys', 'ksio'],
...pkgFields,
dependencies: { '@ntks/toolbox': devDependencies['@ntks/toolbox'] },
}, null, 2));
copyMetaFiles('hexo');
}
Expand Down
13 changes: 10 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
{
"name": "@ourai/lime",
"version": "0.0.0-alpha.1",
"version": "0.0.0-alpha.2",
"description": "Simple, readable, responsive theme for blogs, personal websites and API docs",
"private": true,
"main": "index.js",
"scripts": {
"copy": "node .knosys/scripts copy",
"build": "node .knosys/scripts build",
"clean": "rm -rf src/jekyll/.asset-cache",
"start": "node .knosys/scripts serve",
"predeploy": "npm run clean",
"deploy": "node .knosys/scripts deploy"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ourai/lime.git"
Expand All @@ -22,8 +14,18 @@
"url": "https://github.com/ourai/lime/issues"
},
"homepage": "https://ourai.github.io/lime/",
"dependencies": {
"hexo-front-matter-defaults": "0.0.0"
},
"devDependencies": {
"@ntks/toolbox": "0.0.6",
"ksio": "0.0.2"
},
"scripts": {
"copy": "node .knosys/scripts copy",
"build": "node .knosys/scripts build",
"clean": "rm -rf src/jekyll/.asset-cache",
"start": "node .knosys/scripts serve",
"predeploy": "npm run clean",
"deploy": "node .knosys/scripts deploy"
}
}
113 changes: 2 additions & 111 deletions src/hexo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions src/hexo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,10 @@
},
"dependencies": {
"hexo": "^6.3.0",
"hexo-generator-archive": "^2.0.0",
"hexo-generator-category": "^2.0.0",
"hexo-generator-index": "^3.0.0",
"hexo-generator-tag": "^2.0.0",
"hexo-renderer-coffeescript": "^0.2.0",
"hexo-renderer-ejs": "^2.0.0",
"hexo-renderer-marked": "^6.0.0",
"hexo-renderer-sass": "^0.4.0",
"hexo-renderer-stylus": "^2.1.0",
"hexo-server": "^3.0.0",
"hexo-theme-landscape": "^0.0.3"
"hexo-server": "^3.0.0"
}
}
19 changes: 19 additions & 0 deletions src/hexo/themes/lime/layout/_ksio/layouts/base.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="<%= config.language %>" dir="ltr">
<head>
<%- partial('_ksio/partials/head') %>
<%- css('stylesheets/global') %>
<% [].concat(page.ksio_asset_css || []).forEach(cssPath => { %><%- css(cssPath) %><% }) %>
<%- js('javascripts/ksio/vendors/jquery-1.11.3.min') %>
<%- js('javascripts/ksio/vendors/bootstrap.min') %>
</head>
<% const bodyClass = ['Page'] %>
<% if (page.ksio_slot_banner || page.banner) { %>
<% bodyClass.push('has-headerImage') %>
<% } %>
<body class="<%= bodyClass.join(' ') %>" itemscope itemtype="http:https://schema.org/WebPage">
<%- body %>
<script>$('.Article-content > table').addClass('table table-bordered')</script>
<% [].concat(page.ksio_asset_js || []).forEach(jsPath => { %><%- js(jsPath) %><% }) %>
</body>
</html>
20 changes: 1 addition & 19 deletions src/hexo/themes/lime/layout/_ksio/layouts/default.ejs
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
<!DOCTYPE html>
<html lang="<%= config.language %>" dir="ltr">
<head>
<%- partial('_ksio/partials/head') %>
<%- css('stylesheets/global') %>
<% [].concat(page.ksio_asset_css || []).forEach(cssPath => { %><%- css(cssPath) %><% }) %>
<%- js('javascripts/ksio/vendors/jquery-1.11.3.min') %>
<%- js('javascripts/ksio/vendors/bootstrap.min') %>
</head>
<% const bodyClass = ['Page'] %>
<% if (page.ksio_slot_banner || page.banner) { %>
<% bodyClass.push('has-headerImage') %>
<% } %>
<body class="<%= bodyClass.join(' ') %>" itemscope itemtype="http:https://schema.org/WebPage">
<%- body %>
<script>$('.Article-content > table').addClass('table table-bordered')</script>
<% [].concat(page.ksio_asset_js || []).forEach(jsPath => { %><%- js(jsPath) %><% }) %>
</body>
</html>
<%- partial('_ksio/slots/content') %>
3 changes: 2 additions & 1 deletion src/hexo/themes/lime/layout/_ksio/partials/meta/brand.ejs
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<%- favicon_tag('images/ksio/favicon.ico') %>
<% if (theme.brand && theme.brand.color) { %><meta name="theme-color" content="<%= theme.brand.color %>"><% } %>
<%- favicon_tag(theme.brand && theme.brand.icon || 'images/ksio/favicon.ico') %>
2 changes: 1 addition & 1 deletion src/hexo/themes/lime/layout/layout.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%- partial('_ksio/layouts/default') %>
<%- partial('_ksio/layouts/base') %>

0 comments on commit fad6d4a

Please sign in to comment.