mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-24 13:26:45 +08:00
Previously, the only way to author js/hbs via the admin panel was to use `<script>` tags. This strategy is not pretty, and doesn't provide access to proper ES module imports or gjs `<template>` syntax. Our recommendation for most themes is still that they should be authored using a proper IDE, the `discourse_theme` CLI, and version-controlled using git. However, we understand that this isn't a good fit for everyone, and that there's still a place for simple admin-panel-ui-authored themes. This commit introduces a "JS" tab in the admin theme editor, which corresponds to a file named `discourse/api-initializers/theme-initializer.gjs` in the theme. This means that everyone will be able to move towards the more modern syntaxes, and away from the old `<script>` patterns. |
||
|---|---|---|
| .. | ||
| adapters | ||
| components | ||
| controllers | ||
| helpers | ||
| lib | ||
| mixins | ||
| models | ||
| routes | ||
| services | ||
| templates | ||