v1.0.0.rst 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. v1.0.0 release notes
  2. ====================
  3. Today we celebrate our 43rd public release of CRX! This is the largest release
  4. ever with tons of performance improvements that will increase the speed and
  5. accessibility of your CRX website.
  6. New features
  7. ------------
  8. * Upgrade to Wagtail 3.
  9. * Upgrade to Bootstrap 5 (ships with Bootstrap 5.2).
  10. * Removed jQuery, modernizr, and many other JavaScript improvements.
  11. * Use WebP image format. If you need to support older browsers released prior to
  12. 2020, disable this feature. See :doc:`/how_to/images`.
  13. * New Accordion snippet and block. See :doc:`/features/snippets/accordions`.
  14. * Added hidden "skip navigation" link for accessibility.
  15. * Most settings have been consolidated in the Wagtail admin under
  16. **Settings > CRX Settings**.
  17. * Banner color has been changed from red to yellow, and appearance is slightly
  18. improved in the Wagtail admin.
  19. * Codebase has been formatted with ``black`` to improve readability and
  20. maintainability.
  21. * CRX 1, Wagtail 3, and Bootstrap 5 all drop support for Internet Explorer. If
  22. you need to support Internet Explorer, follow the Bootstrap 4 guide below.
  23. Upgrade instructions
  24. --------------------
  25. .. important::
  26. It is highly recommended to first upgrade and deploy your site in production
  27. with version 0.25 before performing the upgrade to 1.0.
  28. Updating Python code & Django templates
  29. '''''''''''''''''''''''''''''''''''''''
  30. #. Run ``pip install coderedcms==1.0.*`` and update your ``requirements.txt``
  31. with ``coderedcms==1.0.*``.
  32. #. Follow the `Wagtail 3 upgrade instructions
  33. <https://docs.wagtail.org/en/stable/releases/3.0.html#upgrade-considerations-changes-affecting-all-projects>`_.
  34. This primarily involves running the following tool to update the Wagtail
  35. imports:
  36. .. code-block:: text
  37. wagtail updatemodulepaths
  38. #. Find and replace the following panels in your Python code:
  39. * ``StreamFieldPanel``
  40. * ``RichTextFieldPanel``
  41. * ``ImageChooserPanel``
  42. * ``DocumentChooserPanel``
  43. * ``SnippetChooserPanel``
  44. with:
  45. * ``FieldPanel``
  46. #. Find all instances of ``StreamField(`` and add the ``use_json_field=True``
  47. argument.
  48. #. Rename ``BASE_URL`` to ``WAGTAILADMIN_BASE_URL`` in your Django settings.
  49. #. Find and delete any references to ``ADASettings`` in your Python and HTML
  50. code.
  51. #. Find and replace the following references in your Python and HTML code:
  52. * ``GeneralSettings``
  53. * ``GoogleApiSettings``
  54. * ``MailchimpApiSettings``
  55. with:
  56. * ``LayoutSettings``
  57. #. Find and replace ``codered_banner.html`` with ``crx_banner.html`` in your
  58. Python and HTML code.
  59. #. Find and replace the following URL names in your Python and HTML code:
  60. * ``codered_favicon`` with ``crx_favicon``
  61. * ``codered_robots`` with ``crx_robots``
  62. * ``codered_search`` with ``crx_search``
  63. * ``codered_sitemap`` with ``crx_sitemap``
  64. #. Make and run migrations:
  65. .. code-block:: text
  66. python manage.py makemigrations
  67. python manage.py migrate
  68. #. Next, choose whether to upgrade to Bootstrap 5, or stay on Bootstrap 4.
  69. If upgrading your site to Bootstrap 5
  70. '''''''''''''''''''''''''''''''''''''
  71. #. Add ``django_bootstrap5`` to ``INSTALLED_APPS``..
  72. #. If you are not using ``django-bootstrap4`` elsewhere in your project, remove
  73. ``bootstrap4`` from ``INSTALLED_APPS``.
  74. #. In your Django settings file, remove the ``BOOTSTRAP4`` dictionary.
  75. #. Update your HTML templates to `Bootstrap 5.2 <https://getbootstrap.com/>`_.
  76. Compare your custom templates to the stock ones for help:
  77. https://github.com/coderedcorp/coderedcms/tree/dev/coderedcms/templates.
  78. #. Notable template changes:
  79. * ``event_index_page.html`` and ``calendar.html`` have changed.
  80. * ``location_index_page.html`` has changed.
  81. * ``stream_form_page.html`` has changed.
  82. * ``form_page.html`` and ``pagepreview_form.html`` have changed to use
  83. ``django_bootstrap5`` rendering.
  84. * ``article_index_page.html`` and ``article_page.html`` have a new design
  85. that is closer to stock Bootstrap.
  86. * ``grid_block.html`` now has with a CSS class ``crx-grid`` which you can
  87. target with CSS.
  88. * Blocks no longer render with a ``<div class="block-*">`` wrapper. This may
  89. affect custom CSS.
  90. #. ``pages/base.html`` template has removed ``{% block required_scripts %}``.
  91. Delete it from your template if it is present.
  92. #. If you still rely on jQuery, be sure to add it to your base template in
  93. ``{% block custom_scripts %}``. Generally speaking, any instance of the
  94. ``custom_scripts`` block should call ``block.super`` to preserve scripts from
  95. parent templates as such:
  96. .. code-block:: django
  97. {% block custom_scripts %}
  98. {{ block.super }}
  99. <script src="my-script-here.js"></script>
  100. {% endblock %}
  101. #. All CSS class names and JavaScript files beginning with ``codered-`` have
  102. been renamed to ``crx-``. Find and replace those in your templates and CSS.
  103. #. The new templates all use WebP images. See: :doc:`/how_to/images` for options
  104. to disable this if needed.
  105. #. If you are using Sass, update your ``_variables.scss`` and ``custom.scss``
  106. files appropriately. As a starting point, update your Sass files to match our
  107. project template:
  108. https://github.com/coderedcorp/coderedcms/tree/dev/coderedcms/project_template/sass/website/static/website/src.
  109. If staying on Bootstrap 4
  110. '''''''''''''''''''''''''
  111. While we recommend *eventually* upgrading to Bootstrap 5, for larger sites or
  112. highly customized sites, this can be a lengthy process. We have published a
  113. `compatibility theme <https://github.com/coderedcorp/coderedcms-bootstrap4>`_
  114. which preserves all the old Bootstrap 4 templates, CSS, Sass, and JavaScript.
  115. Do not follow any of the steps above in the Bootstrap 5 section if you are
  116. staying on Bootstrap 4!
  117. #. Run ``pip install coderedcms-bootstrap4`` and add to your
  118. ``requirements.txt`` file ``coderedcms-bootstrap4==1.*``.
  119. #. In your Django settings file, add ``coderedcms_bootstrap4`` **ABOVE** the
  120. ``coderedcms`` app:
  121. .. code-block:: python
  122. INSTALLED_APPS = [
  123. ...,
  124. "coderedcms_bootstrap4",
  125. "coderedcms",
  126. ...,
  127. ]
  128. Final steps: after deploying
  129. ''''''''''''''''''''''''''''
  130. Locally in development, and after deploying your upgraded site to production,
  131. you should run the following commands to clean up the site.
  132. Run migrations (as usual):
  133. .. code-block:: text
  134. python manage.py migrate
  135. Delete old media renditions:
  136. .. code-block:: text
  137. python manage.py wagtail_update_image_renditions --purge-only
  138. Clear the cache:
  139. .. code-block:: text
  140. python manage.py clear_wagtail_cache
  141. Update Wagtail search index:
  142. .. code-block:: text
  143. python manage.py wagtail_update_index
  144. Thank you!
  145. ----------
  146. Thanks to everyone who contributed to `1.0.0 on GitHub <https://github.com/coderedcorp/coderedcms/milestone/1?closed=1>`_.