2
0

tutorial01.rst 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. Tutorial Part 1: Site Name, Logo, and Basics
  2. ============================================
  3. After :doc:`install`, you are greeted with a bare-bones website.
  4. Let's start filling things out.
  5. For this tutorial, we will assume the name of your project is ``mysite``.
  6. Logging in
  7. ----------
  8. Navigate to http://localhost:8000/admin/ and log in with the username
  9. and password you created with the ``python manage.py createsuperuser`` command.
  10. After logging in, you will be taken to the admin dashboard - also known as the "Wagtail Admin".
  11. .. figure:: img/tutorial_admin.png
  12. :alt: The admin dashboard.
  13. The admin dashboard.
  14. .. _site-name:
  15. Changing your site name
  16. -----------------------
  17. By default, the site name shows up in many different places, including page titles in the browser tab.
  18. To change the name, go to **Settings > Sites**, and click on the site that is there. Change the
  19. **Site name** setting and click "Save".
  20. .. note::
  21. There is also a ``WAGTAIL_SITE_NAME`` setting in the ``mysite/settings/base.py`` file. This is really
  22. only used for the login screen and on the main Wagtail Admin dashboard. The reason this setting exists
  23. is for use with multi-sites. For example, if you have a parent company that operates many separate
  24. brand websites within one CMS, then ``WAGTAIL_SITE_NAME`` would be the name of the parent company.
  25. For my website, I'm going to change **Settings > Sites > Site name** to "Simple Sweet Desserts".
  26. .. figure:: img/tutorial_sitename.png
  27. :alt: Changing the site name.
  28. Changing the site name.
  29. And edit ``mysite/settings/base.py`` by changing ``WAGTAIL_SITE_NAME`` as so::
  30. WAGTAIL_SITE_NAME = 'Simple Sweet Desserts Ltd.'
  31. Now the admin dashboard and login page show "Simple Sweet Desserts Ltd.", and the Home page at http://localhost:8000/
  32. will show "Simple Sweet Desserts".
  33. .. _logo:
  34. Adding your logo
  35. ----------------
  36. First, and most important, is the logo. Go to **Settings > Layout**. Here are the site-wide
  37. visual and design settings for your website. At the top are two settings for your logo and
  38. favicon. Both will be scaled to fit wherever they are used, but we recommend
  39. the following image parameters:
  40. * **Logo:** probably does not need to be any larger than 500x500 pixels, unless you plan to have
  41. a giant logo. Any image ratio is fine, logos come in all shapes and sizes. 😀
  42. * **Favicon:** does not need to be any larger than 200x200 pixels. A 1:1 (square) image ratio is
  43. best here - if the image is not square, it will be scaled to a square.
  44. .. note::
  45. We recommend PNG format at 300 DPI so that your logo will look sharp on high resolution
  46. mobile devices and retina displays. However, any image format will work.
  47. After uploading your logo and favicon, click "Save". You should now instantly see your logo
  48. applied in the dashboard. In a new tab, go to http://localhost:8000/ and you'll see that your
  49. logo and favicon show up everywhere on your site.
  50. .. figure:: img/tutorial_logo.png
  51. :alt: Adding the logo.
  52. Adding the logo.
  53. .. figure:: img/tutorial_logo_front.png
  54. :alt: The logo on our website.
  55. The logo on our website.
  56. .. _navbar-global:
  57. Changing navbar and global site colors
  58. --------------------------------------
  59. The default style is a light-colored navbar and the standard Bootstrap colors.
  60. But if you have a white or light colored logo, you might prefer a dark navbar.
  61. To change the navbar color, go to **Settings > Layout** and alter the following settings:
  62. * **Navbar color scheme:** Dark
  63. * **Navbar CSS class:** ``bg-dark`` (or some other CSS class. See
  64. `Bootstrap color utilities <https://getbootstrap.com/docs/4.3/utilities/colors/#background-color>`_)
  65. Click "Save" and go to http://localhost:8000/ to see your new navbar. Great success! There are
  66. many other settings here for controlling the layout of the navbar. Play with them and pick
  67. what works best for you. Once again, most of these settings utilize default Bootstrap styles.
  68. .. figure:: img/tutorial_dark_navbar.png
  69. :alt: Our site with a dark navbar.
  70. Our site with a dark navbar.
  71. Beyond the navbar, you can swap out the entire Bootstrap CSS theme in use. We provide a few simple
  72. themes from `Bootswatch <https://bootswatch.com/>`_. Select an option from the **Theme variant**
  73. setting, click "Save", and view your site. Pick one that looks best to you. If you are going to be
  74. doing a lot of heavy CSS customization, you might want to stick with the default to ensure
  75. compatibility with the Bootstrap documentation.
  76. For our website, we are going to change the navbar color scheme back to "Light", CSS class to ``bg-light``,
  77. and leave the theme variant at the default.