Привет! Я новичок в Discourse и мне очень нравятся его возможности и функционал. Я хочу серьёзно кастомизировать его внешний вид и способ отображения контента. Я читаю различные ветки и посты, пытаясь разобраться, но, несмотря на опыт работы с JavaScript, я запутался. Под «серьёзной кастомизацией» я имею в виду: удаление боковой панели, добавление пунктов навигации в верхнюю панель. Отображение тем с именем автора, аватаром, заголовком и превью текста, а также с информацией о последнем ответе и его превью с аватаром и именем автора ответа. Темы, сгруппированные по категориям в одном большом списке категорий и их тем (по-старинке). Похоже, мне нужно понять, как переопределить данные, которые отображаются или извлекаются для отображения, но я не знаю, как лучше всего это сделать. Будет ли это один «тема», компонент темы? Или это будет плагин? Может, несколько тем, компонентов и плагинов? В чём разница между компонентом и плагином? Хотелось бы увидеть видео на YouTube, где показан процесс разработки такой сильно кастомизированной «темы». Сейчас я собираю список «дополнений», которые делают что-то похожее на то, что я хочу реализовать, и пытаюсь изучить их код, но, черт возьми, это действительно запутанно для новичка, который только что «вышел на улицу». Я лучше усваиваю информацию, глядя видео, чем читая. Есть ли какие-то советы, рекомендации или видео, о которых я мог бы не знать? Любая помощь будет очень кстати.
Falco
(Falco)
08.Ноябрь.2023 03:28:30
2
Поскольку желаемые вами изменения потребуют получения дополнительных данных для страниц, темы или компонента будет недостаточно — для реализации вашей задумки потребуется плагин.
Спасибо У меня гора литературы для чтения. Надеюсь, всё постепенно начнёт складываться в логичную картину. Я нашёл очень актуальную тему:
Ideally, when customizing Discourse via themes/plugins, you should use CSS, the JavaScript Plugin API , or plugin outlets . If none of these work for your use-case, feel free to open a PR to Discourse core or start a Dev topic here on Meta. We’re always happy to discuss adding new outlets/APIs to make customization easier.
If you’ve exhausted all other options, you may need to resort to template overrides. This technique allows you to override the entire template of any Ember Component or Route f…
А теперь просто делюсь ссылками и заметками для тех, кто, возможно, находится в аналогичной ситуации:
HTML-шаблоны находятся здесь: https://github.com/discourse/discourse/tree/main/app/assets/javascripts/discourse/app/templates
Руководство для новичков по темам:
This is a crash course in Discourse theme basics. The target audience is everyone who is not familiar with Discourse themes. If you’ve already used Discourse theme / theme components, this guide is probably not something you need to read.
What are themes and theme components?
A theme or theme component is a set of files packaged together designed to either modify Discourse visually or to add new features.
Let’s start with themes.
Themes
In general, themes are not supposed to be compatible …
Руководство для разработчиков по темам:
Discourse Themes and Theme Components can be used to customize the look, feel and functionality of Discourse’s frontend. This section of the developer guides aims to provide all the reference materials you need to develop simple themes for a single site, right up to complex open-source theme components.
This introduction aims to provide a map of all the tools and APIs for theme development. If you prefer a step-by-step tutorial for theme development, jump straight to:
Themes vs. Theme Compon…
Руководство для дизайнеров по началу работы с темами в Discourse:
This is possible, and the method I would reccomend. The only thing you need to be aware of is that these changes will be live on the forum as you make every change.
What I do is set the theme to be user selectable, and change my personal user preference to that theme, while keeping the default theme the choice for all other users. This lets only you see any issues that may arise during theming.
Создание компонента темы:
Компонент темы для отображения мест размещения плагинов (мест для внедрения нового HTML/скриптов/стилей):
Contribute to communiteq/plugin-outlets-theme-component development by creating an account on GitHub.
Разработка плагинов:
Научитесь создавать вещи с нуля:
There are a few ‘how to start’ guides for working with Discourse already and a wealth of useful info on meta, but I thought it might help to give an insight to the mental processes of starting from little, if any, prior coding experience to building substantial Discourse plugins.
Discourse is written by experienced developers and has a large codebase. This can feel intimidating. This intimidation factor can be a significant barrier for novice developers. This is a kind of ‘psychological primer’…
Установка Discourse на Ubuntu/Debian для разработки:
This guide covers installation instructions in a development environment. For a production guide see: Install Discourse in production with the official supported instructions
So you want to set up Discourse on Ubuntu or Debian to hack on and develop with?
We’ll assume that you work locally and don’t have Ruby/Rails/Postgres/Redis installed on your Ubuntu or Debian system. Let’s begin!
Requirements
We suggest having at least 4 GB RAM and 2 CPU cores.
Current compatibility:
O…
То, что я действительно хочу изменить, — это «topic-list» или главная страница
• Эта тема уже создала нужный формат списка тем:
• Имя автора + аватар:
Author name plus avatar или Show Original Poster Avatars
• Группы категорий:
• Иконки избранных категорий:
Также можно попробовать онлайн-редактор тем:
Дополнительно:
• Единый вход (SSO)?
DiscourseConnect is a core Discourse feature that allows you to configure “Single Sign-On (SSO)” to completely outsource all user registration and login from Discourse to another site. Offered to our pro, business and enterprise hosting customers .
(Feb 2021) ‘Discourse SSO ’ is now ‘DiscourseConnect ’. If you are running an old version of Discourse, the settings below will be named sso_... rather than discourse_connect_...
The Problem
Many sites wishing to integrate wit…
• Бот для Discord
Purpose of this plugin
This plugin does several things:
Allows you to power a Discord bot using your Discourse server to do stuff to link the two systems. Fork this repo and expand it with simple Ruby to create all kinds of bot functionality.
Existing functionality to serve as examples and useful utility:
Provides some two-way auto posting of content that meet some criteria.
Command to copy messages ad hoc to Discourse
Command to sync group membership to role membership of your Discor…
pfaffman
(Jay Pfaffman)
08.Ноябрь.2023 05:14:39
4
SinisterSpatula:
удаление боковой панели
Вы можете сделать это, нажав на иконку «гамбургер», так что это довольно просто понять.
Посмотрите Пользовательские ссылки в заголовке .
Это может помочь вам начать работу.