-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 945046c
Showing
8 changed files
with
432 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
~ |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Block Processors | ||
|
||
Block processors package for [Frontity](https://frontity.org). | ||
|
||
# Installation | ||
|
||
1. Do `npm install @aamodtgroup/block-processors` in the root of your project. | ||
1. Add the package name in `frontity-settings.js`. | ||
|
||
```javascript | ||
"packages": [ | ||
"@aamodtgroup/block-processors" | ||
// other packages ... | ||
] | ||
``` | ||
|
||
3. Run `npx frontity dev` again. | ||
|
||
That's it! The package doesn't need any settings. | ||
|
||
## Credits | ||
|
||
- Build with love :blue_heart:, using [Frontity](https://frontity.org) | ||
|
||
## Authors | ||
|
||
1. [Kasper Aamodt](https://twitter.com/kasperaamodt) - Owner and developer [@aamodtgroup](https://twitter.com/aamodtgroup) | ||
|
||
## License | ||
|
||
![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg) | ||
|
||
- **[GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html)** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"name": "@aamodtgroup/block-processors", | ||
"version": "0.1.0", | ||
"description": "Block processors for Gutenberg blocks in Frontity.", | ||
"keywords": [ | ||
"Frontity", | ||
"WordPress", | ||
"Reactjs", | ||
"react", | ||
"gutenberg" | ||
], | ||
"homepage": "https://aamodtgroup.com", | ||
"license": "GPL-2.0-or-later", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/aamodtgroup/gutenberg-processors" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/aamodtgroup/gutenberg-processors/issues" | ||
}, | ||
"author": "Aamodt Group", | ||
"peerDependencies": { | ||
"frontity": "^1.15.0", | ||
"@frontity/html2react": "^1.6.2" | ||
}, | ||
"publishConfig": { | ||
"cache": "~/.npm", | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import processors from "./processors"; | ||
|
||
const BlockProcessors = { | ||
|
||
libraries: { | ||
html2react: { | ||
processors, | ||
} | ||
} | ||
|
||
} | ||
|
||
export default BlockProcessors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const fileBlock = { | ||
name: 'fileBlock', | ||
test: ({ node }) => node.component === "div" && node.props.className === "wp-block-file", | ||
processor: ({ node }) => { | ||
node.children[0].props.target = "_blank"; | ||
node.children[1].props.target = "_blank"; | ||
return node; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { fileBlock } from './file-block'; | ||
|
||
export default [ | ||
fileBlock | ||
]; |