Skip to content

Commit

Permalink
Merge branch 'main' into 15-about-image-display
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrusky committed Feb 22, 2024
2 parents 0f94abf + 1cd7963 commit 32661ad
Show file tree
Hide file tree
Showing 24 changed files with 2,820 additions and 128 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# top-most EditorConfig file
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
tab_width = 2
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.eslintrc.js
build
35 changes: 35 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
extends: ["plugin:prettier/recommended"],
plugins: [
"simple-import-sort",
"@typescript-eslint",
"import",
"prettier",
"header",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: "./tsconfig.json",
},
rules: {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"prettier/prettier": "error",
"import/first": "off",
"header/header": [
2,
"block",
[
"************************************************",
" * Copyright (c) 2023.",
" * Author: Cyrusky <[email protected]>",
" ************************************************",
],
],
"@typescript-eslint/no-useless-constructor": "off",
},
};
23 changes: 23 additions & 0 deletions .github/workflows/node.js.pulish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Publish Node.js Package

on:
release:
types: [ created ]

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
30 changes: 0 additions & 30 deletions .github/workflows/node.js.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
dist/index.js
5 changes: 5 additions & 0 deletions .idea/.gitignore

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

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

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

6 changes: 6 additions & 0 deletions .idea/jsLinters/eslint.xml

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

7 changes: 7 additions & 0 deletions .idea/prettier.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

12 changes: 12 additions & 0 deletions .versionrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
types: [
{ type: "feat", section: "Features" },
{ type: "fix", section: "Bugs Fix" },
{ type: "chore", hidden: true },
{ type: "docs", hidden: true },
{ type: "style", hidden: true },
{ type: "refactor", section: "Refactor" },
{ type: "perf", hidden: true },
{ type: "test", hidden: true },
],
};
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### 0.1.5 (2024-02-22)
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2022 Cyrusky

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.
MIT License
Copyright (c) 2022 Cyrusky
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.
64 changes: 32 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Hexo-Backlink

A plugin to convert backlink in `.md` file to `in-site` link.

## Install

```bash
npm install hexo-backlink
```

## configuration

Add `backlink:true` in `_config.yml`:

Check the settings in Obsidian as follow:

> "Settings" -> "Files & Links" -> "New link format" , setting as "Relative path to file"
> "Settings" -> "Files & Links" -> "Use [[Wikilinks]]" , keeping it ON
## Know-issue

- Can not convert link include `tags`, it will ignore the tags. like:

```
[[DemoMarkdownFile#Demo]] --<result equals>-> [[DemoMarkdownFile]]
```

## TODO

- [] Update the documents and make sure you can start from zero.
- [] Change the project to typescript.
- [] Try to do some integritions.
# Hexo-Backlink

A plugin to convert backlink in `.md` file to `in-site` link.

## Install

```bash
npm install hexo-backlink
```

## configuration

Add `backlink:true` in `_config.yml`:

Check the settings in Obsidian as follow:

> "Settings" -> "Files & Links" -> "New link format" , setting as "Relative path to file"
> "Settings" -> "Files & Links" -> "Use [[Wiki links]]" , keeping it ON
## Know-issue

- Can not convert link include `tags`, it will ignore the tags. like:

```
[[DemoMarkdownFile#Demo]] --<result equals>-> [[DemoMarkdownFile]]
```

## TODO

- [] Update the documents and make sure you can start from zero.
- [] Change the project to typescript.
- [] Try to do some integritions.
17 changes: 17 additions & 0 deletions build/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { resolve } = require("path");
const { build } = require("esbuild");

const rootDir = resolve(__dirname, "..");

build({
entryPoints: [resolve(rootDir, "src/index.ts")],
bundle: true,
minify: true,
format: "cjs",
platform: "node",
target: "es2018",
treeShaking: true,
outfile: resolve(rootDir, "dist", "index.js"),
}).then(() => {
console.log("Build complete!");
});
13 changes: 13 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"ignore": [
"**/*.test.ts",
"**/*.spec.ts",
".git",
"node_modules"
],
"watch": [
"src"
],
"exec": "pnpm build",
"ext": "ts, *"
}
41 changes: 33 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,55 @@
{
"name": "hexo-backlink",
"version": "0.1.4",
"version": "0.1.5",
"description": "This plugin is for transfer Obsidian-type backlink to standard hexo in-site post link.",
"main": "index.js",
"scripts": {},
"main": "dist/index.js",
"scripts": {
"build": "node build/index.js",
"dev": "cross-env NODE_ENV=development nodemon",
"release": "standard-version"
},
"keywords": [
"hexo",
"plugin",
"backlink",
"obsidian"
],
"files": [
"index.js"
],
"author": "BorGor",
"license": "MIT",
"dependencies": {
"hexo-log": "^3.0.0",
"@types/hexo": "^3.8.12",
"husky": "^7.0.4",
"jira-smart-commit": "^1.1.2"
},
"repository": {
"type": "git",
"url": "https://github.com/Cyrusky/hexo-backlink.git"
},
"husky": {
"hooks": {
"commit-msg": "jira-smart-commit PSN",
"pre-commit": "lint-staged"
"config": {
"commitizen": {
"path": "./node_modules/git-cz"
}
},
"devDependencies": {
"@types/node": "^20.11.19",
"cross-env": "^7.0.3",
"esbuild": "^0.20.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-with-typescript": "^43.0.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-simple-import-sort": "^10.0.0",
"git-cz": "^4.9.0",
"hexo-fs": "^4.1.1",
"hexo-log": "^3.2.0",
"nodemon": "^3.0.2",
"prettier": "^3.2.5",
"standard-version": "^9.5.0",
"typescript": "^5.3.3"
}
}
Loading

0 comments on commit 32661ad

Please sign in to comment.