Skip to content

Commit

Permalink
feat: [#617] new static page with terms
Browse files Browse the repository at this point in the history
http://localhost:3000/terms

It also add a link on the footer. Page content is laoded in markdown
format from the API (settings->website).
  • Loading branch information
josecelano committed Sep 13, 2024
1 parent c1bb16d commit 0d92346
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="flex-grow" />
<footer class="p-4 footer footer-center text-base-content">
<div>
<p><a target="_blank" href="https://torrust.com" class="link link-hover"> Powered by Torrust </a> ⚡ <a target="_self" href="/license" class="link link-hover">Copyright © 2024</a></p>
<p><a target="_blank" href="https://torrust.com" class="link link-hover"> Powered by Torrust </a> ⚡ <a target="_self" href="/license" class="link link-hover">Copyright © 2024</a> &nbsp; <a target="_self" href="/terms" class="link link-hover">Terms</a></p>
</div>
</footer>
</div>
Expand Down
15 changes: 10 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"marked": "^12.0.2",
"notiwind-ts": "^2.0.2",
"torrust-index-api-lib": "^3.0.0-beta",
"torrust-index-types-lib": "^3.0.0-beta",
"torrust-index-types-lib": "file:../torrust-index-types-lib",
"uuid": "^9.0.1"
}
}
34 changes: 34 additions & 0 deletions pages/terms.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<div>
<Markdown :source="pageContent" class="px-40 pt-2 pb-5 prose-h1:text-center max-w-none" />
</div>
</template>

<script setup lang="ts">
import { ref, watch } from "vue";
import { useSettings, useSeoMeta } from "#imports";
const settings = useSettings();
const pageTitle = ref("");
const pageContent = ref("");
watch(
() => settings.value,
(newSettings) => {
if (newSettings?.website?.terms?.page) {
pageTitle.value = newSettings.website.terms.page.title;
pageContent.value = newSettings.website.terms.page.content;
}
},
{ immediate: true }
);
useSeoMeta({
title: () => `${pageTitle.value} - Torrent`
});
</script>

<style scoped>
</style>

0 comments on commit 0d92346

Please sign in to comment.