mirror of
https://github.com/typemill/typemill.git
synced 2025-10-17 07:36:24 +02:00
Version 1.1.1 Removed vendor folder
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Plugins\Disqus;
|
||||
|
||||
use \Typemill\Plugin;
|
||||
|
||||
class Disqus extends Plugin
|
||||
{
|
||||
protected $settings;
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function onSettingsLoaded($settings)
|
||||
{
|
||||
$this->settings = $settings->getData();
|
||||
}
|
||||
|
||||
public function onTwigLoaded()
|
||||
{
|
||||
/* get Twig Instance and add the cookieconsent template-folder to the path */
|
||||
$twig = $this->getTwig();
|
||||
$loader = $twig->getLoader();
|
||||
$loader->addPath(__DIR__ . '/templates');
|
||||
|
||||
$analyticSettings = $this->settings['settings']['plugins']['analytics'];
|
||||
|
||||
/* fetch the template, render it with twig and add javascript with settings */
|
||||
if($analyticSettings['tool'] == 'piwik')
|
||||
{
|
||||
$this->addInlineJS($twig->fetch('/piwikanalytics.twig', $this->settings));
|
||||
}
|
||||
elseif($analyticSettings['tool'] == 'google')
|
||||
{
|
||||
$this->addJS('https://www.googletagmanager.com/gtag/js?id=' . $analyticSettings['google_id']);
|
||||
$this->addInlineJS($twig->fetch('/googleanalytics.twig', $analyticSettings));
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,15 +0,0 @@
|
||||
name: Disqus
|
||||
version: 1.0.0
|
||||
description: Integrate Disqus into Typemill.
|
||||
author: Sebastian Schürmanns
|
||||
homepage: http://typemill.net
|
||||
licence: MIT
|
||||
|
||||
forms:
|
||||
fields:
|
||||
|
||||
shortname:
|
||||
type: text
|
||||
label: Disqus-Shortname
|
||||
help: You can find the shortname in your disqus-settings
|
||||
placeholder: 'YOUR SHORTNAME'
|
@@ -1,12 +0,0 @@
|
||||
var disqus_config = function () {
|
||||
this.page.url = {{ item.urlAbs }} ;
|
||||
};
|
||||
|
||||
(function() {
|
||||
var d = document, s = d.createElement('script');
|
||||
|
||||
s.src = 'https://{{ settings.plugins.disqus.shortname }}.disqus.com/embed.js';
|
||||
|
||||
s.setAttribute('data-timestamp', +new Date());
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
Reference in New Issue
Block a user