-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
30 changed files
with
377 additions
and
90 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"/js/cp.js": "/js/cp.js?id=a111bc589aba1b73cd9741c2cac99989", | ||
"/js/cp.js": "/js/cp.js?id=ad0deeb3d85b3f2bec4c7418fb07f730", | ||
"/css/cp.css": "/css/cp.css?id=8061e1c7006144a94600e6bb047fcff1" | ||
} |
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 @@ | ||
import DefaultsPublishForm from './components/DefaultsPublishForm' | ||
import SocialImageFieldtype from './components/SocialImageFieldtype' | ||
import SourceFieldtype from './components/SourceFieldtype' | ||
|
||
Statamic.booting(() => { | ||
Statamic.component('defaults-publish-form', DefaultsPublishForm) | ||
Statamic.component('social_image-fieldtype', SocialImageFieldtype) | ||
Statamic.component('seo_source-fieldtype', SourceFieldtype) | ||
}) |
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
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,19 @@ | ||
// Fetch the conditions after Statamic has booted. | ||
Statamic.booted(() => { | ||
Statamic.$store.dispatch("publish/advancedSeo/fetchConditions") | ||
}) | ||
|
||
// Fetch the conditions when the user changes the site in the sidebar. | ||
Statamic.$store.watch(state => state.publish?.base?.site, () => { | ||
Statamic.$store.dispatch("publish/advancedSeo/fetchConditions") | ||
}) | ||
|
||
// Add the showSitemapFields condition. | ||
Statamic.$conditions.add('showSitemapFields', ({ store }) => { | ||
return store.state.publish.advancedSeo.conditions?.showSitemapFields | ||
}); | ||
|
||
// Add the showSocialImagesGeneratorFields condition. | ||
Statamic.$conditions.add('showSocialImagesGeneratorFields', ({ store }) => { | ||
return store.state.publish.advancedSeo.conditions?.showSocialImagesGeneratorFields | ||
}); |
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 |
---|---|---|
@@ -1,9 +1,3 @@ | ||
import DefaultsPublishForm from './components/DefaultsPublishForm' | ||
import SocialImageFieldtype from './components/SocialImageFieldtype' | ||
import SourceFieldtype from './components/SourceFieldtype' | ||
|
||
Statamic.booting(() => { | ||
Statamic.component('defaults-publish-form', DefaultsPublishForm) | ||
Statamic.component('social_image-fieldtype', SocialImageFieldtype) | ||
Statamic.component('seo_source-fieldtype', SourceFieldtype) | ||
}) | ||
import './components' | ||
import './conditions' | ||
import './store' |
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 @@ | ||
Statamic.$store.registerModule(['publish', 'advancedSeo'], { | ||
|
||
namespaced: true, | ||
|
||
state: { | ||
conditions: null, | ||
}, | ||
|
||
getters: { | ||
conditions: state => state.conditions, | ||
}, | ||
|
||
actions: { | ||
fetchConditions({ commit }) { | ||
return Statamic.$request.post(`/!/advanced-seo/conditions`, { | ||
url: window.location, | ||
id: Statamic.$store.state.publish?.base?.values?.id, | ||
site: Statamic.$store.state.publish.base.site, | ||
}) | ||
.then(response => commit('setConditions', response.data)) | ||
.catch(function (error) { | ||
console.log(error); | ||
}); | ||
}, | ||
}, | ||
|
||
mutations: { | ||
setConditions(state, conditions) { | ||
state.conditions = conditions; | ||
}, | ||
} | ||
|
||
}) |
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 |
---|---|---|
@@ -1,8 +1,10 @@ | ||
<?php | ||
|
||
use Aerni\AdvancedSeo\Http\Controllers\Cp\ConditionsController; | ||
use Aerni\AdvancedSeo\Http\Controllers\Web\SocialImagesController; | ||
use Illuminate\Support\Facades\Route; | ||
|
||
Route::name('advanced-seo.')->group(function () { | ||
Route::get('/social-images/{theme}/{type}/{id}', [SocialImagesController::class, 'show'])->name('social_images.show'); | ||
Route::post('/conditions', ConditionsController::class); | ||
}); |
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
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
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
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
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
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
8 changes: 6 additions & 2 deletions
8
src/Actions/ShouldDisplaySitemapSettings.php → src/Conditions/ShowSitemapFields.php
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
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
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
Oops, something went wrong.