add embed snippet code

This commit is contained in:
Max Böck 2019-04-14 18:50:45 +02:00
parent 656c35c558
commit 9bcc031689
3 changed files with 19 additions and 6 deletions

View file

@ -9,7 +9,6 @@ module.exports = function(config) {
config.addLayoutAlias('page', 'page.njk')
config.addPassthroughCopy('src/assets/images')
config.addPassthroughCopy('src/assets/styles/main.css')
config.addTransform('htmlmin', function(content, outputPath) {
if (outputPath.endsWith('.html')) {

10
src/includes/snippet.njk Normal file
View file

@ -0,0 +1,10 @@
<div class="webring-badge-embed">
<p>Member of <a href="{{ meta.url }}">{{ meta.title }}</a></p>
<a href="{{ meta.url }}/prev">Previous</a>
<a href="{{ meta.url }}/random">Random</a>
<a href="{{ meta.url }}/next">Next</a>
</div>
<script async src="{{ meta.url }}/embed.js" charset="utf-8"></script>

View file

@ -18,14 +18,18 @@ The webring admins will then look at your site and handle your request.
## Add the badge
If you want to make your own badge, use these three links to connect to the webring:
```html
<a href="{{ meta.url }}/prev">Previous</a>
<a href="{{ meta.url }}/random">Random</a>
<a href="{{ meta.url }}/next">Next</a>
<div class="webring-badge-embed">
<p>Member of <a href="{{ meta.url }}">{{ meta.title }}</a></p>
<a href="{{ meta.url }}/prev">Previous</a>
<a href="{{ meta.url }}/random">Random</a>
<a href="{{ meta.url }}/next">Next</a>
</div>
<script async src="{{ meta.url }}/embed.js" charset="utf-8"></script>
```
{% include 'snippet.njk' %}
## Want to host your own webring?
If you want to start your own webring, fork [this project](https://github.com/maxboeck/webring) on Github and follow the instructions in the README.