postnhost 0.0.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/{LICENSE.txt → LICENSE} +6 -6
- data/README.md +341 -15
- data/Rakefile +38 -6
- data/app/assets/builds/postnhost/application.css +2 -0
- data/app/assets/builds/postnhost/application.js +50190 -0
- data/app/assets/config/postnhost_manifest.js +2 -0
- data/app/assets/images/postnhost/demo.webp +0 -0
- data/app/assets/images/postnhost/icons/alert-circle.svg +3 -0
- data/app/assets/images/postnhost/icons/arrow-left-long.svg +3 -0
- data/app/assets/images/postnhost/icons/arrow-left.svg +3 -0
- data/app/assets/images/postnhost/icons/arrow-right-end-on-rectangle.svg +3 -0
- data/app/assets/images/postnhost/icons/arrow-right-long.svg +3 -0
- data/app/assets/images/postnhost/icons/arrow-right.svg +3 -0
- data/app/assets/images/postnhost/icons/bars.svg +3 -0
- data/app/assets/images/postnhost/icons/bluesky.svg +3 -0
- data/app/assets/images/postnhost/icons/check-circle.svg +3 -0
- data/app/assets/images/postnhost/icons/chevron-down-small.svg +3 -0
- data/app/assets/images/postnhost/icons/chevron-down.svg +3 -0
- data/app/assets/images/postnhost/icons/chevron-left.svg +3 -0
- data/app/assets/images/postnhost/icons/chevron-right.svg +3 -0
- data/app/assets/images/postnhost/icons/clock.svg +3 -0
- data/app/assets/images/postnhost/icons/close.svg +3 -0
- data/app/assets/images/postnhost/icons/code-bracket.svg +3 -0
- data/app/assets/images/postnhost/icons/document-text.svg +3 -0
- data/app/assets/images/postnhost/icons/drag-handle.svg +8 -0
- data/app/assets/images/postnhost/icons/edit.svg +3 -0
- data/app/assets/images/postnhost/icons/external-link.svg +3 -0
- data/app/assets/images/postnhost/icons/eye.svg +4 -0
- data/app/assets/images/postnhost/icons/facebook.svg +3 -0
- data/app/assets/images/postnhost/icons/folder.svg +3 -0
- data/app/assets/images/postnhost/icons/image.svg +3 -0
- data/app/assets/images/postnhost/icons/info-circle.svg +3 -0
- data/app/assets/images/postnhost/icons/instagram.svg +3 -0
- data/app/assets/images/postnhost/icons/language.svg +3 -0
- data/app/assets/images/postnhost/icons/layers.svg +3 -0
- data/app/assets/images/postnhost/icons/lightning.svg +3 -0
- data/app/assets/images/postnhost/icons/linkedin.svg +3 -0
- data/app/assets/images/postnhost/icons/logout.svg +3 -0
- data/app/assets/images/postnhost/icons/magnifying-glass.svg +3 -0
- data/app/assets/images/postnhost/icons/mastodon.svg +3 -0
- data/app/assets/images/postnhost/icons/menu.svg +3 -0
- data/app/assets/images/postnhost/icons/plus.svg +3 -0
- data/app/assets/images/postnhost/icons/schedule.svg +3 -0
- data/app/assets/images/postnhost/icons/settings.svg +4 -0
- data/app/assets/images/postnhost/icons/sparkles.svg +3 -0
- data/app/assets/images/postnhost/icons/spinner.svg +4 -0
- data/app/assets/images/postnhost/icons/threads.svg +3 -0
- data/app/assets/images/postnhost/icons/tiktok.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/align-center.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/align-left.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/align-right.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/apply-link.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/blockquote.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/bold.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/bullet-list.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/code-block.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/code.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/heading-2.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/heading-3.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/image-add.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/italic.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/link.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/ordered-list.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/redo.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/remove-link.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/strike.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/table.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/underline.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/undo.svg +3 -0
- data/app/assets/images/postnhost/icons/tiptap/youtube.svg +4 -0
- data/app/assets/images/postnhost/icons/translate.svg +3 -0
- data/app/assets/images/postnhost/icons/trash.svg +3 -0
- data/app/assets/images/postnhost/icons/user.svg +4 -0
- data/app/assets/images/postnhost/icons/users.svg +3 -0
- data/app/assets/images/postnhost/icons/warning.svg +3 -0
- data/app/assets/images/postnhost/icons/x.svg +3 -0
- data/app/assets/images/postnhost/icons/youtube.svg +3 -0
- data/app/assets/images/postnhost/logo.webp +0 -0
- data/app/assets/images/postnhost/og-image.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/08-how-to-control-suggested-articles-and-top-picks-01-discovery-controls.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/09-all-about-authors-in-postnhost-01-author-profile.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/09-all-about-authors-in-postnhost-02-multiple-authors.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/11-how-to-schedule-an-article-for-publication-01-timezone.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/11-how-to-schedule-an-article-for-publication-02-scheduled-article.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/12-how-article-version-history-and-restores-work-01-version-history.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/13-how-to-add-and-manage-languages-01-language-management.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/14-how-to-translate-articles-pages-and-categories-01-translation-options.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/14-how-to-translate-articles-pages-and-categories-02-ai-language-selection.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/16-how-to-add-navigation-links-01-navigation-builder.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/16-how-to-add-navigation-links-02-external-link-settings.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/17-how-to-add-a-logo-and-default-og-image-01-assets-settings.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/19-how-to-customize-public-text-for-each-language-01-i18n-overrides.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/20-how-to-configure-structured-data-and-sitemap-seo-01-site-schema.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/20-how-to-configure-structured-data-and-sitemap-seo-02-author-schema-defaults.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/20-how-to-configure-structured-data-and-sitemap-seo-03-author-schema-advanced-fields.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/08-suggested-articles-and-top-picks.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/09-authors.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/11-scheduling.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/12-version-history.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/13-languages.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/14-translations.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/16-navigation-links.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/17-logo-and-default-og-image.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/19-public-text-for-each-language.webp +0 -0
- data/app/assets/images/postnhost/sample-docs/covers/20-structured-data-and-sitemap-seo.webp +0 -0
- data/app/assets/stylesheets/application.tailwind.css +343 -0
- data/app/assets/stylesheets/postnhost/application.css +15 -0
- data/app/assets/xsl/sitemap.xsl +64 -0
- data/app/controllers/concerns/postnhost/authentication.rb +59 -0
- data/app/controllers/concerns/postnhost/canonical_first_page_redirect.rb +14 -0
- data/app/controllers/concerns/postnhost/language_switcher.rb +42 -0
- data/app/controllers/concerns/postnhost/onboarding/access_control.rb +57 -0
- data/app/controllers/concerns/postnhost/onboarding/step_assignment.rb +55 -0
- data/app/controllers/concerns/postnhost/public_footer_data.rb +103 -0
- data/app/controllers/concerns/postnhost/public_http_caching.rb +35 -0
- data/app/controllers/concerns/postnhost/public_page_size.rb +17 -0
- data/app/controllers/concerns/postnhost/public_template_resolvable.rb +44 -0
- data/app/controllers/concerns/postnhost/settings/i18n_manageable.rb +61 -0
- data/app/controllers/concerns/postnhost/settings/navigation_manageable.rb +118 -0
- data/app/controllers/concerns/postnhost/settings/schema_manageable.rb +140 -0
- data/app/controllers/concerns/postnhost/users/schema_manageable.rb +119 -0
- data/app/controllers/postnhost/application_controller.rb +37 -0
- data/app/controllers/postnhost/article_variants_controller.rb +138 -0
- data/app/controllers/postnhost/articles/cover_images_controller.rb +35 -0
- data/app/controllers/postnhost/articles/images_controller.rb +28 -0
- data/app/controllers/postnhost/articles/translations_controller.rb +26 -0
- data/app/controllers/postnhost/articles_controller.rb +130 -0
- data/app/controllers/postnhost/categories/translations_controller.rb +24 -0
- data/app/controllers/postnhost/categories_controller.rb +59 -0
- data/app/controllers/postnhost/category_variants_controller.rb +69 -0
- data/app/controllers/postnhost/languages_controller.rb +66 -0
- data/app/controllers/postnhost/onboarding_controller.rb +70 -0
- data/app/controllers/postnhost/page_variants_controller.rb +136 -0
- data/app/controllers/postnhost/pages/images_controller.rb +28 -0
- data/app/controllers/postnhost/pages/translations_controller.rb +26 -0
- data/app/controllers/postnhost/pages_controller.rb +95 -0
- data/app/controllers/postnhost/public/articles_controller.rb +135 -0
- data/app/controllers/postnhost/public/authors_controller.rb +57 -0
- data/app/controllers/postnhost/public/categories_controller.rb +61 -0
- data/app/controllers/postnhost/public/static_pages_controller.rb +77 -0
- data/app/controllers/postnhost/public_controller.rb +32 -0
- data/app/controllers/postnhost/sessions_controller.rb +37 -0
- data/app/controllers/postnhost/settings/site_scripts_controller.rb +61 -0
- data/app/controllers/postnhost/settings_controller.rb +63 -0
- data/app/controllers/postnhost/sitemap_controller.rb +17 -0
- data/app/controllers/postnhost/templates_controller.rb +26 -0
- data/app/controllers/postnhost/users_controller.rb +112 -0
- data/app/helpers/postnhost/application_helper.rb +247 -0
- data/app/helpers/postnhost/article_helper.rb +41 -0
- data/app/helpers/postnhost/category_helper.rb +52 -0
- data/app/helpers/postnhost/common_css_helper.rb +97 -0
- data/app/helpers/postnhost/navigation_helper.rb +148 -0
- data/app/helpers/postnhost/pagy_helper.rb +103 -0
- data/app/helpers/postnhost/public_pages_helper.rb +287 -0
- data/app/helpers/postnhost/schema_helper.rb +102 -0
- data/app/helpers/postnhost/seo_helper.rb +428 -0
- data/app/helpers/postnhost/settings_helper.rb +79 -0
- data/app/javascript/application.js +3 -0
- data/app/javascript/controllers/ai_translation_controller.js +42 -0
- data/app/javascript/controllers/application.js +9 -0
- data/app/javascript/controllers/author_manager_controller.js +96 -0
- data/app/javascript/controllers/auto_save_controller.js +244 -0
- data/app/javascript/controllers/bulk_selection_controller.js +74 -0
- data/app/javascript/controllers/burger_controller.js +20 -0
- data/app/javascript/controllers/category_manager_controller.js +99 -0
- data/app/javascript/controllers/collapsible_sidebar_controller.js +87 -0
- data/app/javascript/controllers/cover_image_upload_controller.js +164 -0
- data/app/javascript/controllers/dropdown_controller.js +38 -0
- data/app/javascript/controllers/editor_mobile_sidebars_controller.js +36 -0
- data/app/javascript/controllers/file_auto_submit_controller.js +23 -0
- data/app/javascript/controllers/flash_message_controller.js +40 -0
- data/app/javascript/controllers/index.js +71 -0
- data/app/javascript/controllers/navigation_builder_controller.js +463 -0
- data/app/javascript/controllers/public_mobile_nav_controller.js +26 -0
- data/app/javascript/controllers/publish_guard_controller.js +47 -0
- data/app/javascript/controllers/reading_progress_controller.js +38 -0
- data/app/javascript/controllers/schedule_manager_controller.js +87 -0
- data/app/javascript/controllers/suggestion_manager_controller.js +99 -0
- data/app/javascript/controllers/template_preview_controller.js +34 -0
- data/app/javascript/controllers/tiptap_editor_controller.js +812 -0
- data/app/javascript/controllers/title_field_controller.js +17 -0
- data/app/javascript/helpers/auto_save_state.js +47 -0
- data/app/javascript/helpers/code_highlighting.js +48 -0
- data/app/javascript/helpers/dom_helpers.js +109 -0
- data/app/javascript/helpers/style_helpers.js +168 -0
- data/app/jobs/postnhost/application_job.rb +9 -0
- data/app/jobs/postnhost/scheduled_article_job.rb +13 -0
- data/app/jobs/postnhost/translation/article_variant_job.rb +17 -0
- data/app/jobs/postnhost/translation/category_variant_job.rb +17 -0
- data/app/jobs/postnhost/translation/page_variant_job.rb +17 -0
- data/app/models/concerns/postnhost/article/image_uploadable.rb +11 -0
- data/app/models/concerns/postnhost/excerpt_optimizable.rb +57 -0
- data/app/models/concerns/postnhost/inline_image_uploadable.rb +40 -0
- data/app/models/concerns/postnhost/page/image_uploadable.rb +11 -0
- data/app/models/concerns/postnhost/primary_language_guard.rb +18 -0
- data/app/models/concerns/postnhost/public_revision_touch.rb +15 -0
- data/app/models/concerns/postnhost/schema_localizable.rb +28 -0
- data/app/models/postnhost/application_record.rb +5 -0
- data/app/models/postnhost/article.rb +142 -0
- data/app/models/postnhost/article_author.rb +20 -0
- data/app/models/postnhost/article_category.rb +8 -0
- data/app/models/postnhost/article_suggestion.rb +19 -0
- data/app/models/postnhost/article_variant.rb +28 -0
- data/app/models/postnhost/category.rb +34 -0
- data/app/models/postnhost/category_variant.rb +24 -0
- data/app/models/postnhost/language.rb +38 -0
- data/app/models/postnhost/navigation.rb +76 -0
- data/app/models/postnhost/navigation_item.rb +100 -0
- data/app/models/postnhost/page.rb +63 -0
- data/app/models/postnhost/page_variant.rb +26 -0
- data/app/models/postnhost/public_site_revision.rb +24 -0
- data/app/models/postnhost/published_cover_image.rb +28 -0
- data/app/models/postnhost/setting.rb +116 -0
- data/app/models/postnhost/site_script.rb +11 -0
- data/app/models/postnhost/snapshot/article.rb +142 -0
- data/app/models/postnhost/snapshot/article_author.rb +11 -0
- data/app/models/postnhost/snapshot/article_category.rb +10 -0
- data/app/models/postnhost/snapshot/article_suggestion.rb +11 -0
- data/app/models/postnhost/snapshot/article_variant.rb +60 -0
- data/app/models/postnhost/snapshot/page.rb +33 -0
- data/app/models/postnhost/snapshot/page_variant.rb +41 -0
- data/app/models/postnhost/template.rb +20 -0
- data/app/models/postnhost/user.rb +63 -0
- data/app/models/postnhost/version.rb +7 -0
- data/app/services/postnhost/base_service.rb +17 -0
- data/app/services/postnhost/constraints/public_locale_constraint.rb +9 -0
- data/app/services/postnhost/constraints/public_route_constraint.rb +19 -0
- data/app/services/postnhost/onboarding/step_processor.rb +27 -0
- data/app/services/postnhost/onboarding/steps/base.rb +52 -0
- data/app/services/postnhost/onboarding/steps/choose_languages.rb +66 -0
- data/app/services/postnhost/onboarding/steps/complete_post_install_checklist.rb +12 -0
- data/app/services/postnhost/onboarding/steps/create_admin_account.rb +28 -0
- data/app/services/postnhost/onboarding/steps/finish_setup.rb +27 -0
- data/app/services/postnhost/onboarding/steps/set_site_metadata.rb +70 -0
- data/app/services/postnhost/public_navigation_targets.rb +67 -0
- data/app/services/postnhost/public_request_context.rb +101 -0
- data/app/services/postnhost/publishing/article_variants/publish.rb +26 -0
- data/app/services/postnhost/publishing/article_variants/publish_many.rb +23 -0
- data/app/services/postnhost/publishing/article_variants/snapshot_writer.rb +44 -0
- data/app/services/postnhost/publishing/article_variants/unpublish.rb +27 -0
- data/app/services/postnhost/publishing/article_variants/unpublish_many.rb +23 -0
- data/app/services/postnhost/publishing/articles/publish.rb +25 -0
- data/app/services/postnhost/publishing/articles/publish_scheduled.rb +42 -0
- data/app/services/postnhost/publishing/articles/snapshot_writer.rb +84 -0
- data/app/services/postnhost/publishing/articles/unpublish.rb +26 -0
- data/app/services/postnhost/publishing/bulk_transition.rb +63 -0
- data/app/services/postnhost/publishing/error.rb +12 -0
- data/app/services/postnhost/publishing/page_variants/publish.rb +26 -0
- data/app/services/postnhost/publishing/page_variants/publish_many.rb +23 -0
- data/app/services/postnhost/publishing/page_variants/snapshot_writer.rb +41 -0
- data/app/services/postnhost/publishing/page_variants/unpublish.rb +27 -0
- data/app/services/postnhost/publishing/page_variants/unpublish_many.rb +23 -0
- data/app/services/postnhost/publishing/pages/publish.rb +25 -0
- data/app/services/postnhost/publishing/pages/snapshot_writer.rb +38 -0
- data/app/services/postnhost/publishing/pages/unpublish.rb +26 -0
- data/app/services/postnhost/publishing/revision.rb +37 -0
- data/app/services/postnhost/publishing/route_validator.rb +41 -0
- data/app/services/postnhost/publishing/versions/restore_draft.rb +64 -0
- data/app/services/postnhost/service_result.rb +7 -0
- data/app/services/postnhost/sitemap_builder.rb +395 -0
- data/app/services/postnhost/translation/article_variant_translator.rb +102 -0
- data/app/services/postnhost/translation/category_variant_translator.rb +92 -0
- data/app/services/postnhost/translation/content_translator.rb +119 -0
- data/app/services/postnhost/translation/openai_llm_client.rb +30 -0
- data/app/services/postnhost/translation/page_variant_translator.rb +55 -0
- data/app/uploaders/base_uploader.rb +26 -0
- data/app/uploaders/cover_image_uploader.rb +31 -0
- data/app/uploaders/postnhost/avatar_uploader.rb +17 -0
- data/app/uploaders/postnhost/inline_article_image_uploader.rb +38 -0
- data/app/uploaders/postnhost/inline_page_image_uploader.rb +38 -0
- data/app/uploaders/postnhost/setting_asset_uploader.rb +18 -0
- data/app/views/layouts/postnhost/_favicon.html.erb +6 -0
- data/app/views/layouts/postnhost/_footer.html.erb +67 -0
- data/app/views/layouts/postnhost/_header.html.erb +89 -0
- data/app/views/layouts/postnhost/_sidebar.html.erb +72 -0
- data/app/views/layouts/postnhost/application.html.erb +23 -0
- data/app/views/layouts/postnhost/articles.html.erb +34 -0
- data/app/views/layouts/postnhost/product.html.erb +36 -0
- data/app/views/layouts/postnhost/public/templates/default.html.erb +110 -0
- data/app/views/layouts/postnhost/public/templates/swiss-editorial.html.erb +213 -0
- data/app/views/layouts/postnhost/public/templates/workspace-journal.html.erb +231 -0
- data/app/views/layouts/postnhost/public_header/_dashboard_sign_in.html.erb +14 -0
- data/app/views/layouts/postnhost/public_header/_language_switcher.html.erb +43 -0
- data/app/views/layouts/postnhost/public_header/_logo.html.erb +9 -0
- data/app/views/postnhost/article_variants/_variants_list.html.erb +82 -0
- data/app/views/postnhost/article_variants/edit.html.erb +48 -0
- data/app/views/postnhost/article_variants/index.html.erb +128 -0
- data/app/views/postnhost/article_variants/publish.turbo_stream.erb +3 -0
- data/app/views/postnhost/article_variants/unpublish.turbo_stream.erb +3 -0
- data/app/views/postnhost/article_variants/update.turbo_stream.erb +3 -0
- data/app/views/postnhost/articles/_author_manager.html.erb +38 -0
- data/app/views/postnhost/articles/_category_manager.html.erb +42 -0
- data/app/views/postnhost/articles/_cover_image_upload.html.erb +82 -0
- data/app/views/postnhost/articles/_suggestion_manager.html.erb +43 -0
- data/app/views/postnhost/articles/_version_snapshot.html.erb +10 -0
- data/app/views/postnhost/articles/edit.html.erb +51 -0
- data/app/views/postnhost/articles/index.html.erb +132 -0
- data/app/views/postnhost/articles/publish.turbo_stream.erb +3 -0
- data/app/views/postnhost/articles/unpublish.turbo_stream.erb +3 -0
- data/app/views/postnhost/articles/update.turbo_stream.erb +3 -0
- data/app/views/postnhost/articles/version_preview.html.erb +17 -0
- data/app/views/postnhost/articles/versions.html.erb +68 -0
- data/app/views/postnhost/categories/edit.html.erb +77 -0
- data/app/views/postnhost/categories/index.html.erb +80 -0
- data/app/views/postnhost/categories/new.html.erb +50 -0
- data/app/views/postnhost/categories/show.html.erb +99 -0
- data/app/views/postnhost/category_variants/_category_variants_list.html.erb +67 -0
- data/app/views/postnhost/category_variants/_form.html.erb +29 -0
- data/app/views/postnhost/category_variants/edit.html.erb +21 -0
- data/app/views/postnhost/category_variants/index.html.erb +82 -0
- data/app/views/postnhost/category_variants/new.html.erb +21 -0
- data/app/views/postnhost/languages/edit.html.erb +45 -0
- data/app/views/postnhost/languages/index.html.erb +86 -0
- data/app/views/postnhost/languages/new.html.erb +45 -0
- data/app/views/postnhost/languages/show.html.erb +156 -0
- data/app/views/postnhost/onboarding/_post_install_checklist.html.erb +40 -0
- data/app/views/postnhost/onboarding/_step_1.html.erb +42 -0
- data/app/views/postnhost/onboarding/_step_2.html.erb +38 -0
- data/app/views/postnhost/onboarding/_step_3.html.erb +62 -0
- data/app/views/postnhost/onboarding/_step_4.html.erb +26 -0
- data/app/views/postnhost/onboarding/show.html.erb +51 -0
- data/app/views/postnhost/page_variants/_variants_list.html.erb +82 -0
- data/app/views/postnhost/page_variants/edit.html.erb +50 -0
- data/app/views/postnhost/page_variants/index.html.erb +128 -0
- data/app/views/postnhost/page_variants/publish.turbo_stream.erb +3 -0
- data/app/views/postnhost/page_variants/unpublish.turbo_stream.erb +3 -0
- data/app/views/postnhost/page_variants/update.turbo_stream.erb +3 -0
- data/app/views/postnhost/pages/edit.html.erb +50 -0
- data/app/views/postnhost/pages/index.html.erb +110 -0
- data/app/views/postnhost/pages/publish.turbo_stream.erb +3 -0
- data/app/views/postnhost/pages/unpublish.turbo_stream.erb +3 -0
- data/app/views/postnhost/public/articles/content_for/_index.html.erb +30 -0
- data/app/views/postnhost/public/articles/content_for/_preview.html.erb +9 -0
- data/app/views/postnhost/public/articles/content_for/_show.html.erb +24 -0
- data/app/views/postnhost/public/authors/content_for/_show.html.erb +24 -0
- data/app/views/postnhost/public/categories/content_for/_index.html.erb +29 -0
- data/app/views/postnhost/public/static_pages/content_for/_show.html.erb +19 -0
- data/app/views/postnhost/public/templates/default/articles/_article_card.html.erb +37 -0
- data/app/views/postnhost/public/templates/default/articles/_search_form.html.erb +12 -0
- data/app/views/postnhost/public/templates/default/articles/_suggestions.html.erb +44 -0
- data/app/views/postnhost/public/templates/default/articles/_top_picks.html.erb +42 -0
- data/app/views/postnhost/public/templates/default/articles/index.html.erb +53 -0
- data/app/views/postnhost/public/templates/default/articles/preview.html.erb +102 -0
- data/app/views/postnhost/public/templates/default/articles/show.html.erb +111 -0
- data/app/views/postnhost/public/templates/default/authors/_article_card.html.erb +28 -0
- data/app/views/postnhost/public/templates/default/authors/_profile_block.html.erb +29 -0
- data/app/views/postnhost/public/templates/default/authors/show.html.erb +36 -0
- data/app/views/postnhost/public/templates/default/categories/_article_card.html.erb +34 -0
- data/app/views/postnhost/public/templates/default/categories/index.html.erb +48 -0
- data/app/views/postnhost/public/templates/default/shared/_article_authors.html.erb +24 -0
- data/app/views/postnhost/public/templates/default/shared/_author_avatar.html.erb +9 -0
- data/app/views/postnhost/public/templates/default/shared/_hero_cover_image.html.erb +11 -0
- data/app/views/postnhost/public/templates/default/shared/_pagination.html.erb +35 -0
- data/app/views/postnhost/public/templates/default/shared/_thumbnail_cover_image.html.erb +9 -0
- data/app/views/postnhost/public/templates/default/static_pages/show.html.erb +22 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/_article_card.html.erb +28 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/_search_form.html.erb +19 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/_suggestions.html.erb +42 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/_top_picks.html.erb +38 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/index.html.erb +133 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/preview.html.erb +42 -0
- data/app/views/postnhost/public/templates/swiss-editorial/articles/show.html.erb +100 -0
- data/app/views/postnhost/public/templates/swiss-editorial/authors/_article_card.html.erb +27 -0
- data/app/views/postnhost/public/templates/swiss-editorial/authors/_profile_block.html.erb +32 -0
- data/app/views/postnhost/public/templates/swiss-editorial/authors/show.html.erb +31 -0
- data/app/views/postnhost/public/templates/swiss-editorial/categories/_article_card.html.erb +28 -0
- data/app/views/postnhost/public/templates/swiss-editorial/categories/index.html.erb +88 -0
- data/app/views/postnhost/public/templates/swiss-editorial/shared/_article_authors.html.erb +26 -0
- data/app/views/postnhost/public/templates/swiss-editorial/shared/_author_avatar.html.erb +9 -0
- data/app/views/postnhost/public/templates/swiss-editorial/shared/_hero_cover_image.html.erb +11 -0
- data/app/views/postnhost/public/templates/swiss-editorial/shared/_pagination.html.erb +35 -0
- data/app/views/postnhost/public/templates/swiss-editorial/shared/_thumbnail_cover_image.html.erb +9 -0
- data/app/views/postnhost/public/templates/swiss-editorial/static_pages/show.html.erb +17 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/_article_card.html.erb +44 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/_search_form.html.erb +19 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/_suggestions.html.erb +49 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/_top_picks.html.erb +34 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/index.html.erb +69 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/preview.html.erb +113 -0
- data/app/views/postnhost/public/templates/workspace-journal/articles/show.html.erb +120 -0
- data/app/views/postnhost/public/templates/workspace-journal/authors/_article_card.html.erb +1 -0
- data/app/views/postnhost/public/templates/workspace-journal/authors/_profile_block.html.erb +32 -0
- data/app/views/postnhost/public/templates/workspace-journal/authors/show.html.erb +33 -0
- data/app/views/postnhost/public/templates/workspace-journal/categories/_article_card.html.erb +1 -0
- data/app/views/postnhost/public/templates/workspace-journal/categories/index.html.erb +58 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_article_authors.html.erb +27 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_article_card.html.erb +44 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_author_avatar.html.erb +9 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_category_navigation.html.erb +10 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_hero_cover_image.html.erb +11 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_pagination.html.erb +35 -0
- data/app/views/postnhost/public/templates/workspace-journal/shared/_thumbnail_cover_image.html.erb +9 -0
- data/app/views/postnhost/public/templates/workspace-journal/static_pages/show.html.erb +17 -0
- data/app/views/postnhost/sessions/new.html.erb +59 -0
- data/app/views/postnhost/settings/edit.html.erb +68 -0
- data/app/views/postnhost/settings/sections/_assets.html.erb +40 -0
- data/app/views/postnhost/settings/sections/_feature_flags.html.erb +43 -0
- data/app/views/postnhost/settings/sections/_i18n.html.erb +57 -0
- data/app/views/postnhost/settings/sections/_navigation.html.erb +98 -0
- data/app/views/postnhost/settings/sections/_schema.html.erb +253 -0
- data/app/views/postnhost/settings/sections/_scripts.html.erb +79 -0
- data/app/views/postnhost/settings/sections/_site.html.erb +41 -0
- data/app/views/postnhost/settings/sections/_timezone.html.erb +19 -0
- data/app/views/postnhost/shared/_ai_translation_modal.html.erb +85 -0
- data/app/views/postnhost/shared/_flash_messages.html.erb +27 -0
- data/app/views/postnhost/shared/_form_errors.html.erb +22 -0
- data/app/views/postnhost/shared/_seo_meta_tags.html.erb +70 -0
- data/app/views/postnhost/shared/_structured_data.html.erb +5 -0
- data/app/views/postnhost/shared/articles/_action_buttons.html.erb +87 -0
- data/app/views/postnhost/shared/articles/_cover_image_preview.html.erb +30 -0
- data/app/views/postnhost/shared/articles/_editor_column.html.erb +15 -0
- data/app/views/postnhost/shared/articles/_editor_column_preview.html.erb +33 -0
- data/app/views/postnhost/shared/articles/_error_messages.html.erb +23 -0
- data/app/views/postnhost/shared/articles/_meta_sidebar.html.erb +322 -0
- data/app/views/postnhost/shared/articles/_meta_sidebar_preview.html.erb +29 -0
- data/app/views/postnhost/shared/articles/_post_actions.html.erb +105 -0
- data/app/views/postnhost/shared/articles/_schedule_actions.html.erb +51 -0
- data/app/views/postnhost/shared/articles/_tiptap_editor.html.erb +225 -0
- data/app/views/postnhost/shared/articles/_title_field.html.erb +9 -0
- data/app/views/postnhost/shared/articles/_version_action_buttons.html.erb +35 -0
- data/app/views/postnhost/shared/elements/_button.html.erb +20 -0
- data/app/views/postnhost/shared/elements/_button_link.html.erb +24 -0
- data/app/views/postnhost/shared/elements/_empty_state.html.erb +22 -0
- data/app/views/postnhost/shared/elements/_error_messages.html.erb +28 -0
- data/app/views/postnhost/shared/elements/_form_card.html.erb +10 -0
- data/app/views/postnhost/shared/elements/_form_page_header.html.erb +21 -0
- data/app/views/postnhost/shared/elements/_icon_button.html.erb +17 -0
- data/app/views/postnhost/shared/elements/_page_header.html.erb +40 -0
- data/app/views/postnhost/shared/elements/_table_container.html.erb +23 -0
- data/app/views/postnhost/shared/pages/_action_buttons.html.erb +84 -0
- data/app/views/postnhost/shared/pages/_meta_sidebar.html.erb +132 -0
- data/app/views/postnhost/shared/pages/_post_actions.html.erb +69 -0
- data/app/views/postnhost/templates/edit.html.erb +83 -0
- data/app/views/postnhost/users/_avatar.html.erb +9 -0
- data/app/views/postnhost/users/_form.html.erb +160 -0
- data/app/views/postnhost/users/edit.html.erb +26 -0
- data/app/views/postnhost/users/index.html.erb +91 -0
- data/app/views/postnhost/users/new.html.erb +9 -0
- data/app/views/postnhost/users/schema_edit.html.erb +175 -0
- data/config/locales/de.yml +55 -0
- data/config/locales/en.yml +88 -0
- data/config/locales/es.yml +58 -0
- data/config/locales/fr.yml +55 -0
- data/config/locales/ja.yml +55 -0
- data/config/locales/ko.yml +55 -0
- data/config/locales/pl.yml +55 -0
- data/config/locales/pt.yml +55 -0
- data/config/locales/ru.yml +55 -0
- data/config/routes.rb +112 -0
- data/db/migrate/20250822213820_create_users.rb +29 -0
- data/db/migrate/20250822214046_create_categories.rb +15 -0
- data/db/migrate/20250822214106_create_languages.rb +16 -0
- data/db/migrate/20250822214148_create_articles.rb +34 -0
- data/db/migrate/20250822214217_create_article_variants.rb +24 -0
- data/db/migrate/20250929091137_create_article_categories.rb +12 -0
- data/db/migrate/20251013204200_create_versions.rb +40 -0
- data/db/migrate/20260106074532_create_article_suggestions.rb +13 -0
- data/db/migrate/20260108110506_create_category_variants.rb +15 -0
- data/db/migrate/20260308130000_create_settings.rb +23 -0
- data/db/migrate/20260323113000_create_pages.rb +19 -0
- data/db/migrate/20260414100000_create_article_authors.rb +14 -0
- data/db/migrate/20260512100000_create_templates.rb +9 -0
- data/db/migrate/20260520110001_create_navigations.rb +9 -0
- data/db/migrate/20260520110002_create_navigation_items.rb +22 -0
- data/db/migrate/20260528000002_create_page_variants.rb +20 -0
- data/db/migrate/20260709090000_create_snapshots.rb +154 -0
- data/db/migrate/20260726130000_create_site_scripts.rb +11 -0
- data/lib/generators/postnhost/install/install_generator.rb +56 -0
- data/lib/generators/postnhost/install/templates/carrierwave.rb +17 -0
- data/lib/generators/postnhost/install/templates/postnhost.rb +36 -0
- data/lib/generators/postnhost/locale/locale_generator.rb +36 -0
- data/lib/generators/postnhost/static_pages/static_pages_generator.rb +47 -0
- data/lib/generators/postnhost/tailwindcss/install_generator.rb +97 -0
- data/lib/generators/postnhost/tailwindcss/templates/host.tailwind.css +7 -0
- data/lib/generators/postnhost/tailwindcss/templates/tailwind.config.js +8 -0
- data/lib/generators/postnhost/user/user_generator.rb +36 -0
- data/lib/generators/postnhost/views/views_generator.rb +142 -0
- data/lib/postnhost/configuration.rb +64 -0
- data/lib/postnhost/engine.rb +57 -0
- data/lib/postnhost/sample_data.rb +865 -0
- data/lib/postnhost/settings/i18n_overrides.rb +137 -0
- data/lib/postnhost/settings/i18n_patch.rb +18 -0
- data/lib/postnhost/version.rb +1 -3
- data/lib/postnhost.rb +26 -3
- data/lib/tasks/postnhost_snapshots.rake +77 -0
- data/lib/tasks/postnhost_tasks.rake +96 -0
- metadata +662 -21
- data/.github/workflows/main.yml +0 -27
- data/.gitignore +0 -11
- data/.rspec +0 -3
- data/.rubocop.yml +0 -8
- data/Gemfile +0 -13
- data/bin/console +0 -11
- data/bin/setup +0 -8
- data/postnhost.gemspec +0 -31
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<% content_for :title, "Set up PostnHost" %>
|
|
2
|
+
<% content_for :meta_description, "Create your admin account and configure your site." %>
|
|
3
|
+
<% content_for :robots, "noindex, nofollow" %>
|
|
4
|
+
|
|
5
|
+
<div class="flex min-h-dvh min-h-screen bg-gray-50 pb-[max(1rem,env(safe-area-inset-bottom))] pt-[max(0.75rem,env(safe-area-inset-top))]">
|
|
6
|
+
<div class="flex w-full min-w-0 flex-1 flex-col justify-center px-4 sm:px-6 lg:px-8 sm:-mt-10">
|
|
7
|
+
<div class="mx-auto w-full <%= (@post_install_checklist || @step == 3) ? 'max-w-3xl' : 'max-w-md' %>">
|
|
8
|
+
<div class="rounded-2xl border border-gray-200 bg-white p-5 sm:p-8">
|
|
9
|
+
<div class="space-y-6">
|
|
10
|
+
<div class="space-y-2 text-center">
|
|
11
|
+
<h1 class="text-2xl font-semibold tracking-tight text-gray-900">
|
|
12
|
+
<%= if @post_install_checklist
|
|
13
|
+
"Production checklist"
|
|
14
|
+
elsif @step == 1
|
|
15
|
+
"Create your admin account"
|
|
16
|
+
elsif @step == 2
|
|
17
|
+
"Choose blog languages"
|
|
18
|
+
elsif @step == 3
|
|
19
|
+
"Set your site details"
|
|
20
|
+
elsif @step == 4
|
|
21
|
+
"Start with sample content?"
|
|
22
|
+
else
|
|
23
|
+
t("postnhost.onboarding.title")
|
|
24
|
+
end %>
|
|
25
|
+
</h1>
|
|
26
|
+
<% unless @post_install_checklist %>
|
|
27
|
+
<p class="text-sm text-gray-600">
|
|
28
|
+
<%= t("postnhost.onboarding.step_indicator", step: @step, total: 4) %>
|
|
29
|
+
</p>
|
|
30
|
+
<% end %>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<%= render "postnhost/shared/flash_messages" %>
|
|
34
|
+
|
|
35
|
+
<% if @post_install_checklist %>
|
|
36
|
+
<%= render "postnhost/onboarding/post_install_checklist" %>
|
|
37
|
+
<% else %>
|
|
38
|
+
<%= render "postnhost/onboarding/step_#{@step}" %>
|
|
39
|
+
<% end %>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="mt-4 flex justify-center">
|
|
44
|
+
<a href="https://postnhost.com" target="_blank" rel="noopener noreferrer" class="inline-flex items-center gap-1.5 text-xs text-gray-400 transition-colors hover:text-gray-600">
|
|
45
|
+
Powered by
|
|
46
|
+
<%= image_tag "postnhost/logo.webp", alt: "PostnHost", class: "h-4 w-auto opacity-60 transition-opacity hover:opacity-100", width: 80, height: 16 %>
|
|
47
|
+
</a>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<% variants.each do |variant| %>
|
|
2
|
+
<div class="px-6 py-4 hover:bg-gray-50 transition-colors duration-200">
|
|
3
|
+
<div class="flex items-center gap-2 md:gap-4">
|
|
4
|
+
<div class="flex items-center justify-center w-6 md:w-8 flex-shrink-0">
|
|
5
|
+
<input
|
|
6
|
+
type="checkbox"
|
|
7
|
+
name="ids[]"
|
|
8
|
+
value="<%= variant.id %>"
|
|
9
|
+
data-bulk-selection-target="checkbox"
|
|
10
|
+
data-action="change->bulk-selection#toggle"
|
|
11
|
+
<%= "disabled" if variant.generating? %>
|
|
12
|
+
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 <%= variant.generating? ? 'cursor-not-allowed opacity-50' : 'cursor-pointer' %>"
|
|
13
|
+
>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="flex-1 min-w-0">
|
|
16
|
+
<% if variant.generating? %>
|
|
17
|
+
<div class="block">
|
|
18
|
+
<div class="font-medium text-gray-900">
|
|
19
|
+
<%= variant.title.present? ? variant.title : 'Untitled Translation' %>
|
|
20
|
+
</div>
|
|
21
|
+
<% if variant.meta_description.present? %>
|
|
22
|
+
<div class="text-sm text-gray-500 mt-1 line-clamp-2">
|
|
23
|
+
<%= variant.meta_description %>
|
|
24
|
+
</div>
|
|
25
|
+
<% end %>
|
|
26
|
+
</div>
|
|
27
|
+
<% else %>
|
|
28
|
+
<%= link_to edit_page_variant_path(variant.page, variant), class: "block group" do %>
|
|
29
|
+
<div class="font-medium text-gray-900 group-hover:text-gray-600 transition-colors">
|
|
30
|
+
<%= variant.title.present? ? variant.title : 'Untitled Translation' %>
|
|
31
|
+
</div>
|
|
32
|
+
<% if variant.meta_description.present? %>
|
|
33
|
+
<div class="text-sm text-gray-500 mt-1 line-clamp-2">
|
|
34
|
+
<%= variant.meta_description %>
|
|
35
|
+
</div>
|
|
36
|
+
<% end %>
|
|
37
|
+
<% end %>
|
|
38
|
+
<% end %>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div class="hidden md:block md:w-32 flex-shrink-0">
|
|
42
|
+
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
|
|
43
|
+
<%= variant.language.name %>
|
|
44
|
+
</span>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div class="hidden md:block md:w-28 flex-shrink-0">
|
|
48
|
+
<% if variant.generating? %>
|
|
49
|
+
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-purple-100 text-purple-800">
|
|
50
|
+
<%= icon("spinner", css_class: "animate-spin -ml-1 mr-1.5 h-3 w-3 text-purple-800") %>
|
|
51
|
+
Translating
|
|
52
|
+
</span>
|
|
53
|
+
<% else %>
|
|
54
|
+
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium <%= variant.published? ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-800' %>">
|
|
55
|
+
<%= variant.published? ? 'Published' : 'Draft' %>
|
|
56
|
+
</span>
|
|
57
|
+
<% end %>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div class="w-16 md:w-24 flex items-center justify-end space-x-2 flex-shrink-0">
|
|
61
|
+
<% if variant.generating? %>
|
|
62
|
+
<span class="text-gray-300 cursor-not-allowed inline-flex" title="Editing is available when translation finishes">
|
|
63
|
+
<%= icon("edit", css_class: "w-4 h-4") %>
|
|
64
|
+
</span>
|
|
65
|
+
<% else %>
|
|
66
|
+
<%= link_to edit_page_variant_path(variant.page, variant), class: "text-gray-400 hover:text-gray-600 transition-colors cursor-pointer" do %>
|
|
67
|
+
<%= icon("edit", css_class: "w-4 h-4") %>
|
|
68
|
+
<% end %>
|
|
69
|
+
<% end %>
|
|
70
|
+
|
|
71
|
+
<%= link_to page_variant_path(variant.page, variant), method: :delete,
|
|
72
|
+
class: "text-gray-400 hover:text-red-600 transition-colors cursor-pointer",
|
|
73
|
+
data: {
|
|
74
|
+
turbo_method: :delete,
|
|
75
|
+
turbo_confirm: "Are you sure you want to delete this translation? This action cannot be undone."
|
|
76
|
+
} do %>
|
|
77
|
+
<%= icon("trash", css_class: "w-4 h-4") %>
|
|
78
|
+
<% end %>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<% end %>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<% content_for :title, "Editing #{@page_variant.title.presence || 'Translation'}" %>
|
|
2
|
+
|
|
3
|
+
<div data-controller="auto-save publish-guard editor-mobile-sidebars">
|
|
4
|
+
<%= form_with model: @page_variant, url: page_variant_path(@page, @page_variant), local: true, data: { auto_save_target: "form" } do |form| %>
|
|
5
|
+
<%= render 'postnhost/shared/articles/error_messages', resource: @page_variant, resource_type: "variant" %>
|
|
6
|
+
|
|
7
|
+
<div class="md:hidden px-4 py-3 bg-white border-b border-gray-200">
|
|
8
|
+
<div class="grid grid-cols-2 gap-2">
|
|
9
|
+
<button type="button"
|
|
10
|
+
data-action="click->editor-mobile-sidebars#toggleMeta"
|
|
11
|
+
class="w-full bg-white border border-gray-300 text-gray-700 py-2.5 px-4 rounded-xl hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition duration-200 text-sm font-medium cursor-pointer">
|
|
12
|
+
Details
|
|
13
|
+
</button>
|
|
14
|
+
<button type="button"
|
|
15
|
+
data-action="click->editor-mobile-sidebars#toggleActions"
|
|
16
|
+
class="w-full bg-white border border-gray-300 text-gray-700 py-2.5 px-4 rounded-xl hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition duration-200 text-sm font-medium cursor-pointer">
|
|
17
|
+
Actions
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="flex flex-col md:flex-row min-h-screen">
|
|
23
|
+
<%= render 'postnhost/shared/pages/meta_sidebar',
|
|
24
|
+
form: form,
|
|
25
|
+
resource: @page_variant,
|
|
26
|
+
page: @page,
|
|
27
|
+
is_variant: true,
|
|
28
|
+
mobile_target: "metaSidebar" %>
|
|
29
|
+
|
|
30
|
+
<div class="order-3 md:order-2 w-full md:w-3/5 bg-white border-t border-b border-gray-200 border-t-0">
|
|
31
|
+
<%= render 'postnhost/shared/articles/title_field',
|
|
32
|
+
form: form,
|
|
33
|
+
placeholder: "Translation Title" %>
|
|
34
|
+
|
|
35
|
+
<%= render 'postnhost/shared/articles/tiptap_editor',
|
|
36
|
+
form: form,
|
|
37
|
+
content: @page_variant.content,
|
|
38
|
+
resource_type: 'page',
|
|
39
|
+
resource_id: @page.id %>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<%= render 'postnhost/shared/pages/action_buttons',
|
|
43
|
+
form: form,
|
|
44
|
+
resource: @page_variant,
|
|
45
|
+
page: @page,
|
|
46
|
+
is_variant: true,
|
|
47
|
+
mobile_target: "actionsSidebar" %>
|
|
48
|
+
</div>
|
|
49
|
+
<% end %>
|
|
50
|
+
</div>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<% content_for :title, "Translations for #{@page.title}" %>
|
|
2
|
+
|
|
3
|
+
<%= turbo_stream_from "page_variants_#{@page.id}" %>
|
|
4
|
+
<div class="space-y-8" data-controller="ai-translation dialog" data-action="click->dialog#backdropClose">
|
|
5
|
+
<%= render 'postnhost/shared/elements/page_header',
|
|
6
|
+
title: 'Page Translations',
|
|
7
|
+
description: "Manage translations for \"#{@page.title.present? ? @page.title : 'Untitled Page'}\"",
|
|
8
|
+
stats: [
|
|
9
|
+
{ text: "#{@pagy.count} translations", class: '' },
|
|
10
|
+
{ text: "#{@available_languages.count} available languages", class: '' }
|
|
11
|
+
] do %>
|
|
12
|
+
<%= render 'postnhost/shared/elements/button_link',
|
|
13
|
+
text: 'Back to Page',
|
|
14
|
+
url: edit_page_path(@page),
|
|
15
|
+
variant: :secondary,
|
|
16
|
+
icon: 'chevron-left',
|
|
17
|
+
extra_class: 'w-full md:w-auto' %>
|
|
18
|
+
|
|
19
|
+
<% if @available_languages.any? %>
|
|
20
|
+
<button
|
|
21
|
+
data-action="dialog#open"
|
|
22
|
+
class="<%= button_classes %> w-full md:w-auto">
|
|
23
|
+
<%= icon("sparkles", css_class: "w-4 h-4 mr-2") %>
|
|
24
|
+
Translate with AI
|
|
25
|
+
</button>
|
|
26
|
+
|
|
27
|
+
<div class="relative w-full md:w-auto" data-controller="dropdown">
|
|
28
|
+
<button
|
|
29
|
+
data-action="click->dropdown#toggle"
|
|
30
|
+
class="<%= button_classes %> w-full md:w-auto">
|
|
31
|
+
<%= icon("language", css_class: "w-4 h-4 mr-2") %>
|
|
32
|
+
Manual Translation
|
|
33
|
+
<%= icon("chevron-down", css_class: "w-4 h-4 ml-2") %>
|
|
34
|
+
</button>
|
|
35
|
+
|
|
36
|
+
<div data-dropdown-target="menu" class="absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg border border-gray-200 overflow-hidden z-20 hidden">
|
|
37
|
+
<div class="py-1">
|
|
38
|
+
<% @available_languages.each do |language| %>
|
|
39
|
+
<%= link_to new_page_variant_path(@page, language_id: language.id), data: { turbo_prefetch: false}, class: "flex items-center px-4 py-3 text-sm text-gray-700 hover:bg-gray-50 transition-colors duration-150" do %>
|
|
40
|
+
<div class="flex-1">
|
|
41
|
+
<div class="font-medium"><%= language.name %></div>
|
|
42
|
+
<div class="text-xs text-gray-500"><%= language.html_lang %></div>
|
|
43
|
+
</div>
|
|
44
|
+
<% end %>
|
|
45
|
+
<% end %>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
<% else %>
|
|
50
|
+
<span class="<%= button_classes(variant: :secondary, disabled: true) %> w-full md:w-auto">
|
|
51
|
+
All languages translated
|
|
52
|
+
</span>
|
|
53
|
+
<% end %>
|
|
54
|
+
<% end %>
|
|
55
|
+
|
|
56
|
+
<% if @variants.any? %>
|
|
57
|
+
<%= form_with url: "#", method: :patch, data: { controller: "bulk-selection" } do |form| %>
|
|
58
|
+
<div class="bg-white rounded-lg border border-gray-200 overflow-hidden">
|
|
59
|
+
<div data-bulk-selection-target="bulkActions" class="hidden px-6 py-4 bg-gray-50 border-b border-gray-200">
|
|
60
|
+
<div class="flex items-center justify-between">
|
|
61
|
+
<span class="text-sm font-medium text-gray-700">
|
|
62
|
+
<span data-bulk-selection-target="selectedCount">0</span> translation(s) selected
|
|
63
|
+
</span>
|
|
64
|
+
<div class="flex space-x-3">
|
|
65
|
+
<%= form.button type: "submit",
|
|
66
|
+
formaction: bulk_publish_page_variants_path(@page),
|
|
67
|
+
data: { turbo_confirm: "Publish selected translation(s)?" },
|
|
68
|
+
class: "#{button_classes} bg-green-600 hover:bg-green-700" do %>
|
|
69
|
+
Publish
|
|
70
|
+
<% end %>
|
|
71
|
+
<%= form.button type: "submit",
|
|
72
|
+
formaction: bulk_unpublish_page_variants_path(@page),
|
|
73
|
+
data: { turbo_confirm: "Unpublish selected translation(s)?" },
|
|
74
|
+
class: "#{button_classes(variant: :secondary)} border border-gray-300" do %>
|
|
75
|
+
Unpublish
|
|
76
|
+
<% end %>
|
|
77
|
+
<%= form.button type: "submit",
|
|
78
|
+
formaction: bulk_destroy_page_variants_path(@page),
|
|
79
|
+
formmethod: "delete",
|
|
80
|
+
data: { turbo_confirm: "Are you sure you want to delete the selected translation(s)? This action cannot be undone." },
|
|
81
|
+
class: "#{button_classes} bg-red-600 hover:bg-red-700" do %>
|
|
82
|
+
Delete
|
|
83
|
+
<% end %>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<div class="px-6 py-4 border-b border-gray-200 bg-gray-50">
|
|
89
|
+
<div class="flex items-center gap-2 md:gap-4 text-xs font-medium text-gray-500 uppercase tracking-wider">
|
|
90
|
+
<div class="flex items-center justify-center w-6 md:w-8">
|
|
91
|
+
<input
|
|
92
|
+
type="checkbox"
|
|
93
|
+
data-bulk-selection-target="checkAll"
|
|
94
|
+
data-action="change->bulk-selection#toggleAll"
|
|
95
|
+
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 cursor-pointer"
|
|
96
|
+
>
|
|
97
|
+
</div>
|
|
98
|
+
<div class="flex-1">Translation</div>
|
|
99
|
+
<div class="hidden md:block md:w-32">Language</div>
|
|
100
|
+
<div class="hidden md:block md:w-28">Status</div>
|
|
101
|
+
<div class="w-16 md:w-24 text-right">Actions</div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<div id="variants_list" class="divide-y divide-gray-200">
|
|
106
|
+
<%= render partial: "variants_list", locals: { variants: @variants } %>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<% end %>
|
|
110
|
+
|
|
111
|
+
<!-- Pagination -->
|
|
112
|
+
<% if @pagy.pages > 1 %>
|
|
113
|
+
<div class="mt-8 flex justify-center">
|
|
114
|
+
<%== pagination_nav(@pagy) %>
|
|
115
|
+
</div>
|
|
116
|
+
<% end %>
|
|
117
|
+
<% else %>
|
|
118
|
+
<%= render 'postnhost/shared/elements/empty_state',
|
|
119
|
+
icon: 'translate',
|
|
120
|
+
title: 'No translations',
|
|
121
|
+
description: 'Use "Translate with AI" to automatically create translations, or "Manual Translation" to create them manually.' %>
|
|
122
|
+
<% end %>
|
|
123
|
+
|
|
124
|
+
<%= render "postnhost/shared/ai_translation_modal",
|
|
125
|
+
subject_title: (@page.title.present? ? @page.title : "this page"),
|
|
126
|
+
form_url: page_translations_path(@page),
|
|
127
|
+
available_languages: @available_languages %>
|
|
128
|
+
</div>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<% content_for :title, "Editing #{@page.title.presence || 'Page'}" %>
|
|
2
|
+
|
|
3
|
+
<div data-controller="auto-save publish-guard editor-mobile-sidebars">
|
|
4
|
+
<%= form_with model: @page, local: true, data: { auto_save_target: "form" } do |form| %>
|
|
5
|
+
<%= render 'postnhost/shared/form_errors', resource: @page %>
|
|
6
|
+
|
|
7
|
+
<div class="md:hidden px-4 py-3 bg-white border-b border-gray-200">
|
|
8
|
+
<div class="grid grid-cols-2 gap-2">
|
|
9
|
+
<button type="button"
|
|
10
|
+
data-action="click->editor-mobile-sidebars#toggleMeta"
|
|
11
|
+
class="w-full bg-white border border-gray-300 text-gray-700 py-2.5 px-4 rounded-xl hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition duration-200 text-sm font-medium cursor-pointer">
|
|
12
|
+
Details
|
|
13
|
+
</button>
|
|
14
|
+
<button type="button"
|
|
15
|
+
data-action="click->editor-mobile-sidebars#toggleActions"
|
|
16
|
+
class="w-full bg-white border border-gray-300 text-gray-700 py-2.5 px-4 rounded-xl hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition duration-200 text-sm font-medium cursor-pointer">
|
|
17
|
+
Actions
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="flex flex-col md:flex-row min-h-screen">
|
|
23
|
+
<%= render 'postnhost/shared/pages/meta_sidebar',
|
|
24
|
+
form: form,
|
|
25
|
+
resource: @page,
|
|
26
|
+
page: @page,
|
|
27
|
+
is_variant: false,
|
|
28
|
+
mobile_target: "metaSidebar" %>
|
|
29
|
+
|
|
30
|
+
<div class="order-3 md:order-2 w-full md:w-3/5 bg-white border-t border-b border-gray-200 border-t-0">
|
|
31
|
+
<%= render 'postnhost/shared/articles/title_field',
|
|
32
|
+
form: form,
|
|
33
|
+
placeholder: "Untitled Page" %>
|
|
34
|
+
|
|
35
|
+
<%= render 'postnhost/shared/articles/tiptap_editor',
|
|
36
|
+
form: form,
|
|
37
|
+
content: @page.content,
|
|
38
|
+
resource_type: 'page',
|
|
39
|
+
resource_id: @page.id %>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<%= render 'postnhost/shared/pages/action_buttons',
|
|
43
|
+
form: form,
|
|
44
|
+
resource: @page,
|
|
45
|
+
page: @page,
|
|
46
|
+
is_variant: false,
|
|
47
|
+
mobile_target: "actionsSidebar" %>
|
|
48
|
+
</div>
|
|
49
|
+
<% end %>
|
|
50
|
+
</div>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<% content_for :title, "Pages" %>
|
|
2
|
+
|
|
3
|
+
<div class="space-y-8">
|
|
4
|
+
<%= render 'postnhost/shared/elements/page_header',
|
|
5
|
+
title: 'Pages',
|
|
6
|
+
description: 'Manage pages and review code-defined static pages.' do %>
|
|
7
|
+
<%= render 'postnhost/shared/elements/button_link',
|
|
8
|
+
text: 'New Page',
|
|
9
|
+
url: new_page_path,
|
|
10
|
+
icon: 'plus',
|
|
11
|
+
data: { turbo_prefetch: false },
|
|
12
|
+
extra_class: 'w-full md:w-auto' %>
|
|
13
|
+
<% end %>
|
|
14
|
+
|
|
15
|
+
<% if @pages.any? %>
|
|
16
|
+
<%= render 'postnhost/shared/elements/table_container',
|
|
17
|
+
headers: [
|
|
18
|
+
{ text: 'Page', class: 'col-span-6 md:col-span-5' },
|
|
19
|
+
{ text: 'Path', class: 'col-span-6 md:col-span-3' },
|
|
20
|
+
{ text: 'Status', class: 'hidden md:block col-span-2' },
|
|
21
|
+
{ text: 'Actions', class: 'hidden md:block col-span-2 text-right' },
|
|
22
|
+
] do %>
|
|
23
|
+
<% @pages.each do |page| %>
|
|
24
|
+
<div class="<%= table_row_classes %>">
|
|
25
|
+
<div class="grid grid-cols-12 gap-4 items-center">
|
|
26
|
+
<div class="col-span-6 md:col-span-5">
|
|
27
|
+
<%= link_to edit_page_path(page), class: "block group" do %>
|
|
28
|
+
<div class="font-medium text-gray-900 group-hover:text-gray-600 transition-colors">
|
|
29
|
+
<%= page.title.presence || "Untitled Page" %>
|
|
30
|
+
</div>
|
|
31
|
+
<% end %>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="col-span-6 md:col-span-3">
|
|
35
|
+
<% if page.slug.present? %>
|
|
36
|
+
<code class="text-sm text-gray-700">/<%= page.slug %></code>
|
|
37
|
+
<% end %>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div class="hidden md:flex col-span-2 items-center space-x-2">
|
|
41
|
+
<span class="<%= stats_badge_classes(variant: page.published? ? :green : :gray) %>">
|
|
42
|
+
<%= page.published? ? 'Published' : 'Draft' %>
|
|
43
|
+
</span>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="hidden md:flex col-span-2 items-center justify-end space-x-2">
|
|
47
|
+
<%= render 'postnhost/shared/elements/icon_button',
|
|
48
|
+
icon: 'edit',
|
|
49
|
+
url: edit_page_path(page) %>
|
|
50
|
+
|
|
51
|
+
<%= render 'postnhost/shared/elements/icon_button',
|
|
52
|
+
icon: 'trash',
|
|
53
|
+
url: page_path(page),
|
|
54
|
+
variant: :danger,
|
|
55
|
+
data: {
|
|
56
|
+
turbo_method: :delete,
|
|
57
|
+
turbo_confirm: "Are you sure you want to delete this page? This action cannot be undone."
|
|
58
|
+
} %>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
<% end %>
|
|
63
|
+
<% end %>
|
|
64
|
+
<% else %>
|
|
65
|
+
<%= render 'postnhost/shared/elements/empty_state',
|
|
66
|
+
icon: 'layers',
|
|
67
|
+
title: 'No pages',
|
|
68
|
+
description: 'Create your first custom page.' do %>
|
|
69
|
+
<%= render 'postnhost/shared/elements/button_link',
|
|
70
|
+
text: 'New Page',
|
|
71
|
+
url: new_page_path,
|
|
72
|
+
data: { turbo_prefetch: false },
|
|
73
|
+
icon: 'plus' %>
|
|
74
|
+
<% end %>
|
|
75
|
+
<% end %>
|
|
76
|
+
|
|
77
|
+
<% if @static_page_slugs.any? %>
|
|
78
|
+
<div class="space-y-4">
|
|
79
|
+
<h2 class="text-lg font-semibold text-gray-900">Code-defined static pages</h2>
|
|
80
|
+
<%= render 'postnhost/shared/elements/table_container',
|
|
81
|
+
headers: [
|
|
82
|
+
{ text: 'Static Page', class: 'col-span-6' },
|
|
83
|
+
{ text: 'Path', class: 'col-span-6 text-right' }
|
|
84
|
+
] do %>
|
|
85
|
+
<% @static_page_slugs.each do |slug| %>
|
|
86
|
+
<div class="<%= table_row_classes %>">
|
|
87
|
+
<div class="grid grid-cols-12 gap-4 items-center">
|
|
88
|
+
<div class="min-w-0 col-span-6">
|
|
89
|
+
<div class="font-medium text-gray-900 break-words"><%= slug.humanize %></div>
|
|
90
|
+
<div class="text-sm text-gray-500 mt-1 break-all"><%= slug %>.html.erb</div>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<div class="min-w-0 col-span-6 text-right">
|
|
94
|
+
<code class="text-sm text-gray-700 whitespace-normal break-all inline-block">/<%= slug %></code>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<% end %>
|
|
99
|
+
<% end %>
|
|
100
|
+
|
|
101
|
+
<div class="rounded-xl border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600">
|
|
102
|
+
These templates are defined in <code>app/views/postnhost/static_pages</code> and are not editable in the admin panel.
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
<% else %>
|
|
106
|
+
<div class="rounded-xl border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600">
|
|
107
|
+
No code-defined static pages found. Add templates in <code>app/views/postnhost/static_pages</code> (for example, <code>about.html.erb</code> maps to <code>/about</code>), or run <code>rails g postnhost:static_pages about</code> to scaffold a starter template.
|
|
108
|
+
</div>
|
|
109
|
+
<% end %>
|
|
110
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<% content_for :title, public_articles_index_title %>
|
|
2
|
+
<% content_for :url, public_blog_index_url %>
|
|
3
|
+
<% content_for :robots, "noindex, nofollow" if public_search_endpoint? %>
|
|
4
|
+
<% unless paginated_public_page? %>
|
|
5
|
+
<% content_for :meta_description, t("postnhost.public.site.blog_meta_description") %>
|
|
6
|
+
<% end %>
|
|
7
|
+
<% content_for :lang, @current_language.html_lang %>
|
|
8
|
+
|
|
9
|
+
<%# Hreflang tags for language variants %>
|
|
10
|
+
<% if @other_languages.any? %>
|
|
11
|
+
<% content_for :hreflang do %>
|
|
12
|
+
<!-- Current language -->
|
|
13
|
+
<% if @current_language.default? %>
|
|
14
|
+
<link rel="alternate" hreflang="<%= @current_language.html_lang %>" href="<%= root_url %>">
|
|
15
|
+
<link rel="alternate" hreflang="x-default" href="<%= root_url %>">
|
|
16
|
+
<% else %>
|
|
17
|
+
<link rel="alternate" hreflang="<%= @current_language.html_lang %>" href="<%= localized_root_url(@current_language.html_lang) %>">
|
|
18
|
+
<% end %>
|
|
19
|
+
|
|
20
|
+
<!-- Other languages -->
|
|
21
|
+
<% @other_languages.each do |language| %>
|
|
22
|
+
<% if language.default? %>
|
|
23
|
+
<link rel="alternate" hreflang="<%= language.html_lang %>" href="<%= root_url %>">
|
|
24
|
+
<link rel="alternate" hreflang="x-default" href="<%= root_url %>">
|
|
25
|
+
<% else %>
|
|
26
|
+
<link rel="alternate" hreflang="<%= language.html_lang %>" href="<%= localized_root_url(language.html_lang) %>">
|
|
27
|
+
<% end %>
|
|
28
|
+
<% end %>
|
|
29
|
+
<% end %>
|
|
30
|
+
<% end %>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<% content_for :title, @content.title_tag.present? ? @content.title_tag : @content.title %>
|
|
2
|
+
<% content_for :og_title, @content.og_title if @content.og_title.present? %>
|
|
3
|
+
<% content_for :schema_headline, @content.schema_headline if @content.schema_headline.present? %>
|
|
4
|
+
<% if @content.use_excerpt_as_meta_description? && article_excerpt(@content).present? %>
|
|
5
|
+
<% content_for :meta_description, article_excerpt(@content) %>
|
|
6
|
+
<% elsif @content.meta_description.present? %>
|
|
7
|
+
<% content_for :meta_description, @content.meta_description %>
|
|
8
|
+
<% end %>
|
|
9
|
+
<% content_for :lang, @actual_language.html_lang %>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<% content_for :title, @content.title_tag.present? ? @content.title_tag : @content.title %>
|
|
2
|
+
<% content_for :og_title, @content.og_title if @content.og_title.present? %>
|
|
3
|
+
<% content_for :schema_headline, @content.schema_headline if @content.schema_headline.present? %>
|
|
4
|
+
<% if @content.use_excerpt_as_meta_description? && article_excerpt(@content).present? %>
|
|
5
|
+
<% content_for :meta_description, article_excerpt(@content) %>
|
|
6
|
+
<% elsif @content.meta_description.present? %>
|
|
7
|
+
<% content_for :meta_description, @content.meta_description %>
|
|
8
|
+
<% end %>
|
|
9
|
+
<% content_for :lang, @actual_language.html_lang %>
|
|
10
|
+
<% content_for :url, params[:locale].present? ? localized_public_article_url(@actual_language.html_lang, @article.slug) : public_article_url(@article.slug) %>
|
|
11
|
+
|
|
12
|
+
<%# Hreflang tags for language variants %>
|
|
13
|
+
<% content_for :hreflang do %>
|
|
14
|
+
<!-- Original article -->
|
|
15
|
+
<link rel="alternate" hreflang="<%= @primary_language.html_lang %>" href="<%= public_article_url(@article.slug) %>" data-turbo-track="reload">
|
|
16
|
+
|
|
17
|
+
<!-- Article variants -->
|
|
18
|
+
<% @available_variants.each do |variant| %>
|
|
19
|
+
<link rel="alternate" hreflang="<%= variant.language.html_lang %>" href="<%= localized_public_article_url(variant.language.html_lang, @article.slug) %>" data-turbo-track="reload">
|
|
20
|
+
<% end %>
|
|
21
|
+
|
|
22
|
+
<!-- x-default -->
|
|
23
|
+
<link rel="alternate" hreflang="x-default" href="<%= public_article_url(@article.slug) %>" data-turbo-track="reload">
|
|
24
|
+
<% end %>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<% content_for :title, author_name(@author) %>
|
|
2
|
+
<% content_for :url, language_author_url(@author.slug, @current_language) %>
|
|
3
|
+
<% content_for :meta_description, @author.bio if @author.bio.present? %>
|
|
4
|
+
<% content_for :lang, @current_language.html_lang %>
|
|
5
|
+
|
|
6
|
+
<% if @other_languages.any? %>
|
|
7
|
+
<% content_for :hreflang do %>
|
|
8
|
+
<% if @current_language.default? %>
|
|
9
|
+
<link rel="alternate" hreflang="<%= @current_language.html_lang %>" href="<%= public_author_url(@author.slug) %>">
|
|
10
|
+
<link rel="alternate" hreflang="x-default" href="<%= public_author_url(@author.slug) %>">
|
|
11
|
+
<% else %>
|
|
12
|
+
<link rel="alternate" hreflang="<%= @current_language.html_lang %>" href="<%= localized_public_author_url(@current_language.html_lang, @author.slug) %>">
|
|
13
|
+
<% end %>
|
|
14
|
+
|
|
15
|
+
<% @other_languages.each do |language| %>
|
|
16
|
+
<% if language.default? %>
|
|
17
|
+
<link rel="alternate" hreflang="<%= language.html_lang %>" href="<%= public_author_url(@author.slug) %>">
|
|
18
|
+
<link rel="alternate" hreflang="x-default" href="<%= public_author_url(@author.slug) %>">
|
|
19
|
+
<% else %>
|
|
20
|
+
<link rel="alternate" hreflang="<%= language.html_lang %>" href="<%= localized_public_author_url(language.html_lang, @author.slug) %>">
|
|
21
|
+
<% end %>
|
|
22
|
+
<% end %>
|
|
23
|
+
<% end %>
|
|
24
|
+
<% end %>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<% content_for :title, public_category_title(@category) %>
|
|
2
|
+
<% content_for :url, public_category_index_url(@category) %>
|
|
3
|
+
<% unless paginated_public_page? %>
|
|
4
|
+
<% content_for :meta_description, public_category_description(@category) if public_category_description(@category).present? %>
|
|
5
|
+
<% end %>
|
|
6
|
+
<% content_for :lang, @current_language.html_lang %>
|
|
7
|
+
|
|
8
|
+
<%# Hreflang tags for language variants %>
|
|
9
|
+
<% unless @localized_category_fallback %>
|
|
10
|
+
<% content_for :hreflang do %>
|
|
11
|
+
<% if @current_language.default? %>
|
|
12
|
+
<link rel="alternate" hreflang="<%= @current_language.html_lang %>" href="<%= public_category_url(@category.slug) %>">
|
|
13
|
+
<% else %>
|
|
14
|
+
<link rel="alternate" hreflang="<%= @current_language.html_lang %>" href="<%= localized_public_category_url(@current_language.html_lang, @category.slug) %>">
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
17
|
+
<% @other_languages.each do |language| %>
|
|
18
|
+
<% next unless language.default? || @published_category_language_ids.include?(language.id) %>
|
|
19
|
+
|
|
20
|
+
<% if language.default? %>
|
|
21
|
+
<link rel="alternate" hreflang="<%= language.html_lang %>" href="<%= public_category_url(@category.slug) %>">
|
|
22
|
+
<% else %>
|
|
23
|
+
<link rel="alternate" hreflang="<%= language.html_lang %>" href="<%= localized_public_category_url(language.html_lang, @category.slug) %>">
|
|
24
|
+
<% end %>
|
|
25
|
+
<% end %>
|
|
26
|
+
|
|
27
|
+
<link rel="alternate" hreflang="x-default" href="<%= public_category_url(@category.slug) %>">
|
|
28
|
+
<% end %>
|
|
29
|
+
<% end %>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<% content_for :title, @content.title_tag.present? ? @content.title_tag : @content.title %>
|
|
2
|
+
<% content_for :og_title, @content.og_title if @content.og_title.present? %>
|
|
3
|
+
<% content_for :meta_description, @content.meta_description if @content.meta_description.present? %>
|
|
4
|
+
<% content_for :lang, @actual_language.html_lang %>
|
|
5
|
+
<% content_for :url, params[:locale].present? ? localized_public_static_page_url(locale: @actual_language.html_lang, slug: @page.slug) : public_static_page_url(slug: @page.slug) %>
|
|
6
|
+
|
|
7
|
+
<%# Hreflang tags for language variants %>
|
|
8
|
+
<% content_for :hreflang do %>
|
|
9
|
+
<!-- Original page -->
|
|
10
|
+
<link rel="alternate" hreflang="<%= @page.language&.html_lang || @current_language.html_lang %>" href="<%= public_static_page_url(slug: @page.slug) %>" data-turbo-track="reload">
|
|
11
|
+
|
|
12
|
+
<!-- Page variants -->
|
|
13
|
+
<% @available_variants.each do |variant| %>
|
|
14
|
+
<link rel="alternate" hreflang="<%= variant.language.html_lang %>" href="<%= localized_public_static_page_url(locale: variant.language.html_lang, slug: @page.slug) %>" data-turbo-track="reload">
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
17
|
+
<!-- x-default -->
|
|
18
|
+
<link rel="alternate" hreflang="x-default" href="<%= public_static_page_url(slug: @page.slug) %>" data-turbo-track="reload">
|
|
19
|
+
<% end %>
|