Template api url
This commit is contained in:
parent
e896111497
commit
d8834d83b7
2 changed files with 2 additions and 1 deletions
|
|
@ -25,6 +25,7 @@
|
||||||
<span id="upvote-count">—</span>
|
<span id="upvote-count">—</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<script>window.UPVOTE_API = "{{ .Site.Params.upvoteApi }}";</script>
|
||||||
<script src="/upvote.js"></script>
|
<script src="/upvote.js"></script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if not .Params.hideReply }}
|
{{ if not .Params.hideReply }}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
(async function () {
|
(async function () {
|
||||||
// Define the slug
|
// Define the slug
|
||||||
const slug = location.pathname.replace(/^\/|\/$/g, "").replaceAll("/", "-");
|
const slug = location.pathname.replace(/^\/|\/$/g, "").replaceAll("/", "-");
|
||||||
const API = "http://localhost:3000";
|
const API = window.UPVOTE_API;
|
||||||
|
|
||||||
const btn = document.getElementById("upvote-btn");
|
const btn = document.getElementById("upvote-btn");
|
||||||
const count = document.getElementById("upvote-count");
|
const count = document.getElementById("upvote-count");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue