Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
idmyn committed May 11, 2022
0 parents commit 4a99303
Show file tree
Hide file tree
Showing 13 changed files with 3,517 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"standard"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"dot-notation": "off"
},
"ignorePatterns": ["dist/*.js"]
}
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- uses: pnpm/action-setup@v2.0.1
with:
version: 7.0.0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: pnpm semantic-release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib
10 changes: 10 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MIT License

Copyright (c) David Mynors

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.

33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# @idmyn/gatsby-remark-backlinks

## Installation

`npm install @idmyn/gatsby-remark-backlinks`

## Usage

You'll want to load this plugin after a remark wikilinks plugin like
`@idmyn/gatsby-remark-wiki-link`

``` javascript
// gatsby-config.js
module.exports = {
plugins: [
{
resolve: 'gatsby-transformer-remark',
options: {
plugins: [{
resolve: "@idmyn/gatsby-remark-wiki-link",
options: {
pageResolver: (name) => [name.replace(/ /g, '-').toLowerCase()],
hrefTemplate: (permalink) => `/${permalink}`
}
}],
}
},
{
resolve: `@idmyn/gatsby-remark-backlinks`,
},
],
};
```
2 changes: 2 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exports.onCreateNode = require('./dist/index.js').onCreateNode
exports.setFieldsOnGraphQLNodeType = require('./dist/index.js').setFieldsOnGraphQLNodeType
57 changes: 57 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "@idmyn/gatsby-remark-backlinks",
"description": "A gatsby plugin to surface backlinks for wikilinks",
"version": "1.0.0",
"release": {
"branches": [
"main"
]
},
"publishConfig": {
"access": "public"
},
"keywords": [
"gatsby",
"remark",
"remark-plugin",
"markdown",
"wiki"
],
"repository": {
"type": "git",
"url": "git+https://github.com/idmyn/gatsby-remark-backlinks.git"
},
"license": "MIT",
"author": {
"name": "David Mynors",
"email": "hello@davidmyno.rs",
"url": "https://davidmyno.rs"
},
"files": [
"dist",
"gatsby-*"
],
"scripts": {
"prepublish": "npm run build",
"build": "tsc",
"watch": "tsc --watch",
"lint": "eslint . --ext .js,.ts",
"test": "echo 'no tests'"
},
"dependencies": {
"ramda": "^0.28.0"
},
"devDependencies": {
"@tsconfig/node16-strictest-esm": "^1.0.0",
"@types/ramda": "^0.28.12",
"@typescript-eslint/eslint-plugin": "^5.23.0",
"@typescript-eslint/parser": "^5.23.0",
"eslint": "^8.15.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.2.0",
"eslint-plugin-promise": "^6.0.0",
"semantic-release": "^19.0.2",
"typescript": "^4.6.4"
}
}

0 comments on commit 4a99303

Please sign in to comment.