Template api url

This commit is contained in:
Alex Selimov 2026-03-20 00:01:45 -04:00
parent e896111497
commit d8834d83b7
2 changed files with 2 additions and 1 deletions

View file

@ -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 }}

View file

@ -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");