add test page for counters
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<title>remark42 counter</title>
|
||||
|
||||
<style>
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 40px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<p>
|
||||
First counter with url from data-attribute:
|
||||
<span class="remark42__counter" data-url="https://radio-t.com/p/2017/11/11/podcast-571/"></span>
|
||||
(<a href="https://radio-t.com/p/2017/11/11/podcast-571/" target="_blank">note</a>)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Second counter with url from global remark config:
|
||||
<span class="remark42__counter"></span>
|
||||
(<a href="https://radio-t.com/p/2017/12/16/podcast-576/" target="_blank">note</a>)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If it can't get url from data-attribute or remark config, it will try to use window.location.href for it.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var remark_config = {
|
||||
site_id: 'remark',
|
||||
url: 'https://radio-t.com/p/2017/12/16/podcast-576/'
|
||||
};
|
||||
|
||||
(function() {
|
||||
var d = document, s = d.createElement('script');
|
||||
s.src = 'https://demo.remark42.com/web/counter.js';
|
||||
s.type = 'text/javascript';
|
||||
(d.head || d.body).appendChild(s);
|
||||
})();
|
||||
</script>
|
||||
<noscript>
|
||||
Please enable JavaScript to view the comments powered by Remark.
|
||||
</noscript>
|
||||
</body>
|
||||
</html>
|
||||
+12
-1
@@ -40,6 +40,7 @@ module.exports = {
|
||||
entry: {
|
||||
remark: './app/remark',
|
||||
embed: './app/embed',
|
||||
counter: './app/counter',
|
||||
},
|
||||
output: {
|
||||
path: publicFolder,
|
||||
@@ -98,7 +99,17 @@ module.exports = {
|
||||
new Define({
|
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
|
||||
}),
|
||||
new Html({ template: path.resolve(__dirname, 'index.ejs'), inject: false }), // TODO: we should add it only on demo serv
|
||||
// TODO: we should add it only on demo serv
|
||||
new Html({
|
||||
template: path.resolve(__dirname, 'index.ejs'),
|
||||
inject: false,
|
||||
}),
|
||||
// TODO: we should add it only on demo serv
|
||||
new Html({
|
||||
template: path.resolve(__dirname, 'counter.ejs'),
|
||||
filename: 'counter.html',
|
||||
inject: false,
|
||||
}),
|
||||
...(env === 'production' ? [] : [new Html({
|
||||
template: path.resolve(__dirname, 'dev.ejs'),
|
||||
filename: 'dev.html',
|
||||
|
||||
Reference in New Issue
Block a user