big updats

This commit is contained in:
Daniel Ledda
2025-12-20 00:10:42 +01:00
parent a93ffff00d
commit 51e44db779
25 changed files with 570 additions and 203 deletions

View File

@@ -1,22 +1,20 @@
import { defineComponent } from "vue";
import { RouterLink } from "vue-router";
import DJEmail from "@/DJEmail.tsx";
import DjEmail from "@/DjEmail.tsx";
import useHead from "@/useHead.ts";
import useAsyncState from "@/useAsyncState.ts";
import getDJAPI from "@/api.ts";
import DJTooltip from "@/DJTooltip.tsx";
import getDjAPI from "@/api.ts";
import DjTooltip from "@/DjTooltip.tsx";
export default defineComponent({
name: "ge-deutsch",
async setup() {
useHead({ title: "Ray Peat Artikel auf Deutsch" });
const {
result: rpArticles,
stateIsReady,
} = useAsyncState("rp-articles", ({ hostUrl }) => getDJAPI(hostUrl, "/rp-articles"));
const rpArticles = useAsyncState("rp-articles", ({ hostUrl }) => getDjAPI(hostUrl, "/rp-articles"));
await rpArticles.done;
await stateIsReady;
return () => <>
<header>
<h1>Ray Peat Deutsche Übersetzungen</h1>
@@ -29,9 +27,9 @@ export default defineComponent({
<h2>Artikelliste</h2>
<div class="text-slab">
<ul id="article">
{rpArticles.value && rpArticles.value.map((_) => (
{rpArticles.result.value && rpArticles.result.value.map((_) => (
<li>
<DJTooltip tooltip={`Englischer Titel: <em>»${ _.titleEn }«</em>`}>
<DjTooltip tooltip={`Englischer Titel: <em>»${ _.titleEn }«</em>`}>
{_.tags?.includes('in-arbeit')
? _.titleDe
: (
@@ -40,7 +38,7 @@ export default defineComponent({
</RouterLink>
)}
{_.tags?.map(tag => <span class="tag">{tag}</span>)}
</DJTooltip>
</DjTooltip>
</li>
))}
</ul>
@@ -56,7 +54,7 @@ export default defineComponent({
<li><a href="http://raypeat.com/articles/articles/gelatin.shtml">Gelatin, stress, longevity</a></li>
<li><a href="http://raypeat.com/articles/articles/unsaturatedfats.shtml">Unsaturated fatty acids: Nutritionally essential, or toxic?</a></li>
</ul>
<DJEmail>Schick mir deine Vorschläge!</DJEmail>
<DjEmail>Schick mir deine Vorschläge!</DjEmail>
</div>
</section>
<section>
@@ -82,7 +80,7 @@ export default defineComponent({
<h3>Helfen</h3>
<p class="text-slab">
Falls was bei der Übersetzung auffällt oder besonders unidiomatisch klingt, bzw. der deutschen
Fachsprache der Medizin nicht gerecht sein sollte, kannst du mir unter <DJEmail />{" "}
Fachsprache der Medizin nicht gerecht sein sollte, kannst du mir unter <DjEmail />{" "}
eine Mail senden. Meine Muttersprache ist schließlich Englisch und ich bin kein professioneller
Übersetzer!
Falls jemand Hilfe leisten möchte, sag gerne Bescheid!

View File

@@ -1,9 +1,9 @@
import { createTextVNode, computed, defineComponent, h, inject, onServerPrefetch, ref, type VNode, watchEffect } from "vue";
import { createTextVNode, computed, defineComponent, h, inject, ref, type VNode } from "vue";
import { RouterLink } from "vue-router";
import useAsyncState from "@/useAsyncState.ts";
import useHead from "@/useHead.ts";
import DJEmail from "@/DJEmail.tsx";
import getDJAPI from "@/api.ts";
import DjEmail from "@/DjEmail.tsx";
import getDjAPI from "@/api.ts";
export default defineComponent({
name: "ge-deutsch-article",
@@ -25,8 +25,8 @@ export default defineComponent({
(innerHTML: string) => Object.assign(document.createElement("div"), { innerHTML }),
);
const { result: articleContent, stateIsReady } = useAsyncState(
"ge-deutsch-article-data",
const articleContent = useAsyncState(
"ge-deutsch-article-content",
async ({ hostUrl }) => {
const articleResponse = await fetch(`${hostUrl}/generative-energy/content/${props.articleName}.html`);
const result = await articleResponse.text();
@@ -34,15 +34,12 @@ export default defineComponent({
},
);
const {
result: articleData,
stateIsReady: articleDataReady,
} = useAsyncState('article-data', ({hostUrl}) => getDJAPI(hostUrl, '/rp-articles'));
const articlesMetadata = useAsyncState('article-metadata', ({hostUrl}) => getDjAPI(hostUrl, '/rp-articles'));
const articleMetadata = computed(() => articleData.value?.find(_ => _.slug === props.articleName));
const articleMetadata = computed(() => articlesMetadata.result.value?.find(_ => _.slug === props.articleName));
useHead({
title: () => articleMetadata.value?.title ?? '',
useHead({
title: () => articleMetadata.value?.title ?? '',
metatags: () => articleMetadata.value ? [
{ name: 'title', content: articleMetadata.value.title },
{ name: 'author', content: articleMetadata.value.author },
@@ -92,14 +89,14 @@ export default defineComponent({
}
function ArticleContentTransformed() {
if (articleContent.value) {
const dom = parseDom(articleContent.value);
if (articleContent.result.value) {
const dom = parseDom(articleContent.result.value);
return h("div", {}, [...dom.children].map((_) => transformArticleNode(_)));
}
return <div>Artikel lädt...</div>;
}
await Promise.all([stateIsReady, articleDataReady]);
await Promise.all([ articleContent.done, articlesMetadata.done ]);
return () => (
<div class="ge-article">
@@ -111,7 +108,7 @@ export default defineComponent({
</div>
<p class="text-slab">
Bei dem untenstehenden Artikel handelt es sich um eine hobbymäßige, amateurhafte Übersetzung des
Artikels { articleMetadata.value?.titleEn } von Ray Peat. Bei Ungenauigkeiten oder Fehlübersetzungen freue ich mich über <DJEmail>eine Mail</DJEmail>!
Artikels { articleMetadata.value?.titleEn } von Ray Peat. Bei Ungenauigkeiten oder Fehlübersetzungen freue ich mich über <DjEmail>eine Mail</DjEmail>!
</p>
{ articleMetadata.value?.tags?.includes('in-arbeit') && <h5 class="baustelle">🚧 Bitte beachte, dass diese Übersetzung noch in Arbeit ist! 🚧</h5> }
<hr />

View File

@@ -1,6 +1,6 @@
import { RouterLink } from "vue-router";
import useHead from "@/useHead.ts";
import DJTooltip from "@/DJTooltip.tsx";
import DjTooltip from "@/DjTooltip.tsx";
export default {
name: "ge-main",
@@ -21,14 +21,14 @@ export default {
<div class="text-slab">
<ul>
<li>
<DJTooltip tooltip="Convert to and from grains, set ratios, etc.">
<DjTooltip tooltip="Convert to and from grains, set ratios, etc.">
<RouterLink to={{ name: "GECalculator" }}>Thyroid Calculator</RouterLink>
</DJTooltip>
</DjTooltip>
</li>
<li>
<DJTooltip tooltip="A selection of articles by Ray that I have translated in my spare time into German.">
<DjTooltip tooltip="A selection of articles by Ray that I have translated in my spare time into German.">
<RouterLink to={{ name: "GEDeutsch" }}>Ray Peat Articles in German</RouterLink>
</DJTooltip>
</DjTooltip>
</li>
</ul>
</div>
@@ -36,14 +36,14 @@ export default {
<div class="text-slab">
<ul>
<li>
<DJTooltip tooltip="Full text search of the majority of Ray's interviews. Extremely helpful and fun to use.">
<DjTooltip tooltip="Full text search of the majority of Ray's interviews. Extremely helpful and fun to use.">
<a href="https://bioenergeic.life">bioenergetic.life - A Ray Peat Search Engine</a>
</DJTooltip>
</DjTooltip>
</li>
<li>
<DJTooltip tooltip="Ray's original website with articles and bookstore">
<DjTooltip tooltip="Ray's original website with articles and bookstore">
<a href="https://raypeat.com">raypeat.com</a>
</DJTooltip>
</DjTooltip>
</li>
</ul>
</div>

View File

@@ -1,12 +1,12 @@
import { defineComponent, ref, Suspense, type VNode } from "vue";
import { type RouteRecordRaw, RouterLink, RouterView, useRoute } from "vue-router";
import GEMain from "@/generative-energy/GEMain.tsx";
import DJEmail from "@/DJEmail.tsx";
import DjEmail from "@/DjEmail.tsx";
import GEDeutsch from "@/generative-energy/GEDeutsch.tsx";
import GEDeutschArticle from "@/generative-energy/GEDeutschArticle.tsx";
import GECalculator from "@/generative-energy/GECalculator.tsx";
import DJDonate from "@/DJDonate.tsx";
import { setupTooltip } from "@/DJTooltip.tsx";
import DjDonate from "@/DjDonate.tsx";
import { setupTooltip } from "@/DjTooltip.tsx";
export const routes: RouteRecordRaw[] = [
{
@@ -67,9 +67,9 @@ export default defineComponent({
<footer>
<div class="bottom">
<div>
<a href="/">djledda.net</a> {new Date().getFullYear()} - <DJEmail>{() => "Contact"}</DJEmail>
<a href="/">djledda.net</a> {new Date().getFullYear()} - <DjEmail>{() => "Contact"}</DjEmail>
</div>
<DJDonate />
<DjDonate />
</div>
</footer>
</main>