Add Mastodon comments support
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
title: "Nextcloud na OSCloud roste: vlastní úložiště až 1 TB"
|
||||
date: 2026-07-03
|
||||
draft: false
|
||||
comments:
|
||||
host: "mamutovo.cz"
|
||||
id: "116854122305163821"
|
||||
slug: nextcloud-vlastni-uloziste
|
||||
categories: ["Služby"]
|
||||
tags: ["nextcloud", "storage", "cloud", "soukromí", "zálohy", "šifrování"]
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
{{- define "main" }}
|
||||
|
||||
<article class="post-single">
|
||||
<header class="post-header">
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
<h1 class="post-title entry-hint-parent">
|
||||
{{ .Title }}
|
||||
{{- if .Draft }}
|
||||
<span class="entry-hint" title="Draft">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="35" viewBox="0 -960 960 960" fill="currentColor">
|
||||
<path
|
||||
d="M160-410v-60h300v60H160Zm0-165v-60h470v60H160Zm0-165v-60h470v60H160Zm360 580v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q9 9 13 20t4 22q0 11-4.5 22.5T862.09-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z" />
|
||||
</svg>
|
||||
</span>
|
||||
{{- end }}
|
||||
</h1>
|
||||
{{- if .Description }}
|
||||
<div class="post-description">
|
||||
{{ .Description }}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- if not (.Param "hideMeta") }}
|
||||
<div class="post-meta">
|
||||
{{- partial "post_meta.html" . -}}
|
||||
{{- partial "translation_list.html" . -}}
|
||||
{{- partial "edit_post.html" . -}}
|
||||
{{- partial "post_canonical.html" . -}}
|
||||
</div>
|
||||
{{- end }}
|
||||
</header>
|
||||
{{- $isHidden := (.Param "cover.hiddenInSingle") | default (.Param "cover.hidden") | default false }}
|
||||
{{- partial "cover.html" (dict "cxt" . "IsSingle" true "isHidden" $isHidden) }}
|
||||
{{- if (.Param "ShowToc") }}
|
||||
{{- partial "toc.html" . }}
|
||||
{{- end }}
|
||||
|
||||
{{- if .Content }}
|
||||
<div class="post-content">
|
||||
{{- if not (.Param "disableAnchoredHeadings") }}
|
||||
{{- partial "anchored_headings.html" .Content -}}
|
||||
{{- else }}{{ .Content }}{{ end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
|
||||
<footer class="post-footer">
|
||||
{{- $tags := .Language.Params.Taxonomies.tag | default "tags" }}
|
||||
<ul class="post-tags">
|
||||
{{- range ($.GetTerms $tags) }}
|
||||
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- if (.Param "ShowPostNavLinks") }}
|
||||
{{- partial "post_nav_links.html" . }}
|
||||
{{- end }}
|
||||
{{- if (and site.Params.ShowShareButtons (ne .Params.disableShare true)) }}
|
||||
{{- partial "share_icons.html" . -}}
|
||||
{{- end }}
|
||||
</footer>
|
||||
|
||||
{{- if (.Param "comments") }}
|
||||
{{- partial "comments.html" . }}
|
||||
{{- end }}
|
||||
</article>
|
||||
|
||||
{{- end }}{{/* end main */}}
|
||||
@@ -0,0 +1,39 @@
|
||||
{{ with .Params.comments }}
|
||||
<div class="comments-section">
|
||||
<h2>Diskuze</h2>
|
||||
<p>Reaguj na <a href="https://{{ .host }}/web/statuses/{{ .id }}" target="_blank">Mastodon příspěvek</a> a tvá odpověď se zobrazí tady.</p>
|
||||
<button id="load-comments">Načíst komentáře</button>
|
||||
<div id="mastodon-comments-list"></div>
|
||||
</div>
|
||||
<script>
|
||||
function escapeHtml(s) {
|
||||
return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
||||
}
|
||||
document.getElementById('load-comments').addEventListener('click', function () {
|
||||
this.textContent = 'Načítám…';
|
||||
fetch('https://{{ .host }}/api/v1/statuses/{{ .id }}/context')
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
const list = document.getElementById('mastodon-comments-list');
|
||||
if (!data.descendants || data.descendants.length === 0) {
|
||||
list.innerHTML = '<p>Zatím žádné komentáře.</p>';
|
||||
document.getElementById('load-comments').remove();
|
||||
return;
|
||||
}
|
||||
list.innerHTML = data.descendants.map(toot => `
|
||||
<div class="comment">
|
||||
<img src="${toot.account.avatar}" width="32" height="32" alt="">
|
||||
<strong>${escapeHtml(toot.account.display_name || toot.account.username)}</strong>
|
||||
<span class="acct">@${toot.account.acct}</span>
|
||||
<div class="content">${toot.content}</div>
|
||||
<a href="${toot.url}" target="_blank">zobrazit na Mastodonu</a>
|
||||
</div>
|
||||
`).join('');
|
||||
document.getElementById('load-comments').remove();
|
||||
})
|
||||
.catch(() => {
|
||||
document.getElementById('mastodon-comments-list').innerHTML = '<p>Nepodařilo se načíst komentáře.</p>';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
@@ -176,7 +176,7 @@
|
||||
<a href="https://blog.oscloud.cz/categories/projekty/">Projekty <sup><strong><sup>1</sup></strong></sup> </a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://blog.oscloud.cz/categories/slu%C5%BEby/">služby <sup><strong><sup>4</sup></strong></sup> </a>
|
||||
<a href="https://blog.oscloud.cz/categories/slu%C5%BEby/">Služby <sup><strong><sup>4</sup></strong></sup> </a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://blog.oscloud.cz/categories/soukrom%C3%AD/">Soukromí <sup><strong><sup>1</sup></strong></sup> </a>
|
||||
|
||||
@@ -296,6 +296,45 @@ Snapshot nezabere místo hned, sdílí kapacitu s úložištěm a roste jen podl
|
||||
</nav>
|
||||
|
||||
</footer>
|
||||
<div class="comments-section">
|
||||
<h2>Diskuze</h2>
|
||||
<p>Reaguj na <a href="https://mamutovo.cz/web/statuses/116854122305163821" target="_blank">Mastodon příspěvek</a> a tvá odpověď se zobrazí tady.</p>
|
||||
<button id="load-comments">Načíst komentáře</button>
|
||||
<div id="mastodon-comments-list"></div>
|
||||
</div>
|
||||
<script>
|
||||
function escapeHtml(s) {
|
||||
return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");
|
||||
}
|
||||
document.getElementById('load-comments').addEventListener('click', function () {
|
||||
this.textContent = 'Načítám…';
|
||||
fetch('https://mamutovo.cz/api/v1/statuses/116854122305163821/context')
|
||||
.then(r => r.json())
|
||||
.then(data => {
|
||||
const list = document.getElementById('mastodon-comments-list');
|
||||
if (!data.descendants || data.descendants.length === 0) {
|
||||
list.innerHTML = '<p>Zatím žádné komentáře.</p>';
|
||||
document.getElementById('load-comments').remove();
|
||||
return;
|
||||
}
|
||||
list.innerHTML = data.descendants.map(toot => `
|
||||
<div class="comment">
|
||||
<img src="${toot.account.avatar}" width="32" height="32" alt="">
|
||||
<strong>${escapeHtml(toot.account.display_name || toot.account.username)}</strong>
|
||||
<span class="acct">@${toot.account.acct}</span>
|
||||
<div class="content">${toot.content}</div>
|
||||
<a href="${toot.url}" target="_blank">zobrazit na Mastodonu</a>
|
||||
</div>
|
||||
`).join('');
|
||||
document.getElementById('load-comments').remove();
|
||||
})
|
||||
.catch(() => {
|
||||
document.getElementById('mastodon-comments-list').innerHTML = '<p>Nepodařilo se načíst komentáře.</p>';
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
</article>
|
||||
</main>
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ VHSky.cz vzniklo jako alternativa pro ty, kteří chtějí publikovat videa bez
|
||||
<meta property="article:published_time" content="2025-12-13T00:00:00+00:00">
|
||||
<meta property="article:modified_time" content="2025-12-13T00:00:00+00:00">
|
||||
<meta property="article:tag" content="VHSky">
|
||||
<meta property="article:tag" content="PeerTube">
|
||||
<meta property="article:tag" content="Peertube">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:title" content="VHSky.cz – ohlédnutí za rokem 2025 🎬">
|
||||
<meta name="twitter:description" content="VHSky.cz vzniklo jako PeerTube instance pro komunitní videoobsah. Rok 2025 byl prvním rokem, kdy se ukázalo, že má smysl projekt dělat dál.
|
||||
@@ -261,7 +261,7 @@ VHSky.cz vzniklo jako alternativa pro ty, kteří chtějí publikovat videa bez
|
||||
<footer class="post-footer">
|
||||
<ul class="post-tags">
|
||||
<li><a href="https://blog.oscloud.cz/tags/vhsky/">VHSky</a></li>
|
||||
<li><a href="https://blog.oscloud.cz/tags/peertube/">PeerTube</a></li>
|
||||
<li><a href="https://blog.oscloud.cz/tags/peertube/">Peertube</a></li>
|
||||
</ul>
|
||||
<nav class="paginav">
|
||||
<a class="prev" href="https://blog.oscloud.cz/posts/stastny-novy-rok-2026/">
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<meta property="article:section" content="posts">
|
||||
<meta property="article:published_time" content="2026-05-30T07:00:00+02:00">
|
||||
<meta property="article:modified_time" content="2026-05-30T07:00:00+02:00">
|
||||
<meta property="article:tag" content="PeerTube">
|
||||
<meta property="article:tag" content="Peertube">
|
||||
<meta property="article:tag" content="VHSky">
|
||||
<meta property="article:tag" content="Video">
|
||||
<meta property="article:tag" content="Fediverse">
|
||||
@@ -234,7 +234,7 @@
|
||||
|
||||
<footer class="post-footer">
|
||||
<ul class="post-tags">
|
||||
<li><a href="https://blog.oscloud.cz/tags/peertube/">PeerTube</a></li>
|
||||
<li><a href="https://blog.oscloud.cz/tags/peertube/">Peertube</a></li>
|
||||
<li><a href="https://blog.oscloud.cz/tags/vhsky/">VHSky</a></li>
|
||||
<li><a href="https://blog.oscloud.cz/tags/video/">Video</a></li>
|
||||
<li><a href="https://blog.oscloud.cz/tags/fediverse/">Fediverse</a></li>
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
<a href="https://blog.oscloud.cz/tags/ozn%C3%A1men%C3%AD/">oznámení <sup><strong><sup>1</sup></strong></sup> </a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://blog.oscloud.cz/tags/peertube/">PeerTube <sup><strong><sup>2</sup></strong></sup> </a>
|
||||
<a href="https://blog.oscloud.cz/tags/peertube/">peertube <sup><strong><sup>2</sup></strong></sup> </a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://blog.oscloud.cz/tags/privacy/">privacy <sup><strong><sup>1</sup></strong></sup> </a>
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
<description></description>
|
||||
</item>
|
||||
<item>
|
||||
<title>PeerTube</title>
|
||||
<title>Peertube</title>
|
||||
<link>https://blog.oscloud.cz/tags/peertube/</link>
|
||||
<pubDate>Sat, 30 May 2026 07:00:00 +0200</pubDate><author>info@oscloud.cz (OSCloud)</author>
|
||||
<guid>https://blog.oscloud.cz/tags/peertube/</guid>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="robots" content="index, follow">
|
||||
<title>PeerTube | Oscloud News</title>
|
||||
<title>Peertube | Oscloud News</title>
|
||||
<meta name="keywords" content="">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="map[email:info@oscloud.cz name:OSCloud]">
|
||||
@@ -74,11 +74,11 @@
|
||||
</script><script defer src="https://analytics.oscloud.cz/script.js" data-website-id="70aaf052-385c-41fb-9cfe-d3b3c6f54f2d"></script>
|
||||
<meta property="og:url" content="https://blog.oscloud.cz/tags/peertube/">
|
||||
<meta property="og:site_name" content="Oscloud News">
|
||||
<meta property="og:title" content="PeerTube">
|
||||
<meta property="og:title" content="Peertube">
|
||||
<meta property="og:locale" content="cs-cz">
|
||||
<meta property="og:type" content="website">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:title" content="PeerTube">
|
||||
<meta name="twitter:title" content="Peertube">
|
||||
<meta name="twitter:description" content="">
|
||||
|
||||
</head>
|
||||
@@ -139,7 +139,7 @@
|
||||
<main class="main">
|
||||
<header class="page-header"><div class="breadcrumbs"><a href="https://blog.oscloud.cz/">Home</a> » <a href="https://blog.oscloud.cz/tags/">Tags</a></div>
|
||||
<h1>
|
||||
PeerTube
|
||||
Peertube
|
||||
<a href="/tags/peertube/index.xml" title="RSS" aria-label="RSS">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
||||
stroke-linecap="round" stroke-linejoin="round" height="23">
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
|
||||
<channel>
|
||||
<title>PeerTube on Oscloud News</title>
|
||||
<title>Peertube on Oscloud News</title>
|
||||
<link>https://blog.oscloud.cz/tags/peertube/</link>
|
||||
<description>Recent content in PeerTube on Oscloud News</description>
|
||||
<description>Recent content in Peertube on Oscloud News</description>
|
||||
<generator>Hugo -- 0.163.3</generator>
|
||||
<language>cs-cz</language>
|
||||
<managingEditor>info@oscloud.cz (OSCloud)</managingEditor>
|
||||
|
||||
Reference in New Issue
Block a user