Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some improvement #92

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f8b39e3
feat: add ignores
dimaslanjaka Apr 20, 2023
7bfc54f
refactor: package configuration changes
dimaslanjaka Apr 20, 2023
921df66
feat: add indonesia language
dimaslanjaka Apr 20, 2023
d0ddb0b
feat: add helpers
dimaslanjaka Apr 20, 2023
ec3b189
feat: add bulma builder
dimaslanjaka Apr 20, 2023
61b8875
chore: patch fixes
dimaslanjaka Apr 20, 2023
ad365ac
chore: list homepage post by modified date
dimaslanjaka Apr 20, 2023
4362a09
feat: add `hexo-generator-redirect`
dimaslanjaka Apr 20, 2023
af09b67
chore: add meta and some fixes
dimaslanjaka Apr 20, 2023
b4b5f7d
chore: change blog title from site title
dimaslanjaka Apr 20, 2023
6d65760
chore: separate local search js
dimaslanjaka Apr 20, 2023
2f0b019
feat: add index-categories
dimaslanjaka Apr 20, 2023
233f5fe
feat: add snippet layout
dimaslanjaka Apr 20, 2023
17a7dee
feat: add custom local search layout
dimaslanjaka Apr 20, 2023
a13ff06
feat: dimaslanjaka custom layout
dimaslanjaka Apr 20, 2023
3482a97
feat: ignore some files from branch private
dimaslanjaka Apr 20, 2023
f8f73d7
chore: restore original attribution footer
dimaslanjaka Apr 20, 2023
5dd97d3
refactor: remove vscode launch
dimaslanjaka Apr 20, 2023
7525e1a
chore: remove files from private branch
dimaslanjaka Apr 20, 2023
b26583f
docs: add build bulma command
dimaslanjaka Apr 20, 2023
6d8e159
feat: add `fixURL` helper for disqus
dimaslanjaka Apr 22, 2023
4f8f4df
chore: remove `@types/hexo`
dimaslanjaka Apr 24, 2023
b3c9671
chore(script): add build script
dimaslanjaka Apr 25, 2023
767f4a9
chore(bulma): reset `.tag` in `pre` or `code` tags
dimaslanjaka Apr 25, 2023
4fdba2f
Merge branch 'private'
dimaslanjaka Apr 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
const prettier = require('./.prettierrc.json');

/**
* @type {import('eslint').ESLint.ConfigData}
*/
const config = {
root: true, // Specifies your current project has own eslint rules without extends parent folder eslint rules
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
env: {
browser: true, // add support for browser js (window,document,location,etc)
amd: true, // add amd support
node: true // add node support (module.export,etc)
},
globals: { hexo: true },
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module' // Allows for the use of imports
},
extends: [
'eslint:recommended', // uses eslint default recommended
'plugin:@typescript-eslint/eslint-recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:prettier/recommended' // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
// override rules for js files
overrides: [
{
files: ['*.js', '*.cjs'],
rules: {
'@typescript-eslint/no-var-requires': 'off' // disable require warning on js files
}
}
],
// specify your desired rules for eslint
rules: {
'prettier/prettier': ['error', prettier],
'@typescript-eslint/explicit-function-return-type': 'off', // disable function without return type
'no-unused-vars': 'off', // disable original eslint unused-vars
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
], // enable typescript-eslint unused-vars and allow unused vars start with underscore (_)
'@typescript-eslint/no-explicit-any': 'off', // allow any types
'@typescript-eslint/no-this-alias': [
// rules for this binding
'error',
{
allowDestructuring: false, // Disallow `const { props, state } = this`; true by default
allowedNames: ['self', 'hexo'] // Allow `const self = this`; by default
}
],
// "arrow-body-style" and "prefer-arrow-callback" are two ESLint core rules that can cause issues with prettier/prettier plugin, so turn them off.
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off'
}
};

module.exports = config;
13 changes: 10 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
.DS_Store
node_modules
tmp
.idea/
**/node_modules
**/.yarn/cache/**
**/.yarn/unplugged/**
**/.yarn/*.gz
**/.yarn/version*
**/tmp
.idea/
layout/**/*.njk
.vscode/launch.json
source/js/quiz.js
8 changes: 8 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": true,
"printWidth": 120,
"singleQuote": true,
"trailingComma": "none",
"tabWidth": 2
}
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"editor.formatOnSave": false,
"editor.formatOnPaste": false,
"editor.formatOnType": false,
"emmet.includeLanguages": {
"njk": "html"
},
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"terminal.integrated.env.linux": {
"PATH": "${env:PATH}:${workspaceFolder}/node_modules/.bin:${workspaceFolder}/bin"
},
"terminal.integrated.env.windows": {
"PATH": "${env:PATH};${workspaceFolder}\\node_modules\\.bin;${workspaceFolder}\\bin"
}
}
9 changes: 9 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

Large diffs are not rendered by default.

873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.0.cjs

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
enableGlobalCache: true

enableScripts: true

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: "@yarnpkg/plugin-typescript"

yarnPath: .yarn/releases/yarn-3.5.0.cjs
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 align="center">Claudia</h1>
<p align="center">
<p align="center">
Concisely designed & easy to config, match device dark mode, 90+ Lighthouse scoring
</p>

Expand All @@ -14,12 +14,18 @@
</p>

<p align="center">
<span>English | </span>
<span>English | </span>
<a href="README-CN.md" rel="nofollow">简体中文</a>
</p>

![cover](./screenshot/claudia-cover-v2.png)

## Development
to build or update bulma
```bash
gulp build
```

## Changelog
[Recent update 11.06.2022](CHANGELOG.md)

Expand All @@ -29,15 +35,15 @@

Install to Hexo blog root directory, **Not theme directory**
```bash
npm install hexo-renderer-pug
npm install hexo-renderer-pug
npm install hexo-renderer-dartsass
npm install hexo-generator-search

# if you need RSS, you must be install this plugin
npm install hexo-generator-feed

# Flowchat
npm install hexo-filter-flowchart
npm install hexo-filter-flowchart
# Math
npm install hexo-renderer-mathjax
```
Expand All @@ -48,7 +54,7 @@ Configure the file `hexo-theme-claudia/_config.yml` under the theme profile

```yaml
user:
name:
name:
avatar: /images/avatar.jpg
location:
description:
Expand Down Expand Up @@ -116,7 +122,7 @@ comment_valine:

### Appearance
```yaml
# 1.light
# 1.light
# 2.dark
# 3.auto (default, match device appearance setting)
appearance: auto
Expand All @@ -135,10 +141,10 @@ highlight:
Google Analytics and Baidu Analytics simple config:
```yaml
#Baidu Analytics**
ba_track_id:
ba_track_id:

#Google Analytics
ga_track_id:
ga_track_id:
ga_domain:
```

Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ comment_disqus:
enable: false
url: # the url of your website main domain like this https://xxx.xxx/
name: # the short name in disqus
decode: false # decode URL?

# dark
# light
Expand Down
25 changes: 25 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const path = require('path');
const fs = require('fs');

function buildStyles() {
const includePaths = [
path.join(__dirname, 'node_modules'),
path.join(__dirname, '../node_modules'),
path.join(__dirname, '../../node_modules'),
path.join(__dirname, '../../../node_modules')
].filter(fs.existsSync);
return gulp
.src('./src/sass/**/*.scss')
.pipe(
sass({
outputStyle: 'expanded',
includePaths
}).on('error', sass.logError)
)
.pipe(gulp.dest('./source/style'));
}

gulp.task('build', gulp.series(buildStyles));
gulp.task('default', gulp.series('build'));
31 changes: 31 additions & 0 deletions languages/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
archive:
one: 'Archive'
other: 'Archives'

category:
one: 'Category'
other: 'Categories'
tag:
one: 'Tag'
other: 'Tags'
post:
one: 'Post'
other: 'Posts'
page:
one: 'Page'
other: 'Pages'
prev: 'Previous'
next: 'Next'

all: 'All'
home: 'Home'
title: 'Title'
about: 'About'
recent: 'Recent'
friends: 'Friends'
read_more: 'Read more'
user_name: 'User name'
click_back_to_the_top: 'Click back to the top'

search_input_placeholder: 'Search everything..'

31 changes: 31 additions & 0 deletions languages/id.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
archive:
one: 'Arsip'
other: 'Arsip'

category:
one: 'Kategori'
other: 'Kategori'
tag:
one: 'Tag'
other: 'Tags'
post:
one: 'Postingan'
other: 'Postingan'
page:
one: 'Halaman'
other: 'Halaman'
prev: 'Sebelumnya'
next: 'Selanjutnya'

all: 'Semua'
home: 'Beranda'
title: 'Judul'
about: 'Tentang'
recent: 'Baru-baru ini'
friends: 'Teman'
read_more: 'Baca Selengkapnya'
user_name: 'Nama Pengguna'
click_back_to_the_top: 'Klik ke atas'

search_input_placeholder: 'Pencarian'

18 changes: 18 additions & 0 deletions layout/hexo-generator-redirect.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- var newUrl = typeof page !== 'undefined' && typeof page.target !== 'undefined' && page.target.path ? full_url_for(page.target.path) : typeof page.redirect_to === 'string' ? full_url_for(page.redirect_to) : null;

doctype html
head
meta(charset='UTF-8')
meta(http-equiv='X-UA-Compatible' content='IE=edge')
meta(name='viewport' content='width=device-width, initial-scale=1.0')
title=page.title
link(rel='canonical' href=page.redirect_to)
meta(http-equiv='refresh' content="0; url='"+page.redirect_to+"'")
h1=page.title+" Page address was changed"
p
| The new page address is #[a(href=newUrl rel='follow dofollow') #{newUrl}]
script(type='text/javascript').
setTimeout(function () {
//document.location.href = ''+newUrl+'';
location.replace(''+newUrl+'');
}, 3000);
5 changes: 3 additions & 2 deletions layout/post.pug
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ block content
a.button.is-default(href= url_for(page.next.path) title= page.next.title)
span.has-text-weight-semibold= nextContent
i.iconfont.icon-next.ml-2.has-text-grey
//section.related-posts= getRelatedPost(page)
if theme.comment_utteranc && theme.comment_utteranc.enable
article.mt-6.comment-container
script(
Expand All @@ -60,8 +61,8 @@ block content
if theme.comment_disqus && theme.comment_disqus.enable
div#disqus_thread
article.mt-6.comment-container#disqus
script="var disqus_config = function () {this.page.url = '"+theme.comment_disqus.url+url_for(page.path)+"';this.page.identifier = '"+theme.comment_disqus.name+"';};"
script="(function() {var d = document, s = d.createElement('script');s.src = 'https://"+theme.comment_disqus.name+".disqus.com/embed.js';s.setAttribute('data-timestamp', +new Date());(d.head || d.body).appendChild(s);})();"
script="var disqus_config = function () { this.page.url = '"+fixURL(theme.comment_disqus.url+url_for(page.path), {decode: theme.comment_disqus.decode})+"'; this.page.identifier = '"+theme.comment_disqus.name+"'; this.page.title = document.title; };"
script="(function() {var d = document, s = d.createElement('script');s.src = '//"+theme.comment_disqus.name+".disqus.com/embed.js';s.setAttribute('data-timestamp', +new Date());(d.head || d.body).appendChild(s);})();"
script(id="dsq-count-scr", src="//blog-pubgj2togw.disqus.com/count.js", async)
block script
if theme.image_zoom && theme.image_zoom.enable
Expand Down
Loading