Browse Source

Downsizing: no static pages

imwald
Nuša Pukšič 9 months ago
parent
commit
cb539e9297
  1. 6
      .env.dist
  2. 1
      README.md
  3. 9
      src/Command/NostrEventFromYamlDefinitionCommand.php
  4. 24
      src/Controller/StaticController.php
  5. 10
      templates/components/Footer.html.twig
  6. 2
      templates/components/Header.html.twig
  7. 36
      templates/static/about.html.twig
  8. 43
      templates/static/pricing.html.twig
  9. 62
      templates/static/roadmap.html.twig
  10. 76
      templates/static/tos.html.twig

6
.env.dist

@ -47,3 +47,9 @@ MERCURE_JWT_SECRET="!NotSoSecretMercureHubJWTSecretKey!"
LNBITS_URL=https://legend.lnbits.com LNBITS_URL=https://legend.lnbits.com
LNBITS_API_KEY=<your-lnbits-admin-key> LNBITS_API_KEY=<your-lnbits-admin-key>
###< LNBits ### ###< LNBits ###
###> magazine settings ###
MAGAZINE_NPUB=<mag-npub>
MAGAZINE_D_TAG=<mag-d-tag>
DEFAULT_RELAY_URL=wss://legend.relay.com
###< magazine settings ###

1
README.md

@ -14,3 +14,4 @@ cd unfold
### Create the .env file ### Create the .env file
Copy the example file `.env.dist` and replace placeholders with your actual configuration. Copy the example file `.env.dist` and replace placeholders with your actual configuration.

9
src/Command/NostrEventFromYamlDefinitionCommand.php

@ -24,7 +24,7 @@ class NostrEventFromYamlDefinitionCommand extends Command
{ {
private string $nsec; private string $nsec;
public function __construct(private readonly CacheInterface $redisCache, public function __construct(private readonly CacheInterface $cache,
private readonly NostrClient $client, private readonly NostrClient $client,
private readonly ArticleFactory $factory, private readonly ArticleFactory $factory,
ParameterBagInterface $bag, ParameterBagInterface $bag,
@ -86,9 +86,9 @@ class NostrEventFromYamlDefinitionCommand extends Command
}); });
// Generate a Redis key // Generate a Redis key
$cacheKey = 'magazine-' . $slug[0][1]; $cacheKey = 'magazine-' . $slug[0][1];
$cacheItem = $this->redisCache->getItem($cacheKey); $cacheItem = $this->cache->getItem($cacheKey);
$cacheItem->set($event); $cacheItem->set($event);
$this->redisCache->save($cacheItem); $this->cache->save($cacheItem);
$output->writeln("<info>Saved index.</info>"); $output->writeln("<info>Saved index.</info>");
} catch (\Exception $e) { } catch (\Exception $e) {
@ -99,16 +99,13 @@ class NostrEventFromYamlDefinitionCommand extends Command
// crawl relays for all the articles and save to db // crawl relays for all the articles and save to db
$fresh = $this->client->getArticles($articleSlugsList); $fresh = $this->client->getArticles($articleSlugsList);
$articles = [];
foreach ($fresh as $item) { foreach ($fresh as $item) {
$article = $this->factory->createFromLongFormContentEvent($item); $article = $this->factory->createFromLongFormContentEvent($item);
$this->entityManager->persist($article); $this->entityManager->persist($article);
$articles[] = $article;
} }
$this->entityManager->flush(); $this->entityManager->flush();
$output->writeln('<info>Articles saved to database.</info>'); $output->writeln('<info>Articles saved to database.</info>');
$output->writeln('<info>Conversion complete.</info>');
return Command::SUCCESS; return Command::SUCCESS;
} }
} }

24
src/Controller/StaticController.php

@ -10,30 +10,6 @@ use Symfony\Component\Routing\Attribute\Route;
class StaticController extends AbstractController class StaticController extends AbstractController
{ {
#[Route('/about')]
public function about(): Response
{
return $this->render('static/about.html.twig');
}
#[Route('/roadmap')]
public function roadmap(): Response
{
return $this->render('static/roadmap.html.twig');
}
#[Route('/pricing')]
public function pricing(): Response
{
return $this->render('static/pricing.html.twig');
}
#[Route('/tos')]
public function tos(): Response
{
return $this->render('static/tos.html.twig');
}
#[Route('/manifest.webmanifest', name: 'pwa_manifest')] #[Route('/manifest.webmanifest', name: 'pwa_manifest')]
public function manifest(): Response public function manifest(): Response
{ {

10
templates/components/Footer.html.twig

@ -1,9 +1 @@
<div class="footer-links"> <p>{{ "now"|date("Y") }} Unfold Demo</p>
<a href="{{ path('app_static_about') }}">About</a> -
<a href="{{ path('app_static_roadmap') }}">Roadmap</a> -
{# <a href="{{ path('app_static_pricing') }}">Pricing</a> -#}
<a href="{{ path('app_static_tos') }}">Terms of service</a>
<br>
<a href="https://geyser.fund/project/newsroom" target="_blank">Decent Newsroom @ Geyser fund</a>
</div>
<p>{{ "now"|date("Y") }} Decent Newsroom - v0.0.1 Preprint</p>

2
templates/components/Header.html.twig

@ -1,6 +1,6 @@
<header class="header" data-controller="menu" {{ attributes }}> <header class="header" data-controller="menu" {{ attributes }}>
<div class="header__logo"> <div class="header__logo">
<h1 class="brand"><a href="/">newsroom</a></h1> <h1 class="brand"><a href="/">unfold</a></h1>
<button class="hamburger btn btn-secondary" data-action="click->menu#toggle" aria-label="Menu">&#9776;</button> <button class="hamburger btn btn-secondary" data-action="click->menu#toggle" aria-label="Menu">&#9776;</button>
</div> </div>
<div class="header__categories" data-menu-target="menu"> <div class="header__categories" data-menu-target="menu">

36
templates/static/about.html.twig

@ -1,36 +0,0 @@
{% extends 'base.html.twig' %}
{% block nav %}
{% endblock %}
{% block body %}
<h1>About Decent Newsroom</h1>
<h2>Rebuilding Trust in Journalism</h2>
<p>The internet, and especially social media, made news instant and abundant, but also cheap and unreliable. The value of simply reporting what happened and where has dropped to zero,
buried under waves of misinformation, clickbait, and AI-generated noise. Worse, sorting truth from falsehood now costs more than spreading lies.</p>
<p>Decent Newsroom is our answer to this crisis. We are building a curated, decentralized magazine featuring high-quality, long-form journalism published on Nostr.</p>
<h2>How It Works</h2>
<dl>
<dt><strong>Curated Excellence</strong></dt>
<dd>We showcase a selection of featured articles.</dd>
<dt><strong>Indexed & Searchable</strong></dt>
<dd>Every article in Decent Newsroom is easily discoverable, improving access for readers and exposure for authors.</dd>
<dd>Simple search is available to logged-in users.</dd>
<dd>Semantic search is in development.</dd>
<dt><strong>Open to Writers & Publishers</strong> <span class="badge">Soon</span></dt>
<dd>Content creators can request indexing for their work, making it searchable and eligible for inclusion.</dd>
<dd>Publishers can create and manage their own magazines.</dd>
</dl>
<h2>Why It Matters</h2>
<p>The age of the newsroom isn’t over—it’s just evolving. We believe in bringing back editorial standards, collaboration, and high-value reporting in a decentralized way. Decent Newsroom is here to cut through the noise and rebuild trust in digital journalism.</p>
<br>
<p>To support us and get early access to the future of publishing, visit our crowdfunding page <a href="https://geyser.fund/project/newsroom" target="_blank">Geyser fund - Newsroom</a>.</p>
{% endblock %}

43
templates/static/pricing.html.twig

@ -1,43 +0,0 @@
{% extends 'base.html.twig' %}
{% block nav %}
{% endblock %}
{% block body %}
<h1>Pricing</h1>
<p>Choose a plan that fits your publishing needs.</p>
<div class="price-list">
<div class="card">
<h3>Scoop Seeker</h3>
<p class="price">Free</p>
<ul class="features">
<li>Read all the articles featured in the Newsroom magazine</li>
</ul>
<button disabled="disabled">Get Started</button>
</div>
<div class="card">
<h3>Publisher</h3>
<p class="price">5.000 sats/month</p>
<ul class="features">
<li>Submit indexing requests for priority indexing</li>
<li>Access to built-in content editor</li>
<li>Content search</li>
</ul>
<button disabled="disabled">Subscribe</button>
</div>
<div class="card">
<h3>Curator</h3>
<p class="price">15.000 sats/month</p>
<ul class="features">
<li>Create and manage your own magazines</li>
<li>Advanced discovery tools</li>
<li>Featured magazine placement</li>
</ul>
<button disabled="disabled">Subscribe</button>
</div>
</div>
{% endblock %}

62
templates/static/roadmap.html.twig

@ -1,62 +0,0 @@
{% extends 'base.html.twig' %}
{% block nav %}
{% endblock %}
{% block body %}
<h1>Roadmap: The Future of Decent Newsroom</h1>
<p>We are building a decentralized, high-value journalism platform step by step. Each phase unlocks new features,
empowering writers, publishers, and readers to engage with quality, independent reporting in a whole new way.</p>
<div class="roadmap-section">
<h2>v0.1.0 – <strong>Preprint</strong> <span class="badge badge__secondary"><small>Current</small></span></h2>
<div class="milestone">
<h3>A first glimpse into the future of journalism</h3>
<p>This early version of Decent Newsroom is all about discovery. We’re launching a sample magazine
to showcase what’s possible.</p>
<ul>
<li>Hand-curated, high-quality articles in magazine format</li>
<li>Full-text search to find the stories that matter to you</li>
<li>No content editor or user submissions yet</li>
</ul>
<p>Preprint is just the beginning.</p>
</div>
</div>
<div class="roadmap-section">
<h2>v0.2.0 – <strong>First Edition</strong> <span class="badge badge__secondary"><small>Soon</small></span></h2>
<div class="milestone">
<h3>The real newsroom takes shape. Writers publish. Readers support. Journalism thrives.</h3>
<p>This milestone version introduces key features that bring Decent Newsroom to life:</p>
<ul>
<li>Zaps</li>
<li>Content submissions</li>
<li>Subscriptions for premium access</li>
<li>Built-in content editor so publishers can create directly on the platform</li>
</ul>
<p>With First Edition, journalism becomes more than just content, it becomes an ecosystem.</p>
<p></p>
</div>
</div>
<div class="roadmap-section">
<h2>v0.3.0 – <strong>Newsstand</strong></h2>
<div class="milestone">
<h3>Curate. Publish. Own your newsroom.</h3>
<p>At this stage, Decent Newsroom evolves into a true platform for independent journalism. Not only can creators publish, but they can also curate their own magazines.</p>
<ul>
<li>Users can create and manage their own curated publications</li>
<li>Collaborative publishing tools – editors, writers, and photographers can work together</li>
<li>Expanded discovery and personalized reading experiences</li>
</ul>
<p>Your news, your way. Newsstand transforms First Edition into a powerful hub for decentralized journalism, driven by the community.</p>
</div>
</div>
<h2>The Journey Ahead</h2>
<p>Every step we take brings us closer to a new era of independent, decentralized journalism. Decent Newsroom isn’t just another publishing platform — it’s a movement to rebuild trust, quality, and collaboration in media.</p>
<p>First Edition is coming soon. Be part of it.</p>
<br>
<p>To support us and get early access to the future of publishing, visit our crowdfunding page <a href="https://geyser.fund/project/newsroom" target="_blank">Geyser fund - Newsroom</a>.</p>
{% endblock %}

76
templates/static/tos.html.twig

@ -1,76 +0,0 @@
{% extends 'base.html.twig' %}
{% block nav %}
{% endblock %}
{% block body %}
<h1>Terms of service</h1>
<p>Effective Date: April 1, 2025</p>
<p>Welcome to Decent Newsroom. These Terms of Service ("Terms") govern your access to and use of our platform,
including the ability to publish, index, search, and subscribe to content. By using our services, you agree to these Terms.</p>
<ol>
<li>
<h2>Introduction</h2>
<p>Decent Newsroom is a platform for discovering, curating, and publishing journalism on Nostr.
We provide tools for searching, indexing, and managing long-form content.</p>
<p>Decent Newsroom also publishes an open-access magazine, Newsroom magazine, comprised of a curated collection of english language articles.</p>
</li>
<li>
<h2>User Accounts & Responsibilities</h2>
<p>We do not store user credentials, emails, or passwords. Authentication is done via Nostr keys.</p>
<p>Some data is stored and linked to your npub for debug and accounting purposes:</p>
<ul>
<li>Subscription status and payment history (if applicable)</li>
<li>Search requests</li>
{# <li>Indexing requests</li>#}
</ul>
</li>
<li>
<h2>Content & Ownership</h2>
<p>The platform operates on the basis of open-access content.</p>
<p>We do not endorse or verify third-party content and are not responsible for its accuracy.</p>
<p>We reserve the right to include and exclude content from the indexer at our own discretion.</p>
{# <p>By requesting indexing, you agree that your content may be made publicly discoverable unless otherwise specified.</p>#}
</li>
<li>
<h2>Payments & Subscriptions</h2>
<p>We use Lightning invoices for processing payments.</p>
<p>Some features, such as indexing requests, high-volume search, and premium content, require a paid subscription.</p>
<p>Payments are generally non-refundable, except in cases of accidental charges or platform malfunctions.</p>
</li>
<li>
<h2>Disclaimer of Warranties</h2>
<p>The platform is provided "as is" and "as available" without warranties of any kind.</p>
<p>We do not guarantee uninterrupted service, accuracy, or security of content.</p>
</li>
<li>
<h2>Limitation of Liability</h2>
<p>We are not responsible for any direct, indirect, or incidental damages arising from your use of the platform.</p>
</li>
<li>
<h2>Termination & Suspension</h2>
<p>We reserve the right to suspend or terminate access if users violate these Terms.</p>
<p>Users can request deletion of their data at any time, though some content may remain indexed based on prior agreements.</p>
</li>
<li>
<h2>Changes to These Terms</h2>
<p>We may update these Terms periodically. Continued use of the platform after modifications constitutes acceptance of the new Terms.</p>
</li>
</ol>
{% endblock %}
Loading…
Cancel
Save