diff --git a/.env.dist b/.env.dist index 4f68ef9..f75d0e0 100644 --- a/.env.dist +++ b/.env.dist @@ -35,9 +35,3 @@ MYSQL_ROOT_PASSWORD=root_password # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml DATABASE_URL="mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@database:3306/${MYSQL_DATABASE}?serverVersion=${MYSQL_VERSION}&charset=${MYSQL_CHARSET}" ###< doctrine/doctrine-bundle ### - -###> magazine settings ### -MAGAZINE_NPUB= -MAGAZINE_D_TAG= -DEFAULT_RELAY_URL=wss://legend.relay.com -###< magazine settings ### diff --git a/assets/icons/apple-touch-icon.png b/assets/theme/default/icons/apple-touch-icon.png similarity index 100% rename from assets/icons/apple-touch-icon.png rename to assets/theme/default/icons/apple-touch-icon.png diff --git a/assets/icons/favicon-96x96.png b/assets/theme/default/icons/favicon-96x96.png similarity index 100% rename from assets/icons/favicon-96x96.png rename to assets/theme/default/icons/favicon-96x96.png diff --git a/assets/icons/favicon.ico b/assets/theme/default/icons/favicon.ico similarity index 100% rename from assets/icons/favicon.ico rename to assets/theme/default/icons/favicon.ico diff --git a/assets/icons/web-app-manifest-192x192.png b/assets/theme/default/icons/web-app-manifest-192x192.png similarity index 100% rename from assets/icons/web-app-manifest-192x192.png rename to assets/theme/default/icons/web-app-manifest-192x192.png diff --git a/assets/icons/web-app-manifest-512x512.png b/assets/theme/default/icons/web-app-manifest-512x512.png similarity index 100% rename from assets/icons/web-app-manifest-512x512.png rename to assets/theme/default/icons/web-app-manifest-512x512.png diff --git a/assets/theme/default/theme.css b/assets/theme/default/theme.css new file mode 100644 index 0000000..9dfa056 --- /dev/null +++ b/assets/theme/default/theme.css @@ -0,0 +1,30 @@ +@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,200..800;1,6..72,200..800&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Montserrat&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap'); + + +:root { + --color-bg: #1a1a1a; /* Deep charcoal background */ + --color-bg-light: #2a2a2a; /* Slightly lighter charcoal */ + --color-bg-primary: #2e1f2e; /* Muted aubergine for a rich, elegant feel */ + --color-text: #f5f5f5; /* Soft white for readability */ + --color-text-mid: #d8d8d8; /* Warm light gray */ + --color-text-contrast: #000; /* Black text for contrast */ + --color-primary: #5F7355; /* Plum primary color */ + --color-secondary: #495544; /* secondary color */ + --color-border: #3a3a3a; /* Subtle gray border */ + --font-family: 'Montserrat', serif; /* Set the Montserrat font as default */ + --main-body-font: 'Newsreader', serif; /* Set the font for the main body */ + --heading-font: 'EB Garamond', serif; /* Set the font for headings */ + --brand-font: 'Lobster', serif; /* A classic, refined branding font */ + --brand-color: white; +} + +[data-theme="light"] { + --color-bg: #f4f1ee; + --color-bg-light: #e8e4df; + --color-text: #2a2a2a; + --color-text-mid: #3a3a3a; /* Warm light gray */ + --color-text-contrast: #f4f1ee; + --brand-color: black; +} diff --git a/assets/theme/local/.gitignore b/assets/theme/local/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/config/packages/asset_mapper.yaml b/config/packages/asset_mapper.yaml index f7653e9..7091aa1 100644 --- a/config/packages/asset_mapper.yaml +++ b/config/packages/asset_mapper.yaml @@ -2,6 +2,8 @@ framework: asset_mapper: # The paths to make available to the asset mapper. paths: + - assets/theme/local # Highest priority (overrides) + - assets/theme/default # Fallback if file not found in local - assets/ missing_import_mode: strict diff --git a/config/packages/twig.yaml b/config/packages/twig.yaml index 3f795d9..d17a0f4 100644 --- a/config/packages/twig.yaml +++ b/config/packages/twig.yaml @@ -1,5 +1,13 @@ twig: file_name_pattern: '*.twig' + globals: + website_name: '%name%' + website_short_name: '%short_name%' + website_description: '%description%' + website_theme: '%theme%' + website_theme_color: '%theme_color%' + website_bg_color: '%theme_bg_color%' + magazine_community_articles: '%community_articles%' when@test: twig: diff --git a/config/services.yaml b/config/services.yaml index cf1cfd4..354da0c 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -3,8 +3,8 @@ # Put parameters here that don't need to change on each machine where the app is deployed # https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration -parameters: - default_relay_url: '%env(DEFAULT_RELAY_URL)%' +imports: + - { resource: unfold.yaml } services: # default configuration for services in *this* file @@ -28,4 +28,4 @@ services: - '%env(DATABASE_URL)%' App\Service\NostrClient: arguments: - $defaultRelayUrl: '%default_relay_url%' + $defaultRelayUrl: '%default_relay%' diff --git a/config/unfold.yaml b/config/unfold.yaml new file mode 100644 index 0000000..01abf9d --- /dev/null +++ b/config/unfold.yaml @@ -0,0 +1,13 @@ +parameters: + name: 'Unfold Magazine' + short_name: 'Unfold' + description: 'Unfolding nostr magazines and community articles' + default_relay: 'wss://TheForest.nostr1.com' + theme: 'space' + theme_color: '#000000' + theme_bg_color: '#ffffff' + npub: 'npub1ez09adke4vy8udk3y2skwst8q5chjgqzym9lpq4u58zf96zcl7kqyry2lz' + d_tag: 'unfold-magazine' + community_articles: true + + diff --git a/docs/features.md b/docs/features.md index 6c5d716..8bc7e2f 100644 --- a/docs/features.md +++ b/docs/features.md @@ -1,29 +1,10 @@ # Features -## Search Functionality (REMOVED) -- **Status**: Being removed as part of scaling down -- **Previous implementation**: Used Elasticsearch via FOSElasticaBundle -- **Replacement**: Will need basic database-based search for articles by title/content if search is still needed -- **Components affected**: - - SearchComponent (Twig component) - - FeaturedList component - - Article indexing commands - - Controllers using Elasticsearch queries - -## Credit System (REMOVED) -- **Status**: Completely removed as part of scaling down -- **Previous implementation**: Credit-based search system with Redis storage -- **Components removed**: - - Entire `src/Credits/` directory (CreditsManager, RedisCreditStore, CreditTransaction entity) - - GetCreditsComponent (Twig component for adding credits) - - CreditTransactionController (admin interface) - - Credit accounting in SearchComponent - - Credit balance display in search interface - - Credits cache configuration - - Credit translation keys - -## Core Features to Preserve +## Core Features - Article management (CRUD operations) - Article display and listing - Author pages -- Basic article filtering (should use database queries instead of Elasticsearch) +- Basic article filtering (uses database queries) +- Configurable magazine name and short name via YAML and .env +- Theme selection (currently: purple) +- Community articles feature (enable/disable via config) diff --git a/src/Controller/ArticleController.php b/src/Controller/ArticleController.php index 96eba22..0fce05b 100644 --- a/src/Controller/ArticleController.php +++ b/src/Controller/ArticleController.php @@ -255,4 +255,24 @@ class ArticleController extends AbstractController ]); } + /** + * Display latest 20 community articles + */ + #[Route('/articles', name: 'articles')] + public function latestArticles(EntityManagerInterface $entityManager): Response + { + $articles = $entityManager->getRepository(Article::class) + ->findBy([], ['createdAt' => 'DESC'], 20); + + $category = (object) [ + 'title' => 'Community Articles', + 'summary' => 'Latest articles from the community', + ]; + + return $this->render('pages/category.html.twig', [ + 'category' => $category, + 'list' => $articles, + ]); + } + } diff --git a/templates/base.html.twig b/templates/base.html.twig index fcb2bb2..002bdf5 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -1,15 +1,15 @@ - + - {% block title %}Decent Newsroom{% endblock %} - + {% block title %}{{ website_name }}{% endblock %} + - + diff --git a/templates/components/Footer.html.twig b/templates/components/Footer.html.twig index 52bb2c0..2226f22 100644 --- a/templates/components/Footer.html.twig +++ b/templates/components/Footer.html.twig @@ -1 +1 @@ -

{{ "now"|date("Y") }} Unfold Demo

+

{{ "now"|date("Y") }} {{ website_name }}

diff --git a/templates/components/Header.html.twig b/templates/components/Header.html.twig index 4402966..3506500 100644 --- a/templates/components/Header.html.twig +++ b/templates/components/Header.html.twig @@ -1,6 +1,6 @@
diff --git a/templates/components/UserMenu.html.twig b/templates/components/UserMenu.html.twig index 11d151f..f67f6b0 100644 --- a/templates/components/UserMenu.html.twig +++ b/templates/components/UserMenu.html.twig @@ -12,6 +12,11 @@ {# #} {% endif %}
    + {% if magazine_community_articles %} +
  • + Latest Articles +
  • + {% endif %} {#
  • #} {# Write an article#} {#
  • #} diff --git a/templates/pages/category.html.twig b/templates/pages/category.html.twig index 1638cc4..b3ef1c4 100644 --- a/templates/pages/category.html.twig +++ b/templates/pages/category.html.twig @@ -1,11 +1,11 @@ {% extends 'base.html.twig' %} {% block ogtags %} - + - + {% endblock %} {% block nav %} @@ -16,6 +16,4 @@ {% endblock %} {% block aside %} - {#
    Magazines
    #} - {# #} {% endblock %} diff --git a/templates/static/manifest.webmanifest.twig b/templates/static/manifest.webmanifest.twig index 354a57a..75c1a5d 100644 --- a/templates/static/manifest.webmanifest.twig +++ b/templates/static/manifest.webmanifest.twig @@ -1,6 +1,7 @@ { - "name": "Decent Newsroom", - "short_name": "Newsroom", + "name": "{{ website_name }}", + "short_name": "{{ website_short_name }}", + "description": "{{ website_description }}", "start_url": "/?source=pwa", "icons": [ { @@ -14,7 +15,7 @@ "type": "image/png" } ], - "theme_color": "#ffffff", - "background_color": "#ffffff", + "theme_color": "{{ website_theme_color }}", + "background_color": "{{ website_bg_color }}", "display": "standalone" }