Comments (2)
Ok, I understood now how plugins works.
My idea is add a metada similar to the follow code snippet at docpress.json
:
"disqus": {
"shortname": "myShortName",
"exclude": [
"/index.html",
"/bibliography.html",
"/resources.html"
]
}
and the follow snippet in the correct section of layout.pug
:
mixin disqus(shortname)
#disqus_thread
script.
var disqus_shortname = '#{shortname}';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
noscript
| Please enable JavaScript to view the
a(href="http://disqus.com/?ref_noscript") comments powered by Disqus.
a(href="http://disqus.com", class="dsq-brlink")
| comments powered by
span(class='logo-disqus') Disqus
- if (meta.disqus)
- var page = window.location.pathname
- if (meta.disqus.exclude.indexOf(page) === -1)
+disqus(meta.disqus.shortname)
The only problem is that the template is render by jade in the server, so window
object to recover window.location.pathname
is undefined
and doesn't work for avoid comments in specific sections.
Any idea to resolve this @rstacruz ?
from docpress.
Added here: docpress/docpress-base#136
from docpress.
Related Issues (20)
- Docpress serve trips up on symlinked folder. HOT 3
- Update docpress-core deps to fix security issue. HOT 3
- How to insert an image? HOT 6
- Error: README.md: Unknown reference '/docs/components.md' HOT 2
- Mobile: 'Next' overlay shadows button HOT 1
- Mobile: Links should scroll down to content instead of index table.
- isso instead of disqus .. HOT 1
- CRASH: TypeError: Cannot set property 'contents' of undefined
- Set livereload-port for docker watch to work
- Unknown reference '../README.md' HOT 1
- TypeError: Cannot read property 'contents' of undefined HOT 4
- Set htmlhref language to site HOT 1
- docpress --help vs docpress -h
- docpress init HOT 1
- Live code editing HOT 1
- subsites not included (windows) HOT 14
- Build failed - did you forget to load/include a language module? HOT 6
- Code syntax dark theme?
- RTL Support
- Version 9 of Highlight.js has reached EOL and is no longer supported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docpress.