postnhost 0.0.0 → 0.1.1
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 +33 -0
- data/{LICENSE.txt → LICENSE} +6 -6
- data/README.md +343 -15
- data/Rakefile +66 -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 +347 -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 +236 -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 +55 -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 +100 -0
- data/lib/generators/postnhost/tailwindcss/templates/host.tailwind.css +4 -0
- data/lib/generators/postnhost/user/user_generator.rb +36 -0
- data/lib/generators/postnhost/views/views_generator.rb +140 -0
- data/lib/postnhost/configuration.rb +64 -0
- data/lib/postnhost/css_build.rb +68 -0
- data/lib/postnhost/css_scope.rb +77 -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/tailwind_compiler.rb +75 -0
- data/lib/postnhost/tailwind_input.rb +32 -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 +71 -0
- metadata +679 -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,347 @@
|
|
|
1
|
+
@import "tailwindcss" source(none);
|
|
2
|
+
@plugin "@tailwindcss/typography";
|
|
3
|
+
|
|
4
|
+
@source "../../views/**/*.erb";
|
|
5
|
+
@source "../../helpers/**/*.rb";
|
|
6
|
+
@source "../../javascript/**/*.js";
|
|
7
|
+
|
|
8
|
+
.flash-close-button {
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
background: none;
|
|
11
|
+
border: none;
|
|
12
|
+
line-height: 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* Flash message container positioning */
|
|
16
|
+
[data-controller="flash-message"] {
|
|
17
|
+
position: relative;
|
|
18
|
+
padding-right: 3rem;
|
|
19
|
+
/* Space for close button */
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Dialog backdrop styling and centering */
|
|
23
|
+
dialog[data-dialog-target="dialog"] {
|
|
24
|
+
position: fixed;
|
|
25
|
+
top: 50%;
|
|
26
|
+
left: 50%;
|
|
27
|
+
transform: translate(-50%, -50%);
|
|
28
|
+
margin: 0;
|
|
29
|
+
padding: 0;
|
|
30
|
+
border: none;
|
|
31
|
+
box-shadow: 0 0 0 100vw rgb(0 0 0 / 0.5);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Prevent scrolling while dialog is open */
|
|
35
|
+
body:has(dialog[data-dialog-target="dialog"][open]) {
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* TipTap Editor Styles */
|
|
40
|
+
.ProseMirror {
|
|
41
|
+
outline: none;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Syntax-highlighted code blocks shared by the editor and public prose. */
|
|
45
|
+
.prose pre,
|
|
46
|
+
.ProseMirror pre {
|
|
47
|
+
overflow-x: auto;
|
|
48
|
+
border-radius: 0.75rem;
|
|
49
|
+
background-color: #0f172a;
|
|
50
|
+
color: #e2e8f0;
|
|
51
|
+
font-size: 0.875rem;
|
|
52
|
+
line-height: 1.7;
|
|
53
|
+
tab-size: 2;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ProseMirror pre {
|
|
57
|
+
padding-right: 9rem;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.prose pre code,
|
|
61
|
+
.ProseMirror pre code {
|
|
62
|
+
display: block;
|
|
63
|
+
min-width: max-content;
|
|
64
|
+
border: 0;
|
|
65
|
+
background: transparent;
|
|
66
|
+
padding: 0;
|
|
67
|
+
color: inherit;
|
|
68
|
+
font-size: inherit;
|
|
69
|
+
line-height: inherit;
|
|
70
|
+
white-space: pre;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.prose pre code::before,
|
|
74
|
+
.prose pre code::after,
|
|
75
|
+
.ProseMirror pre code::before,
|
|
76
|
+
.ProseMirror pre code::after {
|
|
77
|
+
content: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.prose :where(.hljs-comment, .hljs-quote, .c, .ch, .cm, .cp, .cpf, .c1, .cs),
|
|
81
|
+
.ProseMirror :where(.hljs-comment, .hljs-quote, .c, .ch, .cm, .cp, .cpf, .c1, .cs) {
|
|
82
|
+
color: #94a3b8;
|
|
83
|
+
font-style: italic;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.prose :where(.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-link, .k, .kc, .kd, .kn, .kp, .kr, .kt),
|
|
87
|
+
.ProseMirror :where(.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-link, .k, .kc, .kd, .kn, .kp, .kr, .kt) {
|
|
88
|
+
color: #f472b6;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.prose :where(.hljs-string, .hljs-regexp, .hljs-addition, .s, .sa, .sb, .sc, .dl, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss, .gi),
|
|
92
|
+
.ProseMirror :where(.hljs-string, .hljs-regexp, .hljs-addition, .s, .sa, .sb, .sc, .dl, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss, .gi) {
|
|
93
|
+
color: #86efac;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.prose :where(.hljs-number, .hljs-symbol, .hljs-bullet, .m, .mb, .mf, .mh, .mi, .il, .mo),
|
|
97
|
+
.ProseMirror :where(.hljs-number, .hljs-symbol, .hljs-bullet, .m, .mb, .mf, .mh, .mi, .il, .mo) {
|
|
98
|
+
color: #fbbf24;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.prose :where(.hljs-title, .hljs-title.class_, .hljs-title.function_, .hljs-function, .nc, .ne, .nf, .fm),
|
|
102
|
+
.ProseMirror :where(.hljs-title, .hljs-title.class_, .hljs-title.function_, .hljs-function, .nc, .ne, .nf, .fm) {
|
|
103
|
+
color: #93c5fd;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.prose :where(.hljs-type, .hljs-built_in, .hljs-builtin-name, .nb, .bp),
|
|
107
|
+
.ProseMirror :where(.hljs-type, .hljs-built_in, .hljs-builtin-name, .nb, .bp) {
|
|
108
|
+
color: #c4b5fd;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.prose :where(.hljs-attr, .hljs-attribute, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id, .na),
|
|
112
|
+
.ProseMirror :where(.hljs-attr, .hljs-attribute, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id, .na) {
|
|
113
|
+
color: #67e8f9;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.prose :where(.hljs-variable, .hljs-template-variable, .hljs-params, .nv, .vc, .vg, .vi, .vm),
|
|
117
|
+
.ProseMirror :where(.hljs-variable, .hljs-template-variable, .hljs-params, .nv, .vc, .vg, .vi, .vm) {
|
|
118
|
+
color: #fdba74;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.prose :where(.hljs-meta, .hljs-meta .hljs-keyword, .hljs-doctag, .cp, .cpf, .nd),
|
|
122
|
+
.ProseMirror :where(.hljs-meta, .hljs-meta .hljs-keyword, .hljs-doctag, .cp, .cpf, .nd) {
|
|
123
|
+
color: #f9a8d4;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.prose :where(.hljs-deletion, .gd, .gr, .gt),
|
|
127
|
+
.ProseMirror :where(.hljs-deletion, .gd, .gr, .gt) {
|
|
128
|
+
color: #fca5a5;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.prose :where(.hljs-emphasis, .ge),
|
|
132
|
+
.ProseMirror :where(.hljs-emphasis, .ge) {
|
|
133
|
+
font-style: italic;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.prose :where(.hljs-strong, .gs),
|
|
137
|
+
.ProseMirror :where(.hljs-strong, .gs) {
|
|
138
|
+
font-weight: 700;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Prevent links from being clickable in editor */
|
|
142
|
+
.ProseMirror a {
|
|
143
|
+
pointer-events: none;
|
|
144
|
+
cursor: text;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Task list styling for TipTap */
|
|
148
|
+
.ProseMirror ul[data-type="taskList"] {
|
|
149
|
+
list-style: none;
|
|
150
|
+
padding-left: 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.ProseMirror ul[data-type="taskList"] li {
|
|
154
|
+
display: flex;
|
|
155
|
+
align-items: flex-start;
|
|
156
|
+
margin-bottom: 0.5rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.ProseMirror ul[data-type="taskList"] li label {
|
|
160
|
+
margin-right: 0.5rem;
|
|
161
|
+
user-select: none;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.ProseMirror ul[data-type="taskList"] li input[type="checkbox"] {
|
|
165
|
+
margin-right: 0.5rem;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Toolbar button states */
|
|
169
|
+
.tiptap-toolbar button.is-active {
|
|
170
|
+
background-color: #e5e7eb;
|
|
171
|
+
color: #1f2937;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* Image resize extension styles */
|
|
175
|
+
.ProseMirror .image-resizer {
|
|
176
|
+
position: relative;
|
|
177
|
+
display: inline-block;
|
|
178
|
+
line-height: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.ProseMirror .image-resizer img {
|
|
182
|
+
display: block;
|
|
183
|
+
max-width: 100%;
|
|
184
|
+
height: auto;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.ProseMirror .image-resizer .resize-handle {
|
|
188
|
+
position: absolute;
|
|
189
|
+
width: 10px;
|
|
190
|
+
height: 10px;
|
|
191
|
+
background: #3b82f6;
|
|
192
|
+
border: 2px solid white;
|
|
193
|
+
border-radius: 2px;
|
|
194
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
195
|
+
cursor: nw-resize;
|
|
196
|
+
z-index: 10;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.ProseMirror .image-resizer .resize-handle.top-left {
|
|
200
|
+
top: -5px;
|
|
201
|
+
left: -5px;
|
|
202
|
+
cursor: nw-resize;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.ProseMirror .image-resizer .resize-handle.top-right {
|
|
206
|
+
top: -5px;
|
|
207
|
+
right: -5px;
|
|
208
|
+
cursor: ne-resize;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.ProseMirror .image-resizer .resize-handle.bottom-left {
|
|
212
|
+
bottom: -5px;
|
|
213
|
+
left: -5px;
|
|
214
|
+
cursor: sw-resize;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.ProseMirror .image-resizer .resize-handle.bottom-right {
|
|
218
|
+
bottom: -5px;
|
|
219
|
+
right: -5px;
|
|
220
|
+
cursor: se-resize;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* Image alignment styles */
|
|
224
|
+
.ProseMirror .image-resizer.align-left {
|
|
225
|
+
float: left;
|
|
226
|
+
margin-right: 1rem;
|
|
227
|
+
margin-bottom: 0.5rem;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.ProseMirror .image-resizer.align-right {
|
|
231
|
+
float: right;
|
|
232
|
+
margin-left: 1rem;
|
|
233
|
+
margin-bottom: 0.5rem;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.ProseMirror .image-resizer.align-center {
|
|
237
|
+
display: block;
|
|
238
|
+
margin: 1rem auto;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.prose-lg :where(img):not(:where([class~=not-prose], [class~=not-prose] *)),
|
|
242
|
+
.prose-lg :where(picture):not(:where([class~=not-prose], [class~=not-prose] *)) {
|
|
243
|
+
margin-top: 0;
|
|
244
|
+
margin-bottom: 0;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.prose :where(img):not(:where([class~=not-prose], [class~=not-prose] *)) {
|
|
248
|
+
margin-top: 0;
|
|
249
|
+
margin-bottom: 0;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.ProseMirror .selectedCell {
|
|
253
|
+
background-color: #dbeafe;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.ProseMirror table p {
|
|
257
|
+
margin: 0;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
.ProseMirror .column-resize-handle {
|
|
262
|
+
position: absolute;
|
|
263
|
+
right: -2px;
|
|
264
|
+
top: 0;
|
|
265
|
+
bottom: -2px;
|
|
266
|
+
width: 4px;
|
|
267
|
+
background-color: #3b82f6;
|
|
268
|
+
pointer-events: none;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.ProseMirror.resize-cursor {
|
|
272
|
+
cursor: col-resize;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* Hide image resize handles on mobile and tablets (below lg breakpoint: 1024px) */
|
|
276
|
+
@media (max-width: 1023px) {
|
|
277
|
+
|
|
278
|
+
.ProseMirror [style*="cursor: nwse-resize"],
|
|
279
|
+
.ProseMirror [style*="cursor: nesw-resize"] {
|
|
280
|
+
display: none !important;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Make images full width on mobile - override inline styles */
|
|
284
|
+
.prose .image-container {
|
|
285
|
+
width: 100% !important;
|
|
286
|
+
margin: 0 !important;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.prose .image-container .image-wrapper {
|
|
290
|
+
width: 100% !important;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.prose .image-container img,
|
|
294
|
+
.prose img {
|
|
295
|
+
width: 100% !important;
|
|
296
|
+
max-width: 100% !important;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* Responsive YouTube embeds */
|
|
301
|
+
.youtube-embed,
|
|
302
|
+
.prose iframe[src*="youtube"] {
|
|
303
|
+
width: 100% !important;
|
|
304
|
+
height: auto !important;
|
|
305
|
+
aspect-ratio: 16 / 9;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/* Image alignment containers */
|
|
309
|
+
.prose .image-container {
|
|
310
|
+
display: flex;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.prose .image-container .image-wrapper {
|
|
314
|
+
max-width: 100%;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.prose .image-container .image-wrapper img,
|
|
318
|
+
.prose img:not(.image-container img) {
|
|
319
|
+
max-width: 100%;
|
|
320
|
+
height: auto;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.prose table {
|
|
324
|
+
border-collapse: collapse;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.prose th,
|
|
328
|
+
.prose td {
|
|
329
|
+
border: 1px solid #e5e7eb;
|
|
330
|
+
padding: 0.5rem 0.75rem;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.prose th {
|
|
334
|
+
background-color: #f9fafb;
|
|
335
|
+
font-weight: 600;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.prose table td:has(> p:not(:empty)),
|
|
339
|
+
.prose table th:has(> p:not(:empty)),
|
|
340
|
+
.prose table tr:has(> td > p:not(:empty)),
|
|
341
|
+
.prose table tr:has(> th > p:not(:empty)) {}
|
|
342
|
+
|
|
343
|
+
.prose table td>p:not(:empty):not(:where([class~=not-prose], [class~=not-prose] *)),
|
|
344
|
+
.prose table th>p:not(:empty):not(:where([class~=not-prose], [class~=not-prose] *)) {
|
|
345
|
+
margin-top: 0 !important;
|
|
346
|
+
margin-bottom: 0 !important;
|
|
347
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
+
* listed below.
|
|
4
|
+
*
|
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
|
7
|
+
*
|
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
|
11
|
+
* It is generally better to create a new file per style scope.
|
|
12
|
+
*
|
|
13
|
+
*= require_tree .
|
|
14
|
+
*= require_self
|
|
15
|
+
*/
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<xsl:stylesheet version="1.0"
|
|
3
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
4
|
+
xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
|
|
5
|
+
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
|
6
|
+
exclude-result-prefixes="sitemap xhtml">
|
|
7
|
+
|
|
8
|
+
<xsl:output method="html" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
|
|
9
|
+
|
|
10
|
+
<xsl:template match="/">
|
|
11
|
+
<html lang="en">
|
|
12
|
+
<head>
|
|
13
|
+
<meta charset="utf-8"/>
|
|
14
|
+
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
15
|
+
<meta name="robots" content="noindex, nofollow"/>
|
|
16
|
+
<title>Sitemap</title>
|
|
17
|
+
<style>
|
|
18
|
+
body { font-family: system-ui, -apple-system, Segoe UI, sans-serif; margin: 1.5rem; color: #111827; line-height: 1.5; }
|
|
19
|
+
h1 { font-size: 1.25rem; font-weight: 600; margin: 0 0 1rem; }
|
|
20
|
+
p.meta { font-size: 0.875rem; color: #6b7280; margin-bottom: 1rem; }
|
|
21
|
+
table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
|
|
22
|
+
th, td { border: 1px solid #e5e7eb; padding: 0.5rem 0.75rem; text-align: left; vertical-align: top; word-break: break-word; }
|
|
23
|
+
th { background: #f9fafb; font-weight: 600; }
|
|
24
|
+
tbody tr:nth-child(even) td { background: #fafafa; }
|
|
25
|
+
a { color: #2563eb; text-decoration: underline; }
|
|
26
|
+
a:hover { color: #1d4ed8; }
|
|
27
|
+
.alt { display: block; margin: 0.15rem 0; }
|
|
28
|
+
code { font-size: 0.85em; background: #f3f4f6; padding: 0.1em 0.35em; border-radius: 0.25rem; }
|
|
29
|
+
</style>
|
|
30
|
+
</head>
|
|
31
|
+
<body>
|
|
32
|
+
<h1>Sitemap</h1>
|
|
33
|
+
<table>
|
|
34
|
+
<thead>
|
|
35
|
+
<tr>
|
|
36
|
+
<th scope="col">URL</th>
|
|
37
|
+
<th scope="col">Last modified</th>
|
|
38
|
+
<th scope="col">Alternates</th>
|
|
39
|
+
</tr>
|
|
40
|
+
</thead>
|
|
41
|
+
<tbody>
|
|
42
|
+
<xsl:for-each select="sitemap:urlset/sitemap:url">
|
|
43
|
+
<tr>
|
|
44
|
+
<td>
|
|
45
|
+
<a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc"/></a>
|
|
46
|
+
</td>
|
|
47
|
+
<td><xsl:value-of select="sitemap:lastmod"/></td>
|
|
48
|
+
<td>
|
|
49
|
+
<xsl:for-each select="xhtml:link">
|
|
50
|
+
<span class="alt">
|
|
51
|
+
<code><xsl:value-of select="@hreflang"/></code>
|
|
52
|
+
<xsl:text> </xsl:text>
|
|
53
|
+
<a href="{@href}"><xsl:value-of select="@href"/></a>
|
|
54
|
+
</span>
|
|
55
|
+
</xsl:for-each>
|
|
56
|
+
</td>
|
|
57
|
+
</tr>
|
|
58
|
+
</xsl:for-each>
|
|
59
|
+
</tbody>
|
|
60
|
+
</table>
|
|
61
|
+
</body>
|
|
62
|
+
</html>
|
|
63
|
+
</xsl:template>
|
|
64
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
module Postnhost
|
|
2
|
+
module Authentication
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
|
|
5
|
+
included do
|
|
6
|
+
helper_method :current_user, :user_signed_in?
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
protected
|
|
10
|
+
|
|
11
|
+
def authenticate_user!
|
|
12
|
+
return if user_signed_in?
|
|
13
|
+
|
|
14
|
+
if Postnhost::User.none?
|
|
15
|
+
redirect_to postnhost.onboarding_path
|
|
16
|
+
else
|
|
17
|
+
redirect_to postnhost.new_session_path, alert: "You need to sign in before continuing."
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def skip_authentication
|
|
22
|
+
return unless user_signed_in?
|
|
23
|
+
|
|
24
|
+
redirect_to postnhost.articles_path
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def sign_in(user)
|
|
28
|
+
reset_session
|
|
29
|
+
session[:user_id] = user.id
|
|
30
|
+
cookies.encrypted[:auth_user_id] = {
|
|
31
|
+
value: user.id,
|
|
32
|
+
httponly: true,
|
|
33
|
+
same_site: :lax
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def sign_out
|
|
38
|
+
cookies.delete(:auth_user_id)
|
|
39
|
+
reset_session
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
private
|
|
43
|
+
|
|
44
|
+
def current_user
|
|
45
|
+
return @current_user if defined?(@current_user)
|
|
46
|
+
|
|
47
|
+
user_id = session[:user_id]
|
|
48
|
+
return @current_user = nil if user_id.blank?
|
|
49
|
+
|
|
50
|
+
@current_user = Postnhost::User.find_by(id: user_id)
|
|
51
|
+
sign_out if session[:user_id].present? && @current_user.nil?
|
|
52
|
+
@current_user
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def user_signed_in?
|
|
56
|
+
current_user.present?
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module Postnhost
|
|
2
|
+
module CanonicalFirstPageRedirect
|
|
3
|
+
private
|
|
4
|
+
|
|
5
|
+
def redirect_page_one_to_canonical!
|
|
6
|
+
return unless params[:page].to_s == "1"
|
|
7
|
+
|
|
8
|
+
query_params = request.query_parameters.except("page")
|
|
9
|
+
canonical_path = query_params.present? ? "#{request.path}?#{query_params.to_query}" : request.path
|
|
10
|
+
|
|
11
|
+
redirect_to canonical_path, status: :moved_permanently
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module Postnhost
|
|
2
|
+
module LanguageSwitcher
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
|
|
5
|
+
included do
|
|
6
|
+
before_action :set_language_data
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
private
|
|
10
|
+
|
|
11
|
+
def set_language_data
|
|
12
|
+
language = public_request_context.requested_language
|
|
13
|
+
@current_language = language || ensure_default_language
|
|
14
|
+
public_request_context.default_language = @current_language if @current_language.default?
|
|
15
|
+
|
|
16
|
+
I18n.locale = @current_language.html_lang.to_sym
|
|
17
|
+
|
|
18
|
+
@other_languages = Postnhost::Language.where.not(id: @current_language.id).order(:name)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def ensure_default_language
|
|
22
|
+
public_request_context.default_language || create_english_default
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def public_request_context
|
|
26
|
+
@public_request_context ||= Postnhost::PublicRequestContext.for(request)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def localized_request?
|
|
30
|
+
params[:locale].present?
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def create_english_default
|
|
34
|
+
language = Postnhost::Language.find_or_initialize_by(html_lang: "en") do |lang|
|
|
35
|
+
lang.name = "English"
|
|
36
|
+
end
|
|
37
|
+
language.default = true
|
|
38
|
+
language.save! if language.new_record?
|
|
39
|
+
language
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module Postnhost
|
|
2
|
+
module Onboarding
|
|
3
|
+
module AccessControl
|
|
4
|
+
extend ActiveSupport::Concern
|
|
5
|
+
|
|
6
|
+
private
|
|
7
|
+
|
|
8
|
+
def ensure_onboarding_allowed!
|
|
9
|
+
if user_signed_in?
|
|
10
|
+
return if post_install_checklist_mode?
|
|
11
|
+
|
|
12
|
+
redirect_to postnhost.articles_path
|
|
13
|
+
return
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
return unless Postnhost::User.exists? && session[:onboarding_pending_user_id].blank?
|
|
17
|
+
|
|
18
|
+
redirect_to postnhost.new_session_path, alert: "Sign in to continue."
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def current_step
|
|
22
|
+
step = (session[:onboarding_step] || 1).to_i
|
|
23
|
+
step.clamp(1, 4)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def pending_user
|
|
27
|
+
id = session[:onboarding_pending_user_id]
|
|
28
|
+
return if id.blank?
|
|
29
|
+
|
|
30
|
+
Postnhost::User.find_by(id: id)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def reset_onboarding_session!
|
|
34
|
+
session.delete(:onboarding_pending_user_id)
|
|
35
|
+
session.delete(:onboarding_step)
|
|
36
|
+
session.delete(:onboarding_locale)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def post_install_checklist_mode?
|
|
40
|
+
params[:post_install].to_s == "1" && session[:onboarding_post_install_checklist] == true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def synchronize_onboarding_session
|
|
44
|
+
if session[:onboarding_pending_user_id].present? &&
|
|
45
|
+
!Postnhost::User.exists?(id: session[:onboarding_pending_user_id])
|
|
46
|
+
reset_onboarding_session!
|
|
47
|
+
redirect_to postnhost.onboarding_path, alert: "Setup session expired. Start again."
|
|
48
|
+
return
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
return unless Postnhost::User.none? && session[:onboarding_step].to_i > 1
|
|
52
|
+
|
|
53
|
+
session[:onboarding_step] = 1
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
module Postnhost
|
|
2
|
+
module Onboarding
|
|
3
|
+
module StepAssignment
|
|
4
|
+
extend ActiveSupport::Concern
|
|
5
|
+
|
|
6
|
+
SITE_COPY_KEYS = %w[
|
|
7
|
+
postnhost.public.site.schema_site_name
|
|
8
|
+
postnhost.public.site.blog_tagline
|
|
9
|
+
postnhost.public.site.blog_subtitle
|
|
10
|
+
postnhost.public.site.blog_meta_title
|
|
11
|
+
postnhost.public.site.blog_meta_description
|
|
12
|
+
].freeze
|
|
13
|
+
|
|
14
|
+
LANGUAGE_OPTIONS = [
|
|
15
|
+
{ name: "English", html_lang: "en" },
|
|
16
|
+
{ name: "French", html_lang: "fr" },
|
|
17
|
+
{ name: "German", html_lang: "de" },
|
|
18
|
+
{ name: "Japanese", html_lang: "ja" },
|
|
19
|
+
{ name: "Korean", html_lang: "ko" },
|
|
20
|
+
{ name: "Portuguese", html_lang: "pt" },
|
|
21
|
+
{ name: "Polish", html_lang: "pl" },
|
|
22
|
+
{ name: "Spanish", html_lang: "es" },
|
|
23
|
+
{ name: "Russian", html_lang: "ru" }
|
|
24
|
+
].freeze
|
|
25
|
+
|
|
26
|
+
private
|
|
27
|
+
|
|
28
|
+
def load_step_assignments
|
|
29
|
+
@step = current_step
|
|
30
|
+
|
|
31
|
+
case @step
|
|
32
|
+
when 1
|
|
33
|
+
@user = Postnhost::User.new
|
|
34
|
+
when 2
|
|
35
|
+
@language_options = LANGUAGE_OPTIONS
|
|
36
|
+
@selected_language_locales = session[:onboarding_language_locales].presence || [session[:onboarding_locale].presence || "en"]
|
|
37
|
+
@selected_default_locale = session[:onboarding_locale].presence || "en"
|
|
38
|
+
when 3
|
|
39
|
+
assign_site_copy_fields
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def assign_site_copy_fields
|
|
44
|
+
locale = session[:onboarding_locale].presence || I18n.default_locale.to_s
|
|
45
|
+
@locale = locale
|
|
46
|
+
|
|
47
|
+
setting = Postnhost::Setting.current
|
|
48
|
+
@site_url = setting.site_url.presence || request.base_url
|
|
49
|
+
@site_indexing = setting.site_indexing
|
|
50
|
+
merged = Postnhost::Settings::I18nOverrides.editable_translations_for_locale(locale, setting.locale_overrides)
|
|
51
|
+
@site_copy = SITE_COPY_KEYS.index_with { |key| merged[key].to_s }
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|