Skip to content

Commit

Permalink
feat: controll webmention sending on page
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricerenck committed Jan 13, 2023
1 parent 2b7aa1a commit a4672a1
Show file tree
Hide file tree
Showing 13 changed files with 276 additions and 88 deletions.
11 changes: 11 additions & 0 deletions blueprints/fields/block-webmentions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type: group
fields:
webmentionsStatus:
label: Webmentions
type: toggle
default: true
text:
- en: Webmentions deactivated
de: Webmentions deaktiviert
- en: Webmentions active
de: Webmentions aktiviert
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
},
"require-dev": {
"getkirby/cms": "^3.8",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^9.5",
"mockery/mockery": "^1.5"
},
"replace": {
"mauricerenck/tratschtante": "*"
Expand All @@ -51,4 +52,4 @@
"npm run build"
]
}
}
}
128 changes: 126 additions & 2 deletions composer.lock

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

7 changes: 5 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
'snippets' => [
'activitypub-wm' => __DIR__ . '/snippets/activitypub-webmention.php',
],
'blueprints' => [
'indieconnector/fields/webmentions' => __DIR__ . '/blueprints/fields/block-webmentions.yml',
],
'routes' => [
[
'pattern' => '(indieConnector|indieconnector)/webhook/webmentionio',
Expand Down Expand Up @@ -87,8 +90,8 @@
[
'pattern' => '^.well-known/((host-meta|webfinger).(:any)|(host-meta|webfinger))',
'method' => 'OPTIONS|GET|POST|PUT',
'action' => function($file) {
if(!option('mauricerenck.indieConnector.activityPubBridge', false)) {
'action' => function ($file) {
if (!option('mauricerenck.indieConnector.activityPubBridge', false)) {
return false;
}

Expand Down
4 changes: 3 additions & 1 deletion site/blueprints/pages/phpunit.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
options:
changeSlug: false
update: false
update: true

sections:
phpunit:
type: fields
fields:
indieConnetor:
extends: indieconnector/fields/webmentions
textfield:
type: textarea
label: Text
Expand Down

0 comments on commit a4672a1

Please sign in to comment.