v1.0.0.rst 6.3 KB

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