--- /dev/null
- ### Asking Support Questions
++### Asking support questions
+
+We have an active [discussion forum](https://discourse.gohugo.io) where users and developers can ask questions. Please don't use the GitHub issue tracker to ask questions.
--- /dev/null
- <svg width="158" height="160" viewBox="0 0 158 160" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M4.32 103V27.64H17.664V54.616C18.752 54.04 20 53.56 21.408 53.176C22.816 52.728 24.192 52.376 25.536 52.12C26.88 51.864 28.192 51.672 29.472 51.544C30.816 51.352 32.032 51.256 33.12 51.256C35.872 51.256 38.24 51.704 40.224 52.6C42.272 53.432 43.904 54.584 45.12 56.056C46.336 57.464 47.296 59.32 48 61.624C48.704 63.928 49.152 66.328 49.344 68.824C49.6 71.32 49.728 74.296 49.728 77.752C49.728 86.008 48.448 92.376 45.888 96.856C43.328 101.336 39.072 103.576 33.12 103.576C30.368 103.576 27.584 103 24.768 101.848C21.952 100.696 19.616 99.352 17.76 97.816L15.36 103H4.32ZM17.76 88.984C21.024 91.032 24.992 92.056 29.664 92.056C31.136 92.056 32.352 91.64 33.312 90.808C34.272 89.912 35.008 88.376 35.52 86.2C36.032 83.96 36.288 80.984 36.288 77.272C36.288 73.048 36 69.784 35.424 67.48C34.912 65.176 34.208 63.672 33.312 62.968C32.416 62.2 31.2 61.816 29.664 61.816C27.296 61.816 25.152 61.976 23.232 62.296C21.312 62.552 19.488 63.032 17.76 63.736V88.984ZM56.8958 77.272C56.8958 72.856 57.1518 69.176 57.6638 66.232C58.2398 63.224 59.0398 60.76 60.0638 58.84C61.0878 56.856 62.5278 55.352 64.3838 54.328C66.2398 53.304 68.2878 52.6 70.5278 52.216C72.8318 51.832 75.7118 51.64 79.1678 51.64C81.4718 51.64 83.4238 51.704 85.0238 51.832C86.6238 51.896 88.2238 52.088 89.8238 52.408C91.4878 52.664 92.8318 53.08 93.8558 53.656C94.8798 54.168 95.8718 54.904 96.8318 55.864C97.7918 56.76 98.5278 57.88 99.0398 59.224C99.6158 60.504 100.032 62.072 100.288 63.928C100.608 65.72 100.768 67.8 100.768 70.168C100.768 74.648 99.5838 77.912 97.2158 79.96C94.8478 82.008 91.2958 83.032 86.5598 83.032H70.3358C70.3358 85.976 70.7518 88.184 71.5838 89.656C72.4798 91.064 73.5678 91.928 74.8478 92.248C76.1918 92.568 78.2718 92.728 81.0878 92.728C88.9598 92.728 95.1998 92.376 99.8078 91.672V100.792C95.0078 102.584 86.3038 103.48 73.6958 103.48C70.4318 103.48 67.7118 103 65.5358 102.04C63.4238 101.08 61.7278 99.512 60.4478 97.336C59.1678 95.16 58.2398 92.472 57.6638 89.272C57.1518 86.072 56.8958 82.072 56.8958 77.272ZM70.3358 73.336H83.1038C85.9198 73.336 87.3278 72.056 87.3278 69.496C87.3278 66.296 86.8798 64.248 85.9838 63.352C85.1518 62.392 83.1358 61.912 79.9358 61.912C77.8878 61.912 76.3518 62.008 75.3278 62.2C74.3678 62.328 73.4078 62.776 72.4478 63.544C71.5518 64.248 70.9438 65.368 70.6238 66.904C70.3678 68.44 70.2718 70.584 70.3358 73.336ZM108.101 128.92V52.024H119.141L121.445 57.112C123.301 55.64 125.637 54.328 128.453 53.176C131.333 52.024 134.149 51.448 136.901 51.448C139.397 51.448 141.573 51.864 143.429 52.696C145.349 53.528 146.917 54.68 148.133 56.152C149.413 57.624 150.469 59.448 151.301 61.624C152.133 63.8 152.709 66.168 153.029 68.728C153.349 71.288 153.509 74.136 153.509 77.272C153.509 79.896 153.413 82.264 153.221 84.376C153.093 86.488 152.805 88.6 152.357 90.712C151.909 92.76 151.269 94.552 150.437 96.088C149.669 97.624 148.677 99 147.461 100.216C146.309 101.368 144.837 102.264 143.045 102.904C141.253 103.48 139.205 103.768 136.901 103.768C134.597 103.768 132.005 103.48 129.125 102.904C126.245 102.264 123.685 101.464 121.445 100.504V128.92H108.101ZM121.445 91.288C124.773 92.568 128.773 93.208 133.445 93.208C134.981 93.208 136.197 92.856 137.093 92.152C137.989 91.384 138.693 89.848 139.205 87.544C139.781 85.24 140.069 82.008 140.069 77.848C140.069 72.344 139.525 68.504 138.437 66.328C137.349 64.088 135.685 62.968 133.445 62.968C128.709 62.968 124.709 63.992 121.445 66.04V91.288Z" fill="white"/>
++<svg viewBox="0 0 255 180" fill="none" xmlns="http://www.w3.org/2000/svg">
++<rect fill="#AD1E1E"/>
++<path d="M29.25 60.5C31.1167 60.0667 32.85 59.85 34.45 59.85C36.05 59.85 37.4 59.9 38.5 60V72.5C39.2 72 40.1333 71.5667 41.3 71.2C42.4667 70.8 43.5833 70.6 44.65 70.6C48.2833 70.6 50.8333 71.5333 52.3 73.4C53.7667 75.2667 54.5 78.45 54.5 82.95C54.5 85.45 54.15 87.6167 53.45 89.45C52.7833 91.25 51.8667 92.6333 50.7 93.6C48.5 95.4667 45.9 96.4 42.9 96.4C40.6333 96.4 38.4 95.8333 36.2 94.7C35.5667 95.5667 34.8333 96 34 96H31.5V66.05C30.3333 65.65 29.4167 65.0833 28.75 64.35L29.25 60.5ZM42.5 91.3C45.7 91.3 47.3 88.6167 47.3 83.25C47.3 80.4167 47.0167 78.5 46.45 77.5C45.9167 76.4667 44.9667 75.95 43.6 75.95C41.5333 75.95 39.8333 76.5 38.5 77.6V90.45C39.9333 91.0167 41.2667 91.3 42.5 91.3ZM69.1555 96.4C65.1555 96.4 62.1388 95.3333 60.1055 93.2C58.1055 91.0667 57.1055 87.9667 57.1055 83.9C57.1055 81.4333 57.4555 79.3167 58.1555 77.55C58.8555 75.75 59.8055 74.3667 61.0055 73.4C63.3388 71.5333 66.0555 70.6 69.1555 70.6C72.2555 70.6 74.6221 71.4 76.2555 73C77.9221 74.5667 78.7555 77.4 78.7555 81.5C78.7555 83.9 77.5721 85.1 75.2055 85.1H64.3555C64.4888 87.2 65.0221 88.6833 65.9555 89.55C66.9221 90.4167 68.4388 90.85 70.5055 90.85C71.6388 90.85 72.7221 90.7167 73.7555 90.45C74.7888 90.1833 75.5388 89.9167 76.0055 89.65L76.7055 89.25L78.2055 93.25C78.0055 93.4833 77.7055 93.7833 77.3055 94.15C76.9388 94.4833 75.9721 94.95 74.4055 95.55C72.8721 96.1167 71.1221 96.4 69.1555 96.4ZM72.3055 80.65C72.3721 80.1833 72.4055 79.6167 72.4055 78.95C72.4055 78.2833 72.1388 77.5833 71.6055 76.85C71.0721 76.0833 70.1388 75.7 68.8055 75.7C67.5055 75.7 66.5055 76.1 65.8055 76.9C65.1055 77.7 64.6388 79.05 64.4055 80.95L72.3055 80.65ZM81.2754 71C83.1087 70.6 84.7587 70.4 86.2254 70.4C87.6921 70.4 88.9087 70.4333 89.8754 70.5V72.95C92.1087 71.3833 94.4921 70.6 97.0254 70.6C100.359 70.6 102.775 71.55 104.275 73.45C105.775 75.35 106.525 78.5167 106.525 82.95C106.525 85.3167 106.175 87.4 105.475 89.2C104.775 91 103.825 92.4 102.625 93.4C100.325 95.4 97.5921 96.4 94.4254 96.4C93.0587 96.4 91.7587 96.2667 90.5254 96V100.3C92.4921 100.833 93.7587 101.45 94.3254 102.15L93.8254 106H81.2754L80.7754 102.15C81.2087 101.55 82.1254 100.983 83.5254 100.45V76.55C82.3587 76.15 81.4421 75.5833 80.7754 74.85L81.2754 71ZM93.9254 91.3C95.5921 91.3 96.9087 90.5667 97.8754 89.1C98.8421 87.6 99.3254 85.55 99.3254 82.95C99.3254 80.3167 99.0587 78.5167 98.5254 77.55C97.9921 76.5833 97.0254 76.1 95.6254 76.1C93.4921 76.1 91.7921 76.6 90.5254 77.6V90.9C91.5587 91.1667 92.6921 91.3 93.9254 91.3ZM110.689 96.24C109.361 96.24 108.697 95.64 108.697 94.44C108.697 93.224 109.361 92.616 110.689 92.616C112.033 92.616 112.705 93.224 112.705 94.44C112.705 95.64 112.033 96.24 110.689 96.24ZM119.838 86.256C118.366 86.256 117.63 87.52 117.63 90.048C117.63 91.328 117.83 92.224 118.23 92.736C118.646 93.232 119.238 93.48 120.006 93.48C121.222 93.48 122.294 93.368 123.222 93.144L123.942 94.992C123.43 95.328 122.742 95.616 121.878 95.856C121.014 96.08 120.174 96.192 119.358 96.192C115.902 96.192 114.174 94.192 114.174 90.192C114.174 87.856 114.774 86.176 115.974 85.152C117.046 84.256 118.35 83.808 119.886 83.808C121.422 83.808 122.702 84.096 123.726 84.672C123.742 84.832 123.75 84.984 123.75 85.128C123.75 86.04 123.542 86.904 123.126 87.72H121.014C120.79 87.32 120.654 86.84 120.606 86.28C120.414 86.264 120.158 86.256 119.838 86.256ZM130.453 96.192C128.565 96.192 127.165 95.688 126.253 94.68C125.341 93.672 124.885 92.152 124.885 90.12C124.885 88.072 125.389 86.512 126.397 85.44C127.421 84.352 128.885 83.808 130.789 83.808C132.693 83.808 134.101 84.288 135.013 85.248C135.941 86.208 136.405 87.712 136.405 89.76C136.405 91.792 135.885 93.376 134.845 94.512C133.821 95.632 132.357 96.192 130.453 96.192ZM128.341 89.904C128.341 92.464 129.109 93.744 130.645 93.744C131.429 93.744 132.005 93.456 132.373 92.88C132.757 92.288 132.949 91.328 132.949 90C132.949 87.504 132.165 86.256 130.597 86.256C129.829 86.256 129.261 86.536 128.893 87.096C128.525 87.64 128.341 88.576 128.341 89.904ZM137.876 84C138.756 83.808 139.548 83.712 140.252 83.712C140.956 83.712 141.54 83.728 142.004 83.76V84.96C142.404 84.624 142.932 84.352 143.588 84.144C144.26 83.92 144.9 83.808 145.508 83.808C147.076 83.808 148.172 84.176 148.796 84.912C149.436 85.648 149.756 86.92 149.756 88.728V93.336C150.38 93.576 150.82 93.848 151.076 94.152L150.836 96H145.316L145.076 94.152C145.3 93.848 145.74 93.576 146.396 93.336V88.584C146.396 87.72 146.252 87.144 145.964 86.856C145.692 86.552 145.196 86.4 144.476 86.4C143.756 86.4 143.036 86.656 142.316 87.168V93.336C142.94 93.576 143.38 93.848 143.636 94.152L143.396 96H137.876L137.636 94.152C137.86 93.848 138.3 93.576 138.956 93.336V86.664C138.396 86.472 137.956 86.2 137.636 85.848L137.876 84ZM156.709 85.968C155.653 85.968 155.125 86.28 155.125 86.904C155.125 87.496 155.677 87.936 156.781 88.224L158.677 88.728C160.629 89.24 161.605 90.368 161.605 92.112C161.605 93.312 161.181 94.296 160.333 95.064C159.501 95.816 158.165 96.192 156.325 96.192C154.501 96.192 153.077 95.936 152.053 95.424C152.037 95.248 152.029 95.072 152.029 94.896C152.029 94.016 152.205 93.224 152.557 92.52H154.549C154.757 92.904 154.893 93.304 154.957 93.72C155.277 93.816 155.733 93.864 156.325 93.864C157.733 93.864 158.437 93.464 158.437 92.664C158.437 92.408 158.341 92.2 158.149 92.04C157.957 91.864 157.581 91.696 157.021 91.536L155.125 90.984C154.149 90.712 153.389 90.312 152.845 89.784C152.301 89.24 152.029 88.448 152.029 87.408C152.029 86.352 152.453 85.488 153.301 84.816C154.149 84.144 155.357 83.808 156.925 83.808C158.509 83.808 159.845 84.04 160.933 84.504C160.949 84.664 160.957 84.824 160.957 84.984C160.957 85.816 160.781 86.584 160.429 87.288H158.461C158.253 86.92 158.117 86.536 158.053 86.136C157.605 86.024 157.157 85.968 156.709 85.968ZM171.593 94.992C170.489 95.792 169.185 96.192 167.681 96.192C166.193 96.192 165.153 95.88 164.561 95.256C163.969 94.632 163.673 93.616 163.673 92.208V86.664C163.113 86.472 162.673 86.2 162.353 85.848L162.593 84C163.489 83.792 164.321 83.688 165.089 83.688C165.857 83.688 166.505 83.712 167.033 83.76V91.416C167.033 92.28 167.161 92.856 167.417 93.144C167.689 93.416 168.217 93.552 169.001 93.552C169.785 93.552 170.513 93.296 171.185 92.784V86.664C170.625 86.472 170.185 86.2 169.865 85.848L170.105 84C171.001 83.792 171.833 83.688 172.601 83.688C173.369 83.688 174.017 83.712 174.545 83.76V93.12C175.105 93.232 175.545 93.368 175.865 93.528V95.424C174.905 95.936 173.697 96.192 172.241 96.192C171.841 95.904 171.625 95.504 171.593 94.992ZM176.799 78.96C177.695 78.752 178.527 78.648 179.295 78.648C180.063 78.648 180.711 78.672 181.239 78.72V93.336C181.863 93.576 182.303 93.848 182.559 94.152L182.319 96H176.799L176.559 94.152C176.783 93.848 177.223 93.576 177.879 93.336V81.624C177.319 81.432 176.879 81.16 176.559 80.808L176.799 78.96ZM187.918 80.976V84H191.35V86.016H187.918V92.088C187.918 92.6 187.99 92.976 188.134 93.216C188.278 93.44 188.622 93.552 189.166 93.552C189.71 93.552 190.294 93.432 190.918 93.192L191.638 95.064C190.406 95.688 189.142 96 187.846 96C186.566 96 185.694 95.728 185.23 95.184C184.782 94.624 184.558 93.816 184.558 92.76V86.016H183.478L183.214 84.552C183.47 84.248 183.998 83.944 184.798 83.64C184.99 82.328 185.446 81.44 186.166 80.976H187.918ZM192.767 84C193.663 83.792 194.495 83.688 195.263 83.688C196.031 83.688 196.679 83.712 197.207 83.76V93.336C197.831 93.576 198.271 93.848 198.527 94.152L198.287 96H192.767L192.527 94.152C192.751 93.848 193.191 93.576 193.847 93.336V86.664C193.287 86.472 192.847 86.2 192.527 85.848L192.767 84ZM195.479 82.344C194.151 82.344 193.487 81.744 193.487 80.544C193.487 79.328 194.151 78.72 195.479 78.72C196.823 78.72 197.495 79.328 197.495 80.544C197.495 81.744 196.823 82.344 195.479 82.344ZM199.727 84C200.607 83.808 201.399 83.712 202.103 83.712C202.807 83.712 203.391 83.728 203.855 83.76V84.96C204.255 84.624 204.783 84.352 205.439 84.144C206.111 83.92 206.751 83.808 207.359 83.808C208.927 83.808 210.023 84.176 210.647 84.912C211.287 85.648 211.607 86.92 211.607 88.728V93.336C212.231 93.576 212.671 93.848 212.927 94.152L212.687 96H207.167L206.927 94.152C207.151 93.848 207.591 93.576 208.247 93.336V88.584C208.247 87.72 208.103 87.144 207.815 86.856C207.543 86.552 207.047 86.4 206.327 86.4C205.607 86.4 204.887 86.656 204.167 87.168V93.336C204.791 93.576 205.231 93.848 205.487 94.152L205.247 96H199.727L199.487 94.152C199.711 93.848 200.151 93.576 200.807 93.336V86.664C200.247 86.472 199.807 86.2 199.487 85.848L199.727 84ZM219.281 98.544C220.705 98.544 221.417 97.688 221.417 95.976V94.92C220.633 95.4 219.649 95.64 218.465 95.64C216.961 95.64 215.801 95.2 214.985 94.32C214.185 93.44 213.785 91.976 213.785 89.928C213.785 85.848 215.657 83.808 219.401 83.808C220.361 83.808 221.257 84.016 222.089 84.432C222.249 84.144 222.489 84 222.809 84H224.777V95.808C224.777 97.568 224.337 98.872 223.457 99.72C222.593 100.568 221.249 100.992 219.425 100.992C218.465 100.992 217.473 100.88 216.449 100.656C215.425 100.432 214.649 100.152 214.121 99.816C214.105 99.672 214.097 99.528 214.097 99.384C214.097 98.504 214.305 97.656 214.721 96.84H216.833C217.009 97.176 217.137 97.624 217.217 98.184C217.825 98.424 218.513 98.544 219.281 98.544ZM217.097 89.784C217.097 90.984 217.257 91.824 217.577 92.304C217.913 92.784 218.473 93.024 219.257 93.024C220.057 93.024 220.777 92.8 221.417 92.352V86.664C220.777 86.392 220.081 86.256 219.329 86.256C217.841 86.256 217.097 87.432 217.097 89.784Z" fill="white"/>
+</svg>
--- /dev/null
--- /dev/null
++<svg viewBox="0 0 363 80" fill="none" xmlns="http://www.w3.org/2000/svg">
++<path fill-rule="evenodd" clip-rule="evenodd" d="M29.0705 42.8838C29.425 43.0864 29.8049 43.289 30.1847 43.4663C33.0209 44.783 34.3376 45.644 34.3376 47.4672C34.3376 49.4171 32.7423 51.0124 30.7925 51.0124C29.2731 51.0124 28.007 50.0502 27.5005 48.7081C25.6519 50.5819 23.1197 51.7468 20.2835 51.7468C14.6872 51.7468 10.1544 47.214 10.1544 41.6177C10.1544 41.0859 10.2304 40.5541 10.3064 40.0224C5.1152 38.503 1.1142 34.1728 0.202582 28.7537C0.0759682 27.9687 0 27.1837 0 26.3734C0 25.5631 0.0759682 24.7781 0.202582 23.9931C1.13952 18.5993 5.1152 14.2438 10.3064 12.7244C10.3032 12.7022 10.3 12.6801 10.2968 12.658C10.2242 12.1503 10.1544 11.6629 10.1544 11.1291C10.1544 5.53277 14.6872 1 20.2835 1C23.0943 1 25.6519 2.16485 27.5005 4.03873C28.007 2.69662 29.2731 1.73436 30.7925 1.73436C32.7423 1.73436 34.3376 3.32969 34.3376 5.27954C34.3376 7.25472 33.0209 8.11569 30.1847 9.43248C29.9037 9.5636 29.6366 9.70858 29.3628 9.85717C29.2665 9.90945 29.1694 9.96218 29.0705 10.0149H29.0704C28.8426 10.1415 28.6147 10.2681 28.4121 10.3947C28.2349 10.496 28.0829 10.5973 27.931 10.6986C27.8803 10.7239 27.836 10.7556 27.7917 10.7872C27.7474 10.8189 27.7031 10.8505 27.6524 10.8759C26.7915 11.433 26.0065 12.0914 25.2468 12.7751C25.2215 12.7877 25.2025 12.8067 25.1835 12.8257C25.1645 12.8447 25.1455 12.8637 25.1202 12.8764C24.8163 13.1802 24.5124 13.4841 24.2339 13.788C24.1959 13.826 24.1579 13.8703 24.1199 13.9146C24.0819 13.9589 24.0439 14.0032 24.006 14.0412C23.8864 14.1907 23.7629 14.3363 23.6401 14.481C23.4508 14.704 23.2633 14.9251 23.0943 15.1554C20.7393 18.2954 19.2959 22.2205 19.2959 26.4494C19.2959 30.6783 20.714 34.6033 23.0943 37.7433C23.3729 38.1231 23.6768 38.503 24.006 38.8575C24.0439 38.8955 24.0819 38.9398 24.1199 38.9841C24.1579 39.0284 24.1959 39.0728 24.2339 39.1107C24.4424 39.3572 24.6652 39.5753 24.8915 39.7969C24.9674 39.8712 25.0438 39.946 25.1202 40.0224C25.1455 40.035 25.1645 40.054 25.1835 40.073C25.2025 40.092 25.2215 40.111 25.2468 40.1236C26.0065 40.8074 26.7915 41.4658 27.6524 42.0229C27.7031 42.0482 27.7474 42.0798 27.7917 42.1115C27.836 42.1431 27.8803 42.1748 27.931 42.2001C28.007 42.2508 28.0893 42.3014 28.1716 42.3521C28.2539 42.4027 28.3362 42.4533 28.4121 42.504C28.5261 42.5673 28.6337 42.6306 28.7414 42.6939C28.849 42.7572 28.9566 42.8205 29.0705 42.8838ZM64.2693 12.826C69.4604 14.3453 73.4614 18.6755 74.3731 24.0946C74.4997 24.8543 74.5756 25.6646 74.5756 26.6269C74.5756 27.4372 74.4997 28.2222 74.3731 29.0072C73.4361 34.4009 69.4604 38.7565 64.2693 40.2758L64.2788 40.3423C64.3515 40.85 64.4212 41.3373 64.4212 41.8712C64.4212 47.4675 59.8884 52.0003 54.2921 52.0003C51.4813 52.0003 48.9237 50.8354 47.0751 48.9615C46.5687 50.3036 45.3025 51.2659 43.7832 51.2659C41.8333 51.2659 40.238 49.6706 40.238 47.7207C40.238 45.7455 41.5548 44.8846 44.3909 43.5678C44.6719 43.4367 44.939 43.2917 45.2128 43.1431C45.3091 43.0908 45.4063 43.0381 45.5051 42.9854C45.733 42.8587 45.9609 42.7321 46.1635 42.6055C46.3407 42.5042 46.4926 42.403 46.6445 42.3017L46.6446 42.3016C46.6953 42.2763 46.7396 42.2447 46.7839 42.213C46.8282 42.1814 46.8725 42.1497 46.9232 42.1244C47.7842 41.5673 48.5692 40.9089 49.3289 40.2252C49.3542 40.2125 49.3732 40.1935 49.3922 40.1745C49.4112 40.1555 49.4301 40.1365 49.4555 40.1239C49.7593 39.82 50.0632 39.5161 50.3418 39.2123C50.3797 39.1743 50.4177 39.13 50.4557 39.0856C50.4937 39.0413 50.5317 38.997 50.5697 38.959C50.6893 38.8096 50.8128 38.664 50.9356 38.5193C51.1248 38.2962 51.3124 38.0752 51.4813 37.8448C53.8363 34.7048 55.2797 30.7798 55.2797 26.5509C55.2797 22.322 53.8616 18.397 51.4813 15.257C51.2027 14.8771 50.8989 14.4973 50.5697 14.1428C50.5317 14.1048 50.4937 14.0605 50.4557 14.0161C50.4177 13.9718 50.3797 13.9275 50.3418 13.8895C50.0632 13.5603 49.7593 13.2565 49.4555 12.9779C49.4301 12.9652 49.4112 12.9463 49.3922 12.9273C49.3732 12.9083 49.3542 12.8893 49.3289 12.8766C48.5692 12.1929 47.7842 11.5598 46.9232 10.9774C46.8726 10.9521 46.8282 10.9204 46.7839 10.8888C46.7396 10.8571 46.6953 10.8255 46.6446 10.8001C46.5687 10.7495 46.4864 10.6988 46.4041 10.6482C46.3218 10.5976 46.2395 10.5469 46.1635 10.4963C46.0496 10.433 45.9419 10.3697 45.8343 10.3064C45.7267 10.243 45.6191 10.1797 45.5051 10.1164C45.1506 9.91385 44.7708 9.71127 44.3909 9.53401C41.5801 8.19191 40.238 7.33093 40.238 5.38108C40.238 3.43123 41.8333 1.8359 43.7832 1.8359C45.3025 1.8359 46.5687 2.79816 47.0751 4.14027C48.9237 2.26638 51.456 1.10154 54.2921 1.10154C59.8884 1.10154 64.4212 5.63431 64.4212 11.2306C64.4212 11.7624 64.3452 12.2942 64.2693 12.826Z" fill="#034AD8"/>
++<path d="M48.3405 26.475C48.3405 20.3723 43.4025 15.4343 37.2998 15.4343C31.197 15.4343 26.259 20.3723 26.259 26.475C26.259 32.5778 31.197 37.5158 37.2998 37.5158C43.4025 37.5158 48.3405 32.5778 48.3405 26.475Z" fill="#034AD8"/>
++<path fill-rule="evenodd" clip-rule="evenodd" d="M119.934 36.2635V0.832581H113.425V36.2635H119.934ZM98.4922 36.9973C101.494 36.9973 103.973 36.198 105.931 34.5994C107.888 33.0007 109.161 31.0922 109.748 28.8736L104.022 26.9651C103.696 28.0743 103.076 29.0286 102.162 29.8279C101.249 30.6272 100.026 31.0269 98.4922 31.0269C96.763 31.0269 95.303 30.4152 94.1122 29.1917C92.9214 27.9683 92.326 26.3126 92.326 24.2246C92.326 22.1366 92.9133 20.489 94.0878 19.2819C95.2623 18.0747 96.7141 17.4712 98.4432 17.4712C101.216 17.4712 102.994 18.8251 103.777 21.533L109.601 19.5755C109.046 17.3243 107.79 15.4076 105.833 13.8253C103.875 12.243 101.363 11.4518 98.2964 11.4518C94.7729 11.4518 91.8122 12.6589 89.4142 15.0732C87.0163 17.4875 85.8173 20.5379 85.8173 24.2246C85.8173 27.8786 87.0326 30.9209 89.4631 33.3514C91.8937 35.782 94.9034 36.9973 98.4922 36.9973ZM145.097 33.3759C142.699 35.7902 139.689 36.9973 136.068 36.9973C132.446 36.9973 129.437 35.7902 127.039 33.3759C124.641 30.9617 123.442 27.9112 123.442 24.2246C123.442 20.5379 124.633 17.4875 127.014 15.0732C129.429 12.6589 132.446 11.4518 136.068 11.4518C139.689 11.4518 142.699 12.6589 145.097 15.0732C147.495 17.4875 148.694 20.5379 148.694 24.2246C148.694 27.9112 147.495 30.9617 145.097 33.3759ZM136.069 31.0758C134.373 31.0758 132.921 30.4722 131.714 29.2651C130.539 28.058 129.952 26.3778 129.952 24.2245C129.952 22.0713 130.547 20.3911 131.738 19.1839C132.929 17.9768 134.373 17.3732 136.069 17.3732C137.766 17.3732 139.209 17.9768 140.4 19.1839C141.591 20.3911 142.186 22.0713 142.186 24.2245C142.186 26.3778 141.591 28.058 140.4 29.2651C139.209 30.4722 137.766 31.0758 136.069 31.0758ZM164.901 36.0919C163.677 36.6302 162.381 36.8994 161.01 36.8994C158.172 36.8994 155.937 35.9941 154.306 34.1834C152.675 32.3727 151.859 30.1134 151.859 27.4055V12.1859H158.368V26.0842C158.368 27.5197 158.743 28.686 159.493 29.5832C160.244 30.4804 161.337 30.929 162.772 30.929C164.175 30.929 165.284 30.4967 166.1 29.6321C166.915 28.7676 167.323 27.6175 167.323 26.182V12.1859H173.832V31.9078C173.832 33.4411 173.914 34.893 174.077 36.2632H167.862C167.731 35.6107 167.666 34.7461 167.666 33.6695C167.046 34.7461 166.124 35.5536 164.901 36.0919ZM189.5 36.8507C191.066 36.8507 192.444 36.5408 193.635 35.9209C194.826 35.301 195.698 34.4854 196.253 33.474C196.253 34.518 196.335 35.4479 196.498 36.2635H202.713C202.582 34.9585 202.517 33.5067 202.517 31.908V0.832581H196.106V14.5841C195.03 12.5939 192.762 11.5989 189.304 11.5989C185.943 11.5989 183.178 12.806 181.009 15.2203C178.839 17.6345 177.755 20.6197 177.755 24.1759C177.755 27.8299 178.856 30.8559 181.058 33.2538C183.26 35.6518 186.074 36.8507 189.5 36.8507ZM185.977 29.1919C187.086 30.4154 188.522 31.0271 190.283 31.0271C192.013 31.0271 193.432 30.4072 194.541 29.1674C195.65 27.9277 196.205 26.2475 196.205 24.1269C196.205 22.0388 195.65 20.3994 194.541 19.2086C193.432 18.0178 192.013 17.4224 190.283 17.4224C188.554 17.4224 187.127 18.026 186.001 19.2331C184.876 20.4402 184.313 22.0878 184.313 24.1758C184.313 26.2964 184.868 27.9685 185.977 29.1919ZM218.798 36.9973C221.8 36.9973 224.279 36.198 226.237 34.5994C228.194 33.0007 229.466 31.0922 230.054 28.8736L224.328 26.9651C224.002 28.0743 223.382 29.0286 222.468 29.8279C221.555 30.6272 220.331 31.0269 218.798 31.0269C217.069 31.0269 215.609 30.4152 214.418 29.1917C213.227 27.9683 212.632 26.3126 212.632 24.2246C212.632 22.1366 213.219 20.489 214.394 19.2819C215.568 18.0747 217.02 17.4712 218.749 17.4712C221.522 17.4712 223.3 18.8251 224.083 21.533L229.907 19.5755C229.352 17.3243 228.096 15.4076 226.139 13.8253C224.181 12.243 221.669 11.4518 218.602 11.4518C215.079 11.4518 212.118 12.6589 209.72 15.0732C207.322 17.4875 206.123 20.5379 206.123 24.2246C206.123 27.8786 207.338 30.9209 209.769 33.3514C212.2 35.782 215.209 36.9973 218.798 36.9973ZM248.562 33.3759C247.028 35.7575 244.663 36.9483 241.466 36.9483C238.986 36.9483 236.988 36.2306 235.471 34.7951C233.954 33.3595 233.195 31.663 233.195 29.7055C233.195 27.6501 233.864 26.0026 235.202 24.7628C236.539 23.5231 238.268 22.7401 240.389 22.4138L246.311 21.5329C247.518 21.3698 248.121 20.7989 248.121 19.8201C248.121 18.9066 247.77 18.1562 247.069 17.569C246.368 16.9817 245.364 16.6881 244.059 16.6881C242.689 16.6881 241.604 17.0633 240.805 17.8137C240.006 18.564 239.557 19.4939 239.459 20.6031L233.685 19.3797C233.913 17.2917 234.941 15.4483 236.768 13.8497C238.595 12.2511 241.009 11.4518 244.01 11.4518C247.599 11.4518 250.242 12.3082 251.938 14.021C253.635 15.7338 254.483 17.9279 254.483 20.6031V32.446C254.483 33.8815 254.581 35.1539 254.777 36.2632H248.806C248.643 35.5454 248.562 34.583 248.562 33.3759ZM242.836 32.1037C241.857 32.1037 241.09 31.8346 240.536 31.2963C239.981 30.7579 239.704 30.0973 239.704 29.3143C239.704 27.5851 240.699 26.5738 242.689 26.2801L248.121 25.4482V26.5248C248.121 28.515 247.624 29.9423 246.629 30.8069C245.633 31.6714 244.369 32.1037 242.836 32.1037ZM265.918 22.4142V36.2636H259.41V12.1863H265.723V15.1715C266.408 13.9969 267.386 13.0998 268.659 12.4799C269.931 11.86 271.269 11.5501 272.672 11.5501C275.51 11.5501 277.672 12.4391 279.156 14.2172C280.64 15.9952 281.383 18.2872 281.383 21.0929V36.2636H274.874V22.2185C274.874 20.783 274.507 19.6248 273.773 18.7439C273.039 17.863 271.921 17.4226 270.421 17.4226C269.05 17.4226 267.957 17.8957 267.142 18.8418C266.326 19.7879 265.918 20.9787 265.918 22.4142ZM292.866 36.2636V22.4142C292.866 20.9787 293.274 19.7879 294.09 18.8418C294.905 17.8957 295.998 17.4226 297.368 17.4226C298.869 17.4226 299.987 17.863 300.721 18.7439C301.455 19.6248 301.822 20.783 301.822 22.2185V36.2636H308.33V21.0929C308.33 18.2872 307.588 15.9952 306.104 14.2172C304.619 12.4391 302.458 11.5501 299.619 11.5501C298.217 11.5501 296.879 11.86 295.607 12.4799C294.334 13.0998 293.355 13.9969 292.67 15.1715V12.1863H286.357V36.2636H292.866ZM333.149 33.3759C330.751 35.7901 327.742 36.9972 324.12 36.9972C320.499 36.9972 317.489 35.7901 315.091 33.3759C312.693 30.9616 311.494 27.9111 311.494 24.2245C311.494 20.5379 312.685 17.4874 315.067 15.0731C317.481 12.6589 320.499 11.4518 324.12 11.4518C327.742 11.4518 330.751 12.6589 333.149 15.0731C335.547 17.4874 336.746 20.5379 336.746 24.2245C336.746 27.9111 335.547 30.9616 333.149 33.3759ZM324.121 31.0757C322.425 31.0757 320.973 30.4722 319.766 29.265C318.591 28.0579 318.004 26.3777 318.004 24.2245C318.004 22.0712 318.6 20.391 319.79 19.1839C320.981 17.9767 322.425 17.3732 324.121 17.3732C325.818 17.3732 327.262 17.9767 328.452 19.1839C329.643 20.391 330.239 22.0712 330.239 24.2245C330.239 26.3777 329.643 28.0579 328.452 29.265C327.262 30.4722 325.818 31.0757 324.121 31.0757ZM346.762 22.4142V36.2636H340.254V12.1863H346.567V15.1715C347.252 13.9969 348.23 13.0998 349.503 12.4799C350.775 11.86 352.113 11.5501 353.516 11.5501C356.354 11.5501 358.515 12.4391 360 14.2172C361.484 15.9952 362.227 18.2872 362.227 21.0929V36.2636H355.718V22.2185C355.718 20.783 355.351 19.6248 354.617 18.7439C353.883 17.863 352.765 17.4226 351.265 17.4226C349.894 17.4226 348.801 17.8957 347.986 18.8418C347.17 19.7879 346.762 20.9787 346.762 22.4142Z" fill="#034AD8"/>
++<path d="M313.211 64.2638C318.224 64.2638 320.862 60.5706 320.862 60.5706L319.015 58.724C319.015 58.724 317.037 61.6258 313.211 61.6258C309.386 61.6258 306.353 58.5921 306.353 54.767C306.353 50.9419 309.386 47.9082 313.211 47.9082C317.037 47.9082 318.883 50.6781 318.883 50.6781L320.73 48.8315C320.73 48.8315 318.224 45.2702 313.211 45.2702C307.672 45.2702 303.451 49.491 303.451 54.767C303.451 60.043 307.672 64.2638 313.211 64.2638ZM324.294 64H327.196V50.4143L333.923 58.9878L340.65 50.4143V64H343.552V45.534H340.914L333.923 54.5032L326.932 45.534H324.294V64ZM353.568 64.2638C357.657 64.2638 360.163 61.7577 360.163 58.8559C360.163 51.9971 350.402 54.5032 350.402 50.4143C350.402 49.0953 351.589 47.9082 353.832 47.9082C356.338 47.9082 357.657 49.6229 357.657 49.6229L359.635 47.6444C359.635 47.6444 357.657 45.2702 353.832 45.2702C349.875 45.2702 347.5 47.6444 347.5 50.4143C347.5 57.2731 357.261 54.767 357.261 58.8559C357.261 60.3068 355.942 61.6258 353.568 61.6258C350.402 61.6258 348.951 59.5154 348.951 59.5154L346.973 61.4939C346.973 61.4939 349.083 64.2638 353.568 64.2638Z" fill="#034AD8"/>
++</svg>
--- /dev/null
--- /dev/null
++<svg viewBox="0 0 363 80" fill="none" xmlns="http://www.w3.org/2000/svg">
++<path fill-rule="evenodd" clip-rule="evenodd" d="M29.0705 42.8838C29.425 43.0864 29.8049 43.289 30.1847 43.4663C33.0209 44.783 34.3376 45.644 34.3376 47.4672C34.3376 49.4171 32.7423 51.0124 30.7925 51.0124C29.2731 51.0124 28.007 50.0502 27.5005 48.7081C25.6519 50.5819 23.1197 51.7468 20.2835 51.7468C14.6872 51.7468 10.1544 47.214 10.1544 41.6177C10.1544 41.0859 10.2304 40.5541 10.3064 40.0224C5.1152 38.503 1.1142 34.1728 0.202582 28.7537C0.0759682 27.9687 0 27.1837 0 26.3734C0 25.5631 0.0759682 24.7781 0.202582 23.9931C1.13952 18.5993 5.1152 14.2438 10.3064 12.7244C10.3032 12.7022 10.3 12.6801 10.2968 12.658C10.2242 12.1503 10.1544 11.6629 10.1544 11.1291C10.1544 5.53277 14.6872 1 20.2835 1C23.0943 1 25.6519 2.16485 27.5005 4.03873C28.007 2.69662 29.2731 1.73436 30.7925 1.73436C32.7423 1.73436 34.3376 3.32969 34.3376 5.27954C34.3376 7.25472 33.0209 8.11569 30.1847 9.43248C29.9037 9.5636 29.6366 9.70858 29.3628 9.85717C29.2665 9.90945 29.1694 9.96218 29.0705 10.0149H29.0704C28.8426 10.1415 28.6147 10.2681 28.4121 10.3947C28.2349 10.496 28.0829 10.5973 27.931 10.6986C27.8803 10.7239 27.836 10.7556 27.7917 10.7872C27.7474 10.8189 27.7031 10.8505 27.6524 10.8759C26.7915 11.433 26.0065 12.0914 25.2468 12.7751C25.2215 12.7877 25.2025 12.8067 25.1835 12.8257C25.1645 12.8447 25.1455 12.8637 25.1202 12.8764C24.8163 13.1802 24.5124 13.4841 24.2339 13.788C24.1959 13.826 24.1579 13.8703 24.1199 13.9146C24.0819 13.9589 24.0439 14.0032 24.006 14.0412C23.8864 14.1907 23.7629 14.3363 23.6401 14.481C23.4508 14.704 23.2633 14.9251 23.0943 15.1554C20.7393 18.2954 19.2959 22.2205 19.2959 26.4494C19.2959 30.6783 20.714 34.6033 23.0943 37.7433C23.3729 38.1231 23.6768 38.503 24.006 38.8575C24.0439 38.8955 24.0819 38.9398 24.1199 38.9841C24.1579 39.0284 24.1959 39.0728 24.2339 39.1107C24.4424 39.3572 24.6652 39.5753 24.8915 39.7969C24.9674 39.8712 25.0438 39.946 25.1202 40.0224C25.1455 40.035 25.1645 40.054 25.1835 40.073C25.2025 40.092 25.2215 40.111 25.2468 40.1236C26.0065 40.8074 26.7915 41.4658 27.6524 42.0229C27.7031 42.0482 27.7474 42.0798 27.7917 42.1115C27.836 42.1431 27.8803 42.1748 27.931 42.2001C28.007 42.2508 28.0893 42.3014 28.1716 42.3521C28.2539 42.4027 28.3362 42.4533 28.4121 42.504C28.5261 42.5673 28.6337 42.6306 28.7414 42.6939C28.849 42.7572 28.9566 42.8205 29.0705 42.8838ZM64.2693 12.826C69.4604 14.3453 73.4614 18.6755 74.3731 24.0946C74.4997 24.8543 74.5756 25.6646 74.5756 26.6269C74.5756 27.4372 74.4997 28.2222 74.3731 29.0072C73.4361 34.4009 69.4604 38.7565 64.2693 40.2758L64.2788 40.3423C64.3515 40.85 64.4212 41.3373 64.4212 41.8712C64.4212 47.4675 59.8884 52.0003 54.2921 52.0003C51.4813 52.0003 48.9237 50.8354 47.0751 48.9615C46.5687 50.3036 45.3025 51.2659 43.7832 51.2659C41.8333 51.2659 40.238 49.6706 40.238 47.7207C40.238 45.7455 41.5548 44.8846 44.3909 43.5678C44.6719 43.4367 44.939 43.2917 45.2128 43.1431C45.3091 43.0908 45.4063 43.0381 45.5051 42.9854C45.733 42.8587 45.9609 42.7321 46.1635 42.6055C46.3407 42.5042 46.4926 42.403 46.6445 42.3017L46.6446 42.3016C46.6953 42.2763 46.7396 42.2447 46.7839 42.213C46.8282 42.1814 46.8725 42.1497 46.9232 42.1244C47.7842 41.5673 48.5692 40.9089 49.3289 40.2252C49.3542 40.2125 49.3732 40.1935 49.3922 40.1745C49.4112 40.1555 49.4301 40.1365 49.4555 40.1239C49.7593 39.82 50.0632 39.5161 50.3418 39.2123C50.3797 39.1743 50.4177 39.13 50.4557 39.0856C50.4937 39.0413 50.5317 38.997 50.5697 38.959C50.6893 38.8096 50.8128 38.664 50.9356 38.5193C51.1248 38.2962 51.3124 38.0752 51.4813 37.8448C53.8363 34.7048 55.2797 30.7798 55.2797 26.5509C55.2797 22.322 53.8616 18.397 51.4813 15.257C51.2027 14.8771 50.8989 14.4973 50.5697 14.1428C50.5317 14.1048 50.4937 14.0605 50.4557 14.0161C50.4177 13.9718 50.3797 13.9275 50.3418 13.8895C50.0632 13.5603 49.7593 13.2565 49.4555 12.9779C49.4301 12.9652 49.4112 12.9463 49.3922 12.9273C49.3732 12.9083 49.3542 12.8893 49.3289 12.8766C48.5692 12.1929 47.7842 11.5598 46.9232 10.9774C46.8726 10.9521 46.8282 10.9204 46.7839 10.8888C46.7396 10.8571 46.6953 10.8255 46.6446 10.8001C46.5687 10.7495 46.4864 10.6988 46.4041 10.6482C46.3218 10.5976 46.2395 10.5469 46.1635 10.4963C46.0496 10.433 45.9419 10.3697 45.8343 10.3064C45.7267 10.243 45.6191 10.1797 45.5051 10.1164C45.1506 9.91385 44.7708 9.71127 44.3909 9.53401C41.5801 8.19191 40.238 7.33093 40.238 5.38108C40.238 3.43123 41.8333 1.8359 43.7832 1.8359C45.3025 1.8359 46.5687 2.79816 47.0751 4.14027C48.9237 2.26638 51.456 1.10154 54.2921 1.10154C59.8884 1.10154 64.4212 5.63431 64.4212 11.2306C64.4212 11.7624 64.3452 12.2942 64.2693 12.826Z" fill="white"/>
++<path d="M48.3405 26.475C48.3405 20.3723 43.4025 15.4343 37.2998 15.4343C31.197 15.4343 26.259 20.3723 26.259 26.475C26.259 32.5778 31.197 37.5158 37.2998 37.5158C43.4025 37.5158 48.3405 32.5778 48.3405 26.475Z" fill="white"/>
++<path fill-rule="evenodd" clip-rule="evenodd" d="M119.934 36.2635V0.832581H113.425V36.2635H119.934ZM98.4922 36.9973C101.494 36.9973 103.973 36.198 105.931 34.5994C107.888 33.0007 109.161 31.0922 109.748 28.8736L104.022 26.9651C103.696 28.0743 103.076 29.0286 102.162 29.8279C101.249 30.6272 100.026 31.0269 98.4922 31.0269C96.763 31.0269 95.303 30.4152 94.1122 29.1917C92.9214 27.9683 92.326 26.3126 92.326 24.2246C92.326 22.1366 92.9133 20.489 94.0878 19.2819C95.2623 18.0747 96.7141 17.4712 98.4432 17.4712C101.216 17.4712 102.994 18.8251 103.777 21.533L109.601 19.5755C109.046 17.3243 107.79 15.4076 105.833 13.8253C103.875 12.243 101.363 11.4518 98.2964 11.4518C94.7729 11.4518 91.8122 12.6589 89.4142 15.0732C87.0163 17.4875 85.8173 20.5379 85.8173 24.2246C85.8173 27.8786 87.0326 30.9209 89.4631 33.3514C91.8937 35.782 94.9034 36.9973 98.4922 36.9973ZM145.097 33.3759C142.699 35.7902 139.689 36.9973 136.068 36.9973C132.446 36.9973 129.437 35.7902 127.039 33.3759C124.641 30.9617 123.442 27.9112 123.442 24.2246C123.442 20.5379 124.633 17.4875 127.014 15.0732C129.429 12.6589 132.446 11.4518 136.068 11.4518C139.689 11.4518 142.699 12.6589 145.097 15.0732C147.495 17.4875 148.694 20.5379 148.694 24.2246C148.694 27.9112 147.495 30.9617 145.097 33.3759ZM136.069 31.0758C134.373 31.0758 132.921 30.4722 131.714 29.2651C130.539 28.058 129.952 26.3778 129.952 24.2245C129.952 22.0713 130.547 20.3911 131.738 19.1839C132.929 17.9768 134.373 17.3732 136.069 17.3732C137.766 17.3732 139.209 17.9768 140.4 19.1839C141.591 20.3911 142.186 22.0713 142.186 24.2245C142.186 26.3778 141.591 28.058 140.4 29.2651C139.209 30.4722 137.766 31.0758 136.069 31.0758ZM164.901 36.0919C163.677 36.6302 162.381 36.8994 161.01 36.8994C158.172 36.8994 155.937 35.9941 154.306 34.1834C152.675 32.3727 151.859 30.1134 151.859 27.4055V12.1859H158.368V26.0842C158.368 27.5197 158.743 28.686 159.493 29.5832C160.244 30.4804 161.337 30.929 162.772 30.929C164.175 30.929 165.284 30.4967 166.1 29.6321C166.915 28.7676 167.323 27.6175 167.323 26.182V12.1859H173.832V31.9078C173.832 33.4411 173.914 34.893 174.077 36.2632H167.862C167.731 35.6107 167.666 34.7461 167.666 33.6695C167.046 34.7461 166.124 35.5536 164.901 36.0919ZM189.5 36.8507C191.066 36.8507 192.444 36.5408 193.635 35.9209C194.826 35.301 195.698 34.4854 196.253 33.474C196.253 34.518 196.335 35.4479 196.498 36.2635H202.713C202.582 34.9585 202.517 33.5067 202.517 31.908V0.832581H196.106V14.5841C195.03 12.5939 192.762 11.5989 189.304 11.5989C185.943 11.5989 183.178 12.806 181.009 15.2203C178.839 17.6345 177.755 20.6197 177.755 24.1759C177.755 27.8299 178.856 30.8559 181.058 33.2538C183.26 35.6518 186.074 36.8507 189.5 36.8507ZM185.977 29.1919C187.086 30.4154 188.522 31.0271 190.283 31.0271C192.013 31.0271 193.432 30.4072 194.541 29.1674C195.65 27.9277 196.205 26.2475 196.205 24.1269C196.205 22.0388 195.65 20.3994 194.541 19.2086C193.432 18.0178 192.013 17.4224 190.283 17.4224C188.554 17.4224 187.127 18.026 186.001 19.2331C184.876 20.4402 184.313 22.0878 184.313 24.1758C184.313 26.2964 184.868 27.9685 185.977 29.1919ZM218.798 36.9973C221.8 36.9973 224.279 36.198 226.237 34.5994C228.194 33.0007 229.466 31.0922 230.054 28.8736L224.328 26.9651C224.002 28.0743 223.382 29.0286 222.468 29.8279C221.555 30.6272 220.331 31.0269 218.798 31.0269C217.069 31.0269 215.609 30.4152 214.418 29.1917C213.227 27.9683 212.632 26.3126 212.632 24.2246C212.632 22.1366 213.219 20.489 214.394 19.2819C215.568 18.0747 217.02 17.4712 218.749 17.4712C221.522 17.4712 223.3 18.8251 224.083 21.533L229.907 19.5755C229.352 17.3243 228.096 15.4076 226.139 13.8253C224.181 12.243 221.669 11.4518 218.602 11.4518C215.079 11.4518 212.118 12.6589 209.72 15.0732C207.322 17.4875 206.123 20.5379 206.123 24.2246C206.123 27.8786 207.338 30.9209 209.769 33.3514C212.2 35.782 215.209 36.9973 218.798 36.9973ZM248.562 33.3759C247.028 35.7575 244.663 36.9483 241.466 36.9483C238.986 36.9483 236.988 36.2306 235.471 34.7951C233.954 33.3595 233.195 31.663 233.195 29.7055C233.195 27.6501 233.864 26.0026 235.202 24.7628C236.539 23.5231 238.268 22.7401 240.389 22.4138L246.311 21.5329C247.518 21.3698 248.121 20.7989 248.121 19.8201C248.121 18.9066 247.77 18.1562 247.069 17.569C246.368 16.9817 245.364 16.6881 244.059 16.6881C242.689 16.6881 241.604 17.0633 240.805 17.8137C240.006 18.564 239.557 19.4939 239.459 20.6031L233.685 19.3797C233.913 17.2917 234.941 15.4483 236.768 13.8497C238.595 12.2511 241.009 11.4518 244.01 11.4518C247.599 11.4518 250.242 12.3082 251.938 14.021C253.635 15.7338 254.483 17.9279 254.483 20.6031V32.446C254.483 33.8815 254.581 35.1539 254.777 36.2632H248.806C248.643 35.5454 248.562 34.583 248.562 33.3759ZM242.836 32.1037C241.857 32.1037 241.09 31.8346 240.536 31.2963C239.981 30.7579 239.704 30.0973 239.704 29.3143C239.704 27.5851 240.699 26.5738 242.689 26.2801L248.121 25.4482V26.5248C248.121 28.515 247.624 29.9423 246.629 30.8069C245.633 31.6714 244.369 32.1037 242.836 32.1037ZM265.918 22.4142V36.2636H259.41V12.1863H265.723V15.1715C266.408 13.9969 267.386 13.0998 268.659 12.4799C269.931 11.86 271.269 11.5501 272.672 11.5501C275.51 11.5501 277.672 12.4391 279.156 14.2172C280.64 15.9952 281.383 18.2872 281.383 21.0929V36.2636H274.874V22.2185C274.874 20.783 274.507 19.6248 273.773 18.7439C273.039 17.863 271.921 17.4226 270.421 17.4226C269.05 17.4226 267.957 17.8957 267.142 18.8418C266.326 19.7879 265.918 20.9787 265.918 22.4142ZM292.866 36.2636V22.4142C292.866 20.9787 293.274 19.7879 294.09 18.8418C294.905 17.8957 295.998 17.4226 297.368 17.4226C298.869 17.4226 299.987 17.863 300.721 18.7439C301.455 19.6248 301.822 20.783 301.822 22.2185V36.2636H308.33V21.0929C308.33 18.2872 307.588 15.9952 306.104 14.2172C304.619 12.4391 302.458 11.5501 299.619 11.5501C298.217 11.5501 296.879 11.86 295.607 12.4799C294.334 13.0998 293.355 13.9969 292.67 15.1715V12.1863H286.357V36.2636H292.866ZM333.149 33.3759C330.751 35.7901 327.742 36.9972 324.12 36.9972C320.499 36.9972 317.489 35.7901 315.091 33.3759C312.693 30.9616 311.494 27.9111 311.494 24.2245C311.494 20.5379 312.685 17.4874 315.067 15.0731C317.481 12.6589 320.499 11.4518 324.12 11.4518C327.742 11.4518 330.751 12.6589 333.149 15.0731C335.547 17.4874 336.746 20.5379 336.746 24.2245C336.746 27.9111 335.547 30.9616 333.149 33.3759ZM324.121 31.0757C322.425 31.0757 320.973 30.4722 319.766 29.265C318.591 28.0579 318.004 26.3777 318.004 24.2245C318.004 22.0712 318.6 20.391 319.79 19.1839C320.981 17.9767 322.425 17.3732 324.121 17.3732C325.818 17.3732 327.262 17.9767 328.452 19.1839C329.643 20.391 330.239 22.0712 330.239 24.2245C330.239 26.3777 329.643 28.0579 328.452 29.265C327.262 30.4722 325.818 31.0757 324.121 31.0757ZM346.762 22.4142V36.2636H340.254V12.1863H346.567V15.1715C347.252 13.9969 348.23 13.0998 349.503 12.4799C350.775 11.86 352.113 11.5501 353.516 11.5501C356.354 11.5501 358.515 12.4391 360 14.2172C361.484 15.9952 362.227 18.2872 362.227 21.0929V36.2636H355.718V22.2185C355.718 20.783 355.351 19.6248 354.617 18.7439C353.883 17.863 352.765 17.4226 351.265 17.4226C349.894 17.4226 348.801 17.8957 347.986 18.8418C347.17 19.7879 346.762 20.9787 346.762 22.4142Z" fill="white"/>
++<path d="M313.211 64.2638C318.224 64.2638 320.862 60.5706 320.862 60.5706L319.015 58.724C319.015 58.724 317.037 61.6258 313.211 61.6258C309.386 61.6258 306.353 58.5921 306.353 54.767C306.353 50.9419 309.386 47.9082 313.211 47.9082C317.037 47.9082 318.883 50.6781 318.883 50.6781L320.73 48.8315C320.73 48.8315 318.224 45.2702 313.211 45.2702C307.672 45.2702 303.451 49.491 303.451 54.767C303.451 60.043 307.672 64.2638 313.211 64.2638ZM324.294 64H327.196V50.4143L333.923 58.9878L340.65 50.4143V64H343.552V45.534H340.914L333.923 54.5032L326.932 45.534H324.294V64ZM353.568 64.2638C357.657 64.2638 360.163 61.7577 360.163 58.8559C360.163 51.9971 350.402 54.5032 350.402 50.4143C350.402 49.0953 351.589 47.9082 353.832 47.9082C356.338 47.9082 357.657 49.6229 357.657 49.6229L359.635 47.6444C359.635 47.6444 357.657 45.2702 353.832 45.2702C349.875 45.2702 347.5 47.6444 347.5 50.4143C347.5 57.2731 357.261 54.767 357.261 58.8559C357.261 60.3068 355.942 61.6258 353.568 61.6258C350.402 61.6258 348.951 59.5154 348.951 59.5154L346.973 61.4939C346.973 61.4939 349.083 64.2638 353.568 64.2638Z" fill="#FDFDFD"/>
++</svg>
--- /dev/null
- name = "Your Company?"
- link = "https://bep.is/en/hugo-sponsor-2023-01/"
- logo = "/images/sponsors/your-company.svg"
- utm_campaign = "hugosponsor"
- show_on_hover = true
- bgcolor = "#004887"
+[[banners]]
+ name = "Linode"
+ link = "https://www.linode.com/"
+ logo = "images/sponsors/linode-logo.svg"
+ utm_campaign = "hugosponsor"
++ bgcolor = "#ffffff"
+
+[[banners]]
- logo = "/images/sponsors/your-company.svg"
++ name = "CloudCannon"
++ link = "https://cloudcannon.com/hugo-cms/"
++ logo = "/images/sponsors/cloudcannon-white.svg"
++ utm_campaign = "HugoSponsorship"
++ utm_source = "sponsor"
++ utm_content = "gohugo"
++ bgcolor = "#034AD8"
+
+[[banners]]
+ name = "Your Company?"
+ link = "https://bep.is/en/hugo-sponsor-2023-01/"
- bgcolor = "#004887"
+ utm_campaign = "hugosponsor"
+ show_on_hover = true
++ bgcolor = "#4e4f4f"
--- /dev/null
- {{ $url := printf "%s?%s%s" .link $query_params (querify "utm_source" $utmSource "utm_medium" "banner" "utm_campaign" (.utm_campaign | default "hugosponsor")) | safeURL }}
+{{ $classes_box := "ba b--dark-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l " }}
+{{ $gtag := .gtag | default "unknown" }}
+{{ $classes_box := "ba b--dark-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l " }}
+{{ $gtag := .gtag | default "unknown" }}
+{{ $isFooter := (eq $gtag "footer") }}
+{{ $utmSource := cond $isFooter "hugofooter" "hugohome" }}
+{{ with .cx.Site.Data.sponsors }}
+ <style>
+ a.show-on-hover {
+ opacity: 0;
+ }
+ a.show-on-hover:hover {
+ opacity: 1;
+ }
+ </style>
+ <section
+ class="{{ $.classes_section | default "bg-primary-color-dark b--dark-gray bb bt ph5 pv4 w-100" }}">
+ <div class="center mw9">
+ <h3 class="b f3 mv0 light-gray">Hugo Sponsors</h3>
+ <div class="flex-ns flex-wrap center justify-between pt3">
+ {{ range .banners }}
+ <div
+ class="{{ $classes_box }} o-100"
+ style="background-color: {{ .bgcolor }};">
+ {{ $query_params := .query_params | default "" }}
- {{ $logo.Content | safeHTML }}
++ {{ $url := printf "%s?%s%s" .link $query_params (querify "utm_source" (.utm_source | default $utmSource ) "utm_medium" "banner" "utm_campaign" (.utm_campaign | default "hugosponsor") "utm_content" (.utm_content | default "gohugoio")) | safeURL }}
+ {{ $logo := resources.Get .logo }}
+ {{ if hugo.IsProduction }}
+ {{ $gtagID := printf "Sponsor %s %s" .name $gtag | title }}
+ <a
+ href="{{ $url }}"
+ onclick="trackOutboundLink({{ printf "'%s', '%s'" $gtagID $url | safeJS }});"
+ class="w-100 grow pa3{{ if .show_on_hover }}
+ show-on-hover
+ {{ end }}"
+ style="">
- {{ $logo.Content | safeHTML }}
++ {{ with $logo }}{{ .Content | safeHTML }}{{ end }}
+ </a>
+ {{ else }}
+ <a
+ href="{{ $url }}"
+ class="w-100 grow pa3{{ if .show_on_hover }}
+ show-on-hover
+ {{ end }}">
++ {{ with $logo }}{{ .Content | safeHTML }}{{ end }}
+ </a>
+ {{ end }}
+ </div>
+ {{ end }}
+ </div>
+ </div>
+ </section>
+{{ end }}
--- /dev/null
- # github.com/gohugoio/gohugoioTheme v0.0.0-20230527124826-78bc315d7b8a
++# github.com/gohugoio/gohugoioTheme v0.0.0-20230630055807-9874cd863bc5
--- /dev/null
- name = "Getting Started"
+[[docs]]
+ name = "About Hugo"
+ weight = 10
+ identifier = "about"
+ url = "/about/"
+
+[[docs]]
+ name = "Installation"
+ weight = 20
+ identifier = "installation"
+ url = "/installation/"
+
+[[docs]]
- name = "Content Management"
++ name = "Getting started"
+ weight = 30
+ identifier = "getting-started"
+ url = "/getting-started/"
+
+[[docs]]
+ name = "Hugo Modules"
+ weight = 40
+ identifier = "modules"
+ post = "break"
+ url = "/hugo-modules/"
+
+# Core menus
+
+[[docs]]
- identifier = "pipes"
++ name = "Content management"
+ weight = 50
+ identifier = "content-management"
+ post = "expanded"
+ url = "/content-management/"
+
+[[docs]]
+ name = "Templates"
+ weight = 60
+ identifier = "templates"
+ url = "/templates/"
+
+[[docs]]
+ name = "Functions"
+ weight = 70
+ identifier = "functions"
+ url = "/functions/"
+
+[[docs]]
+ name = "Variables"
+ weight = 80
+ identifier = "variables"
+ url = "/variables/"
+
+[[docs]]
+ name = "Hugo Pipes"
+ weight = 90
- name = "Tools"
++ identifier = "hugo-pipes"
+ url = "/hugo-pipes/"
+
+[[docs]]
+ name = "CLI"
+ weight = 100
+ post = "break"
+ identifier = "commands"
+ url = "/commands/"
+
+# Low level items
+
+[[docs]]
+ name = "Troubleshooting"
+ weight = 110
+ identifier = "troubleshooting"
+ url = "/troubleshooting/"
+
+[[docs]]
- identifier = "tools"
++ name = "Developer tools"
+ weight = 120
- name = "Hosting & Deployment"
++ identifier = "developer-tools"
+ url = "/tools/"
+
+[[docs]]
++ name = "Hosting and deployment"
+ weight = 130
+ identifier = "hosting-and-deployment"
+ url = "/hosting-and-deployment/"
+
+[[docs]]
+ name = "Contribute"
+ weight = 140
+ post = "break"
+ identifier = "contribute"
+ url = "/contribute/"
+
+######## QUICKLINKS
+
+[[quicklinks]]
+ name = "Fundamentals"
+ weight = 1
+ identifier = "fundamentals"
+ url = "/tags/fundamentals/"
+
+######## GLOBAL ITEMS TO BE SHARED WITH THE HUGO SITES
+
+[[global]]
+ name = "News"
+ weight = 1
+ identifier = "news"
+ url = "/news/"
+
+[[global]]
+ name = "Docs"
+ weight = 5
+ identifier = "docs"
+ url = "/documentation/"
+
+[[global]]
+ name = "Themes"
+ weight = 10
+ identifier = "themes"
+ url = "https://themes.gohugo.io/"
+
+[[global]]
+ name = "Showcase"
+ weight = 20
+ identifier = "showcase"
+ url = "/showcase/"
+
+# Anything with a weight > 100 gets an external icon
+
+[[global]]
+ name = "Community"
+ weight = 150
+ icon = true
+ identifier = "community"
+ post = "external"
+ url = "https://discourse.gohugo.io/"
+
+[[global]]
+ name = "GitHub"
+ weight = 200
+ identifier = "github"
+ post = "external"
+ url = "https://github.com/gohugoio/hugo"
--- /dev/null
- title: "The world’s fastest framework for building websites"
+---
++title: The world’s fastest framework for building websites
+date: 2017-03-02T12:00:00-05:00
+features:
+ - heading: Blistering Speed
+ image_path: /images/icon-fast.svg
+ tagline: What's modern about waiting for your site to build?
+ copy: Hugo is the fastest tool of its kind. At <1 ms per page, the average site builds in less than a second.
+
+ - heading: Robust Content Management
+ image_path: /images/icon-content-management.svg
+ tagline: Flexibility rules. Hugo is a content strategist's dream.
+ copy: Hugo supports unlimited content types, taxonomies, menus, dynamic API-driven content, and more, all without plugins.
+
+ - heading: Shortcodes
+ image_path: /images/icon-shortcodes.svg
+ tagline: Hugo's shortcodes are Markdown's hidden superpower.
+ copy: We love the beautiful simplicity of markdown’s syntax, but there are times when we want more flexibility. Hugo shortcodes allow for both beauty and flexibility.
+
+ - heading: Built-in Templates
+ image_path: /images/icon-built-in-templates.svg
+ tagline: Hugo has common patterns to get your work done quickly.
+ copy: Hugo ships with pre-made templates to make quick work of SEO, commenting, analytics and other functions. One line of code, and you're done.
+
+ - heading: Multilingual and i18n
+ image_path: /images/icon-multilingual2.svg
+ tagline: Polyglot baked in.
+ copy: Hugo provides full i18n support for multi-language sites with the same straightforward development experience Hugo users love in single-language sites.
+
+ - heading: Custom Outputs
+ image_path: /images/icon-custom-outputs.svg
+ tagline: HTML not enough?
+ copy: Hugo allows you to output your content in multiple formats, including JSON or AMP, and makes it easy to create your own.
+sections:
+ - heading: "300+ Themes"
+ cta: Check out the Hugo themes.
+ link: https://themes.gohugo.io/
+ color_classes: bg-accent-color white
+ image: /images/homepage-screenshot-hugo-themes.jpg
+ copy: "Hugo provides a robust theming system that is easy to implement but capable of producing even the most complicated websites."
+ - heading: "Capable Templating"
+ cta: Get Started.
+ link: templates/
+ color_classes: bg-primary-color-light black
+ image: /images/home-page-templating-example.png
+ copy: "Hugo's Go-based templating provides just the right amount of logic to build anything from the simple to complex."
+---
+
+Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again.
--- /dev/null
- linktitle: Overview
+---
+title: About Hugo
- weight: 1
- weight: 1
++linkTitle: Overview
+description: Hugo's features, roadmap, license, and motivation.
+categories: []
+keywords: []
+menu:
+ docs:
++ identifier: about-hugo-overview
+ parent: about
++ weight: 10
++weight: 10
+aliases: [/about-hugo/,/docs/]
+---
+
+Hugo is not your average static site generator.
--- /dev/null
- title: The Benefits of Static Site Generators
- linktitle: The Benefits of Static
+---
- weight: 30
- weight: 30
++title: Benefits of static site generators
++linkTitle: Static site generators
+description: Improved performance, security and ease of use are just a few of the reasons static site generators are so appealing.
+keywords: [ssg,static,performance,security]
+menu:
+ docs:
+ parent: about
- ## More on Static Site Generators
++ weight: 40
++weight: 40
+---
+
+The purpose of website generators is to render content into HTML files. Most are "dynamic site generators." That means the HTTP server---i.e., the program that sends files to the browser to be viewed---runs the generator to create a new HTML file every time an end user requests a page.
+
+Over time, dynamic site generators were programmed to cache their HTML files to prevent unnecessary delays in delivering pages to end users. A cached page is a static version of a web page.
+
+Hugo takes caching a step further and all HTML files are rendered on your computer. You can review the files locally before copying them to the computer hosting the HTTP server. Since the HTML files aren't generated dynamically, we say that Hugo is a *static site generator*.
+
+This has many benefits. The most noticeable is performance. HTTP servers are *very* good at sending files---so good, in fact, that you can effectively serve the same number of pages with a fraction of the memory and CPU needed for a dynamic site.
+
++## More on static site generators
+
+* ["An Introduction to Static Site Generators", David Walsh]
+* ["Hugo vs. WordPress page load speed comparison: Hugo leaves WordPress in its dust", GettingThingsTech][hugovwordpress]
+* ["Static Site Generators", O'Reilly]
+* [StaticGen: Top Open-Source Static Site Generators (GitHub Stars)]
+* ["Top 10 Static Website Generators", Netlify blog]
+* ["The Resurgence of Static", dotCMS][dotcms]
+
+["An Introduction to Static Site Generators", David Walsh]: https://davidwalsh.name/introduction-static-site-generators
+["Static Site Generators", O'Reilly]: https://github.com/gohugoio/hugoDocs/files/1242701/static-site-generators.pdf
+["Top 10 Static Website Generators", Netlify blog]: https://www.netlify.com/blog/2016/05/02/top-ten-static-website-generators/
+[hugovwordpress]: https://gettingthingstech.com/hugo-vs.-wordpress-page-load-speed-comparison-hugo-leaves-wordpress-in-its-dust/
+[StaticGen: Top Open-Source Static Site Generators (GitHub Stars)]: https://www.staticgen.com/
+[dotcms]: https://dotcms.com/blog/post/the-resurgence-of-static
--- /dev/null
- title: Hugo Features
+---
- weight: 20
- weight: 20
++title: Hugo features
+description: Hugo boasts blistering speed, robust content management, and a powerful templating language making it a great fit for all kinds of static websites.
+menu:
+ docs:
+ parent: about
- ## Additional Features
++ weight: 30
++weight: 30
+toc: true
+---
+
+## General
+
+* [Extremely fast] build times (< 1 ms per page)
+* Completely cross platform, with [easy installation][install] on macOS, Linux, Windows, and more
+* Renders changes on the fly with [LiveReload] as you develop
+* [Powerful theming]
+* [Host your site anywhere][hostanywhere]
+
+## Organization
+
+* Straightforward [organization for your projects], including website sections
+* Customizable [URLs]
+* Support for configurable [taxonomies], including categories and tags
+* [Sort content] as you desire through powerful template [functions]
+* Automatic [table of contents] generation
+* [Dynamic menu] creation
+* [Pretty URLs] support
+* [Permalink] pattern support
+* Redirects via [aliases]
+
+## Content
+
+* Native Markdown and Emacs Org-Mode support, as well as other languages via *external helpers* (see [supported formats])
+* TOML, YAML, and JSON metadata support in [front matter]
+* Customizable [homepage]
+* Multiple [content types]
+* Automatic and user defined [content summaries]
+* [Shortcodes] to enable rich content inside of Markdown
+* ["Minutes to Read"][pagevars] functionality
+* ["WordCount"][pagevars] functionality
+
++## Additional features
+
+* Integrated [Disqus] comment support
+* Integrated [Google Analytics] support
+* Automatic [RSS] creation
+* Support for [Go] HTML templates
+* [Syntax highlighting] powered by [Chroma]
+
+[aliases]: /content-management/urls/#aliases
+[Chroma]: https://github.com/alecthomas/chroma
+[content summaries]: /content-management/summaries/
+[content types]: /content-management/types/
+[Disqus]: https://disqus.com/
+[Dynamic menu]: /templates/menu-templates/
+[Extremely fast]: https://github.com/bep/hugo-benchmark
+[front matter]: /content-management/front-matter/
+[functions]: /functions/
+[Go]: https://pkg.go.dev/html/template
+[Google Analytics]: https://google-analytics.com/
+[homepage]: /templates/homepage/
+[hostanywhere]: /hosting-and-deployment/
+[install]: /installation/
+[LiveReload]: /getting-started/usage/
+[organization for your projects]: /getting-started/directory-structure/
+[pagevars]: /variables/page/
+[Permalink]: /content-management/urls/#permalinks
+[Powerful theming]: /hugo-modules/theme-components/
+[Pretty URLs]: /content-management/urls/
+[RSS]: /templates/rss/
+[Shortcodes]: /content-management/shortcodes/
+[sort content]: /templates/
+[supported formats]: /content-management/formats/
+[Syntax highlighting]: /content-management/syntax-highlighting/
+[table of contents]: /content-management/toc/
+[taxonomies]: /content-management/taxonomies/
+[URLs]: /content-management/urls/
--- /dev/null
- title: Hugo and the General Data Protection Regulation (GDPR)
- linktitle: Hugo and GDPR
+---
- weight: 5
- weight: 5
++title: Hugo and the General Data Protection Regulation
++linkTitle: Hugo and the GDPR
+description: About how to configure your Hugo site to meet the new regulations.
+layout: single
+keywords: ["GDPR", "Privacy", "Data Protection"]
+menu:
+ docs:
+ parent: about
- But even static websites can integrate with external services, so from version `0.41`, Hugo provides a **Privacy Config** that covers the relevant built-in templates.
++ weight: 60
++weight: 60
+aliases: [/privacy/,/gdpr/]
+toc: true
+---
+
+ General Data Protection Regulation ([GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation)) is a regulation in EU law on data protection and privacy for all individuals within the European Union and the European Economic Area. It became enforceable on 25 May 2018.
+
+ **Hugo is a static site generator. By using Hugo you are already standing on very solid ground. Static HTML files on disk are much easier to reason about compared to server and database driven web sites.**
+
- ## All Privacy Settings
++ But even static websites can integrate with external services, so from version `0.41`, Hugo provides a **privacy configuration** that covers the relevant built-in templates.
+
+ Note that:
+
+ * These settings have their defaults setting set to _off_, i.e. how it worked before Hugo `0.41`. You must do your own evaluation of your site and apply the appropriate settings.
+ * These settings work with the [internal templates](/templates/internal/). Some theme may contain custom templates for embedding services like Google Analytics. In that case these options have no effect.
+ * We will continue this work and improve this further in future Hugo versions.
+
- Below are all privacy settings and their default value. These settings need to be put in your site config (e.g. `hugo.toml`).
++## All privacy settings
+
- ## Disable All Services
++Below are all privacy settings and their default value. These settings need to be put in your site configuration (e.g. `hugo.toml`).
+
+{{< code-toggle file="hugo" >}}
+[privacy]
+[privacy.disqus]
+disable = false
+[privacy.googleAnalytics]
+disable = false
+respectDoNotTrack = false
+anonymizeIP = false
+useSessionStorage = false
+[privacy.instagram]
+disable = false
+simple = false
+[privacy.twitter]
+disable = false
+enableDNT = false
+simple = false
+[privacy.vimeo]
+disable = false
+enableDNT = false
+simple = false
+[privacy.youtube]
+disable = false
+privacyEnhanced = false
+{{< /code-toggle >}}
+
- An example Privacy Config that disables all the relevant services in Hugo. With this configuration, the other settings will not matter.
++## Disable all services
+
- {{< code-toggle file="hugo" >}}
++An example privacy configuration that disables all the relevant services in Hugo. With this configuration, the other settings will not matter.
+
- ## The Privacy Settings Explained
++{{< code-toggle file="hugo" >}}
+[privacy]
+[privacy.disqus]
+disable = true
+[privacy.googleAnalytics]
+disable = true
+[privacy.instagram]
+disable = true
+[privacy.twitter]
+disable = true
+[privacy.vimeo]
+disable = true
+[privacy.youtube]
+disable = true
+{{< /code-toggle >}}
+
++## The privacy settings explained
+
+### GoogleAnalytics
+
+anonymizeIP
+: Enabling this will make it so the users' IP addresses are anonymized within Google Analytics.
+
+respectDoNotTrack
+: Enabling this will make the GA templates respect the "Do Not Track" HTTP header.
+
+useSessionStorage
+: Enabling this will disable the use of Cookies and use Session Storage to Store the GA Client ID.
+
+{{% note %}}
+`useSessionStorage` is not supported when using Google Analytics v4 (gtag.js).
+{{% /note %}}
+
+### Instagram
+
+simple
+: If simple mode is enabled, a static and no-JS version of the Instagram image card will be built. Note that this only supports image cards and the image itself will be fetched from Instagram's servers.
+
+**Note:** If you use the _simple mode_ for Instagram and a site styled with Bootstrap 4, you may want to disable the inline styles provided by Hugo:
+
+ {{< code-toggle file="hugo" >}}
+[services]
+[services.instagram]
+disableInlineCSS = true
+{{< /code-toggle >}}
+
+### Twitter
+
+enableDNT
+: Enabling this for the twitter/tweet shortcode, the tweet and its embedded page on your site are not used for purposes that include personalized suggestions and personalized ads.
+
+simple
+: If simple mode is enabled, a static and no-JS version of a tweet will be built.
+
+**Note:** If you use the _simple mode_ for Twitter, you may want to disable the inline styles provided by Hugo:
+
+ {{< code-toggle file="hugo" >}}
+[services]
+[services.twitter]
+disableInlineCSS = true
+{{< /code-toggle >}}
+
+### YouTube
+
+privacyEnhanced
+: When you turn on privacy-enhanced mode, YouTube won’t store information about visitors on your website unless the user plays the embedded video.
+
+### Vimeo
+
+enableDNT
+: Enabling this for the vimeo shortcode, the Vimeo player will be blocked from tracking any session data, including all cookies and stats.
+
+simple
+: If simple mode is enabled, the video thumbnail is fetched from Vimeo's servers and it is overlayed with a play button. If the user clicks to play the video, it will open in a new tab directly on Vimeo's website.
--- /dev/null
- title: Apache License
- linktitle: License
+---
- weight: 60
- weight: 60
++title: License
+description: Hugo v0.15 and later are released under the Apache 2.0 license.
+categories: ["about hugo"]
+keywords: ["License","apache"]
+menu:
+ docs:
+ parent: about
++ weight: 70
++weight: 70
+aliases: [/meta/license]
+toc: true
+---
+
+{{% note %}}
+Hugo v0.15 and later are released under the Apache 2.0 license.
+Earlier versions of Hugo were released under the [Simple Public License](https://opensource.org/license/simpl-2-0-html/).
+{{% /note %}}
+
+_Version 2.0, January 2004_ <br>
+<https://www.apache.org/licenses/LICENSE-2.0>
+
+*Terms and Conditions for use, reproduction, and distribution*
+
+## 1. Definitions
+
+“License” shall mean the terms and conditions for use, reproduction, and
+distribution as defined by Sections 1 through 9 of this document.
+
+“Licensor” shall mean the copyright owner or entity authorized by the copyright
+owner that is granting the License.
+
+“Legal Entity” shall mean the union of the acting entity and all other entities
+that control, are controlled by, or are under common control with that entity.
+For the purposes of this definition, “control” means **(i)** the power, direct or
+indirect, to cause the direction or management of such entity, whether by
+contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
+outstanding shares, or **(iii)** beneficial ownership of such entity.
+
+“You” (or “Your”) shall mean an individual or Legal Entity exercising
+permissions granted by this License.
+
+“Source” form shall mean the preferred form for making modifications, including
+but not limited to software source code, documentation source, and configuration
+files.
+
+“Object” form shall mean any form resulting from mechanical transformation or
+translation of a Source form, including but not limited to compiled object code,
+generated documentation, and conversions to other media types.
+
+“Work” shall mean the work of authorship, whether in Source or Object form, made
+available under the License, as indicated by a copyright notice that is included
+in or attached to the work (an example is provided in the Appendix below).
+
+“Derivative Works” shall mean any work, whether in Source or Object form, that
+is based on (or derived from) the Work and for which the editorial revisions,
+annotations, elaborations, or other modifications represent, as a whole, an
+original work of authorship. For the purposes of this License, Derivative Works
+shall not include works that remain separable from, or merely link (or bind by
+name) to the interfaces of, the Work and Derivative Works thereof.
+
+“Contribution” shall mean any work of authorship, including the original version
+of the Work and any modifications or additions to that Work or Derivative Works
+thereof, that is intentionally submitted to Licensor for inclusion in the Work
+by the copyright owner or by an individual or Legal Entity authorized to submit
+on behalf of the copyright owner. For the purposes of this definition,
+“submitted” means any form of electronic, verbal, or written communication sent
+to the Licensor or its representatives, including but not limited to
+communication on electronic mailing lists, source code control systems, and
+issue tracking systems that are managed by, or on behalf of, the Licensor for
+the purpose of discussing and improving the Work, but excluding communication
+that is conspicuously marked or otherwise designated in writing by the copyright
+owner as “Not a Contribution.”
+
+“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
+of whom a Contribution has been received by Licensor and subsequently
+incorporated within the Work.
+
+## 2. Grant of Copyright License
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable copyright license to reproduce, prepare Derivative Works of,
+publicly display, publicly perform, sublicense, and distribute the Work and such
+Derivative Works in Source or Object form.
+
+## 3. Grant of Patent License
+
+Subject to the terms and conditions of this License, each Contributor hereby
+grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
+irrevocable (except as stated in this section) patent license to make, have
+made, use, offer to sell, sell, import, and otherwise transfer the Work, where
+such license applies only to those patent claims licensable by such Contributor
+that are necessarily infringed by their Contribution(s) alone or by combination
+of their Contribution(s) with the Work to which such Contribution(s) was
+submitted. If You institute patent litigation against any entity (including a
+cross-claim or counterclaim in a lawsuit) alleging that the Work or a
+Contribution incorporated within the Work constitutes direct or contributory
+patent infringement, then any patent licenses granted to You under this License
+for that Work shall terminate as of the date such litigation is filed.
+
+## 4. Redistribution
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof
+in any medium, with or without modifications, and in Source or Object form,
+provided that You meet the following conditions:
+
+* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
+this License; and
+* **(b)** You must cause any modified files to carry prominent notices stating that You
+changed the files; and
+* **\(c)** You must retain, in the Source form of any Derivative Works that You distribute,
+all copyright, patent, trademark, and attribution notices from the Source form
+of the Work, excluding those notices that do not pertain to any part of the
+Derivative Works; and
+* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+## 5. Submission of Contributions
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+## 6. Trademarks
+
+This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+## 7. Disclaimer of Warranty
+
+Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+## 8. Limitation of Liability
+
+In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+## 9. Accepting Warranty or Additional Liability
+
+While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+_END OF TERMS AND CONDITIONS_
+
+## APPENDIX: How to apply the Apache License to your work
+
+To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets `[]` replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same “printed page” as the copyright notice for easier identification within third-party archives.
+
+{{< code file="apache-notice.txt" >}}
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{{< /code >}}
--- /dev/null
- title: Hugo's Security Model
+---
- weight: 4
- weight: 5
++title: Hugo's security model
+description: A summary of Hugo's security model.
+layout: single
+keywords: ["Security", "Privacy"]
+menu:
+ docs:
+ parent: about
- ## Runtime Security
++ weight: 50
++weight: 50
+aliases: [/security/]
+toc: true
+---
+
- ## Security Policy
++## Runtime security
+
+Hugo produces static output, so once built, the runtime is the browser (assuming the output is HTML) and any server (API) that you integrate with.
+
+But when developing and building your site, the runtime is the `hugo` executable. Securing a runtime can be [a real challenge](https://blog.logrocket.com/how-to-protect-your-node-js-applications-from-malicious-dependencies-5f2e60ea08f9/).
+
+**Hugo's main approach is that of sandboxing and a security policy with strict defaults:**
+
+* Hugo has a virtual file system and only the main project (not third-party components) is allowed to mount directories or files outside the project root.
+* Only the main project can walk symbolic links.
+* User-defined components have read-only access to the filesystem.
+* We shell out to some external binaries to support [Asciidoctor](/content-management/formats/#list-of-content-formats) and similar, but those binaries and their flags are predefined and disabled by default (see [Security Policy](#security-policy)). General functions to run arbitrary external OS commands have been [discussed](https://github.com/gohugoio/hugo/issues/796), but not implemented because of security concerns.
+
- Note that these and other config settings in Hugo can be overridden by the OS environment. If you want to block all remote HTTP fetching of data:
++## Security policy
+
+Hugo has a built-in security policy that restricts access to [os/exec](https://pkg.go.dev/os/exec), remote communication and similar.
+
+The default configuration is listed below. Any build using features not in the allow list of the security policy will fail with a detailed message about what needs to be done. Most of these settings are allow lists (string or slice, [Regular Expressions](https://pkg.go.dev/regexp) or `none` which matches nothing).
+
+{{< code-toggle config="security" />}}
+
- ## Dependency Security
++Note that these and other configuration settings in Hugo can be overridden by the OS environment. If you want to block all remote HTTP fetching of data:
+
+```txt
+HUGO_SECURITY_HTTP_URLS=none hugo
+```
+
- ## Web Application Security
++## Dependency security
+
+Hugo is built as a static binary using [Go Modules](https://github.com/golang/go/wiki/Modules) to manage its dependencies. Go Modules have several safeguards, one of them being the `go.sum` file. This is a database of the expected cryptographic checksums of all of your dependencies, including transitive dependencies.
+
+[Hugo Modules](/hugo-modules/) is a feature built on top of the functionality of Go Modules. Like Go Modules, a Hugo project using Hugo Modules will have a `go.sum` file. We recommend that you commit this file to your version control system. The Hugo build will fail if there is a checksum mismatch, which would be an indication of [dependency tampering](https://julienrenaux.fr/2019/12/20/github-actions-security-risk/).
+
++## Web application security
+
+These are the security threats as defined by [OWASP](https://en.wikipedia.org/wiki/OWASP).
+
+For HTML output, this is the core security model:
+
+<https://pkg.go.dev/html/template#hdr-Security_Model>
+
+In short:
+
+Template and configuration authors (you) are trusted, but the data you send in is not.
+This is why you sometimes need to use the _safe_ functions, such as `safeHTML`, to avoid escaping of data you know is safe.
+There is one exception to the above, as noted in the documentation: If you enable inline shortcodes, you also say that the shortcodes and data handling in content files are trusted, as those macros are treated as pure text.
+It may be worth adding that Hugo is a static site generator with no concept of dynamic user input.
+
+For content, the default Markdown renderer is [configured](/getting-started/configuration-markup) to remove or escape potentially unsafe content. This behavior can be reconfigured if you trust your content.
--- /dev/null
- weight: 10
- weight: 10
+---
+title: What is Hugo
+description: Hugo is a fast and modern static site generator written in Go, and designed to make website creation fun again.
+layout: single
+menu:
+ docs:
+ parent: about
- ## How Fast is Hugo?
++ weight: 20
++weight: 20
+aliases: [/overview/introduction/,/about/why-i-built-hugo/]
+toc: true
+---
+
+Hugo is a general-purpose website framework. Technically speaking, Hugo is a [static site generator]. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website's end users and an ideal writing experience for website authors.
+
+Websites built with Hugo are extremely fast and secure. Hugo sites can be hosted anywhere, including [Netlify], [Heroku], [GoDaddy], [DreamHost], [GitHub Pages], [GitLab Pages], [Surge], [Firebase], [Google Cloud Storage], [Amazon S3], [Rackspace], [Azure], and [CloudFront] and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP.
+
+We think of Hugo as the ideal website creation tool with nearly instant build times, able to rebuild whenever a change is made.
+
- ## What Does Hugo Do?
++## How fast is Hugo?
+
+{{< youtube "CdiDYZ51a2o" >}}
+
- ## Who Should Use Hugo?
++## What does Hugo do?
+
+In technical terms, Hugo takes a source directory of files and templates and uses these as input to create a complete website.
+
++## Who should use Hugo?
+
+Hugo is for people that prefer writing in a text editor over a browser.
+
+Hugo is for people who want to hand code their own website without worrying about setting up complicated runtimes, dependencies and databases.
+
+Hugo is for people building a blog, a company site, a portfolio site, documentation, a single landing page, or a website with thousands of pages.
+
+[@spf13]: https://twitter.com/spf13
+[Amazon S3]: https://aws.amazon.com/s3/
+[Azure]: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website
+[CloudFront]: https://aws.amazon.com/cloudfront/ "Amazon CloudFront"
+[DreamHost]: https://www.dreamhost.com/
+[Firebase]: https://firebase.google.com/docs/hosting/ "Firebase static hosting"
+[GitHub Pages]: https://pages.github.com/
+[GitLab Pages]: https://about.gitlab.com/features/pages/
+[Go language]: https://go.dev/
+[GoDaddy]: https://www.godaddy.com/ "GoDaddy.com Hosting"
+[Google Cloud Storage]: https://cloud.google.com/storage/
+[Heroku]: https://www.heroku.com/
+[Jekyll]: https://jekyllrb.com/
+[Middleman]: https://middlemanapp.com/
+[Nanoc]: https://nanoc.ws/
+[Netlify]: https://netlify.com
+[Rackspace]: https://www.rackspace.com/cloud/files
+[Surge]: https://surge.sh
+[contributing to it]: https://github.com/gohugoio/hugo
+[rackspace]: https://www.rackspace.com/openstack/public/files
+[static site generator]: /about/benefits/
--- /dev/null
-
+---
+title: "hugo completion bash"
+slug: hugo_completion_bash
+url: /commands/hugo_completion_bash/
+---
+## hugo completion bash
+
+Generate the autocompletion script for bash
+
+### Synopsis
+
+Generate the autocompletion script for the bash shell.
+
+This script depends on the 'bash-completion' package.
+If it is not installed already, you can install it via your OS's package manager.
+
+To load completions in your current shell session:
+
+ source <(hugo completion bash)
+
+To load completions for every new session, execute once:
+
+#### Linux:
+
+ hugo completion bash > /etc/bash_completion.d/hugo
+
+#### macOS:
+
+ hugo completion bash > $(brew --prefix)/etc/bash_completion.d/hugo
+
+You will need to start a new shell for this setup to take effect.
+
+
+```
+hugo completion bash
+```
+
+### Options
+
+```
+ -h, --help help for bash
+ --no-descriptions disable completion descriptions
+```
+
+### Options inherited from parent commands
+
+```
+ --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
+ --config string config file (default is hugo.yaml|json|toml)
+ --configDir string config dir (default "config")
+ --debug debug output
+ -d, --destination string filesystem path to write files to
+ -e, --environment string build environment
+ --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
+ --logLevel string log level (debug|info|warn|error)
+ --quiet build in quiet mode
+ -s, --source string filesystem path to read files relative from
+ --themesDir string filesystem path to themes directory
+ -v, --verbose verbose output
+```
+
+### SEE ALSO
+
+* [hugo completion](/commands/hugo_completion/) - Generate the autocompletion script for the specified shell
--- /dev/null
- ```
- hugo convert [command] [flags]
- ```
-
+---
+title: "hugo convert"
+slug: hugo_convert
+url: /commands/hugo_convert/
+---
+## hugo convert
+
+Convert your content to different formats
+
+### Synopsis
+
+Convert your content (e.g. front matter) to different formats.
+
+See convert's subcommands toJSON, toTOML and toYAML for more information.
+
+### Options
+
+```
+ -h, --help help for convert
+ -o, --output string filesystem path to write files to
+ --unsafe enable less safe operations, please backup first
+```
+
+### Options inherited from parent commands
+
+```
+ --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
+ --config string config file (default is hugo.yaml|json|toml)
+ --configDir string config dir (default "config")
+ --debug debug output
+ -d, --destination string filesystem path to write files to
+ -e, --environment string build environment
+ --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
+ --logLevel string log level (debug|info|warn|error)
+ --quiet build in quiet mode
+ -s, --source string filesystem path to read files relative from
+ --themesDir string filesystem path to themes directory
+ -v, --verbose verbose output
+```
+
+### SEE ALSO
+
+* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo convert toJSON](/commands/hugo_convert_tojson/) - Convert front matter to JSON
+* [hugo convert toTOML](/commands/hugo_convert_totoml/) - Convert front matter to TOML
+* [hugo convert toYAML](/commands/hugo_convert_toyaml/) - Convert front matter to YAML
+
--- /dev/null
- ```
- hugo gen [command] [flags]
- ```
-
+---
+title: "hugo gen"
+slug: hugo_gen
+url: /commands/hugo_gen/
+---
+## hugo gen
+
+A collection of several useful generators.
+
+### Options
+
+```
+ -h, --help help for gen
+```
+
+### Options inherited from parent commands
+
+```
+ --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
+ --config string config file (default is hugo.yaml|json|toml)
+ --configDir string config dir (default "config")
+ --debug debug output
+ -d, --destination string filesystem path to write files to
+ -e, --environment string build environment
+ --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
+ --logLevel string log level (debug|info|warn|error)
+ --quiet build in quiet mode
+ -s, --source string filesystem path to read files relative from
+ --themesDir string filesystem path to themes directory
+ -v, --verbose verbose output
+```
+
+### SEE ALSO
+
+* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo gen chromastyles](/commands/hugo_gen_chromastyles/) - Generate CSS stylesheet for the Chroma code highlighter
+* [hugo gen doc](/commands/hugo_gen_doc/) - Generate Markdown documentation for the Hugo CLI.
+* [hugo gen man](/commands/hugo_gen_man/) - Generate man pages for the Hugo CLI
+
--- /dev/null
- ```
- hugo import [command] [flags]
- ```
-
+---
+title: "hugo import"
+slug: hugo_import
+url: /commands/hugo_import/
+---
+## hugo import
+
+Import your site from others.
+
+### Synopsis
+
+Import your site from other web site generators like Jekyll.
+
+Import requires a subcommand, e.g. `hugo import jekyll jekyll_root_path target_path`.
+
+### Options
+
+```
+ -h, --help help for import
+```
+
+### Options inherited from parent commands
+
+```
+ --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
+ --config string config file (default is hugo.yaml|json|toml)
+ --configDir string config dir (default "config")
+ --debug debug output
+ -d, --destination string filesystem path to write files to
+ -e, --environment string build environment
+ --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
+ --logLevel string log level (debug|info|warn|error)
+ --quiet build in quiet mode
+ -s, --source string filesystem path to read files relative from
+ --themesDir string filesystem path to themes directory
+ -v, --verbose verbose output
+```
+
+### SEE ALSO
+
+* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo import jekyll](/commands/hugo_import_jekyll/) - hugo import from Jekyll
+
--- /dev/null
- ```
- hugo list [command] [flags]
- ```
-
+---
+title: "hugo list"
+slug: hugo_list
+url: /commands/hugo_list/
+---
+## hugo list
+
+Listing out various types of content
+
+### Synopsis
+
+Listing out various types of content.
+
+List requires a subcommand, e.g. hugo list drafts
+
+### Options
+
+```
+ -h, --help help for list
+```
+
+### Options inherited from parent commands
+
+```
+ --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
+ --config string config file (default is hugo.yaml|json|toml)
+ --configDir string config dir (default "config")
+ --debug debug output
+ -d, --destination string filesystem path to write files to
+ -e, --environment string build environment
+ --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
+ --logLevel string log level (debug|info|warn|error)
+ --quiet build in quiet mode
+ -s, --source string filesystem path to read files relative from
+ --themesDir string filesystem path to themes directory
+ -v, --verbose verbose output
+```
+
+### SEE ALSO
+
+* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo list all](/commands/hugo_list_all/) - List all posts
+* [hugo list drafts](/commands/hugo_list_drafts/) - List all drafts
+* [hugo list expired](/commands/hugo_list_expired/) - List all posts already expired
+* [hugo list future](/commands/hugo_list_future/) - List all posts dated in the future
+
--- /dev/null
- ```
- hugo new [command] [flags]
- ```
-
+---
+title: "hugo new"
+slug: hugo_new
+url: /commands/hugo_new/
+---
+## hugo new
+
+Create new content for your site
+
+### Synopsis
+
+Create a new content file and automatically set the date and title.
+It will guess which kind of file to create based on the path provided.
+
+You can also specify the kind with `-k KIND`.
+
+If archetypes are provided in your theme or site, they will be used.
+
+Ensure you run this within the root directory of your site.
+
- * [hugo new theme](/commands/hugo_new_theme/) - Create a new site (skeleton)
+### Options
+
+```
+ -h, --help help for new
+```
+
+### Options inherited from parent commands
+
+```
+ --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
+ --config string config file (default is hugo.yaml|json|toml)
+ --configDir string config dir (default "config")
+ --debug debug output
+ -d, --destination string filesystem path to write files to
+ -e, --environment string build environment
+ --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
+ --logLevel string log level (debug|info|warn|error)
+ --quiet build in quiet mode
+ -s, --source string filesystem path to read files relative from
+ --themesDir string filesystem path to themes directory
+ -v, --verbose verbose output
+```
+
+### SEE ALSO
+
+* [hugo](/commands/hugo/) - hugo builds your site
+* [hugo new content](/commands/hugo_new_content/) - Create new content for your site
+* [hugo new site](/commands/hugo_new_site/) - Create a new site (skeleton)
++* [hugo new theme](/commands/hugo_new_theme/) - Create a new theme (skeleton)
+
--- /dev/null
- It will guess which kind of file to create based on the path provided.
-
- You can also specify the kind with `-k KIND`.
-
- If archetypes are provided in your theme or site, they will be used.
-
- Ensure you run this within the root directory of your site.
+---
+title: "hugo new content"
+slug: hugo_new_content
+url: /commands/hugo_new_content/
+---
+## hugo new content
+
+Create new content for your site
+
+### Synopsis
+
+Create a new content file and automatically set the date and title.
++It will guess which kind of file to create based on the path provided.
++
++You can also specify the kind with `-k KIND`.
++
++If archetypes are provided in your theme or site, they will be used.
++
++Ensure you run this within the root directory of your site.
+
+```
+hugo new content [path] [flags]
+```
+
+### Options
+
+```
+ -b, --baseURL string hostname (and path) to the root, e.g. https://spf13.com/
+ --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache_$USER/
+ -c, --contentDir string filesystem path to content directory
+ --editor string edit new content with this editor, if provided
+ -f, --force overwrite file if it already exists
+ --format string preferred file format (toml, yaml or json) (default "toml")
+ -h, --help help for content
+ -k, --kind string content type to create
+ -t, --theme strings themes to use (located in /themes/THEMENAME/)
+```
+
+### Options inherited from parent commands
+
+```
+ --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
+ --config string config file (default is hugo.yaml|json|toml)
+ --configDir string config dir (default "config")
+ --debug debug output
+ -d, --destination string filesystem path to write files to
+ -e, --environment string build environment
+ --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
+ --logLevel string log level (debug|info|warn|error)
+ --quiet build in quiet mode
+ -s, --source string filesystem path to read files relative from
+ --themesDir string filesystem path to themes directory
+ -v, --verbose verbose output
+```
+
+### SEE ALSO
+
+* [hugo new](/commands/hugo_new/) - Create new content for your site
+
--- /dev/null
- -f, --force init inside non-empty directory
- -h, --help help for site
+---
+title: "hugo new site"
+slug: hugo_new_site
+url: /commands/hugo_new_site/
+---
+## hugo new site
+
+Create a new site (skeleton)
+
+### Synopsis
+
+Create a new site in the provided directory.
+The new site will have the correct structure, but no content or theme yet.
+Use `hugo new [contentPath]` to create new content.
+
+```
+hugo new site [path] [flags]
+```
+
+### Options
+
+```
++ -f, --force init inside non-empty directory
++ --format string preferred file format (toml, yaml or json) (default "toml")
++ -h, --help help for site
+```
+
+### Options inherited from parent commands
+
+```
+ --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
+ --config string config file (default is hugo.yaml|json|toml)
+ --configDir string config dir (default "config")
+ --debug debug output
+ -d, --destination string filesystem path to write files to
+ -e, --environment string build environment
+ --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
+ --logLevel string log level (debug|info|warn|error)
+ --quiet build in quiet mode
+ -s, --source string filesystem path to read files relative from
+ --themesDir string filesystem path to themes directory
+ -v, --verbose verbose output
+```
+
+### SEE ALSO
+
+* [hugo new](/commands/hugo_new/) - Create new content for your site
+
--- /dev/null
- Create a new site (skeleton)
+---
+title: "hugo new theme"
+slug: hugo_new_theme
+url: /commands/hugo_new_theme/
+---
+## hugo new theme
+
- Create a new site in the provided directory.
- The new site will have the correct structure, but no content or theme yet.
- Use `hugo new [contentPath]` to create new content.
++Create a new theme (skeleton)
+
+### Synopsis
+
- hugo new theme [path] [flags]
++Create a new theme (skeleton) called [name] in ./themes.
++New theme is a skeleton. Please add content to the touched files. Add your
++name to the copyright line in the license and adjust the theme.toml file
++according to your needs.
+
+```
++hugo new theme [name] [flags]
+```
+
+### Options
+
+```
+ -h, --help help for theme
+```
+
+### Options inherited from parent commands
+
+```
+ --clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
+ --config string config file (default is hugo.yaml|json|toml)
+ --configDir string config dir (default "config")
+ --debug debug output
+ -d, --destination string filesystem path to write files to
+ -e, --environment string build environment
+ --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
+ --logLevel string log level (debug|info|warn|error)
+ --quiet build in quiet mode
+ -s, --source string filesystem path to read files relative from
+ --themesDir string filesystem path to themes directory
+ -v, --verbose verbose output
+```
+
+### SEE ALSO
+
+* [hugo new](/commands/hugo_new/) - Create new content for your site
+
--- /dev/null
- title: Content Management
- linkTitle: Content Management Overview
+---
++title: Content management
++linkTitle: Overview
+description: Hugo makes managing large static sites easy with support for archetypes, content types, menus, cross references, summaries, and more.
+menu:
+ docs:
++ identifier: content-management-overview
+ parent: content-management
+ weight: 10
+keywords: [source, organization]
+categories: [content management]
+weight: 10
+aliases: [/content/,/content/organization]
+---
+
+A static site generator needs to extend beyond front matter and a couple of templates to be both scalable and *manageable*. Hugo was designed with not only developers in mind, but also content managers and authors.
--- /dev/null
- ## What are Archetypes?
+---
+title: Archetypes
+description: Archetypes are templates used when creating new content.
+keywords: [archetypes,generators,metadata,front matter]
+categories: [content management]
+menu:
+ docs:
+ parent: content-management
+ weight: 140
+ quicklinks:
+toc: true
+weight: 140
+aliases: [/content/archetypes/]
+---
+
- ## Create a New Archetype Template
++## What are archetypes?
+
+**Archetypes** are content template files in the [archetypes directory] of your project that contain preconfigured [front matter] and possibly also a content disposition for your website's [content types]. These will be used when you run `hugo new`.
+
+
+The `hugo new` uses the `content-section` to find the most suitable archetype template in your project. If your project does not contain any archetype files, it will also look in the theme.
+
+{{< code file="archetype-example.sh" >}}
+hugo new posts/my-first-post.md
+{{< /code >}}
+
+The above will create a new content file in `content/posts/my-first-post.md` using the first archetype file found of these:
+
+1. `archetypes/posts.md`
+2. `archetypes/default.md`
+3. `themes/my-theme/archetypes/posts.md`
+4. `themes/my-theme/archetypes/default.md`
+
+The last two list items are only applicable if you use a theme and it uses the `my-theme` theme name as an example.
+
- ## New Cool Posts
++## Create a new archetype template
+
+A fictional example for the section `newsletter` and the archetype file `archetypes/newsletter.md`. Create a new file in `archetypes/newsletter.md` and open it in a text editor.
+
+{{< code file="archetypes/newsletter.md" >}}
+---
+title: "{{ replace .Name "-" " " | title }}"
+date: {{ .Date }}
+draft: true
+---
+
+**Insert Lead paragraph here.**
+
++## New cool posts
+
+{{ range first 10 ( where .Site.RegularPages "Type" "cool" ) }}
+* {{ .Title }}
+{{ end }}
+{{< /code >}}
+
+When you create a new newsletter with:
+
+```bash
+hugo new newsletter/the-latest-cool.stuff.md
+```
+
+It will create a new newsletter type of content file based on the archetype template.
+
+**Note:** the site will only be built if the `.Site` is in use in the archetype file, and this can be time consuming for big sites.
+
+The above _newsletter type archetype_ illustrates the possibilities: The full Hugo `.Site` and all of Hugo's template funcs can be used in the archetype file.
+
+## Directory based archetypes
+
+Since Hugo `0.49` you can use complete directories as archetype templates. Given this archetype directory:
+
+```bash
+archetypes
+├── default.md
+└── post-bundle
+ ├── bio.md
+ ├── images
+ │ └── featured.jpg
+ └── index.md
+```
+
+```bash
+hugo new --kind post-bundle posts/my-post
+```
+
+Will create a new folder in `/content/posts/my-post` with the same set of files as in the `post-bundle` archetypes folder. All content files (`index.md` etc.) can contain template logic, and will receive the correct `.Site` for the content's language.
+
+[archetypes directory]: /getting-started/directory-structure/
+[content types]: /content-management/types/
+[front matter]: /content-management/front-matter/
--- /dev/null
- title: Build Options
- linkTitle: Build Options
+---
- categories: [content management]
++title: Build options
+description: Build options help define how Hugo must treat a given page when building the site.
+keywords: [build,content,front matter, page resources]
- They are stored in a reserved Front Matter object named `_build` with the following defaults:
++categories: [fundamentals,content management]
+menu:
+ docs:
+ parent: content-management
+ weight: 70
+toc: true
+weight: 70
+aliases: [/content/build-options/]
+---
+
- We extended this property from a boolean to an enum in Hugo 0.76.0. Valid values are:
-
- never
- : The page will not be included in any page collection.
-
- always (default)
- : The page will be rendered to disk and get a `RelPermalink` etc.
++They are stored in a reserved front matter object named `_build` with the following defaults:
+
+{{< code-toggle >}}
+_build:
+ render: always
+ list: always
+ publishResources: true
+{{< /code-toggle >}}
+
+#### render
+
+If `always`, the page will be treated as a published page, holding its dedicated output files (`index.html`, etc...) and permalink.
+
- link
- : The page will be not be rendered to disk, but will get a `RelPermalink`.
++Valid values are:
+
- Note that we extended this property from a boolean to an enum in Hugo 0.68.0.
-
++ - `never`
++ : The page will not be included in any page collection.
++ - `always (default)`
++ : The page will be rendered to disk and get a `RelPermalink` etc.
++ - `link`
++ : The page will be not be rendered to disk, but will get a `RelPermalink`.
+
+#### list
+
-
- never
- : The page will not be included in any page collection.
-
- always (default)
- : The page will be included in all page collections, e.g. `site.RegularPages`, `$page.Pages`.
-
- local
- : The page will be included in any _local_ page collection, e.g. `$page.RegularPages`, `$page.Pages`. One use case for this would be to create fully navigable, but headless content sections.
-
- If true, the page will be treated as part of the project's collections and, when appropriate, returned by Hugo's listing methods (`.Pages`, `.RegularPages` etc...).
+Valid values are:
- If set to true the [Bundle's Resources](/content-management/page-bundles) will be published.
- Setting this to false will still publish Resources on demand (when a resource's `.Permalink` or `.RelPermalink` is invoked from the templates) but will skip the others.
++
++ - `never`
++ : The page will not be included in any page collection.
++ - `always (default)`
++ : The page will be included in all page collections, e.g. `site.RegularPages`, `.Pages`.
++ - `local`
++ : The page will be included in any _local_ page collection, e.g. `.RegularPages`, `.Pages`. One use case for this would be to create fully navigable, but headless content sections.
+
+#### publishResources
+
- Project needs a "Who We Are" content file for Front Matter and body to be used by the homepage but nowhere else.
++If set to `true` (default) the [Bundle's Resources](/content-management/page-bundles) will be published.
++Setting this to `false` will still publish Resources on demand (when a resource's `.Permalink` or `.RelPermalink` is invoked from the templates) but will skip the others.
+
+{{% note %}}
+Any page, regardless of their build options, will always be available using the [`.GetPage`](/functions/getpage) methods.
+{{% /note %}}
+
+### Illustrative use cases
+
+#### Not publishing a page
+
++Project needs a "Who We Are" content file for front matter and body to be used by the homepage but nowhere else.
+
+{{< code-toggle file="content/who-we-are.md" fm=true copy=false >}}
+title: Who we are
+_build:
+ list: false
+ render: false
+{{< /code-toggle >}}
+
+{{< code file="layouts/index.html" copy=false >}}
+<section id="who-we-are">
+ {{ with site.GetPage "who-we-are" }}
+ {{ .Content }}
+ {{ end }}
+</section>
+{{< /code >}}
+
+#### Listing pages without publishing them
+
+Website needs to showcase a few of the hundred "testimonials" available as content files without publishing any of them.
+
+To avoid setting the build options on every testimonials, one can use [`cascade`](/content-management/front-matter#front-matter-cascade) on the testimonial section's content file.
+
+{{< code-toggle >}}
+title: Testimonials
+_build:
+ render: true
+cascade:
+ _build:
+ render: false
+ list: true # default
+{{< /code-toggle >}}
+
+{{< code file="layouts/_defaults/testimonials.html" copy=false >}}
+<section id="testimonials">
+ {{ range first 5 .Pages }}
+ <blockquote cite="{{ .Params.cite }}">
+ {{ .Content }}
+ </blockquote>
+ {{ end }}
+</section>
+{{< /code >}}
--- /dev/null
- categories: [project organization, fundamentals]
+---
+title: Comments
+description: Hugo ships with an internal Disqus template, but this isn't the only commenting system that will work with your new Hugo website.
+keywords: [sections,content,organization]
- ### Render Hugo's Built-in Disqus Partial Template
++categories: [project organization]
+menu:
+ docs:
+ parent: content-management
+ weight: 220
+toc: true
+weight: 220
+aliases: [/extras/comments/]
+---
+
+Hugo ships with support for [Disqus](https://disqus.com/), a third-party service that provides comment and community capabilities to websites via JavaScript.
+
+Your theme may already support Disqus, but if not, it is easy to add to your templates via [Hugo's built-in Disqus partial][disquspartial].
+
+## Add Disqus
+
+Hugo comes with all the code you need to load Disqus into your templates. Before adding Disqus to your site, you'll need to [set up an account][disqussetup].
+
+### Configure Disqus
+
+Disqus comments require you set a single value in your [site's configuration file][configuration] like so:
+
+{{< code-toggle copy=false >}}
+disqusShortname = "yourDisqusShortname"
+{{</ code-toggle >}}
+
+For many websites, this is enough configuration. However, you also have the option to set the following in the [front matter] of a single content file:
+
+* `disqus_identifier`
+* `disqus_title`
+* `disqus_url`
+
- Disqus has its own [internal template](https://gohugo.io/templates/internal/#disqus) available, to render it add the following code where you want comments to appear:
++### Render Hugo's built-in Disqus partial template
+
++Disqus has its own [internal template](/templates/internal/#disqus) available, to render it add the following code where you want comments to appear:
+
+```go-html-template
+{{ template "_internal/disqus.html" . }}
+```
+
+## Alternatives
+
+These are some alternatives to Disqus:
+
+* [Cactus Comments](https://cactus.chat/docs/integrations/hugo/) (Open Source, Matrix appservice, Docker install)
+* [Commento](https://commento.io/) (Open Source, available as a service, local install, or docker image)
+* [Graph Comment](https://graphcomment.com/)
+* [Hyvor Talk](https://talk.hyvor.com/) (Available as a service)
+* [IntenseDebate](https://intensedebate.com/)
+* [Isso](https://isso-comments.de/) (Self-hosted, Python) ([tutorial][issotutorial])
+* [Muut](https://muut.com/)
+* [Remark42](https://remark42.com/) (Open source, Golang, Easy to run docker)
+* [ReplyBox](https://getreplybox.com/)
+* [Staticman](https://staticman.net/)
+* [Talkyard](https://blog-comments.talkyard.io/) (Open source, & serverless hosting)
+* [Utterances](https://utteranc.es/) (Open source, GitHub comments widget built on GitHub issues)
+
+[configuration]: /getting-started/configuration/
+[disquspartial]: /templates/internal/#disqus
+[disqussetup]: https://disqus.com/profile/signup/
+[forum]: https://discourse.gohugo.io
+[front matter]: /content-management/front-matter/
+[kaijuissue]: https://github.com/spf13/kaiju/issues/new
+[issotutorial]: https://stiobhart.net/2017-02-24-isso-comments/
+[partials]: /templates/partials/
+[MongoDB]: https://www.mongodb.com/
+[tweet]: https://twitter.com/spf13
--- /dev/null
- title: Links and Cross References
- linkTitle: Links and Cross References
+---
- ```
++title: Links and cross references
+description: Shortcodes for creating links to documents.
+categories: [content management]
+keywords: ["cross references","references", "anchors", "urls"]
+menu:
+ docs:
+ parent: content-management
+ weight: 170
+toc: true
+weight: 170
+aliases: [/extras/crossreferences/]
+---
+
+The `ref` and `relref` shortcodes display the absolute and relative permalinks to a document, respectively.
+
+## Use of `ref` and `relref`
+
+The `ref` and `relref` shortcodes require a single parameter: the path to a content document, with or without a file extension, with or without an anchor. Paths without a leading `/` are first resolved relative to the current page, then to the remainder of the site.
+
- ### Get another Output Format
++```text
+.
+└── content
+ ├── about
+ | ├── _index.md
+ | └── credits.md
+ ├── pages
+ | ├── document1.md
+ | └── document2.md // has anchor #anchor
+ ├── products
+ | └── index.md
+ └── blog
+ └── my-post.md
+```
+
+The pages can be referenced as follows:
+
+
+```text
+{{</* ref "document2" */>}} // <- From pages/document1.md, relative path
+{{</* ref "document2#anchor" */>}}
+{{</* ref "document2.md" */>}}
+{{</* ref "document2.md#anchor" */>}}
+{{</* ref "#anchor" */>}} // <- From pages/document2.md
+{{</* ref "/blog/my-post" */>}} // <- From anywhere, absolute path
+{{</* ref "/blog/my-post.md" */>}}
+{{</* relref "document" */>}}
+{{</* relref "document.md" */>}}
+{{</* relref "#anchor" */>}}
+{{</* relref "/blog/my-post.md" */>}}
+```
+
+index.md can be reference either by its path or by its containing folder without the ending `/`. \_index.md can be referenced only by its containing folder:
+
+```text
+{{</* ref "/about" */>}} // <- References /about/_index.md
+{{</* ref "/about/_index" */>}} // Raises REF_NOT_FOUND error
+{{</* ref "/about/credits.md" */>}} // <- References /about/credits.md
+
+{{</* ref "/products" */>}} // <- References /products/index.md
+{{</* ref "/products/index" */>}} // <- References /products/index.md
+```
+
+To generate a hyperlink using `ref` or `relref` in markdown:
+
+```text
+[About]({{</* ref "/about" */>}} "About Us")
+```
+
+Hugo emits an error or warning if a document cannot be uniquely resolved. The error behavior is configurable; see below.
+
+### Link to another language version
+
+To link to another language version of a document, use this syntax:
+
+```go-html-template
+{{</* relref path="document.md" lang="ja" */>}}
+```
+
++### Get another output format
+
+To link to another Output Format of a document, use this syntax:
+
+```go-html-template
+{{</* relref path="document.md" outputFormat="rss" */>}}
+```
+
+### Heading IDs
+
+When using Markdown document types, Hugo generates element IDs for every heading on a page. For example:
+
+```md
+## Reference
+```
+
+produces this HTML:
+
+```html
+<h2 id="reference">Reference</h2>
+```
+
+Get the permalink to a heading by appending the ID to the path when using the `ref` or `relref` shortcodes:
+
+```go-html-template
+{{</* ref "document.md#reference" */>}}
+{{</* relref "document.md#reference" */>}}
+```
+
+Generate a custom heading ID by including an attribute. For example:
+
+```md
+## Reference A {#foo}
+## Reference B {id="bar"}
+```
+
+produces this HTML:
+
+```html
+<h2 id="foo">Reference A</h2>
+<h2 id="bar">Reference B</h2>
+```
+
+Hugo will generate unique element IDs if the same heading appears more than once on a page. For example:
+
+```md
+## Reference
+## Reference
+## Reference
+```
+
+produces this HTML:
+
+```html
+<h2 id="reference">Reference</h2>
+<h2 id="reference-1">Reference</h2>
+<h2 id="reference-2">Reference</h2>
+```
+
+## Ref and RelRef Configuration
+
+The behavior can, since Hugo 0.45, be configured in `hugo.toml`:
+
+refLinksErrorLevel ("ERROR")
+: When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).
+
+refLinksNotFoundURL
+: URL to be used as a placeholder when a page reference cannot be found in `ref` or `relref`. Is used as-is.
+
+
+[lists]: /templates/lists/
+[output formats]: /templates/output-formats/
+[shortcode]: /content-management/shortcodes/
--- /dev/null
- ## GoAT Diagrams (Ascii)
+---
+title: Diagrams
+description: Use fenced code blocks and markdown render hooks to display diagrams.
+categories: [content management]
+keywords: [diagrams,drawing]
+menu:
+ docs:
+ parent: content-management
+ weight: 50
+toc: true
+weight: 50
+---
+{{< new-in "0.93.0" >}}
+
- ## Mermaid Diagrams
++## GoAT diagrams (Ascii)
+
+Hugo supports [GoAT](https://github.com/bep/goat) natively. This means that this code block:
+
+````txt
+```goat
+ . . . .--- 1 .-- 1 / 1
+ / \ | | .---+ .-+ +
+ / \ .---+---. .--+--. | '--- 2 | '-- 2 / \ 2
+ + + | | | | ---+ ---+ +
+ / \ / \ .-+-. .-+-. .+. .+. | .--- 3 | .-- 3 \ / 3
+ / \ / \ | | | | | | | | '---+ '-+ +
+ 1 2 3 4 1 2 3 4 1 2 3 4 '--- 4 '-- 4 \ 4
+
+```
+````
+
+Will be rendered as:
+
+```goat
+
+ . . . .--- 1 .-- 1 / 1
+ / \ | | .---+ .-+ +
+ / \ .---+---. .--+--. | '--- 2 | '-- 2 / \ 2
+ + + | | | | ---+ ---+ +
+ / \ / \ .-+-. .-+-. .+. .+. | .--- 3 | .-- 3 \ / 3
+ / \ / \ | | | | | | | | '---+ '-+ +
+ 1 2 3 4 1 2 3 4 1 2 3 4 '--- 4 '-- 4 \ 4
+```
+
- <div class="mermaid">
++## Mermaid diagrams
+
+Hugo currently does not provide default templates for Mermaid diagrams. But you can easily add your own. One way to do it would be to create `layouts/_default/_markup/render-codeblock-mermaid.html`:
+
+```go-html-template
- </div>
++<pre class="mermaid">
+ {{- .Inner | safeHTML }}
- ````
++</pre>
+{{ .Page.Store.Set "hasMermaid" true }}
+```
+
+And then include this snippet at the bottom of the content template (**Note**: below `.Content` as the render hook is not processed until `.Content` is executed):
+
+```go-html-template
+{{ if .Page.Store.Get "hasMermaid" }}
+ <script type="module">
+ import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.esm.min.mjs';
+ mermaid.initialize({ startOnLoad: true });
+ </script>
+{{ end }}
+```
+
+With that you can use the `mermaid` language in Markdown code blocks:
+
- ## Goat Ascii Diagram Examples
++````text
+```mermaid
+sequenceDiagram
+ participant Alice
+ participant Bob
+ Alice->>John: Hello John, how are you?
+ loop Healthcheck
+ John->>John: Fight against hypochondria
+ end
+ Note right of John: Rational thoughts <br/>prevail!
+ John-->>Alice: Great!
+ John->>Bob: How about you?
+ Bob-->>John: Jolly good!
+```
+````
+
- ### Sequence Diagram
++## Goat ASCII diagram examples
+
+### Graphics
+
+```goat
+ .
+ 0 3 P * Eye / ^ /
+ *-------* +y \ +) \ / Reflection
+ 1 /| 2 /| ^ \ \ \ v
+ *-------* | | v0 \ v3 --------*--------
+ | |4 | |7 | *----\-----*
+ | *-----|-* +-----> +x / v X \ .-.<-------- o
+ |/ |/ / / o \ | / | Refraction / \
+ *-------* v / \ +-' / \
+ 5 6 +z v1 *------------------* v2 | o-----o
+ v
+
+```
+
+### Complex
+
+```goat
++-------------------+ ^ .---.
+| A Box |__.--.__ __.--> | .-. | |
+| | '--' v | * |<--- | |
++-------------------+ '-' | |
+ Round *---(-. |
+ .-----------------. .-------. .----------. .-------. | | |
+ | Mixed Rounded | | | / Diagonals \ | | | | | |
+ | & Square Corners | '--. .--' / \ |---+---| '-)-' .--------.
+ '--+------------+-' .--. | '-------+--------' | | | | / Search /
+ | | | | '---. | '-------' | '-+------'
+ |<---------->| | | | v Interior | ^
+ ' <---' '----' .-----------. ---. .--- v |
+ .------------------. Diag line | .-------. +---. \ / . |
+ | if (a > b) +---. .--->| | | | | Curved line \ / / \ |
+ | obj->fcn() | \ / | '-------' |<--' + / \ |
+ '------------------' '--' '--+--------' .--. .--. | .-. +Done?+-'
+ .---+-----. | ^ |\ | | /| .--+ | | \ /
+ | | | Join \|/ | | Curved | \| |/ | | \ | \ /
+ | | +----> o --o-- '-' Vertical '--' '--' '-- '--' + .---.
+ <--+---+-----' | /|\ | | 3 |
+ v not:line 'quotes' .-' '---'
+ .-. .---+--------. / A || B *bold* | ^
+ | | | Not a dot | <---+---<-- A dash--is not a line v |
+ '-' '---------+--' / Nor/is this. ---
+
+```
+
+### Process
+
+```goat
+ .
+ .---------. / \
+ | START | / \ .-+-------+-. ___________
+ '----+----' .-------. A / \ B | |COMPLEX| | / \ .-.
+ | | END |<-----+CHOICE +----->| | | +--->+ PREPARATION +--->| X |
+ v '-------' \ / | |PROCESS| | \___________/ '-'
+ .---------. \ / '-+---+---+-'
+ / INPUT / \ /
+ '-----+---' '
+ | ^
+ v |
+ .-----------. .-----+-----. .-.
+ | PROCESS +---------------->| PROCESS |<------+ X |
+ '-----------' '-----------' '-'
+```
+
+### File tree
+
+Created from <https://arthursonzogni.com/Diagon/#Tree>
+
+```goat { width=300 color="orange" }
+───Linux─┬─Android
+ ├─Debian─┬─Ubuntu─┬─Lubuntu
+ │ │ ├─Kubuntu
+ │ │ ├─Xubuntu
+ │ │ └─Xubuntu
+ │ └─Mint
+ ├─Centos
+ └─Fedora
+```
+
+
++### Sequence diagram
+
+<https://arthursonzogni.com/Diagon/#Sequence>
+
+```goat { class="w-40" }
+┌─────┐ ┌───┐
+│Alice│ │Bob│
+└──┬──┘ └─┬─┘
+ │ │
+ │ Hello Bob! │
+ │───────────>│
+ │ │
+ │Hello Alice!│
+ │<───────────│
+┌──┴──┐ ┌─┴─┐
+│Alice│ │Bob│
+└─────┘ └───┘
+
+```
+
+
+### Flowchart
+
+<https://arthursonzogni.com/Diagon/#Flowchart>
+
+```goat
+ _________________
+ ╱ ╲ ┌─────┐
+ ╱ DO YOU UNDERSTAND ╲____________________________________________________│GOOD!│
+ ╲ FLOW CHARTS? ╱yes └──┬──┘
+ ╲_________________╱ │
+ │no │
+ _________▽_________ ______________________ │
+ ╱ ╲ ╱ ╲ ┌────┐ │
+╱ OKAY, YOU SEE THE ╲________________╱ ... AND YOU CAN SEE ╲___│GOOD│ │
+╲ LINE LABELED 'YES'? ╱yes ╲ THE ONES LABELED 'NO'? ╱yes└──┬─┘ │
+ ╲___________________╱ ╲______________________╱ │ │
+ │no │no │ │
+ ________▽_________ _________▽__________ │ │
+ ╱ ╲ ┌───────────┐ ╱ ╲ │ │
+ ╱ BUT YOU SEE THE ╲___│WAIT, WHAT?│ ╱ BUT YOU JUST ╲___ │ │
+ ╲ ONES LABELED 'NO'? ╱yes└───────────┘ ╲ FOLLOWED THEM TWICE? ╱yes│ │ │
+ ╲__________________╱ ╲____________________╱ │ │ │
+ │no │no │ │ │
+ ┌───▽───┐ │ │ │ │
+ │LISTEN.│ └───────┬───────┘ │ │
+ └───┬───┘ ┌──────▽─────┐ │ │
+ ┌─────▽────┐ │(THAT WASN'T│ │ │
+ │I HATE YOU│ │A QUESTION) │ │ │
+ └──────────┘ └──────┬─────┘ │ │
+ ┌────▽───┐ │ │
+ │SCREW IT│ │ │
+ └────┬───┘ │ │
+ └─────┬─────┘ │
+ │ │
+ └─────┬─────┘
+ ┌───────▽──────┐
+ │LET'S GO DRING│
+ └───────┬──────┘
+ ┌─────────▽─────────┐
+ │HEY, I SHOULD TRY │
+ │INSTALLING FREEBSD!│
+ └───────────────────┘
+
+```
+
+
+### Table
+
+<https://arthursonzogni.com/Diagon/#Table>
+
+```goat { class="w-80 dark-blue" }
+┌────────────────────────────────────────────────┐
+│ │
+├────────────────────────────────────────────────┤
+│SYNTAX = { PRODUCTION } . │
+├────────────────────────────────────────────────┤
+│PRODUCTION = IDENTIFIER "=" EXPRESSION "." . │
+├────────────────────────────────────────────────┤
+│EXPRESSION = TERM { "|" TERM } . │
+├────────────────────────────────────────────────┤
+│TERM = FACTOR { FACTOR } . │
+├────────────────────────────────────────────────┤
+│FACTOR = IDENTIFIER │
+├────────────────────────────────────────────────┤
+│ | LITERAL │
+├────────────────────────────────────────────────┤
+│ | "[" EXPRESSION "]" │
+├────────────────────────────────────────────────┤
+│ | "(" EXPRESSION ")" │
+├────────────────────────────────────────────────┤
+│ | "{" EXPRESSION "}" . │
+├────────────────────────────────────────────────┤
+│IDENTIFIER = letter { letter } . │
+├────────────────────────────────────────────────┤
+│LITERAL = """" character { character } """" .│
+└────────────────────────────────────────────────┘
+```
--- /dev/null
- title: Content Formats
- linkTitle: Content Formats
+---
- ## External Helpers
++title: Content formats
+description: Both HTML and Markdown are supported content formats.
+categories: [content management]
+keywords: [markdown,asciidoc,pandoc,content format]
+menu:
+ docs:
+ parent: content-management
+ weight: 40
+toc: true
+weight: 40
+aliases: [/content/markdown-extras/,/content/supported-formats/,/doc/supported-formats/]
+---
+
+You can put any file type into your `/content` directories, but Hugo uses the `markup` front matter value if set or the file extension (see `Markup identifiers` in the table below) to determine if the markup needs to be processed, e.g.:
+
+* Markdown converted to HTML
+* [Shortcodes](/content-management/shortcodes/) processed
+* Layout applied
+
+## List of content formats
+
+The current list of content formats in Hugo:
+
+| Name | Markup identifiers | Comment |
+| ------------- | ------------- |-------------|
+| Goldmark | md, markdown, goldmark |Note that you can set the default handler of `md` and `markdown` to something else, see [Configure Markup](/getting-started/configuration-markup/).|
+|Emacs Org-Mode|org|See [go-org](https://github.com/niklasfasching/go-org).|
+|AsciiDoc|asciidocext, adoc, ad|Needs [Asciidoctor][ascii] installed.|
+|RST|rst|Needs [RST](https://docutils.sourceforge.io/rst.html) installed.|
+|Pandoc|pandoc, pdc|Needs [Pandoc](https://www.pandoc.org/) installed.|
+|HTML|html, htm|To be treated as a content file, with layout, shortcodes etc., it must have front matter. If not, it will be copied as-is.|
+
+The `markup identifier` is fetched from either the `markup` variable in front matter or from the file extension. For markup-related configuration, see [Configure Markup](/getting-started/configuration-markup/).
+
- ### External Helper AsciiDoc
-
- [AsciiDoc](https://github.com/asciidoc/asciidoc) implementation EOLs in Jan 2020 and is no longer supported.
- AsciiDoc development is being continued under [Asciidoctor](https://github.com/asciidoctor). The format AsciiDoc
- remains of course. Please continue with the implementation Asciidoctor.
-
- ### External Helper Asciidoctor
++## External helpers
+
+Some of the formats in the table above need external helpers installed on your PC. For example, for AsciiDoc files,
+Hugo will try to call the `asciidoctor` command. This means that you will have to install the associated
+tool on your machine to be able to use these formats.
+
+Hugo passes reasonable default arguments to these external helpers by default:
+
+- `asciidoctor`: `--no-header-footer -`
+- `rst2html`: `--leave-comments --initial-header-level=2`
+- `pandoc`: `--mathjax`
+
+{{% note %}}
+Because additional formats are external commands, generation performance will rely heavily on the performance of the external tool you are using. As this feature is still in its infancy, feedback is welcome.
+{{% /note %}}
+
- ## Learn Markdown
++### External helper Asciidoctor
+
+The Asciidoctor community offers a wide set of tools for the AsciiDoc format that can be installed additionally to Hugo.
+[See the Asciidoctor docs for installation instructions](https://asciidoctor.org/docs/install-toolchain/). Make sure that also all
+optional extensions like `asciidoctor-diagram` or `asciidoctor-html5s` are installed if required.
+
+{{% note %}}
+External `asciidoctor` command requires Hugo rendering to _disk_ to a specific destination directory. It is required to run Hugo with the command option `--destination`.
+{{% /note %}}
+
+Some [Asciidoctor](https://asciidoctor.org/man/asciidoctor/) parameters can be customized in Hugo:
+
+Parameter | Comment
+--- | ---
+backend | Don't change this unless you know what you are doing.
+doctype | Currently, the only document type supported in Hugo is `article`.
+extensions | Possible extensions are `asciidoctor-html5s`, `asciidoctor-bibtex`, `asciidoctor-diagram`, `asciidoctor-interdoc-reftext`, `asciidoctor-katex`, `asciidoctor-latex`, `asciidoctor-mathematical`, `asciidoctor-question`, `asciidoctor-rouge`.
+attributes | Variables to be referenced in your AsciiDoc file. This is a list of variable name/value maps. See [Asciidoctor's attributes](https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#attributes-and-substitutions).
+noHeaderOrFooter | Output an embeddable document, which excludes the header, the footer, and everything outside the body of the document. Don't change this unless you know what you are doing.
+safeMode | Safe mode level `unsafe`, `safe`, `server` or `secure`. Don't change this unless you know what you are doing.
+sectionNumbers | Auto-number section titles.
+verbose | Verbosely print processing information and configuration file checks to stderr.
+trace | Include backtrace information on errors.
+failureLevel | The minimum logging level that triggers a non-zero exit code (failure).
+
+Hugo provides additional settings that don't map directly to Asciidoctor's CLI options:
+
+workingFolderCurrent
+: Sets the working directory to be the same as that of the AsciiDoc file being processed, so that [include](https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#include-files) will work with relative paths. This setting uses the `asciidoctor` cli parameter `--base-dir` and attribute `outdir=`. For rendering diagrams with [asciidoctor-diagram](https://asciidoctor.org/docs/asciidoctor-diagram/), `workingFolderCurrent` must be set to `true`.
+
+preserveTOC
+: By default, Hugo removes the table of contents generated by Asciidoctor and provides it through the built-in variable [`.TableOfContents`](/content-management/toc/) to enable further customization and better integration with the various Hugo themes. This option can be set to `true` to preserve Asciidoctor's TOC in the generated page.
+
+Below are all the AsciiDoc related settings in Hugo with their default values:
+
+{{< code-toggle config="markup.asciidocExt" />}}
+
+Notice that for security concerns only extensions that do not have path separators (either `\`, `/` or `.`) are allowed. That means that extensions can only be invoked if they are in one's ruby's `$LOAD_PATH` (ie. most likely, the extension has been installed by the user). Any extension declared relative to the website's path will not be accepted.
+
+Example of how to set extensions and attributes:
+
+```yml
+[markup.asciidocExt]
+ extensions = ["asciidoctor-html5s", "asciidoctor-diagram"]
+ workingFolderCurrent = true
+ [markup.asciidocExt.attributes]
+ my-base-url = "https://example.com/"
+ my-attribute-name = "my value"
+```
+
+In a complex Asciidoctor environment it is sometimes helpful to debug the exact call to your external helper with all
+parameters. Run Hugo with `-v`. You will get an output like
+
+```txt
+INFO 2019/12/22 09:08:48 Rendering book-as-pdf.adoc with C:\Ruby26-x64\bin\asciidoctor.bat using asciidoc args [--no-header-footer -r asciidoctor-html5s -b html5s -r asciidoctor-diagram --base-dir D:\prototypes\hugo_asciidoc_ddd\docs -a outdir=D:\prototypes\hugo_asciidoc_ddd\build -] ...
+```
+
++## Learn markdown
+
+Markdown syntax is simple enough to learn in a single sitting. The following are excellent resources to get you up and running:
+
+* [Daring Fireball: Markdown, John Gruber (Creator of Markdown)][fireball]
+* [Markdown Cheatsheet, Adam Pritchard][mdcheatsheet]
+* [Markdown Tutorial (Interactive), Garen Torikian][mdtutorial]
+* [The Markdown Guide, Matt Cone][mdguide]
+
+[`emojify` function]: /functions/emojify/
+[ascii]: https://asciidoctor.org/
+[config]: /getting-started/configuration/
+[developer tools]: /tools/
+[emojis]: https://www.webpagefx.com/tools/emoji-cheat-sheet/
+[fireball]: https://daringfireball.net/projects/markdown/
+[gfmtasks]: https://guides.github.com/features/mastering-markdown/#syntax
+[helperssource]: https://github.com/gohugoio/hugo/blob/77c60a3440806067109347d04eb5368b65ea0fe8/helpers/general.go#L65
+[hl]: /content-management/syntax-highlighting/
+[hlsc]: /content-management/shortcodes/#highlight
+[hugocss]: /css/style.css
+[ietf]: https://tools.ietf.org/html/
+[mathjaxdocs]: https://docs.mathjax.org/en/latest/
+[mdcheatsheet]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet
+[mdguide]: https://www.markdownguide.org/
+[mdtutorial]: https://www.markdowntutorial.com/
+[org]: https://orgmode.org/
+[pandoc]: https://www.pandoc.org/
+[rest]: https://docutils.sourceforge.io/rst.html
+[sc]: /content-management/shortcodes/
+[sct]: /templates/shortcode-templates/
--- /dev/null
- title: Front Matter
+---
- ## Front Matter Formats
++title: Front matter
+description: Hugo allows you to add front matter in yaml, toml, or json to your content files.
+categories: [content management]
+keywords: ["front matter", "yaml", "toml", "json", "metadata", "archetypes"]
+menu:
+ docs:
+ parent: content-management
+ weight: 60
+toc: true
+weight: 60
+aliases: [/content/front-matter/]
+---
+
+**Front matter** allows you to keep metadata attached to an instance of a [content type]---i.e., embedded inside a content file---and is one of the many features that gives Hugo its strength.
+
+{{< youtube Yh2xKRJGff4 >}}
+
- ## Front Matter Variables
++## Front matter formats
+
+Hugo supports four formats for front matter, each with their own identifying tokens.
+
+TOML
+: identified by opening and closing `+++`.
+
+YAML
+: identified by opening and closing `---`.
+
+JSON
+: a single JSON object surrounded by '`{`' and '`}`', followed by a new line.
+
+ORG
+: a group of Org mode keywords in the format '`#+KEY: VALUE`'. Any line that does not start with `#+` ends the front matter section.
+ Keyword values can be either strings (`#+KEY: VALUE`) or a whitespace separated list of strings (`#+KEY[]: VALUE_1 VALUE_2`).
+
+### Example
+
+{{< code-toggle >}}
+title = "spf13-vim 3.0 release and new website"
+description = "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
+tags = [ ".vimrc", "plugins", "spf13-vim", "vim" ]
+date = "2012-04-06"
+categories = [
+ "Development",
+ "VIM"
+]
+slug = "spf13-vim-3-0-release-and-new-website"
+{{< /code-toggle >}}
+
- : Used for creating links to content; if set, Hugo defaults to using the `linktitle` before the `title`. Hugo can also [order lists of content by `linktitle`][bylinktitle].
++## Front matter variables
+
+### Predefined
+
+There are a few predefined variables that Hugo is aware of. See [Page Variables][pagevars] for how to call many of these predefined variables in your templates.
+
+aliases
+: An array of one or more aliases (e.g., old published paths of renamed content) that will be created in the output directory structure . See [Aliases][aliases] for details.
+
+audio
+: An array of paths to audio files related to the page; used by the `opengraph` [internal template](/templates/internal) to populate `og:audio`.
+
+cascade
+: A map of front matter keys whose values are passed down to the page's descendants unless overwritten by self or a closer ancestor's cascade. See [Front Matter Cascade](#front-matter-cascade) for details.
+
+date
+: The datetime assigned to this page. This is usually fetched from the `date` field in front matter, but this behavior is configurable.
+
+description
+: The description for the content.
+
+draft
+: If `true`, the content will not be rendered unless the `--buildDrafts` flag is passed to the `hugo` command.
+
+expiryDate
+: The datetime at which the content should no longer be published by Hugo; expired content will not be rendered unless the `--buildExpired` flag is passed to the `hugo` command.
+
+headless
+: If `true`, sets a leaf bundle to be [headless][headless-bundle].
+
+images
+: An array of paths to images related to the page; used by [internal templates](/templates/internal) such as `_internal/twitter_cards.html`.
+
+isCJKLanguage
+: If `true`, Hugo will explicitly treat the content as a CJK language; both `.Summary` and `.WordCount` work properly in CJK languages.
+
+keywords
+: The meta keywords for the content.
+
+layout
+: The layout Hugo should select from the [lookup order][lookup] when rendering the content. If a `type` is not specified in the front matter, Hugo will look for the layout of the same name in the layout directory that corresponds with a content's section. See [Content Types][content type].
+
+lastmod
+: The datetime at which the content was last modified.
+
+linkTitle
- If neither `slug` nor `url` is present and [permalinks are not configured otherwise in your site configuration file](/content-management/urls/#permalinks), Hugo will use the filename of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors.
++: Used for creating links to content; if set, Hugo defaults to using the `linkTitle` before the `title`. Hugo can also [order lists of content by `linkTitle`][bylinktitle].
+
+markup
+: **experimental**; specify `"rst"` for reStructuredText (requires`rst2html`) or `"md"` (default) for Markdown.
+
+outputs
+: Allows you to specify output formats specific to the content. See [output formats][outputs].
+
+publishDate
+: If in the future, content will not be rendered unless the `--buildFuture` flag is passed to `hugo`.
+
+resources
+: Used for configuring page bundle resources. See [Page Resources][page-resources].
+
+series
+: An array of series this page belongs to, as a subset of the `series` [taxonomy](/content-management/taxonomies/); used by the `opengraph` [internal template](/templates/internal) to populate `og:see_also`.
+
+slug
+: Overrides the last segment of the URL path. Not applicable to section pages. See [URL Management](/content-management/urls/#slug) for details.
+
+summary
+: Text used when providing a summary of the article in the `.Summary` page variable; details available in the [content-summaries](/content-management/summaries/) section.
+
+title
+: The title for the content.
+
+type
+: The type of the content; this value will be automatically derived from the directory (i.e., the [section]) if not specified in front matter.
+
+url
+: Overrides the entire URL path. Applicable to regular pages and section pages. See [URL Management](/content-management/urls/#url) for details.
+
+videos
+: An array of paths to videos related to the page; used by the `opengraph` [internal template](/templates/internal) to populate `og:video`.
+
+weight
+: used for [ordering your content in lists][ordering]. Lower weight gets higher precedence. So content with lower weight will come first. If set, weights should be non-zero, as 0 is interpreted as an *unset* weight.
+
+\<taxonomies\>
+: Field name of the *plural* form of the index. See `tags` and `categories` in the above front matter examples. *Note that the plural form of user-defined taxonomies cannot be the same as any of the predefined front matter variables.*
+
+{{% note %}}
- ### User-Defined
++If neither `slug` nor `url` is present and [permalinks are not configured otherwise in your site configuration file](/content-management/urls/#permalinks), Hugo will use the file name of your content to create the output URL. See [Content Organization](/content-management/organization) for an explanation of paths in Hugo and [URL Management](/content-management/urls/) for ways to customize Hugo's default behaviors.
+{{% /note %}}
+
- ## Front Matter Cascade
++### User-defined
+
+You can add fields to your front matter arbitrarily to meet your needs. These user-defined key-values are placed into a single `.Params` variable for use in your templates.
+
+The following fields can be accessed via `.Params.include_toc` and `.Params.show_comments`, respectively. The [Variables] section provides more information on using Hugo's page- and site-level variables in your templates.
+
+{{< code-toggle copy=false >}}
+include_toc: true
+show_comments: false
+{{</ code-toggle >}}
+
- Any node or section can pass down to descendants a set of Front Matter values as long as defined underneath the reserved `cascade` Front Matter key.
++## Front matter cascade
+
- ### Target Specific Pages
++Any node or section can pass down to descendants a set of front matter values as long as defined underneath the reserved `cascade` front matter key.
+
- ## Order Content Through Front Matter
++### Target specific pages
+
+The `cascade` block can be a slice with a optional `_target` keyword, allowing for multiple `cascade` values targeting different page sets.
+
+{{< code-toggle copy=false >}}
+title ="Blog"
+[[cascade]]
+background = "yosemite.jpg"
+[cascade._target]
+path="/blog/**"
+lang="en"
+kind="page"
+[[cascade]]
+background = "goldenbridge.jpg"
+[cascade._target]
+kind="section"
+{{</ code-toggle >}}
+
+Keywords available for `_target`:
+
+path
+: A [Glob](https://github.com/gobwas/glob) pattern matching the content path below /content. Expects Unix-styled slashes. Note that this is the virtual path, so it starts at the mount root. The matching supports double-asterisks so you can match for patterns like `/blog/*/**` to match anything from the third level and down.
+
+kind
+: A Glob pattern matching the Page's Kind(s), e.g. "{home,section}".
+
+lang
+: A Glob pattern matching the Page's language, e.g. "{en,sv}".
+
+environment
+: A Glob pattern matching the build environment, e.g. "{production,development}"
+
+Any of the above can be omitted.
+
+### Example
+
+In `content/blog/_index.md`
+
+{{< code-toggle copy=false >}}
+title: Blog
+cascade:
+ banner: images/typewriter.jpg
+{{</ code-toggle >}}
+
+With the above example the Blog section page and its descendants will return `images/typewriter.jpg` when `.Params.banner` is invoked unless:
+
+- Said descendant has its own `banner` value set
+- Or a closer ancestor node has its own `cascade.banner` value set.
+
- ## Override Global Markdown Configuration
++## Order content through front matter
+
+You can assign content-specific `weight` in the front matter of your content. These values are especially useful for [ordering][ordering] in list views. You can use `weight` for ordering of content and the convention of [`<TAXONOMY>_weight`][taxweight] for ordering content within a taxonomy. See [Ordering and Grouping Hugo Lists][lists] to see how `weight` can be used to organize your content in list views.
+
- It's possible to set some options for Markdown rendering in a content's front matter as an override to the [Rendering options set in your project configuration][config].
++## Override global markdown configuration
+
- ## Front Matter Format Specs
++It's possible to set some options for Markdown rendering in a content's front matter as an override to the [rendering options set in your project configuration][config].
+
- [config]: /getting-started/configuration/ "Hugo documentation for site configuration"
++## Front matter format specs
+
+- [TOML Spec][toml]
+- [YAML Spec][yaml]
+- [JSON Spec][json]
+
+[variables]: /variables/
+[aliases]: /content-management/urls/#aliases
+[archetype]: /content-management/archetypes/
+[bylinktitle]: /templates/lists/#by-link-title
- [json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
- [lists]: /templates/lists/#order-content "See how to order content in list pages; for example, templates that look to specific _index.md for content and front matter."
- [lookup]: /templates/lookup-order/ "Hugo traverses your templates in a specific order when rendering content to allow for DRYer templating."
- [ordering]: /templates/lists/ "Hugo provides multiple ways to sort and order your content in list templates"
- [outputs]: /templates/output-formats/ "With the release of v22, you can output your content to any text format using Hugo's familiar templating"
++[config]: /getting-started/configuration/
+[content type]: /content-management/types/
+[contentorg]: /content-management/organization/
+[headless-bundle]: /content-management/page-bundles/#headless-bundle
- [yaml]: https://yaml.org/spec/ "Specification for YAML, YAML Ain't Markup Language"
++[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
++[lists]: /templates/lists/#order-content
++[lookup]: /templates/lookup-order/
++[ordering]: /templates/lists/
++[outputs]: /templates/output-formats/
+[page-resources]: /content-management/page-resources/
+[pagevars]: /variables/page/
+[section]: /content-management/sections/
+[taxweight]: /content-management/taxonomies/
+[toml]: https://toml.io/
+[urls]: /content-management/urls/
+[variables]: /variables/
++[yaml]: https://yaml.org/spec/
--- /dev/null
- title: Image Processing
+---
- categories: [content management]
++title: Image processing
+description: Resize, crop, rotate, filter, and convert images.
- ## Image Resources
++categories: [fundamentals,content management]
+keywords: [resources, images]
+menu:
+ docs:
+ parent: content-management
+ weight: 90
+toc: true
+weight: 90
+---
- ### Page Resources
++## Image resources
+
+To process an image, you must access the image as either a page resource or a global resource.
+
- ### Global Resources
++### Page resources
+
+A page resource is a file within a [page bundle]. A page bundle is a directory with an `index.md` or `_index.md` file at its root.
+
+```text
+content/
+└── posts/
+ └── post-1/ <-- page bundle
+ ├── index.md
+ └── sunset.jpg <-- page resource
+```
+
- ## Image Rendering
++### Global resources
+
+A global resource is a file:
+
+- Within the `assets` directory, or
+- Within any directory [mounted] to the `assets` directory, or
+- Located on a remote server accessible via `http` or `https`
+
+```text
+assets/
+└── images/
+ └── sunset.jpg <-- global resource
+```
+
+To access a local image as a global resource:
+
+```go-html-template
+{{ $image := resources.Get "images/sunset.jpg" }}
+```
+
+To access a remote image as a global resource:
+
+```go-html-template
+{{ $image := resources.GetRemote "https://gohugo.io/img/hugo-logo.png" }}
+```
+
- ## Image Processing Methods
++## Image rendering
+
+Once you have accessed an image as either a page resource or a global resource, render it in your templates using the `Permalink`, `RelPermalink`, `Width`, and `Height` properties.
+
+Example 1: Throws an error if the resource is not found.
+
+```go-html-template
+{{ $image := .Resources.GetMatch "sunset.jpg" }}
+<img src="{{ $image.RelPermalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}">
+```
+
+Example 2: Skips image rendering if the resource is not found.
+
+```go-html-template
+{{ $image := .Resources.GetMatch "sunset.jpg" }}
+{{ with $image }}
+ <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}">
+{{ end }}
+```
+
+Example 3: A more concise way to skip image rendering if the resource is not found.
+
+```go-html-template
+{{ with .Resources.GetMatch "sunset.jpg" }}
+ <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}">
+{{ end }}
+```
+
- Metadata (Exif, IPTC, XMP, etc.) is not preserved during image transformation. Use the [`Exif`] method with the _original_ image to extract Exif metadata from JPEG or TIFF images.
++## Image processing methods
+
+The `image` resource implements the [`Resize`], [`Fit`], [`Fill`], [`Crop`], [`Filter`], [`Colors`] and [`Exif`] methods.
+
+{{% note %}}
- ### Exif
++Metadata (EXIF, IPTC, XMP, etc.) is not preserved during image transformation. Use the [`Exif`] method with the _original_ image to extract EXIF metadata from JPEG or TIFF images.
+{{% /note %}}
+
+### Resize
+
+Resize an image to the specified width and/or height.
+
+If you specify both width and height, the resulting image will be disproportionally scaled unless the original image has the same aspect ratio.
+
+```go-html-template
+{{/* Resize to a width of 600px and preserve aspect ratio */}}
+{{ $image := $image.Resize "600x" }}
+
+{{/* Resize to a height of 400px and preserve aspect ratio */}}
+{{ $image := $image.Resize "x400" }}
+
+{{/* Resize to a width of 600px and a height of 400px */}}
+{{ $image := $image.Resize "600x400" }}
+```
+
+### Fit
+
+Downscale an image to fit the given dimensions while maintaining aspect ratio. You must provide both width and height.
+
+```go-html-template
+{{ $image := $image.Fit "600x400" }}
+```
+
+### Fill
+
+Crop and resize an image to match the given dimensions. You must provide both width and height. Use the [`anchor`] option to change the crop box anchor point.
+
+```go-html-template
+{{ $image := $image.Fill "600x400" }}
+```
+
+### Crop
+
+Crop an image to match the given dimensions without resizing. You must provide both width and height. Use the [`anchor`] option to change the crop box anchor point.
+
+```go-html-template
+{{ $image := $image.Crop "600x400" }}
+```
+
+### Filter
+
+Apply one or more [filters] to an image.
+
+```go-html-template
+{{ $image := $image.Filter (images.GaussianBlur 6) (images.Pixelate 8) }}
+```
+
+Write this in a more functional style using pipes. Hugo applies the filters in the order given.
+
+```go-html-template
+{{ $image := $image | images.Filter (images.GaussianBlur 6) (images.Pixelate 8) }}
+```
+
+Sometimes it can be useful to create the filter chain once and then reuse it.
+
+```go-html-template
+{{ $filters := slice (images.GaussianBlur 6) (images.Pixelate 8) }}
+{{ $image1 := $image1.Filter $filters }}
+{{ $image2 := $image2.Filter $filters }}
+```
+
+### Colors
+
+{{< new-in "0.104.0" >}}
+
+`.Colors` returns a slice of hex strings with the dominant colors in the image using a simple histogram method.
+
+```go-html-template
+{{ $colors := $image.Colors }}
+```
+
+This method is fast, but if you also scale down your images, it would be good for performance to extract the colors from the scaled down image.
+
+
- Provides an [Exif] object containing image metadata.
++### EXIF
+
- You may access Exif data in JPEG and TIFF images. To prevent errors when processing images without Exif data, wrap the access in a [`with`] statement.
++Provides an [EXIF] object containing image metadata.
+
- You may also access Exif fields individually, using the [`lang.FormatNumber`] function to format the fields as needed.
++You may access EXIF data in JPEG and TIFF images. To prevent errors when processing images without EXIF data, wrap the access in a [`with`] statement.
+
+```go-html-template
+{{ with $image.Exif }}
+ Date: {{ .Date }}
+ Lat/Long: {{ .Lat }}/{{ .Long }}
+ Tags:
+ {{ range $k, $v := .Tags }}
+ TAG: {{ $k }}: {{ $v }}
+ {{ end }}
+{{ end }}
+```
+
- #### Exif Variables
++You may also access EXIF fields individually, using the [`lang.FormatNumber`] function to format the fields as needed.
+
+```go-html-template
+{{ with $image.Exif }}
+ <ul>
+ {{ with .Date }}<li>Date: {{ .Format "January 02, 2006" }}</li>{{ end }}
+ {{ with .Tags.ApertureValue }}<li>Aperture: {{ lang.FormatNumber 2 . }}</li>{{ end }}
+ {{ with .Tags.BrightnessValue }}<li>Brightness: {{ lang.FormatNumber 2 . }}</li>{{ end }}
+ {{ with .Tags.ExposureTime }}<li>Exposure Time: {{ . }}</li>{{ end }}
+ {{ with .Tags.FNumber }}<li>F Number: {{ . }}</li>{{ end }}
+ {{ with .Tags.FocalLength }}<li>Focal Length: {{ . }}</li>{{ end }}
+ {{ with .Tags.ISOSpeedRatings }}<li>ISO Speed Ratings: {{ . }}</li>{{ end }}
+ {{ with .Tags.LensModel }}<li>Lens Model: {{ . }}</li>{{ end }}
+ </ul>
+{{ end }}
+```
+
- : A collection of the available Exif tags for this image. You may include or exclude specific tags from this collection in the [site configuration](#exif-data).
++#### EXIF variables
+
+.Date
+: Image creation date/time. Format with the [time.Format] function.
+
+.Lat
+: GPS latitude in degrees.
+
+.Long
+: GPS longitude in degrees.
+
+.Tags
- ## Image Processing Options
++: A collection of the available EXIF tags for this image. You may include or exclude specific tags from this collection in the [site configuration](#exif-data).
+
- ### Target Format
++## Image processing options
+
+The [`Resize`], [`Fit`], [`Fill`], and [`Crop`] methods accept a space-separated, case-insensitive list of options. The order of the options within the list is irrelevant.
+
+### Dimensions
+
+With the [`Resize`] method you must specify width, height, or both. The [`Fit`], [`Fill`], and [`Crop`] methods require both width and height. All dimensions are in pixels.
+
+```go-html-template
+{{ $image := $image.Resize "600x" }}
+{{ $image := $image.Resize "x400" }}
+{{ $image := $image.Resize "600x400" }}
+{{ $image := $image.Fit "600x400" }}
+{{ $image := $image.Fill "600x400" }}
+{{ $image := $image.Crop "600x400" }}
+```
+
+### Rotation
+
+Rotates an image counter-clockwise by the given angle. Hugo performs rotation _before_ scaling. For example, if the original image is 600x400 and you wish to rotate the image 90 degrees counter-clockwise while scaling it by 50%:
+
+```go-html-template
+{{ $image = $image.Resize "200x r90" }}
+```
+
+In the example above, the width represents the desired width _after_ rotation.
+
+To rotate an image without scaling, use the dimensions of the original image:
+
+```go-html-template
+{{ with .Resources.GetMatch "sunset.jpg" }}
+ {{ with .Resize (printf "%dx%d r90" .Height .Width) }}
+ <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}">
+ {{ end }}
+{{ end }}
+```
+
+In the example above, on the second line, we have reversed width and height to reflect the desired dimensions _after_ rotation.
+
+### Anchor
+
+When using the [`Crop`] or [`Fill`] method, the _anchor_ determines the placement of the crop box. You may specify `TopLeft`, `Top`, `TopRight`, `Left`, `Center`,`Right`, `BottomLeft`, `Bottom`, `BottomRight`, or `Smart`.
+
+The default value is `Smart`, which uses [Smartcrop] image analysis to determine the optimal placement of the crop box. You may override the default value in the [site configuration].
+
+For example, if you have a 400x200 image with a bird in the upper left quadrant, you can create a 200x100 thumbnail containing the bird:
+
+```go-html-template
+{{ $image.Crop "200x100 TopLeft" }}
+```
+
+If you apply [rotation](#rotation) when using the [`Crop`] or [`Fill`] method, specify the anchor relative to the rotated image.
+
- ### Background Color
++### Target format
+
+By default, Hugo encodes the image in the source format. You may convert the image to another format by specifying `bmp`, `gif`, `jpeg`, `jpg`, `png`, `tif`, `tiff`, or `webp`.
+
+```go-html-template
+{{ $image.Resize "600x webp" }}
+```
+
+To convert an image without scaling, use the dimensions of the original image:
+
+```go-html-template
+{{ with .Resources.GetMatch "sunset.jpg" }}
+ {{ with .Resize (printf "%dx%d webp" .Width .Height) }}
+ <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}">
+ {{ end }}
+{{ end }}
+```
+
+### Quality
+
+Applicable to JPEG and WebP images, the `q` value determines the quality of the converted image. Higher values produce better quality images, while lower values produce smaller files. Set this value to a whole number between 1 and 100, inclusive.
+
+The default value is 75. You may override the default value in the [site configuration].
+
+```go-html-template
+{{ $image.Resize "600x webp q50" }}
+```
+
+### Hint
+
+<!-- Specifies a libwebp preset, not a libwebp image hint. -->
+
+Applicable to WebP images, this option corresponds to a set of predefined encoding parameters.
+
+Value|Example
+:--|:--
+`drawing`|Hand or line drawing with high-contrast details
+`icon`|Small colorful image
+`photo`|Outdoor photograph with natural lighting
+`picture`|Indoor photograph such as a portrait
+`text`|Image that is primarily text
+
+The default value is `photo`. You may override the default value in the [site configuration].
+
+```go-html-template
+{{ $image.Resize "600x webp picture" }}
+```
+
- ### Resampling Filter
++### Background color
+
+When converting an image from a format that supports transparency (e.g., PNG) to a format that does _not_ support transparency (e.g., JPEG), you may specify the background color of the resulting image.
+
+Use either a 3-digit or a 6-digit hexadecimal color code (e.g., `#00f` or `#0000ff`).
+
+The default value is `#ffffff` (white). You may override the default value in the [site configuration].
+
+```go-html-template
+{{ $image.Resize "600x jpg #b31280" }}
+```
+
- ## Image Processing Examples
++### Resampling filter
+
+You may specify the resampling filter used when resizing an image. Commonly used resampling filters include:
+
+Filter|Description
+:--|:--
+`Box`|Simple and fast averaging filter appropriate for downscaling
+`Lanczos`|High-quality resampling filter for photographic images yielding sharp results
+`CatmullRom`|Sharp cubic filter that is faster than the Lanczos filter while providing similar results
+`MitchellNetravali`|Cubic filter that produces smoother results with less ringing artifacts than CatmullRom
+`Linear`|Bilinear resampling filter, produces smooth output, faster than cubic filters
+`NearestNeighbor`|Fastest resampling filter, no antialiasing
+
+The default value is `Box`. You may override the default value in the [site configuration].
+
+```go-html-template
+{{ $image.Resize "600x400 Lanczos" }}
+```
+
+See [github.com/disintegration/imaging] for the complete list of resampling filters. If you wish to improve image quality at the expense of performance, you may wish to experiment with the alternative filters.
+
- ## Imaging Configuration
++## Image processing examples
+
+_The photo of the sunset used in the examples below is Copyright [Bjørn Erik Pedersen](https://commons.wikimedia.org/wiki/User:Bep) (Creative Commons Attribution-Share Alike 4.0 International license)_
+
+{{< imgproc sunset Resize "300x" />}}
+
+{{< imgproc sunset Fill "90x120 left" />}}
+
+{{< imgproc sunset Fill "90x120 right" />}}
+
+{{< imgproc sunset Fit "90x90" />}}
+
+{{< imgproc sunset Crop "250x250 center" />}}
+
+{{< imgproc sunset Resize "300x q10" />}}
+
+This is the shortcode used to generate the examples above:
+
+{{< code file="layouts/shortcodes/imgproc.html" >}}
+{{< readfile file="layouts/shortcodes/imgproc.html" >}}
+{{< /code >}}
+
+Call the shortcode from your Markdown like this:
+
+```go-html-template
+{{</* imgproc sunset Resize "300x" /*/>}}
+```
+
+{{% note %}}
+Note the self-closing shortcode syntax above. You may call the `imgproc` shortcode with or without **inner content**.
+{{% /note %}}
+
- ### Processing Options
++## Imaging configuration
+
- ### Exif Data
++### Processing options
+
+Define an `imaging` section in your site configuration to set the default [image processing options](#image-processing-options).
+
+{{< code-toggle file="hugo" copy=true >}}
+[imaging]
+resampleFilter = "Box"
+quality = 75
+hint = "photo"
+anchor = "Smart"
+bgColor = "#ffffff"
+{{< /code-toggle >}}
+
+anchor
+: See image processing options: [anchor](#anchor).
+
+bgColor
+: See image processing options: [background color](#background-color).
+
+hint
+: See image processing options: [hint](#hint).
+
+quality
+: See image processing options: [quality](#quality).
+
+resampleFilter
+: See image processing options: [resampling filter](#resampling-filter).
+
- Define an `imaging.exif` section in your site configuration to control the availability of Exif data.
++### EXIF data
+
- : Regular expression matching the Exif tags to exclude from the `.Tags` collection. Default is `""`.
++Define an `imaging.exif` section in your site configuration to control the availability of EXIF data.
+
+{{< code-toggle file="hugo" copy=true >}}
+[imaging.exif]
+includeFields = ""
+excludeFields = ""
+disableDate = false
+disableLatLong = false
+{{< /code-toggle >}}
+
+disableDate
+: Hugo extracts the image creation date/time into `.Date`. Set this to `true` to disable. Default is `false`.
+
+disableLatLong
+: Hugo extracts the GPS latitude and longitude into `.Lat` and `.Long`. Set this to `true` to disable. Default is `false`.
+
+excludeFields
- : Regular expression matching the Exif tags to include in the `.Tags` collection. Default is `""`. To include all available tags, set this value to `".*"`.
++: Regular expression matching the EXIF tags to exclude from the `.Tags` collection. Default is `""`.
+
+includeFields
- ## Smart Cropping of Images
++: Regular expression matching the EXIF tags to include in the `.Tags` collection. Default is `""`. To include all available tags, set this value to `".*"`.
+
+{{% note %}}
+To improve performance and decrease cache size, if you set neither `excludeFields` nor `includeFields`, Hugo excludes the following tags: `ColorSpace`, `Contrast`, `Exif`, `Exposure[M|P|B]`, `Flash`, `GPS`, `JPEG`, `Metering`, `Resolution`, `Saturation`, `Sensing`, `Sharp`, and `WhiteBalance`.
+{{% /note %}}
+
- ## Image Processing Performance Consideration
++## Smart cropping of images
+
+By default, Hugo uses the [Smartcrop] library when cropping images with the `Crop` or`Fill` methods. You can set the anchor point manually, but in most cases the `Smart` option will make a good choice.
+
+Examples using the sunset image from above:
+
+{{< imgproc sunset Fill "200x200 smart" />}}
+
+{{< imgproc sunset Crop "200x200 smart" />}}
+
- [mounted]: /hugo-modules/configuration#module-config-mounts
++## Image processing performance consideration
+
+Hugo caches processed images in the `resources` directory. If you include this directory in source control, Hugo will not have to regenerate the images in a CI/CD workflow (e.g., GitHub Pages, GitLab Pages, Netlify, etc.). This results in faster builds.
+
+If you change image processing methods or options, or if you rename or remove images, the `resources` directory will contain unused images. To remove the unused images, perform garbage collection with:
+
+```bash
+hugo --gc
+```
+
+[time.Format]: /functions/dateformat
+[`anchor`]: /content-management/image-processing#anchor
++[mounted]: /hugo-modules/configuration#module-configuration-mounts
+[page bundle]: /content-management/page-bundles
+[`lang.FormatNumber`]: /functions/lang
+[filters]: /functions/images
+[github.com/disintegration/imaging]: <https://github.com/disintegration/imaging#image-resizing>
+[Smartcrop]: <https://github.com/muesli/smartcrop#smartcrop>
+[Exif]: <https://en.wikipedia.org/wiki/Exif>
+[`Colors`]: #colors
+[`Crop`]: #crop
+[`Exif`]: #exif
+[`Fill`]: #fill
+[`Filter`]: #filter
+[`Fit`]: #fit
+[`Resize`]: #resize
+[site configuration]: #processing-options
+[`with`]: /functions/with/
--- /dev/null
- title: Multilingual Mode
+---
- ## Configure Languages
++title: Multilingual mode
+linkTitle: Multilingual
+description: Hugo supports the creation of websites with multiple languages side by side.
+categories: [content management]
+keywords: [multilingual,i18n, internationalization]
+menu:
+ docs:
+ parent: content-management
+ weight: 230
+toc: true
+weight: 230
+aliases: [/content/multilingual/,/tutorials/create-a-multilingual-site/]
+---
+
+You should define the available languages in a `languages` section in your site configuration.
+
+Also See [Hugo Multilingual Part 1: Content translation].
+
- The following is an example of a site configuration for a multilingual Hugo project:
++## Configure languages
+
- defaultContentLanguage = "en"
- copyright = "Everything is mine"
++This is an example of a site configuration for a multilingual project. Any key not defined in a `languages` object will fall back to the global value in the root of your site configuration.
+
+{{< code-toggle file="hugo" >}}
- [params]
- [params.navigation]
- help = "Help"
-
- [languages]
- [languages.en]
- title = "My blog"
++defaultContentLanguage = 'de'
++defaultContentLanguageInSubdir = true
+
- [languages.en.params]
- linkedin = "https://linkedin.com/whoever"
++[languages.de]
++contentDir = 'content/de'
++disabled = false
++languageCode = 'de-DE'
++languageDirection = 'ltr'
++languageName = 'Deutsch'
++title = 'Projekt Dokumentation'
+weight = 1
- [languages.fr]
- title = "Mon blogue"
- weight = 2
- [languages.fr.params]
- linkedin = "https://linkedin.com/fr/whoever"
- [languages.fr.params.navigation]
- help = "Aide"
+
- [languages.ar]
- title = "مدونتي"
++[languages.de.params]
++subtitle = 'Referenz, Tutorials und Erklärungen'
+
- languagedirection = "rtl"
++[languages.en]
++contentDir = 'content/en'
++disabled = false
++languageCode = 'en-US'
++languageDirection = 'ltr'
++languageName = 'English'
++title = 'Project Documentation'
+weight = 2
- [languages.pt-pt]
- title = "O meu blog"
- weight = 3
+
- Anything not defined in a `languages` block will fall back to the global value for that key (e.g., `copyright` for the English `en` language). This also works for `params`, as demonstrated with `help` above: You will get the value `Aide` in French and `Help` in all the languages without this parameter set.
++[languages.en.params]
++subtitle = 'Reference, Tutorials, and Explanations'
+{{< /code-toggle >}}
+
- With the configuration above, all content, sitemap, RSS feeds, pagination,
- and taxonomy pages will be rendered below `/` in English (your default content language) and then below `/fr` in French.
++`defaultContentLanguage`
++: (`string`) The project's default language tag as defined by [RFC 5646]. Must be lower case, and must match one of the defined language keys. Default is `en`. Examples:
++
++- `en`
++- `en-gb`
++- `pt-br`
+
- When working with front matter `Params` in [single page templates], omit the `params` in the key for the translation.
++`defaultContentLanguageInSubdir`
++: (`bool`) If `true`, Hugo renders the default language site in a subdirectory matching the `defaultContentLanguage`. Default is `false`.
+
- `defaultContentLanguage` sets the project's default language. If not set, the default language will be `en`.
++`contentDir`
++: (`string`) The content directory for this language. Omit if [translating by file name].
+
- If the default language needs to be rendered below its own language code (`/en`) like the others, set `defaultContentLanguageInSubdir: true`.
++`disabled`
++: (`bool`) If `true`, Hugo will not render content for this language. Default is `false`.
+
- Only the obvious non-global options can be overridden per language. Examples of global options are `baseURL`, `buildDrafts`, etc.
++`languageCode`
++: (`string`) The language tag as defined by [RFC 5646]. This value may include upper and lower case characters, hyphens or underscores, and does not affect localization or URLs. Hugo uses this value to populate the `language` element in the [built-in RSS template], and the `lang` attribute of the `html` element in the [built-in alias template]. Examples:
+
- **Please note:** use lowercase language codes, even when using regional languages (ie. use pt-pt instead of pt-PT). Currently Hugo language internals lowercase language codes, which can cause conflicts with settings like `defaultContentLanguage` which are not lowercased. Please track the evolution of this issue in [Hugo repository issue tracker](https://github.com/gohugoio/hugo/issues/7344)
++- `en`
++- `en-GB`
++- `pt-BR`
+
- 1. Adding custom params to the top level language config is deprecated, add all of these below `[params]`, see `color` in the example below.
++`languageDirection`
++: (`string`) The language direction, either left-to-right (`ltr`) or right-to-left (`rtl`). Use this value in your templates with the global [`dir`] HTML attribute.
++
++`languageName`
++: (`string`) The language name, typically used when rendering a language switcher.
++
++`title`
++: (`string`) The language title. When set, this overrides the site title for this language.
++
++`weight`
++: (`int`) The language weight. When set to a non-zero value, this is the primary sort criteria for this language.
++
++[`dir`]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir
++[built-in RSS template]: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/rss.xml
++[built-in alias template]: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/alias.html
++[RFC 5646]: https://datatracker.ietf.org/doc/html/rfc5646
++[translating by file name]: #translation-by-file-name
+
+### Changes in Hugo 0.112.0
+
+{{< new-in "0.112.0" >}}
+
+In Hugo `v0.112.0` we consolidated all configuration options, and improved how the languages and their parameters are merged with the main configuration. But while testing this on Hugo sites out there, we received some error reports and reverted some of the changes in favor of deprecation warnings:
+
+1. `site.Language.Params` is deprecated. Use `site.Params` directly.
- ```
++1. Adding custom parameters to the top level language configuration is deprecated, add all of these below `[params]`, see `color` in the example below.
+
+```toml
+title = "My blog"
+languageCode = "en-us"
+
+[languages]
+[languages.sv]
+title = "Min blogg"
+languageCode = "sv"
+[languages.en.params]
+color = "blue"
+```
+
+In the example above, all settings except `color` below `params` map to predefined configuration options in Hugo for the site and its language, and should be accessed via the documented accessors:
+
- ### Disable a Language
++```go-html-template
+{{ site.Title }}
+{{ site.LanguageCode }}
+{{ site.Params.color }}
+```
+
- You can disable one or more languages. This can be useful when working on a new translation.
++### Disable a language
+
- {{< code-toggle file="hugo" >}}
- disableLanguages = ["fr", "ja"]
++To disable a language within a `languages` object in your site configuration:
+
- Note that you cannot disable the default content language.
++{{< code-toggle file="hugo" copy=false >}}
++[languages.es]
++disabled = true
+{{< /code-toggle >}}
+
- We kept this as a standalone setting to make it easier to set via [OS environment]:
-
- ```bash
- HUGO_DISABLELANGUAGES="fr ja" hugo
- ```
++To disable one or more languages in the root of your site configuration:
+
- If you have already a list of disabled languages in `hugo.toml`, you can enable them in development like this:
++{{< code-toggle file="hugo" copy=false >}}
++disableLanguages = ["es", "fr"]
++{{< /code-toggle >}}
+
- HUGO_DISABLELANGUAGES=" " hugo server
++To disable one or more languages using an environment variable:
+
+```bash
- ### Configure Multilingual Multihost
++HUGO_DISABLELANGUAGES="es fr" hugo
+```
+
-
- ## Translate Your Content
++Note that you cannot disable the default content language.
++
++### Configure multilingual multihost
+
+From **Hugo 0.31** we support multiple languages in a multihost configuration. See [this issue](https://github.com/gohugoio/hugo/issues/4027) for details.
+
+This means that you can now configure a `baseURL` per `language`:
+
+{{% note %}}
+If a `baseURL` is set on the `language` level, then all languages must have one and they must all be different.
+{{% /note %}}
+
+Example:
+
+{{< code-toggle file="hugo" >}}
+[languages]
+[languages.fr]
+baseURL = "https://example.fr"
+languageName = "Français"
+weight = 1
+title = "En Français"
+
+[languages.en]
+baseURL = "https://example.com"
+languageName = "English"
+weight = 2
+title = "In English"
+{{</ code-toggle >}}
+
+With the above, the two sites will be generated into `public` with their own root:
+
+```text
+public
+├── en
+└── fr
+```
+
+**All URLs (i.e `.Permalink` etc.) will be generated from that root. So the English home page above will have its `.Permalink` set to `https://example.com/`.**
+
+When you run `hugo server` we will start multiple HTTP servers. You will typically see something like this in the console:
+
+```text
+Web Server is available at 127.0.0.1:1313 (bind address 127.0.0.1)
+Web Server is available at 127.0.0.1:1314 (bind address 127.0.0.1)
+Press Ctrl+C to stop
+```
+
+Live reload and `--navigateToChanged` between the servers work as expected.
+
- ### Translation by filename
++## Translate your content
+
+There are two ways to manage your content translations. Both ensure each page is assigned a language and is linked to its counterpart translations.
+
- Their language is __assigned__ according to the language code added as a __suffix to the filename__.
++### Translation by file name
+
+Considering the following example:
+
+1. `/content/about.en.md`
+2. `/content/about.fr.md`
+
+The first file is assigned the English language and is linked to the second.
+The second file is assigned the French language and is linked to the first.
+
- By having the same **path and base filename**, the content pieces are __linked__ together as translated pages.
++Their language is __assigned__ according to the language code added as a __suffix to the file name__.
+
- This system uses different content directories for each of the languages. Each language's content directory is set using the `contentDir` param.
++By having the same **path and base file name**, the content pieces are __linked__ together as translated pages.
+
+{{% note %}}
+If a file has no language code, it will be assigned the default language.
+{{% /note %}}
+
+### Translation by content directory
+
- By setting the `translationKey` front matter param to `about` in all three pages, they will be __linked__ as translated pages.
++This system uses different content directories for each of the languages. Each language's content directory is set using the `contentDir` parameter.
+
+{{< code-toggle file="hugo" >}}
+languages:
+ en:
+ weight: 10
+ languageName: "English"
+ contentDir: "content/english"
+ fr:
+ weight: 20
+ languageName: "Français"
+ contentDir: "content/french"
+{{< /code-toggle >}}
+
+The value of `contentDir` can be any valid path -- even absolute path references. The only restriction is that the content directories cannot overlap.
+
+Considering the following example in conjunction with the configuration above:
+
+1. `/content/english/about.md`
+2. `/content/french/about.md`
+
+The first file is assigned the English language and is linked to the second.
+The second file is assigned the French language and is linked to the first.
+
+Their language is __assigned__ according to the content directory they are __placed__ in.
+
+By having the same **path and basename** (relative to their language content directory), the content pieces are __linked__ together as translated pages.
+
+### Bypassing default linking
+
+Any pages sharing the same `translationKey` set in front matter will be linked as translated pages regardless of basename or location.
+
+Considering the following example:
+
+1. `/content/about-us.en.md`
+2. `/content/om.nn.md`
+3. `/content/presentation/a-propos.fr.md`
+
+{{< code-toggle >}}
+translationKey: "about"
+{{< /code-toggle >}}
+
- Because paths and filenames are used to handle linking, all translated pages will share the same URL (apart from the language subdirectory).
++By setting the `translationKey` front matter parameter to `about` in all three pages, they will be __linked__ as translated pages.
+
+### Localizing permalinks
+
- ### Page Bundles
++Because paths and file names are used to handle linking, all translated pages will share the same URL (apart from the language subdirectory).
+
+To localize URLs:
+
+- For a regular page, set either [`slug`] or [`url`] in front matter
+- For a section page, set [`url`] in front matter
+
+[`slug`]: /content-management/urls/#slug
+[`url`]: /content-management/urls/#url
+
+For example, a French translation can have its own localized slug.
+
+{{< code-toggle file="content/about.fr.md" fm=true copy=false >}}
+title: A Propos
+slug: "a-propos"
+{{< /code-toggle >}}
+
+At render, Hugo will build both `/about/` and `/fr/a-propos/` without affecting the translation link.
+
- Page Bundle resources follow the same language assignment logic as content files, both by filename (`image.jpg`, `image.fr.jpg`) and by directory (`english/about/header.jpg`, `french/about/header.jpg`).
++### Page bundles
+
+To avoid the burden of having to duplicate files, each Page Bundle inherits the resources of its linked translated pages' bundles except for the content files (Markdown files, HTML files etc...).
+
+Therefore, from within a template, the page will have access to the files from all linked pages' bundles.
+
+If, across the linked bundles, two or more files share the same basename, only one will be included and chosen as follows:
+
+* File from current language bundle, if present.
+* First file found across bundles by order of language `Weight`.
+
+{{% note %}}
- ## Reference the Translated Content
++Page Bundle resources follow the same language assignment logic as content files, both by file name (`image.jpg`, `image.fr.jpg`) and by directory (`english/about/header.jpg`, `french/about/header.jpg`).
+{{%/ note %}}
+
- ### List All Available Languages
++## Reference translated content
+
+To create a list of links to translated content, use a template similar to the following:
+
+{{< code file="layouts/partials/i18nlist.html" >}}
+{{ if .IsTranslated }}
+<h4>{{ i18n "translations" }}</h4>
+<ul>
+ {{ range .Translations }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Lang }}: {{ .Title }}{{ if .IsPage }} ({{ i18n "wordCount" . }}){{ end }}</a>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
+The above can be put in a `partial` (i.e., inside `layouts/partials/`) and included in any template, whether a [single content page][contenttemplate] or the [homepage]. It will not print anything if there are no translations for a given page.
+
+The above also uses the [`i18n` function][i18func] described in the next section.
+
- ## Translation of Strings
++### List all available languages
+
+`.AllTranslations` on a `Page` can be used to list all translations, including the page itself. On the home page it can be used to build a language navigator:
+
+{{< code file="layouts/partials/allLanguages.html" >}}
+<ul>
+{{ range $.Site.Home.AllTranslations }}
+<li><a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a></li>
+{{ end }}
+</ul>
+{{< /code >}}
+
- ## Missing Translations
++## Translation of strings
+
+Hugo uses [go-i18n] to support string translations. [See the project's source repository][go-i18n-source] to find tools that will help you manage your translation workflows.
+
+Translations are collected from the `themes/<THEME>/i18n/` folder (built into the theme), as well as translations present in `i18n/` at the root of your project. In the `i18n`, the translations will be merged and take precedence over what is in the theme folder. Language files should be named according to [RFC 5646] with names such as `en-US.toml`, `fr.toml`, etc.
+
+Artificial languages with private use subtags as defined in [RFC 5646 § 2.2.7](https://datatracker.ietf.org/doc/html/rfc5646#section-2.2.7) are also supported. You may omit the `art-x-` prefix for brevity. For example:
+
+```text
+art-x-hugolang
+hugolang
+```
+
+Private use subtags must not exceed 8 alphanumeric characters.
+
+### Query basic translation
+
+From within your templates, use the `i18n` function like this:
+
+```go-html-template
+{{ i18n "home" }}
+```
+
+The function will search for the `"home"` id:
+
+{{< code-toggle file="i18n/en-US" >}}
+[home]
+other = "Home"
+{{< /code-toggle >}}
+
+The result will be
+
+```text
+Home
+```
+
+### Query a flexible translation with variables
+
+Often you will want to use the page variables in the translation strings. To do so, pass the `.` context when calling `i18n`:
+
+```go-html-template
+{{ i18n "wordCount" . }}
+```
+
+The function will pass the `.` context to the `"wordCount"` id:
+
+{{< code-toggle file="i18n/en-US" >}}
+[wordCount]
+other = "This article has {{ .WordCount }} words."
+{{< /code-toggle >}}
+
+Assume `.WordCount` in the context has value is 101. The result will be:
+
+```text
+This article has 101 words.
+```
+
+### Query a singular/plural translation
+
+In other to meet singular/plural requirement, you must pass a dictionary (map) with a numeric `.Count` property to the `i18n` function. The below example uses `.ReadingTime` variable which has a built-in `.Count` property.
+
+```go-html-template
+{{ i18n "readingTime" .ReadingTime }}
+```
+
+The function will read `.Count` from `.ReadingTime` and evaluate whether the number is singular (`one`) or plural (`other`). After that, it will pass to `readingTime` id in `i18n/en-US.toml` file:
+
+{{< code-toggle file="i18n/en-US" >}}
+[readingTime]
+one = "One minute to read"
+other = "{{ .Count }} minutes to read"
+{{< /code-toggle >}}
+
+Assuming `.ReadingTime.Count` in the context has value is 525600. The result will be:
+
+```text
+525600 minutes to read
+```
+
+If `.ReadingTime.Count` in the context has value is 1. The result is:
+
+```text
+One minute to read
+```
+
+In case you need to pass a custom data: (`(dict "Count" numeric_value_only)` is minimum requirement)
+
+```go-html-template
+{{ i18n "readingTime" (dict "Count" 25 "FirstArgument" true "SecondArgument" false "Etc" "so on, so far") }}
+```
+
+## Localization
+
+The following localization examples assume your site's primary language is English, with translations to French and German.
+
+{{< code-toggle file="hugo" >}}
+defaultContentLanguage = 'en'
+
+[languages]
+[languages.en]
+contentDir = 'content/en'
+languageName = 'English'
+weight = 1
+[languages.fr]
+contentDir = 'content/fr'
+languageName = 'Français'
+weight = 2
+[languages.de]
+contentDir = 'content/de'
+languageName = 'Deutsch'
+weight = 3
+
+{{< /code-toggle >}}
+
+### Dates
+
+With this front matter:
+
+{{< code-toggle >}}
+date = 2021-11-03T12:34:56+01:00
+{{< /code-toggle >}}
+
+And this template code:
+
+```go-html-template
+{{ .Date | time.Format ":date_full" }}
+```
+
+The rendered page displays:
+
+Language|Value
+:--|:--
+English|Wednesday, November 3, 2021
+Français|mercredi 3 novembre 2021
+Deutsch|Mittwoch, 3. November 2021
+
+See [time.Format] for details.
+
+### Currency
+
+With this template code:
+
+```go-html-template
+{{ 512.5032 | lang.FormatCurrency 2 "USD" }}
+```
+
+The rendered page displays:
+
+Language|Value
+:--|:--
+English|$512.50
+Français|512,50 $US
+Deutsch|512,50 $
+
+See [lang.FormatCurrency] and [lang.FormatAccounting] for details.
+
+### Numbers
+
+With this template code:
+
+```go-html-template
+{{ 512.5032 | lang.FormatNumber 2 }}
+```
+
+The rendered page displays:
+
+Language|Value
+:--|:--
+English|512.50
+Français|512,50
+Deutsch|512,50
+
+See [lang.FormatNumber] and [lang.FormatNumberCustom] for details.
+
+### Percentages
+
+With this template code:
+
+```go-html-template
+{{ 512.5032 | lang.FormatPercent 2 }} ---> 512.50%
+```
+
+The rendered page displays:
+
+Language|Value
+:--|:--
+English|512.50%
+Français|512,50 %
+Deutsch|512,50 %
+
+See [lang.FormatPercent] for details.
+
+## Menus
+
+Localization of menu entries depends on the how you define them:
+
+- When you define menu entries [automatically] using the section pages menu, you must use translation tables to localize each entry.
+- When you define menu entries [in front matter], they are already localized based on the front matter itself. If the front matter values are insufficient, use translation tables to localize each entry.
+- When you define menu entries [in site configuration], you can (a) use translation tables, or (b) create language-specific menu entries under each language key.
+
+### Use translation tables
+
+When rendering the text that appears in menu each entry, the [example menu template] does this:
+
+```go-html-template
+{{ or (T .Identifier) .Name | safeHTML }}
+```
+
+It queries the translation table for the current language using the menu entry's `identifier` and returns the translated string. If the translation table does not exist, or if the `identifier` key is not present in the translation table, it falls back to `name`.
+
+The `identifier` depends on how you define menu entries:
+
+- If you define the menu entry [automatically] using the section pages menu, the `identifier` is the page's `.Section`.
+- If you define the menu entry [in site configuration] or [in front matter], set the `identifier` property to the desired value.
+
+For example, if you define menu entries in site configuration:
+
+{{< code-toggle file="hugo" copy=false >}}
+[[menu.main]]
+ identifier = 'products'
+ name = 'Products'
+ pageRef = '/products'
+ weight = 10
+[[menu.main]]
+ identifier = 'services'
+ name = 'Services'
+ pageRef = '/services'
+ weight = 20
+{{< / code-toggle >}}
+
+Create corresponding entries in the translation tables:
+
+{{< code-toggle file="i18n/de" copy=false >}}
+products = 'Produkte'
+services = 'Leistungen'
+{{< / code-toggle >}}
+
+[example menu template]: /templates/menu-templates/#example
+[automatically]: /content-management/menus/#define-automatically
+[in front matter]: /content-management/menus/#define-in-front-matter
+[in site configuration]: /content-management/menus/#define-in-site-configuration
+
+### Create language-specific menu entries
+
+For example:
+
+{{< code-toggle file="hugo" copy=false >}}
+[languages.de]
+languageCode = 'de-DE'
+languageName = 'Deutsch'
+weight = 1
+
+[[languages.de.menu.main]]
+name = 'Produkte'
+pageRef = '/products'
+weight = 10
+
+[[languages.de.menu.main]]
+name = 'Leistungen'
+pageRef = '/services'
+weight = 20
+
+[languages.en]
+languageCode = 'en-US'
+languageName = 'English'
+weight = 2
+
+[[languages.en.menu.main]]
+name = 'Products'
+pageRef = '/products'
+weight = 10
+
+[[languages.en.menu.main]]
+name = 'Services'
+pageRef = '/services'
+weight = 20
+{{< /code-toggle >}}
+
+For a simple menu with two languages, these menu entries are easy to create and maintain. For a larger menu, or with more than two languages, using translation tables as described above is preferable.
+
- ## Multilingual Themes support
++## Missing translations
+
+If a string does not have a translation for the current language, Hugo will use the value from the default language. If no default value is set, an empty string will be shown.
+
+While translating a Hugo website, it can be handy to have a visual indicator of missing translations. The [`enableMissingTranslationPlaceholders` configuration option][config] will flag all untranslated strings with the placeholder `[i18n] identifier`, where `identifier` is the id of the missing translation.
+
+{{% note %}}
+Hugo will generate your website with these missing translation placeholders. It might not be suitable for production environments.
+{{% /note %}}
+
+For merging of content from other languages (i.e. missing content translations), see [lang.Merge].
+
+To track down missing translation strings, run Hugo with the `--printI18nWarnings` flag:
+
+```bash
+hugo --printI18nWarnings | grep i18n
+i18n|MISSING_TRANSLATION|en|wordCount
+```
+
++## Multilingual themes support
+
+To support Multilingual mode in your themes, some considerations must be taken for the URLs in the templates. If there is more than one language, URLs must meet the following criteria:
+
+* Come from the built-in `.Permalink` or `.RelPermalink`
+* Be constructed with the [`relLangURL` template function][rellangurl] or the [`absLangURL` template function][abslangurl] **OR** be prefixed with `{{ .LanguagePrefix }}`
+
+If there is more than one language defined, the `LanguagePrefix` variable will equal `/en` (or whatever your `CurrentLanguage` is). If not enabled, it will be an empty string (and is therefore harmless for single-language Hugo websites).
+
+
+## Generate multilingual content with `hugo new`
+
+If you organize content with translations in the same directory:
+
+```text
+hugo new post/test.en.md
+hugo new post/test.de.md
+```
+
+If you organize content with translations in different directories:
+
+```text
+hugo new content/en/post/test.md
+hugo new content/de/post/test.md
+```
+
+[abslangurl]: /functions/abslangurl
+[config]: /getting-started/configuration/
+[contenttemplate]: /templates/single-page-templates/
+[go-i18n-source]: https://github.com/nicksnyder/go-i18n
+[go-i18n]: https://github.com/nicksnyder/go-i18n
+[homepage]: /templates/homepage/
+[Hugo Multilingual Part 1: Content translation]: https://regisphilibert.com/blog/2018/08/hugo-multilingual-part-1-managing-content-translation/
+[i18func]: /functions/i18n/
+[lang.FormatAccounting]: /functions/lang
+[lang.FormatCurrency]: /functions/lang
+[lang.FormatNumber]: /functions/lang
+[lang.FormatNumberCustom]: /functions/lang
+[lang.FormatPercent]: /functions/lang
+[lang.Merge]: /functions/lang.merge/
+[menus]: /content-management/menus/
+[OS environment]: /getting-started/configuration/#configure-with-environment-variables
+[rellangurl]: /functions/rellangurl
+[RFC 5646]: https://tools.ietf.org/html/rfc5646
+[single page templates]: /templates/single-page-templates/
+[time.Format]: /functions/dateformat
--- /dev/null
- title: Content Organization
+---
- categories: [content management,fundamentals]
++title: Content organization
+linkTitle: Organization
+description: Hugo assumes that the same structure that works to organize your source content is used to organize the rendered site.
- ## Page Bundles
++categories: [fundamentals,content management]
+keywords: [sections,content,organization,bundle,resources]
+menu:
+ docs:
+ parent: content-management
+ weight: 20
+toc: true
+weight: 20
+aliases: [/content/sections/]
+---
+
- ## Organization of Content Source
++## Page bundles
+
+Hugo `0.32` announced page-relative images and other resources packaged into `Page Bundles`.
+
+These terms are connected, and you also need to read about [Page Resources](/content-management/page-resources) and [Image Processing](/content-management/image-processing) to get the full picture.
+
+{{< imgproc 1-featured Resize "300x" >}}
+The illustration shows three bundles. Note that the home page bundle cannot contain other content pages, although other files (images etc.) are allowed.
+{{< /imgproc >}}
+
+
+{{% note %}}
+The bundle documentation is a **work in progress**. We will publish more comprehensive docs about this soon.
+{{% /note %}}
+
+
- ## Path Breakdown in Hugo
++## Organization of content source
+
+In Hugo, your content should be organized in a manner that reflects the rendered website.
+
+While Hugo supports content nested at any level, the top levels (i.e. `content/<DIRECTORIES>`) are special in Hugo and are considered the content type used to determine layouts etc. To read more about sections, including how to nest them, see [sections].
+
+Without any additional configuration, the following will automatically work:
+
+```txt
+.
+└── content
+ └── about
+ | └── index.md // <- https://example.com/about/
+ ├── posts
+ | ├── firstpost.md // <- https://example.com/posts/firstpost/
+ | ├── happy
+ | | └── ness.md // <- https://example.com/posts/happy/ness/
+ | └── secondpost.md // <- https://example.com/posts/secondpost/
+ └── quote
+ ├── first.md // <- https://example.com/quote/first/
+ └── second.md // <- https://example.com/quote/second/
+```
+
- ### Index Pages: `_index.md`
++## Path breakdown in Hugo
+
+
+The following demonstrates the relationships between your content organization and the output URL structure for your Hugo website when it renders. These examples assume you are [using pretty URLs][pretty], which is the default behavior for Hugo. The examples also assume a key-value of `baseURL = "https://example.com"` in your [site's configuration file][config].
+
- ### Single Pages in Sections
++### Index pages: `_index.md`
+
+`_index.md` has a special role in Hugo. It allows you to add front matter and content to your [list templates][lists]. These templates include those for [section templates], [taxonomy templates], [taxonomy terms templates], and your [homepage template].
+
+{{% note %}}
+**Tip:** You can get a reference to the content and metadata in `_index.md` using the [`.Site.GetPage` function](/functions/getpage/).
+{{% /note %}}
+
+You can create one `_index.md` for your homepage and one in each of your content sections, taxonomies, and taxonomy terms. The following shows typical placement of an `_index.md` that would contain content and front matter for a `posts` section list page on a Hugo website:
+
+
+```txt
+. url
+. ⊢--^-⊣
+. path slug
+. ⊢--^-⊣⊢---^---⊣
+. filepath
+. ⊢------^------⊣
+content/posts/_index.md
+```
+
+At build, this will output to the following destination with the associated values:
+
+```txt
+
+ url ("/posts/")
+ ⊢-^-⊣
+ baseurl section ("posts")
+⊢--------^---------⊣⊢-^-⊣
+ permalink
+⊢----------^-------------⊣
+https://example.com/posts/index.html
+```
+
+The [sections] can be nested as deeply as you want. The important thing to understand is that to make the section tree fully navigational, at least the lower-most section must include a content file. (i.e. `_index.md`).
+
+
- ## Paths Explained
++### Single pages in sections
+
+Single content files in each of your sections will be rendered as [single page templates][singles]. Here is an example of a single `post` within `posts`:
+
+
+```txt
+ path ("posts/my-first-hugo-post.md")
+. ⊢-----------^------------⊣
+. section slug
+. ⊢-^-⊣⊢--------^----------⊣
+content/posts/my-first-hugo-post.md
+```
+
+When Hugo builds your site, the content will be output to the following destination:
+
+```txt
+
+ url ("/posts/my-first-hugo-post/")
+ ⊢------------^----------⊣
+ baseurl section slug
+⊢--------^--------⊣⊢-^--⊣⊢-------^---------⊣
+ permalink
+⊢--------------------^---------------------⊣
+https://example.com/posts/my-first-hugo-post/index.html
+```
+
+
++## Paths explained
+
+The following concepts provide more insight into the relationship between your project's organization and the default Hugo behavior when building output for the website.
+
+### `section`
+
+A default content type is determined by the section in which a content item is stored. `section` is determined by the location within the project's `content` directory. `section` *cannot* be specified or overridden in front matter.
+
+### `slug`
+
+The `slug` is the last segment of the URL path, defined by the file name and optionally overridden by a `slug` value in front matter. See [URL Management](/content-management/urls/#slug) for details.
+
+### `path`
+
+A content's `path` is determined by the section's path to the file. The file `path`
+
+* is based on the path to the content's location AND
+* does not include the slug
+
+### `url`
+
+The `url` is the entire URL path, defined by the file path and optionally overridden by a `url` value in front matter. See [URL Management](/content-management/urls/#slug) for details.
+
+[config]: /getting-started/configuration/
+[formats]: /content-management/formats/
+[front matter]: /content-management/front-matter/
+[getpage]: /functions/getpage/
+[homepage template]: /templates/homepage/
+[homepage]: /templates/homepage/
+[lists]: /templates/lists/
+[pretty]: /content-management/urls/#appearance
+[section templates]: /templates/section-templates/
+[sections]: /content-management/sections/
+[singles]: /templates/single-page-templates/
+[taxonomy templates]: /templates/taxonomy-templates/
+[taxonomy terms templates]: /templates/taxonomy-templates/
+[types]: /content-management/types/
+[urls]: /content-management/urls/
--- /dev/null
- title: Page Bundles
+---
- |-------------------------------------|----------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
++title: Page bundles
+description: Content organization using Page Bundles
+keywords: [page, bundle, leaf, branch]
+categories: [content management]
+menu :
+ docs:
+ parent: content-management
+ weight: 30
+toc: true
+weight: 30
+---
+
+Page Bundles are a way to group [Page Resources](/content-management/page-resources/).
+
+A Page Bundle can be one of:
+
+- Leaf Bundle (leaf means it has no children)
+- Branch Bundle (home page, section, taxonomy terms, taxonomy list)
+
+| | Leaf Bundle | Branch Bundle |
- | Index filename | `index.md` [^fn:1] | `_index.md` [^fn:1] |
++|-------------------------------------|----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| Usage | Collection of content and attachments for single pages | Collection of attachments for section pages (home page, section, taxonomy terms, taxonomy list) |
- | Layout type | `single` | `list` |
++| Index file name | `index.md` [^fn:1] | `_index.md` [^fn:1] |
+| Allowed Resources | Page and non-page (like images, PDF, etc.) types | Only non-page (like images, PDF, etc.) types |
+| Where can the Resources live? | At any directory level within the leaf bundle directory. | Only in the directory level **of** the branch bundle directory i.e. the directory containing the `_index.md` ([ref](https://discourse.gohugo.io/t/question-about-content-folder-structure/11822/4?u=kaushalmodi)). |
- | Content from non-index page files... | Accessed only as page resources | Accessed only as regular pages |
++| Layout type | [`single`](/templates/single-page-templates/) | [`list`](/templates/lists) |
+| Nesting | Does not allow nesting of more bundles under it | Allows nesting of leaf or branch bundles under it |
+| Example | `content/posts/my-post/index.md` | `content/posts/_index.md` |
-
- ## Leaf Bundles {#leaf-bundles}
++| Content from non-index page files...| Accessed only as page resources | Accessed only as regular pages |
+
- ### Examples of Leaf Bundle organization {#examples-of-leaf-bundle-organization}
++## Leaf bundles
+
+A _Leaf Bundle_ is a directory at any hierarchy within the `content/`
+directory, that contains an **`index.md`** file.
+
- ### Headless Bundle {#headless-bundle}
++### Examples of leaf bundle organization {#examples-of-leaf-bundle-organization}
+
+```text
+content/
+├── about
+│ ├── index.md
+├── posts
+│ ├── my-post
+│ │ ├── content1.md
+│ │ ├── content2.md
+│ │ ├── image1.jpg
+│ │ ├── image2.png
+│ │ └── index.md
+│ └── my-other-post
+│ └── index.md
+│
+└── another-section
+ ├── ..
+ └── not-a-leaf-bundle
+ ├── ..
+ └── another-leaf-bundle
+ └── index.md
+```
+
+In the above example `content/` directory, there are four leaf
+bundles:
+
+`about`
+: This leaf bundle is at the root level (directly under
+ `content` directory) and has only the `index.md`.
+
+`my-post`
+: This leaf bundle has the `index.md`, two other content
+ Markdown files and two image files.
+
+- image1, image2:
+These images are page resources of `my-post`
+ and only available in `my-post/index.md` resources.
+
+- content1, content2:
+These content files are page resources of `my-post`
+ and only available in `my-post/index.md` resources.
+ They will **not** be rendered as individual pages.
+
+`my-other-post`
+: This leaf bundle has only the `index.md`.
+
+`another-leaf-bundle`
+: This leaf bundle is nested under couple of
+ directories. This bundle also has only the `index.md`.
+
+{{% note %}}
+The hierarchy depth at which a leaf bundle is created does not matter,
+as long as it is not inside another **leaf** bundle.
+{{% /note %}}
+
+
- A leaf bundle can be made headless by adding below in the Front Matter
++### Headless bundle
+
+A headless bundle is a bundle that is configured to not get published
+anywhere:
+
+- It will have no `Permalink` and no rendered HTML in `public/`.
+- It will not be part of `.Site.RegularPages`, etc.
+
+But you can get it by `.Site.GetPage`. Here is an example:
+
+```go-html-template
+{{ $headless := .Site.GetPage "/some-headless-bundle" }}
+{{ $reusablePages := $headless.Resources.Match "author*" }}
+<h2>Authors</h2>
+{{ range $reusablePages }}
+ <h3>{{ .Title }}</h3>
+ {{ .Content }}
+{{ end }}
+```
+
+_In this example, we are assuming the `some-headless-bundle` to be a headless
+ bundle containing one or more **page** resources whose `.Name` matches
+ `"author*"`._
+
+Explanation of the above example:
+
+1. Get the `some-headless-bundle` Page "object".
+2. Collect a _slice_ of resources in this _Page Bundle_ that matches
+ `"author*"` using `.Resources.Match`.
+3. Loop through that _slice_ of nested pages, and output their `.Title` and
+ `.Content`.
+
+---
+
- ## Branch Bundles {#branch-bundles}
++A leaf bundle can be made headless by adding below in the front matter
+(in the `index.md`):
+
+{{< code-toggle file="content/headless/index.md" fm=true copy=false >}}
+headless = true
+{{< /code-toggle >}}
+
+There are many use cases of such headless page bundles:
+
+- Shared media galleries
+- Reusable page content "snippets"
+
- ### Examples of Branch Bundle organization {#examples-of-branch-bundle-organization}
++## Branch bundles
+
+A _Branch Bundle_ is any directory at any hierarchy within the
+`content/` directory, that contains at least an **`_index.md`** file.
+
+This `_index.md` can also be directly under the `content/` directory.
+
+{{% note %}}
+Here `md` (markdown) is used just as an example. You can use any file
+type as a content resource as long as it is a content type recognized by Hugo.
+{{% /note %}}
+
+
++### Examples of branch bundle organization
+
+```text
+content/
+├── branch-bundle-1
+│ ├── branch-content1.md
+│ ├── branch-content2.md
+│ ├── image1.jpg
+│ ├── image2.png
+│ └── _index.md
+└── branch-bundle-2
+ ├── _index.md
+ └── a-leaf-bundle
+ └── index.md
+```
+
+In the above example `content/` directory, there are two branch
+bundles (and a leaf bundle):
+
+`branch-bundle-1`
+: This branch bundle has the `_index.md`, two
+ other content Markdown files and two image files.
+
+`branch-bundle-2`
+: This branch bundle has the `_index.md` and a
+ nested leaf bundle.
+
+{{% note %}}
+The hierarchy depth at which a branch bundle is created does not
+matter.
+{{% /note %}}
+
+[^fn:1]: The `.md` extension is just an example. The extension can be `.html`, `.json` or any valid MIME type.
--- /dev/null
- title: Page Resources
+---
- : Default value is the filename (relative to the owning page). Can be set in front matter.
++title: Page resources
+description: Page resources -- images, other pages, documents, etc. -- have page-relative URLs and their own metadata.
+categories: [content management]
+keywords: [bundle,content,resources]
+menu:
+ docs:
+ parent: content-management
+ weight: 80
+toc: true
+weight: 80
+---
+Page resources are only accessible from [page bundles](/content-management/page-bundles), those directories with `index.md` or
+`_index.md` files at their root. Page resources are only available to the
+page with which they are bundled.
+
+In this example, `first-post` is a page bundle with access to 10 page resources including audio, data, documents, images, and video. Although `second-post` is also a page bundle, it has no page resources and is unable to directly access the page resources associated with `first-post`.
+
+```text
+content
+└── post
+ ├── first-post
+ │ ├── images
+ │ │ ├── a.jpg
+ │ │ ├── b.jpg
+ │ │ └── c.jpg
+ │ ├── index.md (root of page bundle)
+ │ ├── latest.html
+ │ ├── manual.json
+ │ ├── notice.md
+ │ ├── office.mp3
+ │ ├── pocket.mp4
+ │ ├── rating.pdf
+ │ └── safety.txt
+ └── second-post
+ └── index.md (root of page bundle)
+```
+
+## Properties
+
+ResourceType
+: The main type of the resource's [Media Type](/templates/output-formats/#media-types). For example, a file of MIME type `image/jpeg` has the ResourceType `image`. A `Page` will have `ResourceType` with value `page`.
+
+Name
- <img src="data:{{ .MediaType }};base64,{{ .Content | base64Encode }}">
++: Default value is the file name (relative to the owning page). Can be set in front matter.
+
+Title
+: Default value is the same as `.Name`. Can be set in front matter.
+
+Permalink
+: The absolute URL to the resource. Resources of type `page` will have no value.
+
+RelPermalink
+: The relative URL to the resource. Resources of type `page` will have no value.
+
+Content
+: The content of the resource itself. For most resources, this returns a string
+with the contents of the file. Use this to create inline resources.
+
+```go-html-template
+{{ with .Resources.GetMatch "script.js" }}
+ <script>{{ .Content | safeJS }}</script>
+{{ end }}
+
+{{ with .Resources.GetMatch "style.css" }}
+ <style>{{ .Content | safeCSS }}</style>
+{{ end }}
+
+{{ with .Resources.GetMatch "img.png" }}
- MediaType
- : The MIME type of the resource, such as `image/jpeg`.
++ <img src="data:{{ .MediaType.Type }};base64,{{ .Content | base64Encode }}">
+{{ end }}
+```
+
- : The main type of the resource's MIME type. For example, a file of MIME type `application/pdf` has for MainType `application`.
++MediaType.Type
++: The media type (formerly known as a MIME type) of the resource (e.g., `image/jpeg`).
+
+MediaType.MainType
- : The subtype of the resource's MIME type. For example, a file of MIME type `application/pdf` has for SubType `pdf`. Note that this is not the same as the file extension. For example, Microsoft PowerPoint files (`.ppt`) have a subtype of `vnd.ms-powerpoint`.
++: The main type of the resource's media type (e.g., `image`).
+
+MediaType.SubType
- : A slice of possible suffixes for the resource's MIME type.
++: The subtype of the resource's type (e.g., `jpeg`). This may or may not correspond to the file suffix.
+
+MediaType.Suffixes
- ### Pattern Matching
++: A slice of possible file suffixes for the resource's media type (e.g., `[jpg jpeg jpe jif jfif]`).
+
+## Methods
+
+ByType
+: Returns the page resources of the given type.
+
+```go-html-template
+{{ .Resources.ByType "image" }}
+```
+Match
+: Returns all the page resources (as a slice) whose `Name` matches the given Glob pattern ([examples](https://github.com/gobwas/glob/blob/master/readme.md)). The matching is case-insensitive.
+
+```go-html-template
+{{ .Resources.Match "images/*" }}
+```
+
+GetMatch
+: Same as `Match` but will return the first match.
+
- ## Page Resources Metadata
++### Pattern matching
+
+```go
+// Using Match/GetMatch to find this images/sunset.jpg ?
+.Resources.Match "images/sun*" ✅
+.Resources.Match "**/sunset.jpg" ✅
+.Resources.Match "images/*.jpg" ✅
+.Resources.Match "**.jpg" ✅
+.Resources.Match "*" 🚫
+.Resources.Match "sunset.jpg" 🚫
+.Resources.Match "*sunset.jpg" 🚫
+
+```
+
++## Page resources metadata
+
+The page resources' metadata is managed from the corresponding page's front matter with an array/table parameter named `resources`. You can batch assign values using [wildcards](https://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm).
+
+{{% note %}}
+Resources of type `page` get `Title` etc. from their own front matter.
+{{% /note %}}
+
+name
+: Sets the value returned in `Name`.
+
+{{% note %}}
+The methods `Match`, `Get` and `GetMatch` use `Name` to match the resources.
+{{% /note %}}
+
+title
+: Sets the value returned in `Title`
+
+params
+: A map of custom key/values.
+
+### Resources metadata example
+
+{{< code-toggle copy=false >}}
+title: Application
+date : 2018-01-25
+resources :
+- src : "images/sunset.jpg"
+ name : "header"
+- src : "documents/photo_specs.pdf"
+ title : "Photo Specifications"
+ params:
+ icon : "photo"
+- src : "documents/guide.pdf"
+ title : "Instruction Guide"
+- src : "documents/checklist.pdf"
+ title : "Document Checklist"
+- src : "documents/payment.docx"
+ title : "Proof of Payment"
+- src : "**.pdf"
+ name : "pdf-file-:counter"
+ params :
+ icon : "pdf"
+- src : "**.docx"
+ params :
+ icon : "word"
+{{</ code-toggle >}}
+
+From the example above:
+
+- `sunset.jpg` will receive a new `Name` and can now be found with `.GetMatch "header"`.
+- `documents/photo_specs.pdf` will get the `photo` icon.
+- `documents/checklist.pdf`, `documents/guide.pdf` and `documents/payment.docx` will get `Title` as set by `title`.
+- Every `PDF` in the bundle except `documents/photo_specs.pdf` will get the `pdf` icon.
+- All `PDF` files will get a new `Name`. The `name` parameter contains a special placeholder [`:counter`](#the-counter-placeholder-in-name-and-title), so the `Name` will be `pdf-file-1`, `pdf-file-2`, `pdf-file-3`.
+- Every docx in the bundle will receive the `word` icon.
+
+{{% note %}}
+The __order matters__ --- Only the **first set** values of the `title`, `name` and `params`-**keys** will be used. Consecutive parameters will be set only for the ones not already set. In the above example, `.Params.icon` is first set to `"photo"` in `src = "documents/photo_specs.pdf"`. So that would not get overridden to `"pdf"` by the later set `src = "**.pdf"` rule.
+{{% /note %}}
+
+### The `:counter` placeholder in `name` and `title`
+
+The `:counter` is a special placeholder recognized in `name` and `title` parameters `resources`.
+
+The counter starts at 1 the first time they are used in either `name` or `title`.
+
+For example, if a bundle has the resources `photo_specs.pdf`, `other_specs.pdf`, `guide.pdf` and `checklist.pdf`, and the front matter has specified the `resources` as:
+
+{{< code-toggle copy=false >}}
+[[resources]]
+ src = "*specs.pdf"
+ title = "Specification #:counter"
+[[resources]]
+ src = "**.pdf"
+ name = "pdf-file-:counter"
+{{</ code-toggle >}}
+
+the `Name` and `Title` will be assigned to the resource files as follows:
+
+| Resource file | `Name` | `Title` |
+|-------------------|-------------------|-----------------------|
+| checklist.pdf | `"pdf-file-1.pdf` | `"checklist.pdf"` |
+| guide.pdf | `"pdf-file-2.pdf` | `"guide.pdf"` |
+| other\_specs.pdf | `"pdf-file-3.pdf` | `"Specification #1"` |
+| photo\_specs.pdf | `"pdf-file-4.pdf` | `"Specification #2"` |
--- /dev/null
- title: Related Content
+---
- Hugo uses a set of factors to identify a page's related content based on Front Matter parameters. This can be tuned to the desired set of indices and parameters or left to Hugo's default [Related Content configuration](#configure-related-content).
++title: Related content
+description: List related content in "See Also" sections.
+categories: [content management]
+keywords: [content]
+menu:
+ docs:
+ parent: content-management
+ weight: 110
+toc: true
+weight: 110
+aliases: [/content/related/,/related/]
+---
+
- ## List Related Content
++Hugo uses a set of factors to identify a page's related content based on front matter parameters. This can be tuned to the desired set of indices and parameters or left to Hugo's default [Related Content configuration](#configure-related-content).
+
- ## Index Content Headings in Related Content
++## List related content
+
+To list up to 5 related pages (which share the same _date_ or _keyword_ parameters) is as simple as including something similar to this partial in your single page template:
+
+{{< code file="layouts/partials/related.html" >}}
+{{ $related := .Site.RegularPages.Related . | first 5 }}
+{{ with $related }}
+<h3>See Also</h3>
+<ul>
+ {{ range . }}
+ <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
+The `Related` method takes one argument which may be a `Page` or a options map. The options map have these options:
+
+indices
+: The indices to search in.
+
+document
+: The document to search for related content for.
+
+namedSlices
+: The keywords to search for.
+
+fragments
+: Fragments holds a a list of special keywords that is used for indices configured as type "fragments". This will match the fragment identifiers of the documents.
+
+A fictional example using all of the above options:
+
+```go-html-template
+{{ $page := . }}
+{{ $opts :=
+ "indices" (slice "tags" "keywords")
+ "document" $page
+ "namedSlices" (slice (keyVals "tags" "hugo" "rocks") (keyVals "date" $page.Date))
+ "fragments" (slice "heading-1" "heading-2")
+}}
+```
+
+{{% note %}}
+We improved and simplified this feature in Hugo 0.111.0. Before this we had 3 different methods: `Related`, `RelatedTo` and `RelatedIndicies`. Now we have only one method: `Related`. The old methods are still available but deprecated. Also see [this blog article](https://regisphilibert.com/blog/2018/04/hugo-optmized-relashionships-with-related-content/) for a great explanation of more advanced usage of this feature.
+{{% /note %}}
+
- ## Configure Related Content
++## Index content headings in related content
+
+{{< new-in "0.111.0" >}}
+
+Hugo can index the headings in your content and use this to find related content. You can enable this by adding a index of type `fragments` to your `related` configuration:
+
+{{< code-toggle file="hugo" copy=false >}}
+[related]
+threshold = 20
+includeNewer = true
+toLower = false
+[[related.indices]]
+name = "fragmentrefs"
+type = "fragments"
+applyFilter = false
+weight = 80
+{{< /code-toggle >}}
+
+* The `name` maps to a optional front matter slice attribute that can be used to link from the page level down to the fragment/heading level.
+* If `applyFilter`is enabled, the `.HeadingsFiltered` on each page in the result will reflect the filtered headings. This is useful if you want to show the headings in the related content listing:
+
+```go-html-template
+{{ $related := .Site.RegularPages.Related . | first 5 }}
+{{ with $related }}
+ <h2>See Also</h2>
+ <ul>
+ {{ range $i, $p := . }}
+ <li>
+ <a href="{{ .RelPermalink }}">{{ .Title }}</a>
+ {{ with .HeadingsFiltered }}
+ <ul>
+ {{ range . }}
+ {{ $link := printf "%s#%s" $p.RelPermalink .ID | safeURL }}
+ <li>
+ <a href="{{ $link }}">{{ .Title }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ {{ end }}
+ </li>
+ {{ end }}
+ </ul>
+{{ end }}
+```
+
- If you add a `related` config section, you need to add a complete configuration. It is not possible to just set, say, `includeNewer` and use the rest from the Hugo defaults.
++## Configure related content
+
+Hugo provides a sensible default configuration of Related Content, but you can fine-tune this in your configuration, on the global or language level if needed.
+
+### Default configuration
+
+Without any `related` configuration set on the project, Hugo's Related Content methods will use the following.
+
+{{< code-toggle file="hugo" >}}
+related:
+ threshold: 80
+ includeNewer: false
+ toLower: false
+ indices:
+ - name: keywords
+ weight: 100
+ - name: date
+ weight: 10
+{{< /code-toggle >}}
+
+Note that if you have configured `tags` as a taxonomy, `tags` will also be added to the default configuration above with the weight of `80`.
+
+Custom configuration should be set using the same syntax.
+
+{{% note %}}
- ### Top Level Config Options
++If you add a `related` configuration section, you need to add a complete configuration. It is not possible to just set, say, `includeNewer` and use the rest from the Hugo defaults.
+{{% /note %}}
+
- ### Config Options per Index
++### Top level configuration options
+
+threshold
+: A value between 0-100. Lower value will give more, but maybe not so relevant, matches.
+
+includeNewer
+: Set to true to include **pages newer than the current page** in the related content listing. This will mean that the output for older posts may change as new related content gets added.
+
+toLower
+: Set to true to lower case keywords in both the indexes and the queries. This may give more accurate results at a slight performance penalty. Note that this can also be set per index.
+
- : The index name. This value maps directly to a page param. Hugo supports string values (`author` in the example) and lists (`tags`, `keywords` etc.) and time and date objects.
++### Configuration options per index
+
+name
- ## Performance Considerations
++: The index name. This value maps directly to a page parameter. Hugo supports string values (`author` in the example) and lists (`tags`, `keywords` etc.) and time and date objects.
+
+type
+: {{< new-in "0.111.0" >}}. One of `basic`(default) or `fragments`.
+
+applyFilter
+: {{< new-in "0.111.0" >}}. Apply a `type` specific filter to the result of a search. This is currently only used for the `fragments` type.
+
+weight
+: An integer weight that indicates _how important_ this parameter is relative to the other parameters. It can be 0, which has the effect of turning this index off, or even negative. Test with different values to see what fits your content best.
+
+
+cardinalityThreshold (default 0)
+: {{< new-in "0.111.0" >}}. A percentage (0-100) used to remove common keywords from the index. As an example, setting this to 50 will remove all keywords that are used in more than 50% of the documents in the index.
+
+pattern
+: This is currently only relevant for dates. When listing related content, we may want to list content that is also close in time. Setting "2006" (default value for date indexes) as the pattern for a date index will add weight to pages published in the same year. For busier blogs, "200601" (year and month) may be a better default.
+
+toLower
+: See above.
+
++## Performance considerations
+
+**Fast is Hugo's middle name** and we would not have released this feature had it not been blistering fast.
+
+This feature has been in the back log and requested by many for a long time. The development got this recent kick start from this Twitter thread:
+
+{{< tweet user="scott_lowe" id="898398437527363585" >}}
+
+Scott S. Lowe removed the "Related Content" section built using the `intersect` template function on tags, and the build time dropped from 30 seconds to less than 2 seconds on his 1700 content page sized blog.
+
+He should now be able to add an improved version of that "Related Content" section without giving up the fast live-reloads. But it's worth noting that:
+
+* If you don't use any of the `Related` methods, you will not use the Relate Content feature, and performance will be the same as before.
+* Calling `.RegularPages.Related` etc. will create one inverted index, also sometimes named posting list, that will be reused for any lookups in that same page collection. Doing that in addition to, as an example, calling `.Pages.Related` will work as expected, but will create one additional inverted index. This should still be very fast, but worth having in mind, especially for bigger sites.
+
+{{% note %}}
+We currently do not index **Page content**. We thought we would release something that will make most people happy before we start solving [Sherlock's last case](https://github.com/joearms/sherlock).
+{{% /note %}}
--- /dev/null
- title: Content Sections
- linkTitle: Sections
+---
- ## Nested Sections
++title: Sections
+description: Hugo generates a **section tree** that matches your content.
+categories: [content management]
+keywords: [lists,sections,content types,organization]
+menu:
+ docs:
+ parent: content-management
+ weight: 120
+toc: true
+weight: 120
+aliases: [/content/sections/]
+---
+
+A **Section** is a collection of pages that gets defined based on the
+organization structure under the `content/` directory.
+
+By default, all the **first-level** directories under `content/` form their own
+sections (**root sections**) provided they constitute [Branch Bundles][branch bundles].
+Directories which are just [Leaf Bundles][leaf bundles] do *not* form
+their own sections, despite being first-level directories.
+
+If a user needs to define a section `foo` at a deeper level, they need to create
+a directory named `foo` with an `_index.md` file (see [Branch Bundles][branch bundles]
+for more information).
+
+
+{{% note %}}
+A **section** cannot be defined or overridden by a front matter parameter -- it
+is strictly derived from the content organization structure.
+{{% /note %}}
+
- ## Example: Breadcrumb Navigation
++## Nested sections
+
+The sections can be nested as deeply as you need.
+
+```bash
+content
+└── blog <-- Section, because first-level dir under content/
+ ├── funny-cats
+ │ ├── mypost.md
+ │ └── kittens <-- Section, because contains _index.md
+ │ └── _index.md
+ └── tech <-- Section, because contains _index.md
+ └── _index.md
+```
+
+**The important part to understand is, that to make the section tree fully navigational, at least the lower-most section needs a content file. (e.g. `_index.md`).**
+
+{{% note %}}
+When we talk about a **section** in correlation with template selection, it is
+currently always the *root section* only (`/blog/funny-cats/mypost/ => blog`).
+
+If you need a specific template for a sub-section, you need to adjust either the `type` or `layout` in front matter.
+{{% /note %}}
+
- ## Section Page Variables and Methods
++## Example: breadcrumb navigation
+
+With the available [section variables and methods](#section-page-variables-and-methods) you can build powerful navigation. One common example would be a partial to show Breadcrumb navigation:
+
+{{< code file="layouts/partials/breadcrumb.html" >}}
+<nav aria-label="breadcrumb">
+ <ol>
+ {{ range .Ancestors.Reverse }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
+ </li>
+ {{ end }}
+ <li class="active">
+ <a aria-current="page" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
+ </li>
+ </ol>
+</nav>
+{{< /code >}}
+
- ## Content Section Lists
++## Section page variables and methods
+
+Also see [Page Variables](/variables/page/).
+
+{{< readfile file="/content/en/readfiles/sectionvars.md" markdown="true" >}}
+
- ## Content *Section* vs Content *Type*
++## Content section lists
+
+Hugo will automatically create a page for each *root section* that lists all the content in that section. See the documentation on [section templates] for details on customizing the way these pages are rendered.
+
++## Content *section* vs. content *type*
+
+By default, everything created within a section will use the [content `type`][content type] that matches the *root section* name. For example, Hugo will assume that `posts/post-1.md` has a `posts` content `type`. If you are using an [archetype] for your `posts` section, Hugo will generate front matter according to what it finds in `archetypes/posts.md`.
+
+[archetype]: /content-management/archetypes/
+[content type]: /content-management/types/
+[directory structure]: /getting-started/directory-structure/
+[section templates]: /templates/section-templates/
+[leaf bundles]: /content-management/page-bundles/#leaf-bundles
+[branch bundles]: /content-management/page-bundles/#branch-bundles
--- /dev/null
- ## What a Shortcode is
+---
+title: Shortcodes
+description: Shortcodes are simple snippets inside your content files calling built-in or custom templates.
+categories: [content management]
+keywords: [markdown,content,shortcodes]
+menu:
+ docs:
+ parent: content-management
+ weight: 100
+toc: true
+weight: 100
+aliases: [/extras/shortcodes/]
+testparam: "Hugo Rocks!"
+---
+
- ## Use Shortcodes
++## What a shortcode is
+
+Hugo loves Markdown because of its simple content format, but there are times when Markdown falls short. Often, content authors are forced to add raw HTML (e.g., video `<iframe>`'s) to Markdown content. We think this contradicts the beautiful simplicity of Markdown's syntax.
+
+Hugo created **shortcodes** to circumvent these limitations.
+
+A shortcode is a simple snippet inside a content file that Hugo will render using a predefined template. Note that shortcodes will not work in template files. If you need the type of drop-in functionality that shortcodes provide but in a template, you most likely want a [partial template][partials] instead.
+
+In addition to cleaner Markdown, shortcodes can be updated any time to reflect new classes, techniques, or standards. At the point of site generation, Hugo shortcodes will easily merge in your changes. You avoid a possibly complicated search and replace operation.
+
- ### Shortcodes with Markdown
++## Use shortcodes
+
+{{< youtube 2xkNJL4gJ9E >}}
+
+In your content files, a shortcode can be called by calling `{{%/* shortcodename parameters */%}}`. Shortcode parameters are space delimited, and parameters with internal spaces can be quoted.
+
+The first word in the shortcode declaration is always the name of the shortcode. Parameters follow the name. Depending upon how the shortcode is defined, the parameters may be named, positional, or both, although you can't mix parameter types in a single call. The format for named parameters models that of HTML with the format `name="value"`.
+
+Some shortcodes use or require closing shortcodes. Again like HTML, the opening and closing shortcodes match (name only) with the closing declaration, which is prepended with a slash.
+
+Here are two examples of paired shortcodes:
+
+```go-html-template
+{{%/* mdshortcode */%}}Stuff to `process` in the *center*.{{%/* /mdshortcode */%}}
+```
+
+```go-html-template
+{{</* highlight go */>}} A bunch of code here {{</* /highlight */>}}
+```
+
+The examples above use two different delimiters, the difference being the `%` character in the first and the `<>` characters in the second.
+
+### Shortcodes with raw string parameters
+
+You can pass multiple lines as parameters to a shortcode by using raw string literals:
+
+```go-html-template
+{{</* myshortcode `This is some <b>HTML</b>,
+and a new line with a "quoted string".` */>}}
+```
+
- ### Shortcodes Without Markdown
++### Shortcodes with markdown
+
+In Hugo `0.55` we changed how the `%` delimiter works. Shortcodes using the `%` as the outer-most delimiter will now be fully rendered when sent to the content renderer. They can be part of the generated table of contents, footnotes, etc.
+
+If you want the old behavior, you can put the following line in the start of your shortcode template:
+
+```go-html-template
+{{ $_hugo_config := `{ "version": 1 }` }}
+```
+
- ### Nested Shortcodes
++### Shortcodes without markdown
+
+The `<` character indicates that the shortcode's inner content does *not* need further rendering. Often shortcodes without Markdown include internal HTML:
+
+```go-html-template
+{{</* myshortcode */>}}<p>Hello <strong>World!</strong></p>{{</* /myshortcode */>}}
+```
+
- ## Use Hugo's Built-in Shortcodes
++### Nested shortcodes
+
+You can call shortcodes within other shortcodes by creating your own templates that leverage the `.Parent` variable. `.Parent` allows you to check the context in which the shortcode is being called. See [Shortcode templates][sctemps].
+
- #### Example `figure` Input
++## Use Hugo's built-in shortcodes
+
+Hugo ships with a set of predefined shortcodes that represent very common usage. These shortcodes are provided for author convenience and to keep your Markdown content clean.
+
+### `figure`
+
+`figure` is an extension of the image syntax in Markdown, which does not provide a shorthand for the more semantic [HTML5 `<figure>` element][figureelement].
+
+The `figure` shortcode can use the following named parameters:
+
+src
+: URL of the image to be displayed.
+
+link
+: If the image needs to be hyperlinked, URL of the destination.
+
+target
+: Optional `target` attribute for the URL if `link` parameter is set.
+
+rel
+: Optional `rel` attribute for the URL if `link` parameter is set.
+
+alt
+: Alternate text for the image if the image cannot be displayed.
+
+title
+: Image title.
+
+caption
+: Image caption. Markdown within the value of `caption` will be rendered.
+
+class
+: `class` attribute of the HTML `figure` tag.
+
+height
+: `height` attribute of the image.
+
+width
+: `width` attribute of the image.
+
+loading
+: `loading` attribute of the image.
+
+attr
+: Image attribution text. Markdown within the value of `attr` will be rendered.
+
+attrlink
+: If the attribution text needs to be hyperlinked, URL of the destination.
+
- {{</* figure src="elephant.jpg" title=">An elephant at sunset" */>}}
++#### Example `figure` input
+
+{{< code file="figure-input-example.md" >}}
- #### Example `figure` Output
++{{</* figure src="elephant.jpg" title="An elephant at sunset" */>}}
+{{< /code >}}
+
- Gets a value from the current `Page's` params set in front matter, with a fallback to the site param value. It will log an `ERROR` if the param with the given key could not be found in either.
++#### Example `figure` output
+
+```html
+<figure>
+ <img src="elephant.jpg">
+ <figcaption>An elephant at sunset</figcaption>
+</figure>
+```
+
+### `gist`
+
+To display a GitHub [gist] with this URL:
+
+[gist]: https://docs.github.com/en/get-started/writing-on-github/editing-and-sharing-content-with-gists
+
+```text
+https://gist.github.com/user/50a7482715eac222e230d1e64dd9a89b
+```
+
+Include this in your markdown:
+
+```text
+{{</* gist user 50a7482715eac222e230d1e64dd9a89b */>}}
+```
+
+This will display all files in the gist alphabetically by file name.
+
+{{< gist jmooring 50a7482715eac222e230d1e64dd9a89b >}}
+
+To display a specific file within the gist:
+
+```text
+{{</* gist user 50a7482715eac222e230d1e64dd9a89b 1-template.html */>}}
+```
+
+Rendered:
+
+{{< gist jmooring 50a7482715eac222e230d1e64dd9a89b 1-template.html >}}
+
+### `highlight`
+
+To display a highlighted code sample:
+
+```text
+{{</* highlight go-html-template */>}}
+{{ range .Pages }}
+ <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
+{{ end }}
+{{</* /highlight */>}}
+```
+
+Rendered:
+
+{{< highlight go-html-template >}}
+{{ range .Pages }}
+ <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
+{{ end }}
+{{< /highlight >}}
+
+To specify one or more [highlighting options], include a quotation-encapsulated, comma-separated list:
+
+[highlighting options]: /functions/highlight/
+
+```text
+{{</* highlight go-html-template "lineNos=inline, lineNoStart=42" */>}}
+{{ range .Pages }}
+ <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
+{{ end }}
+{{</* /highlight */>}}
+```
+
+Rendered:
+
+{{< highlight go-html-template "lineNos=inline, lineNoStart=42" >}}
+{{ range .Pages }}
+ <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
+{{ end }}
+{{< /highlight >}}
+
+### `instagram`
+
+The `instagram` shortcode uses Facebook's **oEmbed Read** feature. The Facebook [developer documentation] states:
+
+- This permission or feature requires successful completion of the App Review process before your app can access live data. [Learn More]
+- This permission or feature is only available with business verification. You may also need to sign additional contracts before your app can access data. [Learn More Here]
+
+[developer documentation]: https://developers.facebook.com/docs/features-reference/oembed-read
+[Learn More]: https://developers.facebook.com/docs/app-review
+[Learn More Here]: https://developers.facebook.com/docs/development/release/business-verification
+
+You must obtain an Access Token to use the `instagram` shortcode.
+
+If your site configuration is private:
+
+{{< code-toggle file="hugo" copy=false >}}
+[services.instagram]
+accessToken = 'xxx'
+{{< /code-toggle >}}
+
+If your site configuration is _not_ private, set the Access Token with an environment variable:
+
+```text
+HUGO_SERVICES_INSTAGRAM_ACCESSTOKEN=xxx hugo --gc --minify
+```
+
+{{% note %}}
+If you are using a Client Access Token, you must combine the Access Token with your App ID using a pipe symbol (`APPID|ACCESSTOKEN`).
+{{% /note %}}
+
+To display an Instagram post with this URL:
+
+```text
+https://www.instagram.com/p/BWNjjyYFxVx/
+```
+
+Include this in your markdown:
+
+```text
+{{</* instagram BWNjjyYFxVx */>}}
+```
+
+### `param`
+
- Since `testparam` is a param defined in front matter of this page with the value `Hugo Rocks!`, the above will print:
++Gets a value from the current `Page's` parameters set in front matter, with a fallback to the site parameter value. It will log an `ERROR` if the parameter with the given key could not be found in either.
+
+```bash
+{{</* param testparam */>}}
+```
+
- To access deeply nested params, use "dot syntax", e.g:
++Since `testparam` is a parameter defined in front matter of this page with the value `Hugo Rocks!`, the above will print:
+
+{{< param testparam >}}
+
- #### Example `ref` and `relref` Input
++To access deeply nested parameters, use "dot syntax", e.g:
+
+```bash
+{{</* param "my.nested.param" */>}}
+```
+
+### `ref` and `relref`
+
+These shortcodes will look up the pages by their relative path (e.g., `blog/post.md`) or their logical name (`post.md`) and return the permalink (`ref`) or relative permalink (`relref`) for the found page.
+
+`ref` and `relref` also make it possible to make fragmentary links that work for the header links generated by Hugo.
+
+{{% note %}}
+Read a more extensive description of `ref` and `relref` in the [cross references](/content-management/cross-references/) documentation.
+{{% /note %}}
+
+`ref` and `relref` take exactly one required parameter of _reference_, quoted and in position `0`.
+
- #### Example `ref` and `relref` Output
++#### Example `ref` and `relref` input
+
+```go-html-template
+[Neat]({{</* ref "blog/neat.md" */>}})
+[Who]({{</* relref "about.md#who" */>}})
+```
+
- #### Example `youtube` Input
++#### Example `ref` and `relref` output
+
+Assuming that standard Hugo pretty URLs are turned on.
+
+```html
+<a href="https://example.com/blog/neat">Neat</a>
+<a href="/about/#who">Who</a>
+```
+
+### `tweet`
+
+To display a Twitter post with this URL:
+
+```txt
+https://twitter.com/SanDiegoZoo/status/1453110110599868418
+```
+
+Include this in your markdown:
+
+```text
+{{</* tweet user="SanDiegoZoo" id="1453110110599868418" */>}}
+```
+
+Rendered:
+
+{{< tweet user="SanDiegoZoo" id="1453110110599868418" >}}
+
+### `vimeo`
+
+To display a Vimeo video with this URL:
+
+```text
+https://vimeo.com/channels/staffpicks/55073825
+```
+
+Include this in your markdown:
+
+```text
+{{</* vimeo 55073825 */>}}
+```
+
+Rendered:
+
+{{< vimeo 55073825 >}}
+
+{{% note %}}
+If you want to further customize the visual styling of the YouTube or Vimeo output, add a `class` named parameter when calling the shortcode. The new `class` will be added to the `<div>` that wraps the `<iframe>` *and* will remove the inline styles. Note that you will need to call the `id` as a named parameter as well. You can also give the vimeo video a descriptive title with `title`.
+
+```go
+{{</* vimeo id="146022717" class="my-vimeo-wrapper-class" title="My vimeo video" */>}}
+```
+{{% /note %}}
+
+### `youtube`
+
+The `youtube` shortcode embeds a responsive video player for [YouTube videos]. Only the ID of the video is required, e.g.:
+
+```txt
+https://www.youtube.com/watch?v=w7Ft2ymGmfc
+```
+
- #### Example `youtube` Output
++#### Example `youtube` input
+
+Copy the YouTube video ID that follows `v=` in the video's URL and pass it to the `youtube` shortcode:
+
+{{< code file="example-youtube-input.md" >}}
+{{</* youtube w7Ft2ymGmfc */>}}
+{{< /code >}}
+
+Furthermore, you can automatically start playback of the embedded video by setting the `autoplay` parameter to `true`. Remember that you can't mix named and unnamed parameters, so you'll need to assign the yet unnamed video ID to the parameter `id`:
+
+
+{{< code file="example-youtube-input-with-autoplay.md" >}}
+{{</* youtube id="w7Ft2ymGmfc" autoplay="true" */>}}
+{{< /code >}}
+
+For [accessibility reasons](https://dequeuniversity.com/tips/provide-iframe-titles), it's best to provide a title for your YouTube video. You can do this using the shortcode by providing a `title` parameter. If no title is provided, a default of "YouTube Video" will be used.
+
+{{< code file="example-youtube-input-with-title.md" >}}
+{{</* youtube id="w7Ft2ymGmfc" title="A New Hugo Site in Under Two Minutes" */>}}
+{{< /code >}}
+
- #### Example `youtube` Display
++#### Example `youtube` output
+
+Using the preceding `youtube` example, the following HTML will be added to your rendered website's markup:
+
+{{< code file="example-youtube-output.html" >}}
+{{< youtube id="w7Ft2ymGmfc" autoplay="true" >}}
+{{< /code >}}
+
- ## Privacy Config
++#### Example `youtube` display
+
+Using the preceding `youtube` example (without `autoplay="true"`), the following simulates the displayed experience for visitors to your website. Naturally, the final display will be contingent on your style sheets and surrounding markup. The video is also include in the [Quick Start of the Hugo documentation][quickstart].
+
+{{< youtube w7Ft2ymGmfc >}}
+
- ## Create Custom Shortcodes
++## Privacy configuration
+
+To learn how to configure your Hugo site to meet the new EU privacy regulation, see [Hugo and the GDPR].
+
++## Create custom shortcodes
+
+To learn more about creating custom shortcodes, see the [shortcode template documentation].
+
+[`figure` shortcode]: #figure
+[contentmanagementsection]: /content-management/formats/
+[examplegist]: https://gist.github.com/spf13/7896402
+[figureelement]: https://html5doctor.com/the-figure-figcaption-elements/ "An article from HTML5 doctor discussing the fig and figcaption elements."
+[Hugo and the GDPR]: /about/hugo-and-gdpr/
+[Instagram]: https://www.instagram.com/
+[pagevariables]: /variables/page/
+[partials]: /templates/partials/
+[quickstart]: /getting-started/quick-start/
+[sctemps]: /templates/shortcode-templates/
+[scvars]: /variables/shortcodes/
+[shortcode template documentation]: /templates/shortcode-templates/
+[templatessection]: /templates/
+[Vimeo]: https://vimeo.com/
+[YouTube Videos]: https://www.youtube.com/
+[YouTube Input shortcode]: #youtube
--- /dev/null
- title: Static Files
- linkTitle: Static Files
+---
- `staticDir` parameter in the [site config]. All the files in all the
++title: Static files
+description: Files that get served **statically** (as-is, no modification) on the site root.
+categories: [content management]
+keywords: [source, directories]
+menu:
+ docs:
+ parent: content-management
+ weight: 200
+toc: true
+weight: 200
+aliases: [/static-files]
+---
+
+By default, the `static/` directory in the site project is used for
+all **static files** (e.g. stylesheets, JavaScript, images). The static files are served on the site root path (eg. if you have the file `static/image.png` you can access it using `http://{server-url}/image.png`, to include it in a document you can use ` )`.
+
+Hugo can be configured to look into a different directory, or even
+**multiple directories** for such static files by configuring the
- [site config]: /getting-started/configuration/#all-configuration-settings
++`staticDir` parameter in the [site configuration]. All the files in all the
+static directories will form a union filesystem.
+
+This union filesystem will be served from your site root. So a file
+`<SITE PROJECT>/static/me.png` will be accessible as
+`<MY_BASEURL>/me.png`.
+
+Here's an example of setting `staticDir` and `staticDir2` for a
+multi-language site:
+
+{{< code-toggle copy=false file="hugo" >}}
+staticDir = ["static1", "static2"]
+
+[languages]
+[languages.en]
+staticDir2 = "static_en"
+baseURL = "https://example.com"
+languageName = "English"
+weight = 2
+title = "In English"
+[languages.no]
+staticDir = ["staticDir_override", "static_no"]
+baseURL = "https://example.no"
+languageName = "Norsk"
+weight = 1
+title = "På norsk"
+{{</ code-toggle >}}
+
+In the above, with no theme used:
+
+- The English site will get its static files as a union of "static1",
+ "static2" and "static_en". On file duplicates, the right-most
+ version will win.
+- The Norwegian site will get its static files as a union of
+ "staticDir_override" and "static_no".
+
+Note 1
+: The **2** (can be a number between 0 and 10) in `staticDir2` is
+ added to tell Hugo that you want to **add** this directory to the
+ global set of static directories defined using `staticDir`. Using
+ `staticDir` on the language level would replace the global value (as
+ can be seen in the Norwegian site case).
+
+Note 2
+: The example above is a [multihost setup]. In a regular setup, all
+ the static directories will be available to all sites.
+
++[site configuration]: /getting-started/configuration/#all-configuration-settings
+[multihost setup]: /content-management/multilingual/#configure-multilingual-multihost
--- /dev/null
- title: Content Summaries
+---
- ## Summary Splitting Options
++title: Content summaries
+linkTitle: Summaries
+description: Hugo generates summaries of your content.
+categories: [content management]
+keywords: [summaries,abstracts,read more]
+menu:
+ docs:
+ parent: content-management
+ weight: 160
+toc: true
+weight: 160
+aliases: [/content/summaries/,/content-management/content-summaries/]
+---
+
+With the use of the `.Summary` [page variable][pagevariables], Hugo generates summaries of content to use as a short version in summary views.
+
- ### Automatic Summary Splitting
++## Summary splitting options
+
+* Automatic Summary Split
+* Manual Summary Split
+* Front Matter Summary
+
+It is natural to accompany the summary with links to the original content, and a common design pattern is to see this link in the form of a "Read More ..." button. See the `.RelPermalink`, `.Permalink`, and `.Truncated` [page variables][pagevariables].
+
- ### Manual Summary Splitting
++### Automatic summary splitting
+
+By default, Hugo automatically takes the first 70 words of your content as its summary and stores it into the `.Summary` page variable for use in your templates. You may customize the summary length by setting `summaryLength` in your [site configuration](/getting-started/configuration/).
+
+{{% note %}}
+You can customize how HTML tags in the summary are loaded using functions such as `plainify` and `safeHTML`.
+{{% /note %}}
+
+{{% note %}}
+The Hugo-defined summaries are set to use word count calculated by splitting the text by one or more consecutive whitespace characters. If you are creating content in a `CJK` language and want to use Hugo's automatic summary splitting, set `hasCJKLanguage` to `true` in your [site configuration](/getting-started/configuration/).
+{{% /note %}}
+
- ### Front Matter Summary
++### Manual summary splitting
+
+Alternatively, you may add the <code><!--more--></code> summary divider where you want to split the article.
+
+For [Org mode content][org], use `# more` where you want to split the article.
+
+Content that comes before the summary divider will be used as that content's summary and stored in the `.Summary` page variable with all HTML formatting intact.
+
+{{% note %}}
+The concept of a *summary divider* is not unique to Hugo. It is also called the "more tag" or "excerpt separator" in other literature.
+{{% /note %}}
+
+Pros
+: Freedom, precision, and improved rendering. All HTML tags and formatting are preserved.
+
+Cons
+: Extra work for content authors, since they need to remember to type <code><!--more--></code> (or `# more` for [org content][org]) in each content file. This can be automated by adding the summary divider below the front matter of an [archetype](/content-management/archetypes/).
+
+{{% warning "Be Precise with the Summary Divider" %}}
+Be careful to enter <code><!--more--></code> exactly; i.e., all lowercase and with no whitespace.
+{{% /note %}}
+
- ## Summary Selection Order
++### Front matter summary
+
+You might want your summary to be something other than the text that starts the article. In this case you can provide a separate summary in the `summary` variable of the article front matter.
+
+Pros
+: Complete freedom of text independent of the content of the article. Markup can be used within the summary.
+
+Cons
+: Extra work for content authors as they need to write an entirely separate piece of text as the summary of the article.
+
- ## Example: First 10 Articles with Summaries
++## Summary selection order
+
+Because there are multiple ways in which a summary can be specified it is useful to understand the order of selection Hugo follows when deciding on the text to be returned by `.Summary`. It is as follows:
+
+1. If there is a <code><!--more--></code> summary divider present in the article the text up to the divider will be provided as per the manual summary split method
+2. If there is a `summary` variable in the article front matter the value of the variable will be provided as per the front matter summary method
+3. The text at the start of the article will be provided as per the automatic summary split method
+
+{{% warning "Competing selections" %}}
+Hugo uses the _first_ of the above steps that returns text. So if, for example, your article has both `summary` variable in its front matter and a <code><!--more--></code> summary divider Hugo will use the manual summary split method.
+{{% /note %}}
+
++## Example: first 10 articles with summaries
+
+You can show content summaries with the following code. You could use the following snippet, for example, in a [section template].
+
+{{< code file="page-list-with-summaries.html" >}}
+{{ range first 10 .Pages }}
+ <article>
+ <!-- this <div> includes the title summary -->
+ <div>
+ <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
+ {{ .Summary }}
+ </div>
+ {{ if .Truncated }}
+ <!-- This <div> includes a read more link, but only if the summary is truncated... -->
+ <div>
+ <a href="{{ .RelPermalink }}">Read More…</a>
+ </div>
+ {{ end }}
+ </article>
+{{ end }}
+{{< /code >}}
+
+Note how the `.Truncated` boolean variable value may be used to hide the "Read More..." link when the content is not truncated; i.e., when the summary contains the entire article.
+
+[org]: /content-management/formats/
+[pagevariables]: /variables/page/
+[section template]: /templates/section-templates/
--- /dev/null
- title: Syntax Highlighting
+---
- ## Configure Syntax Highlighter
++title: Syntax highlighting
+description: Hugo comes with really fast syntax highlighting from Chroma.
+keywords: [highlighting,chroma,code blocks,syntax]
+categories: [content management]
+menu:
+ docs:
+ parent: content-management
+ weight: 240
+toc: true
+weight: 240
+aliases: [/extras/highlighting/,/extras/highlight/,/tools/syntax-highlighting/]
+---
+
+Hugo uses [Chroma](https://github.com/alecthomas/chroma) as its code highlighter; it is built in Go and is really, really fast.
+
- ## Generate Syntax Highlighter CSS
++## Configure syntax highlighter
+
+See [Configure Highlight](/getting-started/configuration-markup#highlight).
+
- If you run with `markup.highlight.noClasses=false` in your site config, you need a style sheet.
++## Generate syntax highlighter CSS
+
- ## Highlight Shortcode
++If you run with `markup.highlight.noClasses=false` in your site configuration, you need a style sheet.
+
+You can generate one with Hugo:
+
+```bash
+hugo gen chromastyles --style=monokai > syntax.css
+```
+
+Run `hugo gen chromastyles -h` for more options. See https://xyproto.github.io/splash/docs/ for a gallery of available styles.
+
- Highlighting is carried out via the built-in [`highlight` shortcode](https://gohugo.io/content-management/shortcodes/#highlight). It takes exactly one required parameter for the programming language to be highlighted and requires a closing shortcode.
++## Highlight shortcode
+
- * `linenos`: configure line numbers. Valid values are `true`, `false`, `table`, or `inline`. `false` will turn off line numbers if it's configured to be on in site config. `table` will give copy-and-paste friendly code blocks.
++Highlighting is carried out via the built-in [`highlight` shortcode](/content-management/shortcodes/#highlight). It takes exactly one required parameter for the programming language to be highlighted and requires a closing shortcode.
+
+Options:
+
- ### Example: Highlight Shortcode
++* `linenos`: configure line numbers. Valid values are `true`, `false`, `table`, or `inline`. `false` will turn off line numbers if it's configured to be on in site configuration. `table` will give copy-and-paste friendly code blocks.
+* `hl_lines`: lists a set of line numbers or line number ranges to be highlighted.
+* `linenostart=199`: starts the line number count from 199.
+* `anchorlinenos`: Configure anchors on line numbers. Valid values are `true` or `false`;
+* `lineanchors`: Configure a prefix for the anchors on line numbers. Will be suffixed with `-`, so linking to the line number 1 with the option `lineanchors=prefix` adds the anchor `prefix-1` to the page.
+* `hl_inline` Highlight inside a `<code>` (inline HTML element) tag. Valid values are `true` or `false`. The `code` tag will get a class with name `code-inline`. {{< new-in "0.101.0" >}}
+
- ## Highlight Hugo/GO Template Code
++### Example: highlight shortcode
+
+```go-html-template
+{{</* highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" */>}}
+// ... code
+{{</* / highlight */>}}
+```
+
+Gives this:
+
+{{< highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" >}}
+// GetTitleFunc returns a func that can be used to transform a string to
+// title case.
+//
+// The supported styles are
+//
+// - "Go" (strings.Title)
+// - "AP" (see https://www.apstylebook.com/)
+// - "Chicago" (see https://www.chicagomanualofstyle.org/home.html)
+//
+// If an unknown or empty style is provided, AP style is what you get.
+func GetTitleFunc(style string) func(s string) string {
+ switch strings.ToLower(style) {
+ case "go":
+ return strings.Title
+ case "chicago":
+ return transform.NewTitleConverter(transform.ChicagoStyle)
+ default:
+ return transform.NewTitleConverter(transform.APStyle)
+ }
+}
+{{< / highlight >}}
+
- For highlighting Hugo/GO template code on your page, add `/*` after the opening double curly braces and `*/` before closing curly braces.
++## Highlight Hugo/Go template code
+
- ## Highlight Template Func
++For highlighting Hugo/Go template code on your page, add `/*` after the opening double curly braces and `*/` before closing curly braces.
+
+``` go
+{{</*/* myshortcode */*/>}}
+```
+
+Gives this:
+
+``` go
+{{</* myshortcode */>}}
+```
+
- ## Highlighting in Code Fences
++## Highlight template function
+
+See [Highlight](/functions/highlight/).
+
- ## List of Chroma Highlighting Languages
++## Highlighting in code fences
+
+Highlighting in code fences is enabled by default.
+
+````txt
+```go {linenos=table,hl_lines=[8,"15-17"],linenostart=199}
+// ... code
+```
+````
+
+
+Gives this:
+
+```go {linenos=table,hl_lines=[8,"15-17"],linenostart=199}
+// GetTitleFunc returns a func that can be used to transform a string to
+// title case.
+//
+// The supported styles are
+//
+// - "Go" (strings.Title)
+// - "AP" (see https://www.apstylebook.com/)
+// - "Chicago" (see https://www.chicagomanualofstyle.org/home.html)
+//
+// If an unknown or empty style is provided, AP style is what you get.
+func GetTitleFunc(style string) func(s string) string {
+ switch strings.ToLower(style) {
+ case "go":
+ return strings.Title
+ case "chicago":
+ return transform.NewTitleConverter(transform.ChicagoStyle)
+ default:
+ return transform.NewTitleConverter(transform.APStyle)
+ }
+}
+```
+
+The options are the same as in the [highlighting shortcode](/content-management/syntax-highlighting/#highlight-shortcode), including `linenos=false`, but note the slightly different Markdown attribute syntax.
+
++## List of Chroma highlighting languages
+
+The full list of Chroma lexers and their aliases (which is the identifier used in the `highlight` template func or when doing highlighting in code fences):
+
+{{< chroma-lexers >}}
--- /dev/null
- ## What is a Taxonomy?
+---
+title: Taxonomies
+description: Hugo includes support for user-defined taxonomies.
+keywords: [taxonomies,metadata,front matter,terms]
+categories: [content management]
+menu:
+ docs:
+ parent: content-management
+ weight: 150
+toc: true
+weight: 150
+aliases: [/taxonomies/overview/,/taxonomies/usage/,/indexes/overview/,/doc/indexes/,/extras/indexes]
+---
+
- ## Example Taxonomy: Movie Website
++## What is a taxonomy?
+
+Hugo includes support for user-defined groupings of content called **taxonomies**. Taxonomies are classifications of logical relationships between content.
+
+### Definitions
+
+Taxonomy
+: a categorization that can be used to classify content
+
+Term
+: a key within the taxonomy
+
+Value
+: a piece of content assigned to a term
+
+
- ### Movie Taxonomy Organization
++## Example taxonomy: movie website
+
+Let's assume you are making a website about movies. You may want to include the following taxonomies:
+
+* Actors
+* Directors
+* Studios
+* Genre
+* Year
+* Awards
+
+Then, in each of the movies, you would specify terms for each of these taxonomies (i.e., in the [front matter] of each of your movie content files). From these terms, Hugo would automatically create pages for each Actor, Director, Studio, Genre, Year, and Award, with each listing all of the Movies that matched that specific Actor, Director, Studio, Genre, Year, and Award.
+
- ## Hugo Taxonomy Defaults {#default-taxonomies}
++### Movie taxonomy organization
+
+To continue with the example of a movie site, the following demonstrates content relationships from the perspective of the taxonomy:
+
+```txt
+Actor <- Taxonomy
+ Bruce Willis <- Term
+ The Sixth Sense <- Value
+ Unbreakable <- Value
+ Moonrise Kingdom <- Value
+ Samuel L. Jackson <- Term
+ Unbreakable <- Value
+ The Avengers <- Value
+ xXx <- Value
+```
+
+From the perspective of the content, the relationships would appear differently, although the data and labels used are the same:
+
+```txt
+Unbreakable <- Value
+ Actors <- Taxonomy
+ Bruce Willis <- Term
+ Samuel L. Jackson <- Term
+ Director <- Taxonomy
+ M. Night Shyamalan <- Term
+ ...
+Moonrise Kingdom <- Value
+ Actors <- Taxonomy
+ Bruce Willis <- Term
+ Bill Murray <- Term
+ Director <- Taxonomy
+ Wes Anderson <- Term
+ ...
+```
+
- Without adding a single line to your [site config][config] file, Hugo will automatically create taxonomies for `tags` and `categories`. That would be the same as manually [configuring your taxonomies](#configure-taxonomies) as below:
++## Default taxonomies
+
+Hugo natively supports taxonomies.
+
- If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site config][config] to the following:
++Without adding a single line to your [site configuration] file, Hugo will automatically create taxonomies for `tags` and `categories`. That would be the same as manually [configuring your taxonomies](#configure-taxonomies) as below:
+
+{{< code-toggle file="hugo" copy=false >}}
+[taxonomies]
+ tag = "tags"
+ category = "categories"
+{{</ code-toggle >}}
+
- ### Default Destinations
++If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site configuration] to the following:
+
+{{< code-toggle file="hugo" copy=false >}}
+disableKinds = ["taxonomy","term"]
+{{</ code-toggle >}}
+
+{{% page-kinds %}}
+
- ## Configure Taxonomies
++### Default destinations
+
+When taxonomies are used---and [taxonomy templates] are provided---Hugo will automatically create both a page listing all the taxonomy's terms and individual pages with lists of content associated with each term. For example, a `categories` taxonomy declared in your configuration and used in your content front matter will create the following pages:
+
+* A single page at `example.com/categories/` that lists all the [terms within the taxonomy]
+* [Individual taxonomy list pages][taxonomy templates] (e.g., `/categories/development/`) for each of the terms that shows a listing of all pages marked as part of that taxonomy within any content file's [front matter]
+
- Custom taxonomies other than the [defaults](#default-taxonomies) must be defined in your [site config][config] before they can be used throughout the site. You need to provide both the plural and singular labels for each taxonomy. For example, `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML.
++## Configure taxonomies
+
- ### Example: Adding a custom taxonomy named "series"
++Custom taxonomies other than the [defaults](#default-taxonomies) must be defined in your [site configuration] before they can be used throughout the site. You need to provide both the plural and singular labels for each taxonomy. For example, `singular key = "plural value"` for TOML and `singular key: "plural value"` for YAML.
+
- ### Example: Removing default taxonomies
++### Example: adding a custom taxonomy named "series"
+
+{{% note %}}
+While adding custom taxonomies, you need to put in the default taxonomies too, _if you want to keep them_.
+{{% /note %}}
+
+{{< code-toggle file="hugo" copy=false >}}
+[taxonomies]
+ tag = "tags"
+ category = "categories"
+ series = "series"
+{{</ code-toggle >}}
+
- If you want to have just the default `tags` taxonomy, and remove the `categories` taxonomy for your site, you can do so by modifying the `taxonomies` value in your [site config][config].
++### Example: removing default taxonomies
+
- ## Add Taxonomies to Content
++If you want to have just the default `tags` taxonomy, and remove the `categories` taxonomy for your site, you can do so by modifying the `taxonomies` value in your [site configuration].
+
+{{< code-toggle file="hugo" copy=false >}}
+[taxonomies]
+ tag = "tags"
+{{</ code-toggle >}}
+
+If you want to disable all taxonomies altogether, see the use of `disableKinds` in [Hugo Taxonomy Defaults](#default-taxonomies).
+
+{{% note %}}
+You can add content and front matter to your taxonomy list and taxonomy terms pages. See [Content Organization](/content-management/organization/) for more information on how to add an `_index.md` for this purpose.
+
+Much like regular pages, taxonomy list [permalinks](/content-management/urls/) are configurable, but taxonomy term page permalinks are not.
+{{% /note %}}
+
+{{% note %}}
+The configuration option `preserveTaxonomyNames` was removed in Hugo 0.55.
+
+You can now use `.Page.Title` on the relevant taxonomy node to get the original value.
+{{% /note %}}
+
- ### Example: Front Matter with Taxonomies
++## Add taxonomies to content
+
+Once a taxonomy is defined at the site level, any piece of content can be assigned to it, regardless of [content type] or [content section].
+
+Assigning content to a taxonomy is done in the [front matter]. Simply create a variable with the *plural* name of the taxonomy and assign all terms you want to apply to the instance of the content type.
+
+{{% note %}}
+If you would like the ability to quickly generate content files with preconfigured taxonomies or terms, read the docs on [Hugo archetypes](/content-management/archetypes/).
+{{% /note %}}
+
- ## Order Taxonomies
++### Example: front matter with taxonomies
+
+{{< code-toggle file="content/example.md" fm=true copy=false >}}
+title = "Hugo: A fast and flexible static site generator"
+tags = [ "Development", "Go", "fast", "Blogging" ]
+categories = [ "Development" ]
+series = [ "Go Web Dev" ]
+slug = "hugo"
+project_url = "https://github.com/gohugoio/hugo"
+{{</ code-toggle >}}
+
- ### Example: Taxonomic `weight`
++## Order taxonomies
+
+A content file can assign weight for each of its associate taxonomies. Taxonomic weight can be used for sorting or ordering content in [taxonomy list templates] and is declared in a content file's [front matter]. The convention for declaring taxonomic weight is `taxonomyname_weight`.
+
+The following show a piece of content that has a weight of 22, which can be used for ordering purposes when rendering the pages assigned to the "a", "b" and "c" values of the `tags` taxonomy. It has also been assigned the weight of 44 when rendering the "d" category page.
+
- ## Add custom metadata to a Taxonomy or Term
++### Example: taxonomic `weight`
+
+{{< code-toggle copy=false >}}
+title = "foo"
+tags = [ "a", "b", "c" ]
+tags_weight = 22
+categories = ["d"]
+categories_weight = 44
+{{</ code-toggle >}}
+
+By using taxonomic weight, the same piece of content can appear in different positions in different taxonomies.
+
+{{% note %}}
+Currently taxonomies only support the [default `weight => date` ordering of list content](/templates/lists/#default-weight--date--linktitle--filepath). For more information, see the documentation on [taxonomy templates](/templates/taxonomy-templates/).
+{{% /note %}}
+
- [config]: /getting-started/configuration/
++## Add custom metadata to a taxonomy or term
+
+If you need to add custom metadata to your taxonomy terms, you will need to create a page for that term at `/content/<TAXONOMY>/<TERM>/_index.md` and add your metadata in its front matter. Continuing with our 'Actors' example, let's say you want to add a Wikipedia page link to each actor. Your terms pages would be something like this:
+
+{{< code-toggle file="content/actors/bruce-willis/_index.md" fm=true copy=false >}}
+title: "Bruce Willis"
+wikipedia: "https://en.wikipedia.org/wiki/Bruce_Willis"
+{{< /code-toggle >}}
+
+[`urlize` template function]: /functions/urlize/
+[content section]: /content-management/sections/
+[content type]: /content-management/types/
+[documentation on archetypes]: /content-management/archetypes/
+[front matter]: /content-management/front-matter/
+[taxonomy list templates]: /templates/taxonomy-templates/#taxonomy-list-templates
+[taxonomy templates]: /templates/taxonomy-templates/
+[terms within the taxonomy]: /templates/taxonomy-templates/#taxonomy-terms-templates "See how to order terms associated with a taxonomy"
++[configuration]: /getting-started/configuration/
--- /dev/null
- title: Table of Contents
+---
- ## Template Example: Basic TOC
++title: Table of contents
+description: Hugo can automatically parse Markdown content and create a Table of Contents you can use in your templates.
+categories: [content management]
+keywords: [table of contents, toc]
+menu:
+ docs:
+ parent: content-management
+ weight: 210
+toc: true
+weight: 210
+aliases: [/extras/toc/]
+---
+
+{{% note %}}
+
+Previously, there was no out-of-the-box way to specify which heading levels you want the TOC to render. [See the related GitHub discussion (#1778)](https://github.com/gohugoio/hugo/issues/1778). As such, the resulting `<nav id="TableOfContents"><ul></ul></nav>` was going to start at `<h1>` when pulling from `{{ .Content }}`.
+
+Hugo [v0.60.0](https://github.com/gohugoio/hugo/releases/tag/v0.60.0) made a switch to [Goldmark](https://github.com/yuin/goldmark/) as the default library for Markdown which has improved and configurable implementation of TOC. Take a look at [how to configure TOC](/getting-started/configuration-markup/#table-of-contents) for Goldmark renderer.
+
+{{% /note %}}
+
+## Usage
+
+Create your Markdown the way you normally would with the appropriate headings. Here is some example content:
+
+```md
+<!-- Your front matter up here -->
+
+## Introduction
+
+One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin.
+
+## My Heading
+
+He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment.
+
+### My Subheading
+
+A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather. Drops
+```
+
+Hugo will take this Markdown and create a table of contents from `## Introduction`, `## My Heading`, and `### My Subheading` and then store it in the [page variable][pagevars]`.TableOfContents`.
+
+The built-in `.TableOfContents` variables outputs a `<nav id="TableOfContents">` element with a child `<ul>`, whose child `<li>` elements begin with appropriate HTML headings. See [the available settings](/getting-started/configuration-markup/#table-of-contents) to configure what heading levels you want to include in TOC.
+
- ## Template Example: TOC Partial
++## Template example: basic TOC
+
+The following is an example of a very basic [single page template]:
+
+{{< code file="layout/_default/single.html" >}}
+{{ define "main" }}
+<main>
+ <article>
+ <header>
+ <h1>{{ .Title }}</h1>
+ </header>
+ {{ .Content }}
+ </article>
+ <aside>
+ {{ .TableOfContents }}
+ </aside>
+</main>
+{{ end }}
+{{< /code >}}
+
- // Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] config key
++## Template example: TOC partial
+
+The following is a [partial template][partials] that adds slightly more logic for page-level control over your table of contents. It assumes you are using a `toc` field in your content's [front matter] that, unless specifically set to `false`, will add a TOC to any page with a `.WordCount` (see [Page Variables][pagevars]) greater than 400. This example also demonstrates how to use [conditionals] in your templating:
+
+{{< code file="layouts/partials/toc.html" >}}
+{{ if and (gt .WordCount 400 ) (.Params.toc) }}
+<aside>
+ <header>
+ <h2>{{ .Title }}</h2>
+ </header>
+ {{ .TableOfContents }}
+</aside>
+{{ end }}
+{{< /code >}}
+
+{{% note %}}
+With the preceding example, even pages with > 400 words *and* `toc` not set to `false` will not render a table of contents if there are no headings in the page for the `{{ .TableOfContents }}` variable to pull from.
+{{% /note %}}
+
+## Usage with AsciiDoc
+
+Hugo supports table of contents with AsciiDoc content format.
+
+In the header of your content file, specify the AsciiDoc TOC directives necessary to ensure that the table of contents is generated. Hugo will use the generated TOC to populate the page variable `.TableOfContents` in the same way as described for Markdown. See example below:
+
+```asciidoc
+// <!-- Your front matter up here -->
+:toc:
++// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] configuration key
+:toclevels: 4
+
+== Introduction
+
+One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin.
+
+== My Heading
+
+He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment.
+
+=== My Subheading
+
+A collection of textile samples lay spread out on the table - Samsa was a travelling salesman - and above it there hung a picture that he had recently cut out of an illustrated magazine and housed in a nice, gilded frame. It showed a lady fitted out with a fur hat and fur boa who sat upright, raising a heavy fur muff that covered the whole of her lower arm towards the viewer. Gregor then turned to look out the window at the dull weather. Drops
+```
+Hugo will take this AsciiDoc and create a table of contents store it in the page variable `.TableOfContents`, in the same as described for Markdown.
+
+[conditionals]: /templates/introduction/#conditionals
+[front matter]: /content-management/front-matter/
+[pagevars]: /variables/page/
+[partials]: /templates/partials/
+[single page template]: /templates/single-page-templates/
--- /dev/null
- title: Content Types
+---
- - Determine how the content is rendered. See [Template Lookup Order](/templates/lookup-order/) and [Content Views](https://gohugo.io/templates/views) for more.
++title: Content types
+description: Hugo is built around content organized in sections.
+categories: [content management]
+keywords: [lists, sections, content types, types, organization]
+menu:
+ docs:
+ parent: content-management
+ weight: 130
+toc: true
+weight: 130
+aliases: [/content/types]
+---
+
+A **content type** is a way to organize your content. Hugo resolves the content type from either the `type` in front matter or, if not set, the first directory in the file path. E.g. `content/blog/my-first-event.md` will be of type `blog` if no `type` is set.
+
+A content type is used to
+
++- Determine how the content is rendered. See [Template Lookup Order](/templates/lookup-order/) and [Content Views](/templates/views) for more.
+- Determine which [archetype](/content-management/archetypes/) template to use for new content.
--- /dev/null
- title: URL Management
+---
- [page kind]: https://gohugo.io/templates/section-templates/#page-kinds
++title: URL management
+description: Control the structure and appearance of URLs through front matter entries and settings in your site configuration.
+categories: [content management]
+keywords: [aliases,redirects,permalinks,urls]
+menu:
+ docs:
+ parent: content-management
+ weight: 180
+toc: true
+weight: 180
+aliases: [/extras/permalinks/,/extras/aliases/,/extras/urls/,/doc/redirects/,/doc/alias/,/doc/aliases/]
+---
+
+## Overview
+
+By default, when Hugo renders a page, the resulting URL matches the file path within the `content` directory. For example:
+
+```text
+content/posts/post-1.md → https://example.org/posts/post-1/
+```
+
+You can change the structure and appearance of URLs with front matter values and site configuration options.
+
+## Front matter
+
+### `slug`
+
+Set the `slug` in front matter to override the last segment of the path. The `slug` value does not affect section pages.
+
+{{< code-toggle file="content/posts/post-1.md" copy=false fm=true >}}
+title = 'My First Post'
+slug = 'my-first-post'
+{{< /code-toggle >}}
+
+The resulting URL will be:
+
+```text
+https://example.org/posts/my-first-post/
+```
+
+### `url`
+
+Set the `url` in front matter to override the entire path. Use this with either regular pages or section pages.
+
+With this front matter:
+
+{{< code-toggle file="content/posts/post-1.md" copy=false fm=true >}}
+title = 'My First Article'
+url = '/articles/my-first-article'
+{{< /code-toggle >}}
+
+The resulting URL will be:
+
+```text
+https://example.org/articles/my-first-article/
+```
+
+If you include a file extension:
+
+{{< code-toggle file="content/posts/post-1.md" copy=false fm=true >}}
+title = 'My First Article'
+url = '/articles/my-first-article.html'
+{{< /code-toggle >}}
+
+The resulting URL will be:
+
+```text
+https://example.org/articles/my-first-article.html
+```
+
+In a monolingual site, a `url` value with or without a leading slash is relative to the `baseURL`.
+
+In a multilingual site:
+
+- A `url` value with a leading slash is relative to the `baseURL`.
+- A `url` value without a leading slash is relative to the `baseURL` plus the language prefix.
+
+Site type|Front matter `url`|Resulting URL
+:--|:--|:--
+monolingual|`/about`|`https://example.org/about/`
+monolingual|`about`|`https://example.org/about/`
+multilingual|`/about`|`https://example.org/about/`
+multilingual|`about`|`https://example.org/de/about/`
+
+If you set both `slug` and `url` in front matter, the `url` value takes precedence.
+
+## Site configuration
+
+### Permalinks
+
+In your site configuration, define a URL pattern for each top-level section. Each URL pattern can target a given language and/or [page kind].
+
+Front matter `url` values override the URL patterns defined in the `permalinks` section of your site configuration.
+
- : the content's slug (or filename if no slug is provided in the front matter)
++[page kind]: /templates/section-templates/#page-kinds
+
+#### Monolingual examples {#permalinks-monolingual-examples}
+
+With this content structure:
+
+```text
+content/
+├── posts/
+│ ├── bash-in-slow-motion.md
+│ └── tls-in-a-nutshell.md
+├── tutorials/
+│ ├── git-for-beginners.md
+│ └── javascript-bundling-with-hugo.md
+└── _index.md
+```
+
+Render tutorials under "training", and render the posts under "articles" with a date-base hierarchy:
+
+{{< code-toggle file="hugo" copy=false >}}
+[permalinks.page]
+posts = '/articles/:year/:month/:slug/'
+tutorials = '/training/:slug/'
+[permalinks.section]
+posts = '/articles/'
+tutorials = '/training/'
+{{< /code-toggle >}}
+
+The structure of the published site will be:
+
+```text
+public/
+├── articles/
+│ ├── 2023/
+│ │ ├── 04/
+│ │ │ └── bash-in-slow-motion/
+│ │ │ └── index.html
+│ │ └── 06/
+│ │ └── tls-in-a-nutshell/
+│ │ └── index.html
+│ └── index.html
+├── training/
+│ ├── git-for-beginners/
+│ │ └── index.html
+│ ├── javascript-bundling-with-hugo/
+│ │ └── index.html
+│ └── index.html
+└── index.html
+```
+
+To create a date-based hierarchy for regular pages in the content root:
+
+{{< code-toggle file="hugo" copy=false >}}
+[permalinks.page]
+"/" = "/:year/:month/:slug/"
+{{< /code-toggle >}}
+
+Use the same approach with taxonomy terms. For example, to omit the taxonomy segment of the URL:
+
+{{< code-toggle file="hugo" copy=false >}}
+[permalinks.term]
+'tags' = '/:slug/'
+{{< /code-toggle >}}
+
+#### Multilingual example {#permalinks-multilingual-example}
+
+Use the `permalinks` configuration as a component of your localization strategy.
+
+With this content structure:
+
+```text
+content/
+├── de/
+│ ├── books/
+│ │ ├── les-miserables.md
+│ │ └── the-hunchback-of-notre-dame.md
+│ └── _index.md
+└── en/
+ ├── books/
+ │ ├── les-miserables.md
+ │ └── the-hunchback-of-notre-dame.md
+ └── _index.md
+```
+
+And this site configuration:
+
+{{< code-toggle file="hugo" copy=false >}}
+defaultContentLanguage = 'en'
+defaultContentLanguageInSubdir = true
+
+[languages.en]
+contentDir = 'content/en'
+languageCode = 'en-US'
+languageDirection = 'ltr'
+languageName = 'English'
+weight = 1
+
+[languages.en.permalinks.page]
+books = "/books/:slug/"
+
+[languages.en.permalinks.section]
+books = "/books/"
+
+[languages.es]
+contentDir = 'content/de'
+languageCode = 'es-ES'
+languageDirection = 'ltr'
+languageName = 'Español'
+weight = 2
+
+[languages.es.permalinks.page]
+books = "/libros/:slug/"
+
+[languages.es.permalinks.section]
+books = "/libros/"
+{{< /code-toggle >}}
+
+The structure of the published site will be:
+
+```text
+public/
+├── en/
+│ ├── books/
+│ │ ├── les-miserables/
+│ │ │ └── index.html
+│ │ ├── the-hunchback-of-notre-dame/
+│ │ │ └── index.html
+│ │ └── index.html
+│ └── index.html
+├── es/
+│ ├── libros/
+│ │ ├── les-miserables/
+│ │ │ └── index.html
+│ │ ├── the-hunchback-of-notre-dame/
+│ │ │ └── index.html
+│ │ └── index.html
+│ └── index.html
+└── index.html
+````
+
+#### Tokens
+
+Use these tokens when defining the URL pattern. The `date` field in front matter determines the value of time-related tokens.
+
+`:year`
+: the 4-digit year
+
+`:month`
+: the 2-digit month
+
+`:monthname`
+: the name of the month
+
+`:day`
+: the 2-digit day
+
+`:weekday`
+: the 1-digit day of the week (Sunday = 0)
+
+`:weekdayname`
+: the name of the day of the week
+
+`:yearday`
+: the 1- to 3-digit day of the year
+
+`:section`
+: the content's section
+
+`:sections`
+: the content's sections hierarchy. You can use a selection of the sections using _slice syntax_: `:sections[1:]` includes all but the first, `:sections[:last]` includes all but the last, `:sections[last]` includes only the last, `:sections[1:2]` includes section 2 and 3. Note that this slice access will not throw any out-of-bounds errors, so you don't have to be exact.
+
+`:title`
+: the content's title
+
+`:slug`
+: the content's slug (or title if no slug is provided in the front matter)
+
+`:slugorfilename`
- : the content's filename (without extension)
++: the content's slug (or file name if no slug is provided in the front matter)
+
+`:filename`
- ### How Aliases Work
++: the content's file name (without extension)
+
+For time-related values, you can also use the layout string components defined in Go's [time package]. For example:
+
+[time package]: https://pkg.go.dev/time#pkg-constants
+
+{{< code-toggle file="hugo" copy=false >}}
+permalinks:
+ posts: /:06/:1/:2/:title/
+{{< /code-toggle >}}
+
+### Appearance
+
+The appearance of a URL is either ugly or pretty.
+
+Type|Path|URL
+:--|:--|:--
+ugly|content/about.md|`https://example.org/about.html`
+pretty|content/about.md|`https://example.org/about/`
+
+By default, Hugo produces pretty URLs. To generate ugly URLs, change your site configuration:
+
+{{< code-toggle file="hugo" copy=false >}}
+uglyURLs = true
+{{< /code-toggle >}}
+
+### Post-processing
+
+Hugo provides two mutually exclusive configuration options to alter URLs _after_ it renders a page.
+
+#### Canonical URLs
+
+{{% note %}}
+This is a legacy configuration option, superseded by template functions and markdown render hooks, and will likely be [removed in a future release].
+
+[removed in a future release]: https://github.com/gohugoio/hugo/issues/4733
+{{% /note %}}
+
+If enabled, Hugo performs a search and replace _after_ it renders the page. It searches for site-relative URLs (those with a leading slash) associated with `action`, `href`, `src`, `srcset`, and `url` attributes. It then prepends the `baseURL` to create absolute URLs.
+
+```text
+<a href="/about"> → <a href="https://example.org/about/">
+<img src="/a.gif"> → <img src="https://example.org/a.gif">
+```
+
+This is an imperfect, brute force approach that can affect content as well as HTML attributes. As noted above, this is a legacy configuration option that will likely be removed in a future release.
+
+To enable:
+
+{{< code-toggle file="hugo" copy=false >}}
+canonifyURLs = true
+{{< /code-toggle >}}
+
+#### Relative URLs
+
+{{% note %}}
+Do not enable this option unless you are creating a serverless site, navigable via the file system.
+{{% /note %}}
+
+If enabled, Hugo performs a search and replace _after_ it renders the page. It searches for site-relative URLs (those with a leading slash) associated with `action`, `href`, `src`, `srcset`, and `url` attributes. It then transforms the URL to be relative to the current page.
+
+For example, when rendering `content/posts/post-1`:
+
+```text
+<a href="/about"> → <a href="../../about">
+<img src="/a.gif"> → <img src="../../a.gif">
+```
+
+This is an imperfect, brute force approach that can affect content as well as HTML attributes. As noted above, do not enable this option unless you are creating a serverless site.
+
+To enable:
+
+{{< code-toggle file="hugo" copy=false >}}
+relativeURLs = true
+{{< /code-toggle >}}
+
+## Aliases
+
+Create redirects from old URLs to new URLs with aliases:
+
+- An alias with a leading slash is relative to the `baseURL`
+- An alias without a leading slash is relative to the current directory
+
+### Examples {#alias-examples}
+
+Change the file name of an existing page, and create an alias from the previous URL to the new URL:
+
+{{< code-toggle file="content/posts/new-file-name.md" copy=false >}}
+aliases = ['/posts/previous-file-name']
+{{< /code-toggle >}}
+
+Each of these directory-relative aliases is equivalent to the site-relative alias above:
+
+- `previous-file-name`
+- `./previous-file-name`
+- `../posts/previous-file-name`
+
+You can create more than one alias to the current page:
+
+{{< code-toggle file="content/posts/new-file-name.md" copy=false >}}
+aliases = ['previous-file-name','original-file-name']
+{{< /code-toggle >}}
+
+In a multilingual site, use a directory-relative alias, or include the language prefix with a site-relative alias:
+
+{{< code-toggle file="content/posts/new-file-name.de.md" copy=false >}}
+aliases = ['/de/posts/previous-file-name']
+{{< /code-toggle >}}
+
++### How aliases work
+
+Using the first example above, Hugo generates the following site structure:
+
+```text
+public/
+├── posts/
+│ ├── new-file-name/
+│ │ └── index.html
+│ ├── previous-file-name/
+│ │ └── index.html
+│ └── index.html
+└── index.html
+```
+
+The alias from the previous URL to the new URL is a client-side redirect:
+
+{{< code file="posts/previous-file-name/index.html" copy=false >}}
+<!DOCTYPE html>
+<html lang="en-us">
+ <head>
+ <title>https://example.org/posts/new-file-name/</title>
+ <link rel="canonical" href="https://example.org/posts/new-file-name/">
+ <meta name="robots" content="noindex">
+ <meta charset="utf-8">
+ <meta http-equiv="refresh" content="0; url=https://example.org/posts/new-file-name/">
+ </head>
+</html>
+{{< /code >}}
+
+Collectively, the elements in the `head` section:
+
+- Tell search engines that the new URL is canonical
+- Tell search engines not to index the previous URL
+- Tell the browser to redirect to the new URL
+
+Hugo renders alias files before rendering pages. A new page with the previous file name will overwrite the alias, as expected.
+
+### Customize
+
+Create a new template (`layouts/alias.html`) to customize the content of the alias files. The template receives the following context:
+
+`Permalink`
+: the link to the page being aliased
+
+`Page`
+: the Page data for the page being aliased
--- /dev/null
- title: Contribute to the Hugo Project
- linktitle: Contribute to Hugo
+---
- weight: 01
- weight: 01
++title: Contribute to the Hugo project
++linkTitle: Overview
+description: Contribute to Hugo development and documentation.
+categories: [contribute]
+keywords: []
+menu:
+ docs:
++ identifier: contribute-overview
+ parent: contribute
++ weight: 10
++weight: 10
+aliases: [/tutorials/how-to-contribute-to-hugo/,/community/contributing/]
+---
+
+Hugo relies heavily on the enthusiasm and participation of the open-source community. We need your support in both its development and documentation.
+
+Hugo's contribution guidelines are [detailed in a `CONTRIBUTING.md`](https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md) in the Hugo source repository on GitHub.
--- /dev/null
- title: Contribute to Hugo Development
- linktitle: Development
+---
- weight: 10
- weight: 10
++title: Contribute to development
++linkTitle: Development
+description: Hugo relies heavily on contributions from the open source community.
+categories: [contribute]
+keywords: [dev,open source]
+menu:
+ docs:
+ parent: contribute
- ### Install Go From Source
++ weight: 20
++weight: 20
+toc: true
+---
+
+## Introduction
+
+Hugo is an open-source project and lives by the work of its [contributors]. There are plenty of [open issues][issues], and we need your help to make Hugo even more awesome. You don't need to be a Go guru to contribute to the project's development.
+
+## Assumptions
+
+This contribution guide takes a step-by-step approach in hopes of helping newcomers. Therefore, we only assume the following:
+
+* You are new to Git or open-source projects in general
+* You are a fan of Hugo and enthusiastic about contributing to the project
+
+{{% note %}}
+If you're struggling at any point in this contribution guide, reach out to the Hugo community in [Hugo's Discussion forum](https://discourse.gohugo.io).
+{{% /note %}}
+
+## Install Go
+
+The installation of Go should take only a few minutes. You have more than one option to get Go up and running on your machine.
+
+If you are having trouble following the installation guides for Go, check out [Go Bootcamp, which contains setups for every platform][gobootcamp] or reach out to the Hugo community in the [Hugo Discussion Forums][forums].
+
- ## Create a GitHub Account
++### Install Go from source
+
+[Download the latest stable version of Go][godl] and follow the official [Go installation guide][goinstall].
+
+Once you're finished installing Go, let's confirm everything is working correctly. Open a terminal---or command line under Windows--and type the following:
+
+```txt
+go version
+```
+
+You should see something similar to the following written to the console. Note that the version here reflects the most recent version of Go as of the last update for this page:
+
+```txt
+go version go1.12 darwin/amd64
+```
+
+Next, make sure that you set up your `GOPATH` [as described in the installation guide][setupgopath].
+
+You can print the `GOPATH` with `echo $GOPATH`. You should see a non-empty string containing a valid path to your Go workspace; for example:
+
+```txt
+/Users/<yourusername>/Code/go
+```
+
+### Install Go with Homebrew
+
+If you are a macOS user and have [Homebrew](https://brew.sh/) installed on your machine, installing Go is as simple as the following command:
+
+{{< code file="install-go.sh" >}}
+brew install go
+{{< /code >}}
+
+### Install Go via GVM
+
+More experienced users can use the [Go Version Manager][gvm] (GVM). GVM allows you to switch between different Go versions *on the same machine*. If you're a beginner, you probably don't need this feature. However, GVM makes it easy to upgrade to a new released Go version with just a few commands.
+
+GVM comes in especially handy if you follow the development of Hugo over a longer period of time. Future versions of Hugo will usually be compiled with the latest version of Go. Sooner or later, you will have to upgrade if you want to keep up.
+
- ## Install Git on Your System
++## Create a GitHub account
+
+If you're going to contribute code, you'll need to have an account on GitHub. Go to [www.github.com/join](https://github.com/join) and set up a personal account.
+
- ### Git Graphical Front Ends
++## Install Git on your system
+
+You will need to have Git installed on your computer to contribute to Hugo development. Teaching Git is outside the scope of the Hugo docs, but if you're looking for an excellent reference to learn the basics of Git, we recommend the [Git book][gitbook] if you are not sure where to begin. We will include short explanations of the Git commands in this document.
+
+Git is a [version control system](https://en.wikipedia.org/wiki/Version_control) to track the changes of source code. Hugo depends on smaller third-party packages that are used to extend the functionality. We use them because we don't want to reinvent the wheel.
+
+Go ships with a sub-command called `get` that will download these packages for us when we set up our working environment. The source code of the packages is tracked with Git. `get` will interact with the Git servers of the package hosters in order to fetch all dependencies.
+
+Move back to the terminal and check if Git is already installed. Type in `git version` and press enter. You can skip the rest of this section if the command returned a version number. Otherwise [download](https://git-scm.com/downloads) the latest version of Git and follow this [installation guide](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
+
+Finally, check again with `git version` if Git was installed successfully.
+
- ### Install Hub on Your System (Optional)
++### Git graphical front ends
+
+There are several [GUI clients](https://git-scm.com/downloads/guis) that help you to operate Git. Not all are available for all operating systems and maybe differ in their usage. Because of this we will document how to use the command-line, since the commands are the same everywhere.
+
- ## The Hugo Git Contribution Workflow
++### Install Hub on your system (optional)
+
+Hub is a great tool for working with GitHub. The main site for it is [hub.github.com](https://hub.github.com/). Feel free to install this little Git wrapper.
+
+On a Mac, you can install [Hub](https://github.com/github/hub) using [Homebrew](https://brew.sh):
+
+```txt
+brew install hub
+```
+
+Now we'll create an [alias in Bash](https://tldp.org/LDP/abs/html/aliases.html) so that typing `git` actually runs `Hub`:
+
+```txt
+echo "alias git='hub'" >> ~/.bash_profile
+```
+
+Confirm the installation:
+
+```txt
+git version 2.21.0
+hub version 2.10.0
+```
+
+## Set up your working copy
+
+You set up the working copy of the repository locally on your computer. Your local copy of the files is what you'll edit, compile, and end up pushing back to GitHub. The main steps are cloning the repository and creating your fork as a remote.
+
+### Clone the repository
+
+We assume that you've set up your `GOPATH` (see the section above if you're unsure about this). You should now copy the Hugo repository down to your computer. You'll hear this called "clone the repo". GitHub's [help pages](https://help.github.com/articles/cloning-a-repository/) give us a short explanation:
+
+{{% note %}}
+When you create a repository on GitHub, it exists as a remote repository. You can create a local clone of your repository on your computer and sync between the two locations.
+{{% /note %}}
+
+We're going to clone the [master Hugo repository](https://github.com/gohugoio/hugo). That seems counter-intuitive, since you won't have commit rights on it. But it's required for the Go workflow. You'll work on a copy of the master and push your changes to your own repository on GitHub.
+
+So, let's make a new directory and clone that master repository:
+
+```txt
+mkdir $HOME/src
+cd $HOME/src
+git clone https://github.com/gohugoio/hugo.git
+```
+
+Since Hugo 0.48, Hugo uses the Go Modules support built into Go 1.11 to build. The easiest is to clone Hugo in a directory outside of GOPATH
+
+And then, install dependencies of Hugo by running the following in the cloned directory:
+
+```txt
+cd $HOME/src/hugo
+go install
+```
+
+Hugo relies on [mage](https://github.com/magefile/mage) for some convenient build and test targets. If you don't already have it, get it:
+
+```txt
+go install github.com/magefile/mage@latest
+```
+
+### Fork the repository
+
+If you're not familiar with this term, GitHub's [help pages](https://help.github.com/articles/fork-a-repo/) provide again a simple explanation:
+
+{{% note %}}
+A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project.
+{{% /note %}}
+
+#### Fork by hand
+
+Open the [Hugo repository](https://github.com/gohugoio/hugo) on GitHub and click on the "Fork" button in the top right.
+
+
+
+Now open your fork repository on GitHub and copy the remote URL of your fork. You can choose between HTTPS and SSH as protocol that Git should use for the following operations. HTTPS works always [if you're not sure](https://help.github.com/articles/which-remote-url-should-i-use/).
+
+
+
+Switch back to the terminal and move into the directory of the cloned master repository from the last step.
+
+```txt
+cd $HOME/src/hugo
+```
+
+Now Git needs to know that our fork exists by adding the copied remote url:
+
+```txt
+git remote add <YOUR-GITHUB-USERNAME> <COPIED REMOTE-URL>
+```
+
+#### Fork with Hub
+
+Alternatively, you can use the Git wrapper Hub. Hub makes forking a repository easy:
+
+```txt
+git fork
+```
+
+That command will log in to GitHub using your account, create a fork of the repository that you're currently working in, and add it as a remote to your working copy.
+
+#### Trust, but verify
+
+Let's check if everything went right by listing all known remotes:
+
+```txt
+git remote -v
+```
+
+The output should look similar:
+
+```txt
+digitalcraftsman git@github.com:digitalcraftsman/hugo.git (fetch)
+digitalcraftsman git@github.com:digitalcraftsman/hugo.git (push)
+origin https://github.com/gohugoio/hugo (fetch)
+origin https://github.com/gohugoio/hugo (push)
+```
+
- ### Contribute to Documentation
++## The Hugo Git contribution workflow
+
+### Create a new branch
+
+You should never develop against the "master" branch. The development team will not accept a pull request against that branch. Instead, create a descriptive named branch and work on it.
+
+First, you should always pull the latest changes from the master repository:
+
+```txt
+git checkout master
+git pull
+```
+
+Now we can create a new branch for your additions:
+
+```txt
+git checkout -b <BRANCH-NAME>
+```
+
+You can check on which branch you are with `git branch`. You should see a list of all local branches. The current branch is indicated with a little asterisk.
+
- ## Additional References for Learning Git and Go
++### Contribute to documentation
+
+Perhaps you want to start contributing to the Hugo docs. If so, you can ignore most of the following steps and focus on the `/docs` directory within your newly cloned repository. You can change directories into the Hugo docs using `cd docs`.
+
+You can start Hugo's built-in server via `hugo server`. Browse the documentation by entering [http://localhost:1313](http://localhost:1313) in the address bar of your browser. The server automatically updates the page whenever you change content.
+
+We have developed a [separate Hugo documentation contribution guide][docscontrib] for more information on how the Hugo docs are built, organized, and improved by the generosity of people like you.
+
+### Build Hugo
+
+While making changes in the codebase it's a good idea to build the binary to test them:
+
+```txt
+mage hugo
+```
+
+This command generates the binary file at the root of the repository.
+
+If you want to install the binary in `$GOPATH/bin`, run
+
+```txt
+mage install
+```
+
+### Test
+
+Sometimes changes on the codebase can cause unintended side effects. Or they don't work as expected. Most functions have their own test cases. You can find them in files ending with `_test.go`.
+
+Make sure the commands
+
+```txt
+mage -v check
+```
+
+passes.
+
+### Formatting
+
+The Go code style guide maybe is opinionated but it ensures that the codebase looks the same, regardless who wrote the code. Go comes with its own formatting tool. Let's apply the style guide to our additions:
+
+```txt
+mage fmt
+```
+
+Once you made your additions commit your changes. Make sure that you follow our [code contribution guidelines](https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md):
+
+```txt
+# Add all changed files
+git add --all
+git commit --message "YOUR COMMIT MESSAGE"
+```
+
+The commit message should describe what the commit does (e.g. add feature XYZ), not how it is done.
+
+### Modify commits
+
+You noticed some commit messages don't fulfill the code contribution guidelines or you just forget something to add some files? No problem. Git provides the necessary tools to fix such problems. The next two methods cover all common cases.
+
+If you are unsure what a command does leave the commit as it is. We can fix your commits later in the pull request.
+
+#### Modify the last commit
+
+Let's say you want to modify the last commit message. Run the following command and replace the current message:
+
+```txt
+git commit --amend -m"YOUR NEW COMMIT MESSAGE"
+```
+
+Take a look at the commit log to see the change:
+
+```txt
+git log
+# Exit with q
+```
+
+After making the last commit you may have forgotten something. There is no need to create a new commit. Just add the latest changes and merge them into the intended commit:
+
+```txt
+git add --all
+git commit --amend
+```
+
+#### Modify multiple commits
+
+{{% warning "Be Careful Modifying Multiple Commits"%}}
+Modifications such as those described in this section can have serious unintended consequences. Skip this section if you're not sure!
+{{% /note %}}
+
+This is a bit more advanced. Git allows you to [rebase](https://git-scm.com/docs/git-rebase) commits interactively. In other words: it allows you to rewrite the commit history.
+
+```txt
+git rebase --interactive @~6
+```
+
+The `6` at the end of the command represents the number of commits that should be modified. An editor should open and present a list of last six commit messages:
+
+```txt
+pick 80d02a1 tpl: Add hasPrefix to the template funcs' "smoke test"
+pick aaee038 tpl: Sort the smoke tests
+pick f0dbf2c tpl: Add the other test case for hasPrefix
+pick 911c35b Add "How to contribute to Hugo" tutorial
+pick 33c8973 Begin workflow
+pick 3502f2e Refactoring and typo fixes
+```
+
+In the case above we should merge the last two commits in the commit of this tutorial (`Add "How to contribute to Hugo" tutorial`). You can "squash" commits, i.e. merge two or more commits into a single one.
+
+All operations are written before the commit message. Replace "pick" with an operation. In this case `squash` or `s` for short:
+
+```txt
+pick 80d02a1 tpl: Add hasPrefix to the template funcs' "smoke test"
+pick aaee038 tpl: Sort the smoke tests
+pick f0dbf2c tpl: Add the other test case for hasPrefix
+pick 911c35b Add "How to contribute to Hugo" tutorial
+squash 33c8973 Begin workflow
+squash 3502f2e Refactoring and typo fixes
+```
+
+We also want to rewrite the commits message of the third last commit. We forgot "docs:" as prefix according to the code contribution guidelines. The operation to rewrite a commit is called `reword` (or `r` as shortcut).
+
+You should end up with a similar setup:
+
+```txt
+pick 80d02a1 tpl: Add hasPrefix to the template funcs' "smoke test"
+pick aaee038 tpl: Sort the smoke tests
+pick f0dbf2c tpl: Add the other test case for hasPrefix
+reword 911c35b Add "How to contribute to Hugo" tutorial
+squash 33c8973 Begin workflow
+squash 3502f2e Refactoring and typo fixes
+```
+
+Close the editor. It should open again with a new tab. A text is instructing you to define a new commit message for the last two commits that should be merged (aka "squashed"). Save the file with <kbd>CTRL</kbd>+<kbd>S</kbd> and close the editor again.
+
+A last time a new tab opens. Enter a new commit message and save again. Your terminal should contain a status message. Hopefully this one:
+
+```txt
+Successfully rebased and updated refs/heads/<BRANCHNAME>.
+```
+
+Check the commit log if everything looks as expected. Should an error occur you can abort this rebase with `git rebase --abort`.
+
+### Push commits
+
+To push our commits to the fork on GitHub we need to specify a destination. A destination is defined by the remote and a branch name. Earlier, the defined that the remote URL of our fork is the same as our GitHub handle, in my case `digitalcraftsman`. The branch should have the same as our local one. This makes it easy to identify corresponding branches.
+
+```txt
+git push --set-upstream <YOUR-GITHUB-USERNAME> <BRANCHNAME>
+```
+
+Now Git knows the destination. Next time when you to push commits you just need to enter `git push`.
+
+If you modified your commit history in the last step GitHub will reject your try to push. This is a safety-feature because the commit history isn't the same and new commits can't be appended as usual. You can enforce this push explicitly with `git push --force`.
+
+## Open a pull request
+
+We made a lot of progress. Good work. In this step we finally open a pull request to submit our additions. Open the [Hugo master repository](https://github.com/gohugoio/hugo/) on GitHub in your browser.
+
+You should find a green button labeled with "New pull request". But GitHub is clever and probably suggests you a pull request like in the beige box below:
+
+
+
+The new page summaries the most important information of your pull request. Scroll down and you find the additions of all your commits. Make sure everything looks as expected and click on "Create pull request".
+
+### Accept the contributor license agreement
+
+Last but not least you should accept the contributor license agreement (CLA). A new comment should be added automatically to your pull request. Click on the yellow badge, accept the agreement and authenticate yourself with your GitHub account. It just takes a few clicks and only needs to be done once.
+
+
+
+### Automatic builds
+
+We use a GitHub Actions workflow to build and test. This is a matrix build across combinations of operating system (macOS, Windows, and Ubuntu) and Go versions. The workflow is triggered by the submission of a pull request. If you are a first-time contributor, the workflow requires approval from a project maintainer.
+
+## Where to start?
+
+Thank you for reading through this contribution guide. Hopefully, we will see you again soon on GitHub. There are plenty of [open issues][issues] for you to help with.
+
+Feel free to [open an issue][newissue] if you think you found a bug or you have a new idea to improve Hugo. We are happy to hear from you.
+
++## Additional references for learning Git and Go
+
+* [Codecademy's Free "Learn Git" Course][codecademy] (Free)
+* [Code School and GitHub's "Try Git" Tutorial][trygit] (Free)
+* [The Git Book][gitbook] (Free)
+* [Go Bootcamp][gobootcamp]
+
+[codecademy]: https://www.codecademy.com/learn/learn-git
+[contributors]: https://github.com/gohugoio/hugo/graphs/contributors
+[docscontrib]: /contribute/documentation/
+[forums]: https://discourse.gohugo.io
+[gitbook]: https://git-scm.com/
+[gobootcamp]: https://www.golang-book.com/guides/machine_setup
+[godl]: https://go.dev/dl/
+[goinstall]: https://go.dev/doc/install
+[gvm]: https://github.com/moovweb/gvm
+[issues]: https://github.com/gohugoio/hugo/issues
+[newissue]: https://github.com/gohugoio/hugo/issues/new
+[releases]: /getting-started/
+[setupgopath]: https://go.dev/doc/code#Workspaces
+[trygit]: https://try.github.io/levels/1/challenges/1
--- /dev/null
- title: Contribute to the Hugo Docs
- linktitle: Documentation
+---
- weight: 20
++title: Contribute to documentation
++linkTitle: Documentation
+description: Documentation is an integral part of any open source project. The Hugo documentation is as much a work in progress as the source it attempts to cover.
+categories: [contribute]
+keywords: [docs,documentation,community, contribute]
+menu:
+ docs:
+ parent: contribute
- weight: 20
++ weight: 30
+toc: true
++weight: 30
+aliases: [/contribute/docs/]
+---
+
+## GitHub workflow
+
+Step 1
+: Fork the [documentation repository].
+
+Step 2
+: Clone your fork.
+
+Step 3
+: Create a new branch with a descriptive name.
+
+```bash
+git checkout -b fix/typos-site-variables
+```
+
+Step 4
+: Make changes.
+
+Step 5
+: Commit your changes with a descriptive commit message, typically 50 characters or less. Included the "Closes" keyword if your change addresses one or more open [issues].
+
+```bash
+git commit -m "Fix typos on site variables page
+
+Closes #1234
+Closes #5678"
+```
+
+Step 5
+: Push the new branch to your fork of the documentation repository.
+
+Step 6
+: Visit the [documentation repository] and create a pull request (PR).
+
+[documentation repository]: https://github.com/gohugoio/hugoDocs/
+[issues]: https://github.com/gohugoio/hugoDocs/issues
+
+Step 7
+: A project maintainer will review your PR, and may request changes. You may delete your branch after the maintainer merges your PR.
+
+## Including sample code
+
+{{% note %}}
+Use this syntax to include shortcodes calls within your code samples:
+
+`{{</*/* foo */*/>}}`\
+`{{%/*/* foo */*/%}}`
+{{% /note %}}
+
+### Fenced code blocks
+
+Include the language when using a fenced code block.
+
+````text
+```go-html-template
+{{ if eq $foo "bar" }}
+ {{ print "foo is bar" }}
+{{ end }}
+```
+````
+
+Rendered:
+
+```go-html-template
+{{ if eq $foo "bar" }}
+ {{ print "foo is bar" }}
+{{ end }}
+```
+
+### The code shortcode
+
+Use the `code` shortcode to include the file name and a copy-to-clipboard button. This shortcode accepts these optional parameters:
+
+copy
+: (`bool`) If `true`, displays a copy-to-clipboard button. Default is `true`.
+
+file
+: (`string`) The file name to display. If you do not provide a `lang` parameter, the file extension determines the code language.
+
+lang
+: (`string`) The code language. Default is `text`.
+
+````text
+{{</* code file="layouts/_default_/single.html" */>}}
+{{ if eq $foo "bar" }}
+ {{ print "foo is bar" }}
+{{ end }}
+{{</* /code */>}}
+
+````
+
+Rendered:
+
+{{< code file="layouts/_default_/single.html" >}}
+{{ if eq $foo "bar" }}
+ {{ print "foo is bar" }}
+{{ end }}
+{{< /code >}}
+
+### The code-toggle shortcode
+
+Use the `code-toggle` shortcode to display examples of site configuration, front matter, or data files. This shortcode accepts these optional parameters:
+
+copy
+: (`bool`) If `true`, displays a copy-to-clipboard button. Default is `true`.
+
+file
+: (`string`) The file name to display. Omit the file extension for site configuration and data file examples.
+
+fm
+: (`bool`) If `true`, displays the code as front matter. Default is `false`.
+
+#### Site configuration example
+
+```text
+{{</* code-toggle file="hugo" */>}}
+baseURL = 'https://example.org'
+languageCode = 'en-US'
+title = "Example Site"
+{{</* /code-toggle */>}}
+```
+
+Rendered:
+
+{{< code-toggle file="hugo" >}}
+baseURL = 'https://example.org'
+languageCode = 'en-US'
+title = "Example Site"
+{{< /code-toggle >}}
+
+#### Front matter example
+
+```text
+{{</* code-toggle file="content/about.md" fm=true */>}}
+title = "About"
+date = 2023-04-02T12:47:24-07:00
+draft = false
+{{</* /code-toggle */>}}
+```
+
+Rendered:
+
+{{< code-toggle file="content/about.md" fm=true >}}
+title = "About"
+date = 2023-04-02T12:47:24-07:00
+draft = false
+{{< /code-toggle >}}
+
+## Admonitions
+
+Use the `note` shortcode to draw attention to content. Use the `{{%/* */%}}` notation when calling this shortcode.
+
+```text
+{{%/* note */%}}
+This is **bold** text.
+{{%/* /note */%}}
+```
+
+{{% note %}}
+This is **bold** text.
+{{% /note %}}
--- /dev/null
- title: Add Your Hugo Theme to the Showcase
- linktitle: Themes
+---
- weight: 30
- weight: 30
++title: Add your hugo theme to the showcase
++linkTitle: Themes
+description: If you've built a Hugo theme and want to contribute back to the Hugo Community, share it with us.
+categories: [contribute]
+keywords: [contribute,themes,design]
+menu:
+ docs:
+ parent: contribute
- ### Add Your Theme to the Repo
++ weight: 40
++weight: 40
+aliases: [/contribute/theme/]
+toc: true
+---
+
+A collection of all themes created by the Hugo community, including screenshots and demos, can be found at [themes.gohugo.io]. Every theme in this list will automatically be added to the theme site.
+
+Another great site for Hugo themes is [jamstackthemes.dev/](https://jamstackthemes.dev/ssg/hugo/).
+
++### Add your theme to the repository
+
+In order to add your Hugo theme to [themes.gohugo.io] please [open a pull request in the theme repository](https://github.com/gohugoio/hugoThemesSiteBuilder). **Please make sure that you've read the theme submission guidelines in the [README](https://github.com/gohugoio/hugoThemesSiteBuilder/blob/main/README.md#hugo-themes) of the hugoThemesSiteBuilder repository.**
+
+[themes.gohugo.io]: https://themes.gohugo.io/
--- /dev/null
- linktitle: Hugo
+---
+title: Hugo Documentation
- weight: 01
- weight: 01
++linkTitle: Hugo
+description: Hugo is the world's fastest static website engine. It's written in Go (aka Golang) and developed by bep, spf13 and friends.
+menu:
+ main:
++ weight: 1
++weight: 1
+layout: documentation-home
+---
+
+Hugo is the **world's fastest static website engine.** It's written in Go (aka Golang) and developed by [bep](https://github.com/bep), [spf13](https://github.com/spf13) and [friends](https://github.com/gohugoio/hugo/graphs/contributors).
+
+Below you will find some of the most common and helpful pages from our documentation.
--- /dev/null
- ## .GetPage and Multilingual Sites
+---
+title: .GetPage
+description: "Gets a `Page` of a given `path`."
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [sections,lists,indexes]
+signature: [".GetPage PATH"]
+relatedfuncs: []
+---
+
+`.GetPage` returns a page of a given `path`. Both `Site` and `Page` implements this method. The `Page` variant will, if given a relative path -- i.e. a path without a leading `/` -- try look for the page relative to the current page.
+
+{{% note %}}
+**Note:** We overhauled and simplified the `.GetPage` API in Hugo 0.45. Before that you needed to provide a `Kind` attribute in addition to the path, e.g. `{{ .Site.GetPage "section" "blog" }}`. This will still work, but is now superfluous.
+{{% /note %}}
+
+
+```go-html-template
+{{ with .Site.GetPage "/blog" }}{{ .Title }}{{ end }}
+```
+
+This method will return `nil` when no page could be found, so the above will not print anything if the blog section is not found.
+
+To find a regular page in the blog section::
+
+```go-html-template
+{{ with .Site.GetPage "/blog/my-post.md" }}{{ .Title }}{{ end }}
+```
+
+And since `Page` also provides a `.GetPage` method, the above is the same as:
+
+```go-html-template
+{{ with .Site.GetPage "/blog" }}
+{{ with .GetPage "my-post.md" }}{{ .Title }}{{ end }}
+{{ end }}
+```
+
- The previous examples have used the full content filename to look up the post. Depending on how you have organized your content (whether you have the language code in the file name or not, e.g. `my-post.en.md`), you may want to do the lookup without extension. This will get you the current language's version of the page:
++## .GetPage and multilingual sites
+
- ## .GetPage Example
++The previous examples have used the full content file name to look up the post. Depending on how you have organized your content (whether you have the language code in the file name or not, e.g. `my-post.en.md`), you may want to do the lookup without extension. This will get you the current language's version of the page:
+
+```go-html-template
+{{ with .Site.GetPage "/blog/my-post" }}{{ .Title }}{{ end }}
+```
+
- ## `.GetPage` on Page Bundles
++## .GetPage example
+
+This code snippet---in the form of a [partial template][partials]---allows you to do the following:
+
+1. Grab the index object of your `tags` [taxonomy].
+2. Assign this object to a variable, `$t`
+3. Sort the terms associated with the taxonomy by popularity.
+4. Grab the top two most popular terms in the taxonomy (i.e., the two most popular tags assigned to content.
+
+{{< code file="grab-top-two-tags.html" >}}
+<ul class="most-popular-tags">
+{{ $t := .Site.GetPage "/tags" }}
+{{ range first 2 $t.Data.Terms.ByCount }}
+ <li>{{ . }}</li>
+{{ end }}
+</ul>
+{{< /code >}}
+
++## `.GetPage` on page bundles
+
+If the page retrieved by `.GetPage` is a [Leaf Bundle][leaf_bundle], and you
+need to get the nested _**page** resources_ in that, you will need to use the
+methods in `.Resources` as explained in the [Page Resources][page_resources]
+section.
+
+See the [Headless Bundle][headless_bundle] documentation for an example.
+
+
+[partials]: /templates/partials/
+[taxonomy]: /content-management/taxonomies/
+[page_kinds]: /templates/section-templates/#page-kinds
+[leaf_bundle]: /content-management/page-bundles/#leaf-bundles
+[headless_bundle]: /content-management/page-bundles/#headless-bundle
+[page_resources]: /content-management/page-resources/
--- /dev/null
- title: Functions Quick Reference
+---
- weight: 01
++title: Functions
++linkTitle: Overview
+description: Comprehensive list of Hugo templating functions, including basic and advanced usage examples.
+keywords: []
+menu:
+ docs:
++ identifier: functions-overview
+ parent: functions
++ weight: 10
++weight: 10
+aliases: [/layout/functions/,/templates/functions]
+---
+
+Go templates are lightweight but extensible. Go itself supplies built-in functions, including comparison operators and other basic tools. These are listed in the [Go template documentation][gofuncs]. Hugo has added additional functions to the basic template logic.
+
+[gofuncs]: https://golang.org/pkg/text/template/#hdr-Functions
--- /dev/null
- ## Example of `after` with `first`: 2nd–4th Most Recent Articles
+---
+title: after
+description: "`after` slices an array to only the items after the <em>N</em>th item."
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [iteration]
+signature: ["after INDEX COLLECTION"]
+relatedfuncs: [last,first,seq]
+---
+
+The following shows `after` being used in conjunction with the [`slice` function][slice]:
+
+```go-html-template
+{{ $data := slice "one" "two" "three" "four" }}
+{{ range after 2 $data }}
+ {{ . }}
+{{ end }}
+→ ["three", "four"]
+```
+
++## Example of `after` with `first`: 2nd–4th most recent articles
+
+You can use `after` in combination with the [`first` function] and Hugo's [powerful sorting methods][lists]. Let's assume you have a list page at `example.com/articles`. You have 10 articles, but you want your templating for the [list/section page] to show only two rows:
+
+1. The top row is titled "Featured" and shows only the most recently published article (i.e. by `publishdate` in the content files' front matter).
+2. The second row is titled "Recent Articles" and shows only the 2nd- to 4th-most recently published articles.
+
+{{< code file="layouts/section/articles.html" >}}
+{{ define "main" }}
+<section class="row featured-article">
+ <h2>Featured Article</h2>
+ {{ range first 1 .Pages.ByPublishDate.Reverse }}
+ <header>
+ <h3><a href="{{ . Permalink }}">{{ .Title }}</a></h3>
+ </header>
+ <p>{{ .Description }}</p>
+{{ end }}
+</section>
+<div class="row recent-articles">
+ <h2>Recent Articles</h2>
+ {{ range first 3 (after 1 .Pages.ByPublishDate.Reverse) }}
+ <section class="recent-article">
+ <header>
+ <h3><a href="{{ .Permalink }}">{{ .Title }}</a></h3>
+ </header>
+ <p>{{ .Description }}</p>
+ </section>
+ {{ end }}
+</div>
+{{ end }}
+{{< /code >}}
+
+[`first` function]: /functions/first/
+[list/section page]: /templates/section-templates/
+[lists]: /templates/lists/#order-content
+[slice]: /functions/slice/
--- /dev/null
- description: Takes a string and sanitizes it the same way as the [`defaultMarkdownHandler`](https://gohugo.io/getting-started/configuration-markup#configure-markup) does for markdown headers.
+---
+title: anchorize
- If [Goldmark](https://gohugo.io/getting-started/configuration-markup#goldmark) is set as `defaultMarkdownHandler`, the sanitizing logic adheres to the setting [`markup.goldmark.parser.autoHeadingIDType`](https://gohugo.io/getting-started/configuration-markup#goldmark).
++description: Takes a string and sanitizes it the same way as the [`defaultMarkdownHandler`](/getting-started/configuration-markup#configure-markup) does for markdown headers.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [markdown,strings]
+signature: ["anchorize INPUT"]
+relatedfuncs: [humanize]
+---
+
++If [Goldmark](/getting-started/configuration-markup#goldmark) is set as `defaultMarkdownHandler`, the sanitizing logic adheres to the setting [`markup.goldmark.parser.autoHeadingIDType`](/getting-started/configuration-markup#goldmark).
+
+Since the `defaultMarkdownHandler` and this template function use the same sanitizing logic, you can use the latter to determine the ID of a header for linking with anchor tags.
+
+```go-html-template
+{{ anchorize "This is a header" }} --> "this-is-a-header"
+{{ anchorize "This is also a header" }} --> "this-is-also----a-header"
+{{ anchorize "main.go" }} --> "maingo"
+{{ anchorize "Article 123" }} --> "article-123"
+{{ anchorize "<- Let's try this, shall we?" }} --> "--lets-try-this-shall-we"
+{{ anchorize "Hello, 世界" }} --> "hello-世界"
+```
--- /dev/null
- description: Given a map, array, or slice, `apply` returns a new slice with a function applied over it.
+---
+title: apply
++description: Given an array or slice, `apply` returns a new slice with a function applied over it.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [advanced]
+signature: ["apply COLLECTION FUNCTION [PARAM...]"]
+relatedfuncs: []
+---
+
+`apply` expects at least three parameters, depending on the function being applied.
+
+1. The first parameter is the sequence to operate on.
+2. The second parameter is the name of the function as a string, which must be the name of a valid [Hugo function][functions].
+3. After that, the parameters to the applied function are provided, with the string `"."` standing in for each element of the sequence the function is to be applied against.
+
+Here is an example of a content file with `names:` as a front matter field:
+
+{{< code-toggle file="content/example.md" fm=true copy=false >}}
+title: Example
+names: [ "Derek Perkins", "Joe Bergevin", "Tanner Linsley" ]
+{{< /code-toggle >}}
+
+You can then use `apply` as follows:
+
+```go-html-template
+{{ apply .Params.names "urlize" "." }}
+```
+
+Which will result in the following:
+
+```
+"derek-perkins", "joe-bergevin", "tanner-linsley"
+```
+
+This is *roughly* equivalent to using the following with [range]:
+
+```go-html-template
+{{ range .Params.names }}{{ . | urlize }}{{ end }}
+```
+
+However, it is not possible to provide the output of a range to the [`delimit` function][delimit], so you need to `apply` it.
+
+If you have `post-tag-list.html` and `post-tag-link.html` as [partials], you *could* use the following snippets, respectively:
+
+{{< code file="layouts/partials/post-tag-list.html" copy=false >}}
+{{ with .Params.tags }}
+ <div class="tags-list">
+ Tags:
+ {{ $len := len . }}
+ {{ if eq $len 1 }}
+ {{ partial "post-tag-link.html" (index . 0) }}
+ {{ else }}
+ {{ $last := sub $len 1 }}
+ {{ range first $last . }}
+ {{ partial "post-tag-link.html" . }},
+ {{ end }}
+ {{ partial "post-tag-link.html" (index . $last) }}
+ {{ end }}
+ </div>
+{{ end }}
+{{< /code >}}
+
+{{< code file="layouts/partials/post-tag-link.html" copy=false >}}
+<a class="post-tag post-tag-{{ . | urlize }}" href="/tags/{{ . | urlize }}">{{ . }}</a>
+{{< /code >}}
+
+This works, but the complexity of `post-tag-list.html` is fairly high. The Hugo template needs to perform special behavior for the case where there’s only one tag, and it has to treat the last tag as special. Additionally, the tag list will be rendered something like `Tags: tag1 , tag2 , tag3` because of the way that the HTML is generated and then interpreted by a browser.
+
+This first version of `layouts/partials/post-tag-list.html` separates all of the operations for ease of reading. The combined and DRYer version is shown next:
+
+```go-html-template
+{{ with .Params.tags }}
+ <div class="tags-list">
+ Tags:
+ {{ $sort := sort . }}
+ {{ $links := apply $sort "partial" "post-tag-link.html" "." }}
+ {{ $clean := apply $links "chomp" "." }}
+ {{ delimit $clean ", " }}
+ </div>
+{{ end }}
+```
+
+Now in the completed version, you can sort the tags, convert the tags to links with `layouts/partials/post-tag-link.html`, [chomp] off stray newlines, and join the tags together in a delimited list for presentation. Here is an even DRYer version of the preceding example:
+
+{{< code file="layouts/partials/post-tag-list.html" >}}
+{{ with .Params.tags }}
+ <div class="tags-list">
+ Tags:
+ {{ delimit (apply (apply (sort .) "partial" "post-tag-link.html" ".") "chomp" ".") ", " }}
+ </div>
+{{ end }}
+{{< /code >}}
+
+{{% note %}}
+`apply` does not work when receiving the sequence as an argument through a pipeline.
+{{% /note %}}
+
+[chomp]: /functions/chomp/ "See documentation for the chomp function"
+[delimit]: /functions/delimit/ "See documentation for the delimit function"
+[functions]: /functions/ "See the full list of Hugo functions to see what can be passed as an argument to the apply function."
+[partials]: /templates/partials/
+[range]: /functions/range/ "Learn the importance of the range function, a fundamental keyword in both Hugo templates and the Go programming language."
--- /dev/null
- ## Example: Using `dict` to pass multiple values to a `partial`
+---
+title: dict
+description: Creates a dictionary from a list of key and value pairs.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [dictionary]
+signature: ["dict KEY VALUE [KEY VALUE]..."]
+relatedfuncs: []
+---
+
+`dict` is especially useful for passing more than one value to a partial template.
+
+Note that the `key` can be either a `string` or a `string slice`. The latter is useful to create a deeply nested structure, e.g.:
+
+```go-text-template
+{{ $m := dict (slice "a" "b" "c") "value" }}
+```
+
++## Example: using `dict` to pass multiple values to a `partial`
+
+The partial below creates an SVG and expects `fill`, `height` and `width` from the caller:
+
+### Partial definition
+
+{{< code file="layouts/partials/svgs/external-links.svg" >}}
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
+fill="{{ .fill }}" width="{{ .width }}" height="{{ .height }}" viewBox="0 0 32 32" aria-label="External Link">
+<path d="M25.152 16.576v5.696q0 2.144-1.504 3.648t-3.648 1.504h-14.848q-2.144 0-3.648-1.504t-1.504-3.648v-14.848q0-2.112 1.504-3.616t3.648-1.536h12.576q0.224 0 0.384 0.16t0.16 0.416v1.152q0 0.256-0.16 0.416t-0.384 0.16h-12.576q-1.184 0-2.016 0.832t-0.864 2.016v14.848q0 1.184 0.864 2.016t2.016 0.864h14.848q1.184 0 2.016-0.864t0.832-2.016v-5.696q0-0.256 0.16-0.416t0.416-0.16h1.152q0.256 0 0.416 0.16t0.16 0.416zM32 1.152v9.12q0 0.48-0.352 0.8t-0.8 0.352-0.8-0.352l-3.136-3.136-11.648 11.648q-0.16 0.192-0.416 0.192t-0.384-0.192l-2.048-2.048q-0.192-0.16-0.192-0.384t0.192-0.416l11.648-11.648-3.136-3.136q-0.352-0.352-0.352-0.8t0.352-0.8 0.8-0.352h9.12q0.48 0 0.8 0.352t0.352 0.8z"></path>
+</svg>
+{{< /code >}}
+
+### Partial call
+
+The `fill`, `height` and `width` values can be stored in one object with `dict` and passed to the partial:
+
+{{< code file="layouts/_default/list.html" >}}
+{{ partial "svgs/external-links.svg" (dict "fill" "#01589B" "width" 10 "height" 20 ) }}
+{{< /code >}}
+
+[partials]: /templates/partials/
--- /dev/null
- The `emojify` function can be called in your templates but not directly in your content files by default. For emojis in content files, set `enableEmoji` to `true` in your site's [configuration][config]. Then you can write emoji shorthand directly into your content files; e.g. <code>I :</code><code>heart</code><code>: Hugo!</code>:
+---
+title: emojify
+description: Runs a string through the Emoji emoticons processor.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [strings,emojis]
+signature: ["emojify INPUT"]
+relatedfuncs: []
+---
+
+`emojify` runs a passed string through the Emoji emoticons processor.
+
+See the [Emoji cheat sheet][emojis] for available emoticons.
+
- [config]: /getting-started/configuration/
++The `emojify` function can be called in your templates but not directly in your content files by default. For emojis in content files, set `enableEmoji` to `true` in your site's [configuration]. Then you can write emoji shorthand directly into your content files; e.g. <code>I :</code><code>heart</code><code>: Hugo!</code>:
+
+I :heart: Hugo!
+
+
++[configuration]: /getting-started/configuration/
+[emojis]: https://www.webfx.com/tools/emoji-cheat-sheet/
+[sc]: /templates/shortcode-templates/
+[scsource]: https://github.com/gohugoio/hugo/tree/master/docs/layouts/shortcodes
--- /dev/null
- If you feel that this should not be logged as an ERROR, you can ignore it by adding this to your site config:
+---
+title: errorf and warnf
+description: Log ERROR or WARNING from the templates.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [strings, log, error]
+signature: ["errorf FORMAT INPUT"]
+relatedfuncs: [printf]
+---
+
+`errorf` or `warnf` will evaluate a format string, then output the result to the ERROR or WARNING log (and only once per error message to avoid flooding the log).
+
+Any ERROR will also cause the build to fail (the `hugo` command will `exit -1`).
+
+Both functions return an empty string, so the messages are only printed to the console.
+
+```go-html-template
+{{ errorf "Failed to handle page %q" .Path }}
+```
+
+```go-html-template
+{{ warnf "You should update the shortcodes in %q" .Path }}
+```
+
+Note that `errorf`, `erroridf`, and `warnf` support all the formatting verbs of the [fmt](https://pkg.go.dev/fmt) package.
+
+## Suppress errors
+
+Sometimes it may make sense to let the user suppress an ERROR and make the build succeed.
+
+You can do this by using the `erroridf` function. This functions takes an error ID as the first argument.
+
+```go-html-template
+{{ erroridf "my-custom-error" "You should consider fixing this." }}
+```
+
+This will produce:
+
+```
+ERROR 2021/06/07 17:47:38 You should consider fixing this.
++If you feel that this should not be logged as an ERROR, you can ignore it by adding this to your site configuration:
+ignoreErrors = ["my-custom-error"]
+```
--- /dev/null
- ## Go's Layout String
+---
+title: .Format
+description: Formats built-in Hugo dates---`.Date`, `.PublishDate`, and `.Lastmod`---according to Go's layout string.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [dates,time]
+signature: [".Format FORMAT"]
+relatedfuncs: [dateFormat,now,Unix,time]
+toc: true
+---
+
+`.Format` will format date values defined in your front matter and can be used as a property on the following [page variables][pagevars]:
+
+* `.PublishDate`
+* `.Date`
+* `.Lastmod`
+
+Assuming a key-value of `date: 2017-03-03` in a content file's front matter, your can run the date through `.Format` followed by a layout string for your desired output at build time:
+
+```go-html-template
+{{ .PublishDate.Format "January 2, 2006" }} => March 3, 2017
+```
+
+For formatting *any* string representations of dates defined in your front matter, see the [`dateFormat` function][dateFormat], which will still leverage the Go layout string explained below but uses a slightly different syntax.
+
- ### Hugo Date and Time Templating Reference
++## Go's layout string
+
+Hugo templates [format your dates][time] via layout strings that point to a specific reference time:
+
+```
+Mon Jan 2 15:04:05 MST 2006
+```
+
+While this may seem arbitrary, the numerical value of `MST` is `07`, thus making the layout string a sequence of numbers.
+
+Here is a visual explanation [taken directly from the Go docs][gdex]:
+
+```
+ Jan 2 15:04:05 2006 MST
+=> 1 2 3 4 5 6 -7
+```
+
- ### Cardinal Numbers and Ordinal Abbreviations
++### Hugo date and time templating reference
+
+The following examples show the layout string followed by the rendered output.
+
+The examples were rendered and tested in [CST] and all point to the same field in a content file's front matter:
+
+```
+date: 2017-03-03T14:15:59-06:00
+```
+
+`.Date` (i.e. called via [page variable][pagevars])
+: **Returns**: `2017-03-03 14:15:59 -0600 CST`
+
+`"Monday, January 2, 2006"`
+: **Returns**: `Friday, March 3, 2017`
+
+`"Mon Jan 2 2006"`
+: **Returns**: `Fri Mar 3 2017`
+
+`"January 2006"`
+: **Returns**: `March 2017`
+
+`"2006-01-02"`
+: **Returns**: `2017-03-03`
+
+`"Monday"`
+: **Returns**: `Friday`
+
+`"02 Jan 06 15:04 MST"` (RFC822)
+: **Returns**: `03 Mar 17 14:15 CST`
+
+`"02 Jan 06 15:04 -0700"` (RFC822Z)
+: **Returns**: `03 Mar 17 14:15 -0600`
+
+`"Mon, 02 Jan 2006 15:04:05 MST"` (RFC1123)
+: **Returns**: `Fri, 03 Mar 2017 14:15:59 CST`
+
+`"Mon, 02 Jan 2006 15:04:05 -0700"` (RFC1123Z)
+: **Returns**: `Fri, 03 Mar 2017 14:15:59 -0600`
+
+More examples can be found in Go's [documentation for the time package][timeconst].
+
++### Cardinal s
+
+Spelled-out cardinal numbers (e.g. "one", "two", and "three") are not currently supported.
+
+Use the [`humanize`](/functions/humanize) function to render the day of the month as an ordinal number:
+
+```go-html-template
+{{ humanize .Date.Day }} of {{ .Date.Format "January 2006" }}
+```
+
+This will output:
+
+```
+5th of March 2017
+```
+
+
+### Use `.Local` and `.UTC`
+
+In conjunction with the [`dateFormat` function][dateFormat], you can also convert your dates to `UTC` or to local timezones:
+
+`{{ dateFormat "02 Jan 06 15:04 MST" .Date.UTC }}`
+: **Returns**: `03 Mar 17 20:15 UTC`
+
+`{{ dateFormat "02 Jan 06 15:04 MST" .Date.Local }}`
+: **Returns**: `03 Mar 17 14:15 CST`
+
+[CST]: https://en.wikipedia.org/wiki/Central_Time_Zone
+[dateFormat]: /functions/dateformat/
+[gdex]: https://golang.org/pkg/time/#example_Time_Format
+[pagevars]: /variables/page/
+[time]: https://golang.org/pkg/time/
+[timeconst]: https://golang.org/pkg/time/#ANSIC
--- /dev/null
- linktitle: hasPrefix
+---
+title: hasprefix
+description: Tests whether a string begins with prefix.
+date: 2017-02-01
+publishdate: 2017-02-01
+lastmod: 2017-02-01
+categories: [functions]
+menu:
+ docs:
+ parent: "functions"
+keywords: [strings]
+signature: ["hasPrefix STRING PREFIX"]
+workson: []
+hugoversion:
+relatedfuncs: [hasSuffix]
+deprecated: false
+aliases: []
+---
+
+* `{{ hasPrefix "Hugo" "Hu" }}` → true
--- /dev/null
- linktitle: hasSuffix
+---
+title: hassuffix
- * `{{ hasSuffix "Hugo" "go" }}` → true
++linkTitle: hasSuffix
+description: Tests whether a string ends with suffix.
+date: 2023-03-01
+publishdate: 2023-03-01
+lastmod: 2023-03-01
+categories: [functions]
+menu:
+docs:
+parent: "functions"
+keywords: [strings]
+signature: ["hasSuffix STRING SUFFIX"]
+workson: []
+hugoversion:
+relatedfuncs: [hasPrefix]
+deprecated: false
+aliases: []
+---
+
++* `{{ hasSuffix "Hugo" "go" }}` → true
--- /dev/null
- {{ $options := slice "lineNos=table" "style=dracula" }}
- {{ transform.Highlight $input $lang (delimit $options ",") }}
+---
+title: highlight
+description: Renders code with a syntax highlighter.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [highlighting,code blocks,syntax]
+signature: ["transform.Highlight INPUT LANG [OPTIONS]","highlight INPUT LANG [OPTIONS]"]
+relatedfuncs: []
+toc: true
+---
+The `highlight` function uses the [Chroma] syntax highlighter, supporting over 200 languages with more than 40 available styles.
+
+## Parameters
+
+INPUT
+: The code to highlight.
+
+LANG
+: The language of the code to highlight. Choose from one of the [supported languages]. Case-insensitive.
+
+OPTIONS
+: An optional, comma-separated list of zero or more [options]. Set default values in [site configuration].
+
+## Options
+
+lineNos
+: Boolean. Default is `false`.\
+Display a number at the beginning of each line.
+
+lineNumbersInTable
+: Boolean. Default is `true`.\
+Render the highlighted code in an HTML table with two cells. The left table cell contains the line numbers. The right table cell contains the code, allowing a user to select and copy the code without line numbers. Irrelevant if `lineNos` is `false`.
+
+anchorLineNos
+: Boolean. Default is `false`.\
+Render each line number as an HTML anchor element, and set the `id` attribute of the surrounding `<span>` to the line number. Irrelevant if `lineNos` is `false`.
+
+lineAnchors
+: String. Default is `""`.\
+When rendering a line number as an HTML anchor element, prepend this value to the `id` attribute of the surrounding `<span>`. This provides unique `id` attributes when a page contains two or more code blocks. Irrelevant if `lineNos` or `anchorLineNos` is `false`.
+
+lineNoStart
+: Integer. Default is `1`.\
+The number to display at the beginning of the first line. Irrelevant if `lineNos` is `false`.
+
+hl_Lines
+: String. Default is `""`.\
+A space-separated list of lines to emphasize within the highlighted code. To emphasize lines 2, 3, 4, and 7, set this value to `2-4 7`. This option is independent of the `lineNoStart` option.
+
+hl_inline
+: Boolean. Default is `false`.\
+Render the highlighted code without a wrapping container.
+
+style
+: String. Default is `monokai`.\
+The CSS styles to apply to the highlighted code. See the [style gallery] for examples. Case-sensitive.
+
+noClasses
+: Boolean. Default is `true`.\
+Use inline CSS styles instead of an external CSS file. To use an external CSS file, set this value to `false` and [generate the file with the hugo client][hugo client].
+
+tabWidth
+: Integer. Default is `4`.\
+Substitute this number of spaces for each tab character in your highlighted code. Irrelevant if `noClasses` is `false`.
+
+guessSyntax
+: Boolean. Default is `false`.\
+If the `LANG` parameter is blank or an unrecognized language, auto-detect the language if possible, otherwise use a fallback language.
+
+{{% note %}}
+Instead of specifying both `lineNos` and `lineNumbersInTable`, you can use the following shorthand notation:
+
+`lineNos=inline`
+: equivalent to `lineNos=true` and `lineNumbersInTable=false`
+
+`lineNos=table`
+: equivalent to `lineNos=true` and `lineNumbersInTable=true`
+{{% /note %}}
+
+## Examples
+
+```go-html-template
+{{ $input := `fmt.Println("Hello World!")` }}
+{{ transform.Highlight $input "go" }}
+
+{{ $input := `console.log('Hello World!');` }}
+{{ $lang := "js" }}
+{{ transform.Highlight $input $lang "lineNos=table, style=api" }}
+
+{{ $input := `echo "Hello World!"` }}
+{{ $lang := "bash" }}
++{{ $options := dict "lineNos" "table" "style" "dracula" }}
++{{ transform.Highlight $input $lang $options }}
+```
+
+[Chroma]: https://github.com/alecthomas/chroma
+[hugo client]: /commands/hugo_gen_chromastyles
+[options]: #options
+[site configuration]: /getting-started/configuration-markup#highlight
+[style gallery]: https://xyproto.github.io/splash/docs/
+[supported languages]: /content-management/syntax-highlighting#list-of-chroma-highlighting-languages
--- /dev/null
- title: Image Filters
+---
++title: Image filters
+description: The images namespace provides a list of filters and other image related functions.
+categories: [functions]
+aliases: [/functions/imageconfig/]
+menu:
+ docs:
+ parent: functions
+keywords: [images]
+toc: true
+---
+
+See [images.Filter](#filter) for how to apply these filters to an image.
+
+## Overlay
+
+{{% funcsig %}}
+images.Overlay SRC X Y
+{{% /funcsig %}}
+
+Overlay creates a filter that overlays the source image at position x y, e.g:
+
+
+```go-html-template
+{{ $logoFilter := (images.Overlay $logo 50 50 ) }}
+{{ $img := $img | images.Filter $logoFilter }}
+```
+
+A shorter version of the above, if you only need to apply the filter once:
+
+```go-html-template
+{{ $img := $img.Filter (images.Overlay $logo 50 50 )}}
+```
+
+The above will overlay `$logo` in the upper left corner of `$img` (at position `x=50, y=50`).
+
+## Text
+
+Using the `Text` filter, you can add text to an image.
+
+{{% funcsig %}}
+images.Text TEXT DICT)
+{{% /funcsig %}}
+
+The following example will add the text `Hugo rocks!` to the image with the specified color, size and position.
+
+```go-html-template
+{{ $img := resources.Get "/images/background.png" }}
+{{ $img = $img.Filter (images.Text "Hugo rocks!" (dict
+ "color" "#ffffff"
+ "size" 60
+ "linespacing" 2
+ "x" 10
+ "y" 20
+))}}
+```
+
+You can load a custom font if needed. Load the font as a Hugo `Resource` and set it as an option:
+
+```go-html-template
+
+{{ $font := resources.GetRemote "https://github.com/google/fonts/raw/main/apache/roboto/static/Roboto-Black.ttf" }}
+{{ $img := resources.Get "/images/background.png" }}
+{{ $img = $img.Filter (images.Text "Hugo rocks!" (dict
+ "font" $font
+))}}
+```
+
+
+## Brightness
+
+{{% funcsig %}}
+images.Brightness PERCENTAGE
+{{% /funcsig %}}
+
+Brightness creates a filter that changes the brightness of an image.
+The percentage parameter must be in range (-100, 100).
+
+### ColorBalance
+
+{{% funcsig %}}
+images.ColorBalance PERCENTAGERED PERCENTAGEGREEN PERCENTAGEBLUE
+{{% /funcsig %}}
+
+ColorBalance creates a filter that changes the color balance of an image.
+The percentage parameters for each color channel (red, green, blue) must be in range (-100, 500).
+
+## Colorize
+
+{{% funcsig %}}
+images.Colorize HUE SATURATION PERCENTAGE
+{{% /funcsig %}}
+
+Colorize creates a filter that produces a colorized version of an image.
+The hue parameter is the angle on the color wheel, typically in range (0, 360).
+The saturation parameter must be in range (0, 100).
+The percentage parameter specifies the strength of the effect, it must be in range (0, 100).
+
+## Contrast
+
+{{% funcsig %}}
+images.Contrast PERCENTAGE
+{{% /funcsig %}}
+
+Contrast creates a filter that changes the contrast of an image.
+The percentage parameter must be in range (-100, 100).
+
+## Gamma
+
+{{% funcsig %}}
+images.Gamma GAMMA
+{{% /funcsig %}}
+
+Gamma creates a filter that performs a gamma correction on an image.
+The gamma parameter must be positive. Gamma = 1 gives the original image.
+Gamma less than 1 darkens the image and gamma greater than 1 lightens it.
+
+## GaussianBlur
+
+{{% funcsig %}}
+images.GaussianBlur SIGMA
+{{% /funcsig %}}
+
+GaussianBlur creates a filter that applies a gaussian blur to an image.
+
+## Grayscale
+
+{{% funcsig %}}
+images.Grayscale
+{{% /funcsig %}}
+
+Grayscale creates a filter that produces a grayscale version of an image.
+
+## Hue
+
+{{% funcsig %}}
+images.Hue SHIFT
+{{% /funcsig %}}
+
+Hue creates a filter that rotates the hue of an image.
+The hue angle shift is typically in range -180 to 180.
+
+## Invert
+
+{{% funcsig %}}
+images.Invert
+{{% /funcsig %}}
+
+Invert creates a filter that negates the colors of an image.
+
+## Pixelate
+
+{{% funcsig %}}
+images.Pixelate SIZE
+{{% /funcsig %}}
+
+Pixelate creates a filter that applies a pixelation effect to an image.
+
+## Saturation
+
+{{% funcsig %}}
+images.Saturation PERCENTAGE
+{{% /funcsig %}}
+
+Saturation creates a filter that changes the saturation of an image.
+
+## Sepia
+
+{{% funcsig %}}
+images.Sepia PERCENTAGE
+{{% /funcsig %}}
+
+Sepia creates a filter that produces a sepia-toned version of an image.
+
+## Sigmoid
+
+{{% funcsig %}}
+images.Sigmoid MIDPOINT FACTOR
+{{% /funcsig %}}
+
+Sigmoid creates a filter that changes the contrast of an image using a sigmoidal function and returns the adjusted image.
+It's a non-linear contrast change useful for photo adjustments as it preserves highlight and shadow detail.
+
+## UnsharpMask
+
+{{% funcsig %}}
+images.UnsharpMask SIGMA AMOUNT THRESHOLD
+{{% /funcsig %}}
+
+UnsharpMask creates a filter that sharpens an image.
+The sigma parameter is used in a gaussian function and affects the radius of effect.
+Sigma must be positive. Sharpen radius roughly equals 3 * sigma.
+The amount parameter controls how much darker and how much lighter the edge borders become. Typically between 0.5 and 1.5.
+The threshold parameter controls the minimum brightness change that will be sharpened. Typically between 0 and 0.05.
+
+## Other Functions
+
+### Filter
+
+{{% funcsig %}}
+IMAGE | images.Filter FILTERS...
+{{% /funcsig %}}
+
+Can be used to apply a set of filters to an image:
+
+```go-html-template
+{{ $img := $img | images.Filter (images.GaussianBlur 6) (images.Pixelate 8) }}
+```
+
+Also see the [Filter Method](/content-management/image-processing/#filter).
+
+### ImageConfig
+
+Parses the image and returns the height, width, and color model.
+
+The `imageConfig` function takes a single parameter, a file path (_string_) relative to the _project's root directory_, with or without a leading slash.
+
+{{% funcsig %}}
+images.ImageConfig PATH
+{{% /funcsig %}}
+
+```go-html-template
+{{ with (imageConfig "favicon.ico") }}
+favicon.ico: {{ .Width }} x {{ .Height }}
+{{ end }}
+```
--- /dev/null
- ## Example: Load Data from a Path Based on Front Matter Params
+---
+title: index
+description: Looks up the index(es) or key(s) of the data structure passed into it.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: []
+signature: ["index COLLECTION INDEXES", "index COLLECTION KEYS"]
+relatedfuncs: []
+aliases: [/functions/index/]
+---
+
+The `index` functions returns the result of indexing its first argument by the following arguments. Each indexed item must be a map or a slice, e.g.:
+
+```go-text-template
+{{ $slice := slice "a" "b" "c" }}
+{{ index $slice 1 }} => b
+{{ $map := dict "a" 100 "b" 200 }}
+{{ index $map "b" }} => 200
+```
+
+The function takes multiple indices as arguments, and this can be used to get nested values, e.g.:
+
+```go-text-template
+{{ $map := dict "a" 100 "b" 200 "c" (slice 10 20 30) }}
+{{ index $map "c" 1 }} => 20
+{{ $map := dict "a" 100 "b" 200 "c" (dict "d" 10 "e" 20) }}
+{{ index $map "c" "e" }} => 20
+```
+
+You may write multiple indices as a slice:
+
+```go-text-template
+{{ $map := dict "a" 100 "b" 200 "c" (dict "d" 10 "e" 20) }}
+{{ $slice := slice "c" "e" }}
+{{ index $map $slice }} => 20
+```
+
++## Example: load data from a path based on front matter parameters
+
+Assume you want to add a `location = ""` field to your front matter for every article written in `content/vacations/`. You want to use this field to populate information about the location at the bottom of the article in your `single.html` template. You also have a directory in `data/locations/` that looks like the following:
+
+```
+.
+└── data
+ └── locations
+ ├── abilene.toml
+ ├── chicago.toml
+ ├── oslo.toml
+ └── provo.toml
+```
+
+Here is an example:
+
+{{< code-toggle file="data/locations/oslo" copy=false >}}
+website = "https://www.oslo.kommune.no"
+pop_city = 658390
+pop_metro = 1717900
+{{< /code-toggle >}}
+
+The example we will use will be an article on Oslo, whose front matter should be set to exactly the same name as the corresponding file name in `data/locations/`:
+
+{{< code-toggle file="content/articles/oslo.md" fm=true copy=false >}}
+title = "My Norwegian Vacation"
+location = "oslo"
+{{< /code-toggle >}}
+
+The content of `oslo.toml` can be accessed from your template using the following node path: `.Site.Data.locations.oslo`. However, the specific file you need is going to change according to the front matter.
+
+This is where the `index` function is needed. `index` takes 2 parameters in this use case:
+
+1. The node path
+2. A string corresponding to the desired data; e.g.—
+
+```go-html-template
+{{ index .Site.Data.locations "oslo" }}
+```
+
+The variable for `.Params.location` is a string and can therefore replace `oslo` in the example above:
+
+```go-html-template
+{{ index .Site.Data.locations .Params.location }}
+=> map[website:https://www.oslo.kommune.no pop_city:658390 pop_metro:1717900]
+```
+
+Now the call will return the specific file according to the location specified in the content's front matter, but you will likely want to write specific properties to the template. You can do this by continuing down the node path via dot notation (`.`):
+
+```go-html-template
+{{ (index .Site.Data.locations .Params.location).pop_city }}
+=> 658390
+```
--- /dev/null
- The above fetches regular pages not of `page` or `about` type unless they are pinned. And finally, we exclude all pages with no `images` set in Page params.
+---
+title: intersect
+description: Returns the common elements of two arrays or slices, in the same order as the first array.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [collections,intersect,union,complement,symdiff]
+signature: ["intersect SET1 SET2"]
+relatedfuncs: []
+---
+A useful example is to use it as `AND` filters when combined with where:
+
+## AND filter in where query
+
+```go-html-template
+{{ $pages := where .Site.RegularPages "Type" "not in" (slice "page" "about") }}
+{{ $pages := $pages | union (where .Site.RegularPages "Params.pinned" true) }}
+{{ $pages := $pages | intersect (where .Site.RegularPages "Params.images" "!=" nil) }}
+```
+
++The above fetches regular pages not of `page` or `about` type unless they are pinned. And finally, we exclude all pages with no `images` set in Page parameters.
+
+See [union](/functions/union) for `OR`.
+
+
+[partials]: /templates/partials/
+[single]: /templates/single-page-templates/
--- /dev/null
- All site-level configuration keys are stored as lower case. Therefore, a `myParam` key-value set in your [site configuration file](/getting-started/configuration/) needs to be accessed with `{{ if isset .Site.Params "myparam" }}` and *not* with `{{ if isset .Site.Params "myParam" }}`. Note that you can still access the same config key with `.Site.Params.myParam` *or* `.Site.Params.myparam`, for example, when using [`with`](/functions/with).
+---
+title: isset
+description: Returns true if the parameter is set.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: []
+signature: ["isset COLLECTION INDEX", "isset COLLECTION KEY"]
+relatedfuncs: []
+---
+
+Takes either a slice, array, or channel and an index or a map and a key as input.
+
+```go-html-template
+{{ if isset .Params "project_url" }} {{ index .Params "project_url" }}{{ end }}
+```
+
+{{% note %}}
++All site-level configuration keys are stored as lower case. Therefore, a `myParam` key-value set in your [site configuration file](/getting-started/configuration/) needs to be accessed with `{{ if isset .Site.Params "myparam" }}` and *not* with `{{ if isset .Site.Params "myParam" }}`. Note that you can still access the same configuration key with `.Site.Params.myParam` *or* `.Site.Params.myparam`, for example, when using [`with`](/functions/with).
+This restriction also applies when accessing page-level front matter keys from within [shortcodes](/content-management/shortcodes/).
+{{% /note %}}
--- /dev/null
- | Function | Description | Example |
- |--------------|-----------------------------------------------------------------------------|-------------------------------------|
- | `add` | Adds two or more numbers. | `{{ add 12 3 2 }}` → `17` |
- | | *If one of the numbers is a float, the result is a float.* | `{{ add 1.1 2 }}` → `3.1` |
- | `sub` | Subtracts one or more numbers from the first number. | `{{ sub 12 3 2 }}` → `7` |
- | | *If one of the numbers is a float, the result is a float.* | `{{ sub 3 2.5 }}` → `0.5` |
- | `mul` | Multiplies two or more numbers. | `{{ mul 12 3 2 }}` → `72` |
- | | *If one of the numbers is a float, the result is a float.* | `{{ mul 2 3.1 }}` → `6.2` |
- | `div` | Divides the first number by one or more numbers. | `{{ div 12 3 2 }}` → `2` |
- | | *If one of the numbers is a float, the result is a float.* | `{{ div 6 4.0 }}` → `1.5` |
- | `mod` | Modulus of two integers. | `{{ mod 15 3 }}` → `0` |
- | `modBool` | Boolean of modulus of two integers. Evaluates to `true` if result equals 0. | `{{ modBool 15 3 }}` → `true` |
- | `math.Abs` | Returns the absolute value of the given number. | `{{ math.Abs -2.1 }}` → `2.1` |
- | `math.Ceil` | Returns the least integer value greater than or equal to the given number. | `{{ math.Ceil 2.1 }}` → `3` |
- | `math.Floor` | Returns the greatest integer value less than or equal to the given number. | `{{ math.Floor 1.9 }}` → `1` |
- | `math.Log` | Returns the natural logarithm of the given number. | `{{ math.Log 42 }}` → `3.737` |
- | `math.Max` | Returns the greater of two or more numbers. | `{{ math.Max 12 3 2 }}` → `12` |
- | `math.Min` | Returns the smaller of two or more numbers. | `{{ math.Min 12 3 2 }}` → `2` |
- | `math.Pow` | Returns the first number raised to the power of the second number. | `{{ math.Pow 2 3 }}` → `8` |
- | `math.Round` | Returns the nearest integer, rounding half away from zero. | `{{ math.Round 1.5 }}` → `2` |
- | `math.Sqrt` | Returns the square root of the given number. | `{{ math.Sqrt 81 }}` → `9` |
+---
+title: Math
+description: Hugo provides mathematical operators in templates.
+keywords: [math, operators]
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+toc:
+signature: []
+relatedfuncs: []
+---
+
++| Function | Description | Example |
++|-----------------|-----------------------------------------------------------------------------|---------------------------------------------------|
++| `add` | Adds two or more numbers. | `{{ add 12 3 2 }}` → `17` |
++| | *If one of the numbers is a float, the result is a float.* | `{{ add 1.1 2 }}` → `3.1` |
++| `sub` | Subtracts one or more numbers from the first number. | `{{ sub 12 3 2 }}` → `7` |
++| | *If one of the numbers is a float, the result is a float.* | `{{ sub 3 2.5 }}` → `0.5` |
++| `mul` | Multiplies two or more numbers. | `{{ mul 12 3 2 }}` → `72` |
++| | *If one of the numbers is a float, the result is a float.* | `{{ mul 2 3.1 }}` → `6.2` |
++| `div` | Divides the first number by one or more numbers. | `{{ div 12 3 2 }}` → `2` |
++| | *If one of the numbers is a float, the result is a float.* | `{{ div 6 4.0 }}` → `1.5` |
++| `mod` | Modulus of two integers. | `{{ mod 15 3 }}` → `0` |
++| `modBool` | Boolean of modulus of two integers. Evaluates to `true` if result equals 0. | `{{ modBool 15 3 }}` → `true` |
++| `math.Abs` | Returns the absolute value of the given number. | `{{ math.Abs -2.1 }}` → `2.1` |
++| `math.Ceil` | Returns the least integer value greater than or equal to the given number. | `{{ math.Ceil 2.1 }}` → `3` |
++| `math.Floor` | Returns the greatest integer value less than or equal to the given number. | `{{ math.Floor 1.9 }}` → `1` |
++| `math.Log` | Returns the natural logarithm of the given number. | `{{ math.Log 42 }}` → `3.737` |
++| `math.Max` | Returns the greater of all numbers. Accepts scalars, slices, or both. | `{{ math.Max 1 (slice 2 3) 4 }}` → `4` |
++| `math.Min` | Returns the smaller of all numbers. Accepts scalars, slices, or both. | `{{ math.Min 1 (slice 2 3) 4 }}` → `1` |
++| `math.Product` | Returns the product of all numbers. Accepts scalars, slices, or both. | `{{ math.Product 1 (slice 2 3) 4 }}` → `24` |
++| `math.Pow` | Returns the first number raised to the power of the second number. | `{{ math.Pow 2 3 }}` → `8` |
++| `math.Round` | Returns the nearest integer, rounding half away from zero. | `{{ math.Round 1.5 }}` → `2` |
++| `math.Sqrt` | Returns the square root of the given number. | `{{ math.Sqrt 81 }}` → `9` |
++| `math.Sum` | Returns the sum of all numbers. Accepts scalars, slices, or both. | `{{ math.Sum 1 (slice 2 3) 4 }}` → `10` |
--- /dev/null
- description: Returns an array of FileInfo structures sorted by filename, one element for each directory entry.
+---
+title: readDir
++description: Returns an array of FileInfo structures sorted by file name, one element for each directory entry.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [files]
+signature: ["os.ReadDir PATH", "readDir PATH"]
+relatedfuncs: ['os.FileExists','os.ReadFile','os.Stat']
+---
+The `os.ReadDir` function resolves the path relative to the root of your project directory. A leading path separator (`/`) is optional.
+
+With this directory structure:
+
+```text
+content/
+├── about.md
+├── contact.md
+└── news/
+ ├── article-1.md
+ └── article-2.md
+```
+
+This template code:
+
+```go-html-template
+{{ range os.ReadDir "content" }}
+ {{ .Name }} --> {{ .IsDir }}
+{{ end }}
+```
+
+Produces:
+
+```html
+about.md --> false
+contact.md --> false
+news --> true
+```
+
+Note that `os.ReadDir` is not recursive.
+
+Details of the `FileInfo` structure are available in the [Go documentation](https://pkg.go.dev/io/fs#FileInfo).
+
+For more information on using `readDir` and `readFile` in your templates, see [Local File Templates](/templates/files).
--- /dev/null
- To override the safety check, use the `safeHTMLAttr` function:
+---
+title: safeHTMLAttr
+description: Declares the provided string as a safe HTML attribute.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [strings]
+signature: ["safeHTMLAttr INPUT"]
+relatedfuncs: []
+---
+
+Given a site configuration that contains this menu entry:
+
+{{< code-toggle file="hugo" >}}
+[[menu.main]]
+ name = "IRC"
+ url = "irc://irc.freenode.net/#golang"
+{{< /code-toggle >}}
+
+Attempting to use the `url` value directly in an attribute:
+
+```go-html-template
+{{ range site.Menus.main }}
+ <a href="{{ .URL }}">{{ .Name }}</a>
+{{ end }}
+```
+
+Will produce:
+
+```html
+<a href="#ZgotmplZ">IRC</a>
+```
+
+`ZgotmplZ` is a special value, inserted by Go's [template/html] package, that indicates that unsafe content reached a CSS or URL context.
+
- ```
++To indicate that the HTML attribute is safe:
+
+```go-html-template
+{{ range site.Menus.main }}
+ <a {{ printf "href=%q" .URL | safeHTMLAttr }}>{{ .Name }}</a>
+{{ end }}
++```
++
++{{% note %}}
++As demonstrated above, you must pass the HTML attribute name _and_ value through the function. Applying `safeHTMLAttr` to the attribute value has no effect.
++{{% /note %}}
+
+[template/html]: https://pkg.go.dev/html/template
--- /dev/null
- ## Using Locations
+---
+title: time
+description: Converts a timestamp string into a `time.Time` structure.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [dates,time,location]
+signature: ["time INPUT [TIMEZONE]"]
+relatedfuncs: []
+---
+
+
+`time` converts a timestamp string with an optional default location into a [`time.Time`](https://godoc.org/time#Time) structure so you can access its fields:
+
+```go-html-template
+{{ time "2016-05-28" }} → "2016-05-28T00:00:00Z"
+{{ (time "2016-05-28").YearDay }} → 149
+{{ mul 1000 (time "2016-05-28T10:30:00.00+10:00").Unix }} → 1464395400000, or Unix time in milliseconds
+```
+
- ## Example: Using `time` to get Month Index
++## Using locations
+
+The optional `TIMEZONE` parameter is a string that sets a default time zone (or more specific, the location, which represents the collection of time offsets in a geographical area) that is associated with the specified time value. If the time value has an explicit timezone or offset specified, it will take precedence over the `TIMEZONE` parameter.
+
+The list of valid locations may be system dependent, but should include `UTC`, `Local`, or any location in the [IANA Time Zone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
+
+If no `TIMEZONE` is set, the `timeZone` from site configuration will be used.
+
+```go-html-template
+{{ time "2020-10-20" }} → 2020-10-20 00:00:00 +0000 UTC
+{{ time "2020-10-20" "America/Los_Angeles" }} → 2020-10-20 00:00:00 -0700 PDT
+{{ time "2020-01-20" "America/Los_Angeles" }} → 2020-01-20 00:00:00 -0800 PST
+```
+
++## Example: Using `time` to get month index
+
+The following example takes a UNIX timestamp---set as `utimestamp: "1489276800"` in a content's front matter---converts the timestamp (string) to an integer using the [`int` function][int], and then uses [`printf`] to convert the `Month` property of `time` into an index.
+
+The following example may be useful when setting up [multilingual sites][multilingual]:
+
+{{< code file="unix-to-month-integer.html" >}}
+{{ $time := time (int .Params.addDate)}}
+=> $time = 1489276800
+{{ $time.Month }}
+=> "March"
+{{ $monthindex := printf "%d" $time.Month }}
+=> $monthindex = 3
+{{< /code >}}
+
+
+[int]: /functions/int/
+[multilingual]: /content-management/multilingual/
+[`printf`]: /functions/printf/
--- /dev/null
- ## CSV Options
+---
+title: transform.Unmarshal
+description: "`transform.Unmarshal` (alias `unmarshal`) parses the input and converts it into a map or an array. Supported formats are JSON, TOML, YAML, XML and CSV."
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: []
+signature: ["RESOURCE or STRING | transform.Unmarshal [OPTIONS]"]
+---
+
+The function accepts either a `Resource` created in [Hugo Pipes](/hugo-pipes/) or via [Page Bundles](/content-management/page-bundles/), or simply a string. The two examples below will produce the same map:
+
+```go-html-template
+{{ $greetings := "hello = \"Hello Hugo\"" | transform.Unmarshal }}`
+```
+
+```go-html-template
+{{ $greetings := "hello = \"Hello Hugo\"" | resources.FromString "data/greetings.toml" | transform.Unmarshal }}
+```
+
+In both the above examples, you get a map you can work with:
+
+```go-html-template
+{{ $greetings.hello }}
+```
+
+The above prints `Hello Hugo`.
+
- {{ with resources.Get "https://example.com/rss.xml" | transform.Unmarshal }}
++## CSV options
+
+Unmarshal with CSV as input has some options you can set:
+
+delimiter
+: The delimiter used, default is `,`.
+
+comment
+: The comment character used in the CSV. If set, lines beginning with the comment character without preceding whitespace are ignored.:
+
+Example:
+
+```go-html-template
+{{ $csv := "a;b;c" | transform.Unmarshal (dict "delimiter" ";") }}
+```
+
+## XML data
+
+As a convenience, Hugo allows you to access XML data in the same way that you access JSON, TOML, and YAML: you do not need to specify the root node when accessing the data.
+
+To get the contents of `<title>` in the document below, you use `{{ .message.title }}`:
+
+```xml
+<root>
+ <message>
+ <title>Hugo rocks!</title>
+ <description>Thanks for using Hugo</description>
+ </message>
+</root>
+```
+
+The following example lists the items of an RSS feed:
+
+```go-html-template
++{{ with resources.GetRemote "https://example.com/rss.xml" | transform.Unmarshal }}
+ {{ range .channel.item }}
+ <strong>{{ .title | plainify | htmlUnescape }}</strong><br />
+ <p>{{ .description | plainify | htmlUnescape }}</p>
+ {{ $link := .link | plainify | htmlUnescape }}
+ <a href="{{ $link }}">{{ $link }}</a><br />
+ <hr>
+ {{ end }}
+{{ end }}
+```
--- /dev/null
- The above fetches regular pages not of `page` or `about` type unless they are pinned. And finally, we exclude all pages with no `images` set in Page params.
+---
+title: union
+description: Given two arrays or slices, returns a new array that contains the elements or objects that belong to either or both arrays/slices.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [collections,intersect,union,complement]
+signature: ["union SET1 SET2"]
+relatedfuncs: [intersect,where]
+---
+
+Given two arrays (or slices) A and B, this function will return a new array that contains the elements or objects that belong to either A or to B or to both. The elements supported are strings, integers, and floats (only float64).
+
+```go-html-template
+{{ union (slice 1 2 3) (slice 3 4 5) }}
+<!-- returns [1 2 3 4 5] -->
+
+{{ union (slice 1 2 3) nil }}
+<!-- returns [1 2 3] -->
+
+{{ union nil (slice 1 2 3) }}
+<!-- returns [1 2 3] -->
+
+{{ union nil nil }}
+<!-- returns an error because both arrays/slices have to be of the same type -->
+```
+
+## OR filter in where query
+
+This is also very useful to use as `OR` filters when combined with where:
+
+```go-html-template
+{{ $pages := where .Site.RegularPages "Type" "not in" (slice "page" "about") }}
+{{ $pages = $pages | union (where .Site.RegularPages "Params.pinned" true) }}
+{{ $pages = $pages | intersect (where .Site.RegularPages "Params.images" "!=" nil) }}
+```
+
++The above fetches regular pages not of `page` or `about` type unless they are pinned. And finally, we exclude all pages with no `images` set in Page parameters.
+
+See [intersect](/functions/intersect) for `AND`.
--- /dev/null
- ## Use `where` with `Booleans`
+---
+title: where
+description: Filters an array to only the elements containing a matching value for a given field.
+categories: [functions]
+menu:
+ docs:
+ parent: functions
+keywords: [filtering]
+signature: ["where COLLECTION KEY [OPERATOR] MATCH"]
+relatedfuncs: [intersect,first,after,last]
+toc: true
+---
+
+`where` filters an array to only the elements containing a matching
+value for a given field.
+
+It works in a similar manner to the [`where` keyword in
+SQL][wherekeyword].
+
+```go-html-template
+{{ range where .Pages "Section" "foo" }}
+ {{ .Content }}
+{{ end }}
+```
+
+It can be used by dot-chaining the second argument to refer to a nested element of a value.
+
+{{< code-toggle file="content/example.md" fm=true copy=false >}}
+title: Example
+series: golang
+{{< /code-toggle >}}
+
+```go-html-template
+{{ range where .Site.Pages "Params.series" "golang" }}
+ {{ .Content }}
+{{ end }}
+```
+
+It can also be used with the logical operators `!=`, `>=`, `in`, etc. Without an operator, `where` compares a given field with a matching value equivalent to `=`.
+
+```go-html-template
+{{ range where .Pages "Section" "!=" "foo" }}
+ {{ .Content }}
+{{ end }}
+```
+
+The following logical operators are available with `where`:
+
+`=`, `==`, `eq`
+: `true` if a given field value equals a matching value
+
+`!=`, `<>`, `ne`
+: `true` if a given field value doesn't equal a matching value
+
+`>=`, `ge`
+: `true` if a given field value is greater than or equal to a matching value
+
+`>`, `gt`
+: `true` if a given field value is greater than a matching value
+
+`<=`, `le`
+: `true` if a given field value is lesser than or equal to a matching value
+
+`<`, `lt`
+: `true` if a given field value is lesser than a matching value
+
+`in`
+: `true` if a given field value is included in a matching value; a matching value must be an array or a slice
+
+`not in`
+: `true` if a given field value isn't included in a matching value; a matching value must be an array or a slice
+
+`intersect`
+: `true` if a given field value that is a slice/array of strings or integers contains elements in common with the matching value; it follows the same rules as the [`intersect` function][intersect].
+
- ## Nest `where` Clauses
++## Use `where` with boolean values
+When using booleans you should not put quotation marks.
+```go-html-template
+{{ range where .Pages "Draft" true }}
+ <p>{{ .Title }}</p>
+{{ end }}
+```
+
+
+## Use `where` with `intersect`
+
+```go-html-template
+{{ range where .Site.Pages "Params.tags" "intersect" .Params.tags }}
+ {{ if ne .Permalink $.Permalink }}
+ {{ .Render "summary" }}
+ {{ end }}
+{{ end }}
+```
+
+You can also put the returned value of the `where` clauses into a variable:
+
+{{< code file="where-intersect-variables.html" >}}
+{{ $v1 := where .Site.Pages "Params.a" "v1" }}
+{{ $v2 := where .Site.Pages "Params.b" "v2" }}
+{{ $filtered := $v1 | intersect $v2 }}
+{{ range $filtered }}
+{{ end }}
+{{< /code >}}
+
+## Use `where` with `first`
+
+Using `first` and `where` together can be very
+powerful. Below snippet gets a list of posts only from [**main
+sections**](#mainsections), sorts it using the [default
+ordering](/templates/lists/) for lists (i.e., `weight => date`), and
+then ranges through only the first 5 posts in that list:
+
+{{< code file="first-and-where-together.html" >}}
+{{ range first 5 (where site.RegularPages "Type" "in" site.Params.mainSections) }}
+ {{ .Content }}
+{{ end }}
+{{< /code >}}
+
- ## Unset Fields
++## Nest `where` clauses
+
+You can also nest `where` clauses to drill down on lists of content by more than one parameter. The following first grabs all pages in the "blog" section and then ranges through the result of the first `where` clause and finds all pages that are *not* featured:
+
+```go-html-template
+{{ range where (where .Pages "Section" "blog" ) "Params.featured" "!=" true }}
+```
+
- If the user has not set this config parameter in their site config, it
- will default to the *section with the most pages*.
++## Unset fields
+
+Filtering only works for set fields. To check whether a field is set or exists, you can use the operand `nil`.
+
+This can be useful to filter a small amount of pages from a large pool. Instead of setting a field on all pages, you can set that field on required pages only.
+
+Only the following operators are available for `nil`
+
+* `=`, `==`, `eq`: True if the given field is not set.
+* `!=`, `<>`, `ne`: True if the given field is set.
+
+```go-html-template
+{{ range where .Pages "Params.specialpost" "!=" nil }}
+ {{ .Content }}
+{{ end }}
+```
+
+## Portable `where` filters -- `site.Params.mainSections` {#mainsections}
+
+**This is especially important for themes.**
+
+To list the most relevant pages on the front page or similar, you
+should use the `site.Params.mainSections` list instead of comparing
+section names to hard-coded values like `"posts"` or `"post"`.
+
+```go-html-template
+{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
+```
+
++If the user has not set this configuration parameter in their site configuration, it will default to the *section with the most pages*.
+
+The user can override the default:
+
+{{< code-toggle file="hugo" >}}
+[params]
+ mainSections = ["blog", "docs"]
+{{< /code-toggle >}}
+
+[intersect]: /functions/intersect/
+[wherekeyword]: https://www.techonthenet.com/sql/where.php
--- /dev/null
- title: Get Started
- linktitle: Get Started Overview
+---
- weight: 1
- weight: 0001
++title: Getting started
++linkTitle: Overview
+description: Quick start and guides for installing Hugo on your preferred operating system.
+categories: [getting started]
+keywords: [usage,docs]
+menu:
+ docs:
++ identifier: getting-started-overview
+ parent: getting-started
++ weight: 10
++weight: 10
+aliases: [/overview/introduction/]
+---
+
+If this is your first time using Hugo and you've [already installed Hugo on your machine][installed], we recommend the [quick start]. You can also use [external learning resources] to learn Hugo.
+
+[installed]: /installation/
+[quick start]: /getting-started/quick-start/
+[external learning resources]: /getting-started/external-learning-resources/
--- /dev/null
- title: Configure Markup
+---
- categories: [getting started,fundamentals]
++title: Configure markup
+description: How to handle Markdown and other markup related configuration.
- weight: 65
++categories: [fundamentals, getting started]
+keywords: [configuration,highlighting]
- ## Configure Markup
++menu:
++ docs:
++ parent: getting-started
++ weight: 50
++weight: 50
+slug: configuration-markup
+toc: true
+---
+
- ### Table Of Contents
++## Configure markup
+
+See [Goldmark](#goldmark) for settings related to the default Markdown handler in Hugo.
+
+Below are all markup related configuration in Hugo with their default settings:
+
+{{< code-toggle config="markup" />}}
+
+**See each section below for details.**
+
+### Goldmark
+
+[Goldmark](https://github.com/yuin/goldmark/) is from Hugo 0.60 the default library used for Markdown. It's fast, it's [CommonMark](https://spec.commonmark.org/0.29/) compliant and it's very flexible.
+
+This is the default configuration:
+
+{{< code-toggle config="markup.goldmark" />}}
+
+For details on the extensions, refer to [this section](https://github.com/yuin/goldmark/#built-in-extensions) of the Goldmark documentation
+
+Some settings explained:
+
+hardWraps
+: By default, Goldmark ignores newlines within a paragraph. Set to `true` to render newlines as `<br>` elements.
+
+unsafe
+: By default, Goldmark does not render raw HTMLs and potentially dangerous links. If you have lots of inline HTML and/or JavaScript, you may need to turn this on.
+
+typographer
+: This extension substitutes punctuations with typographic entities like [smartypants](https://daringfireball.net/projects/smartypants/).
+
+attribute
+: Enable custom attribute support for titles and blocks by adding attribute lists inside single curly brackets (`{.myclass class="class1 class2" }`) and placing it _after the Markdown element it decorates_, on the same line for titles and on a new line directly below for blocks.
+
+Hugo supports adding attributes (e.g. CSS classes) to Markdown blocks, e.g. tables, lists, paragraphs etc.
+
+A blockquote with a CSS class:
+
+```md
+> foo
+> bar
+{.myclass}
+```
+
+There are some current limitations: For tables you can currently only apply it to the full table, and for lists the `ul`/`ol`-nodes only, e.g.:
+
+```md
+* Fruit
+ * Apple
+ * Orange
+ * Banana
+ {.fruits}
+* Dairy
+ * Milk
+ * Cheese
+ {.dairies}
+{.list}
+```
+
+Note that attributes in [code fences](/content-management/syntax-highlighting/#highlighting-in-code-fences) must come after the opening tag, with any other highlighting processing instruction, e.g.:
+
+````txt
+```go {.myclass linenos=table,hl_lines=[8,"15-17"],linenostart=199}
+// ... code
+```
+````
+
+autoHeadingIDType ("github")
+: The strategy used for creating auto IDs (anchor names). Available types are `github`, `github-ascii` and `blackfriday`. `github` produces GitHub-compatible IDs, `github-ascii` will drop any non-Ascii characters after accent normalization, and `blackfriday` will make the IDs compatible with Blackfriday, the default Markdown engine before Hugo 0.60. Note that if Goldmark is your default Markdown engine, this is also the strategy used in the [anchorize](/functions/anchorize/) template func.
+
+### Highlight
+
+This is the default `highlight` configuration. Note that some of these settings can be set per code block, see [Syntax Highlighting](/content-management/syntax-highlighting/).
+
+{{< code-toggle config="markup.highlight" />}}
+
+For `style`, see these galleries:
+
+* [Short snippets](https://xyproto.github.io/splash/docs/all.html)
+* [Long snippets](https://xyproto.github.io/splash/docs/longer/all.html)
+
+For CSS, see [Generate Syntax Highlighter CSS](/content-management/syntax-highlighting/#generate-syntax-highlighter-css).
+
- ## Markdown Render Hooks
++### Table of contents
+
+{{< code-toggle config="markup.tableOfContents" />}}
+
+These settings only works for the Goldmark renderer:
+
+startLevel
+: The heading level, values starting at 1 (`h1`), to start render the table of contents.
+
+endLevel
+: The heading level, inclusive, to stop render the table of contents.
+
+ordered
+: Whether or not to generate an ordered list instead of an unordered list.
+
++## Markdown render hooks
+
+See [Markdown Render Hooks](/templates/render-hooks/).
--- /dev/null
- linktitle: Configuration
+---
+title: Configure Hugo
- categories: [getting started,fundamentals]
++linkTitle: Configuration
+description: How to configure your Hugo site.
- weight: 60
- weight: 60
++categories: [fundamentals,getting started]
+keywords: [configuration,toml,yaml,json]
+menu:
+ docs:
+ parent: getting-started
- ## Configuration File
++ weight: 40
++weight: 40
+aliases: [/overview/source-directory/,/overview/configuration/]
+toc: true
+---
+
- The user can choose to override that default with one or more site config files
- using the command-line `--config` switch.
++## Configuration file
+
+Hugo uses the `hugo.toml`, `hugo.yaml`, or `hugo.json` (if found in the
+site root) as the default site configuration file.
+
- Multiple site config files can be specified as a comma-separated string to the `--config` switch.
++The user can choose to override that default with one or more site configuration files using the command-line `--config` switch.
+
+Examples:
+
+```txt
+hugo --config debugconfig.toml
+hugo --config a.toml,b.toml,c.toml
+```
+
+{{% note %}}
- In Hugo 0.110.0 we changed the default config base filename to `hugo`, e.g. `hugo.toml`. We will still look for `config.toml` etc., but we recommend you eventually rename it (but you need to wait if you want to support older Hugo versions). The main reason we're doing this is to make it easier for code editors and build tools to identify this as a Hugo configuration file and project.
++Multiple site configuration files can be specified as a comma-separated string to the `--config` switch.
+{{% /note %}}
+
+## hugo.toml vs config.toml
+
- ## Configuration Directory
++In Hugo 0.110.0 we changed the default configuration base file name to `hugo`, e.g. `hugo.toml`. We will still look for `config.toml` etc., but we recommend you eventually rename it (but you need to wait if you want to support older Hugo versions). The main reason we're doing this is to make it easier for code editors and build tools to identify this as a Hugo configuration file and project.
+
+{{< new-in "0.110.0" >}}
+
- In addition to using a single site config file, one can use the `configDir` directory (default to `config/`) to maintain easier organization and environment specific settings.
++## Configuration directory
+
-
++In addition to using a single site configuration file, one can use the `configDir` directory (default to `config/`) to maintain easier organization and environment specific settings.
+
+- Each file represents a configuration root object, such as `params.toml` for `[Params]`, `menu(s).toml` for `[Menu]`, `languages.toml` for `[Languages]` etc...
+- Each file's content must be top-level, for example:
+
+{{< code-toggle file="hugo" >}}
+[Params]
+ foo = "bar"
+{{< /code-toggle >}}
+
+{{< code-toggle file="params" >}}
+foo = "bar"
+{{< /code-toggle >}}
+
+- Each directory holds a group of files containing settings unique to an environment.
+- Files can be localized to become language specific.
+
- 1. In `_default/hugo.toml` you don't need to mention `googleAnalytics` parameter at all. This ensures that no Google Analytics code is loaded in your development server i.e. when you run `hugo server`. This works since, by default Hugo sets `Environment=development` when you run `hugo server` which uses the config files from `_default` folder
+```txt
+├── config
+│ ├── _default
+│ │ ├── hugo.toml
+│ │ ├── languages.toml
+│ │ ├── menus.en.toml
+│ │ ├── menus.zh.toml
+│ │ └── params.toml
+│ ├── production
+│ │ ├── hugo.toml
+│ │ └── params.toml
+│ └── staging
+│ ├── hugo.toml
+│ └── params.toml
+```
+
+Considering the structure above, when running `hugo --environment staging`, Hugo will use every setting from `config/_default` and merge `staging`'s on top of those.
+
+Let's take an example to understand this better. Let's say you are using Google Analytics for your website. This requires you to specify `googleAnalytics = "G-XXXXXXXX"` in `hugo.toml`. Now consider the following scenario:
+- You don't want the Analytics code to be loaded in development i.e. in your `localhost`
+- You want to use separate googleAnalytics IDs for your production & staging environments (say):
+ - `G-PPPPPPPP` for production
+ - `G-SSSSSSSS` for staging
+
+This is how you need to configure your `hugo.toml` files considering the above scenario:
- ```googleAnalytics = "G-PPPPPPPP"```
++1. In `_default/hugo.toml` you don't need to mention `googleAnalytics` parameter at all. This ensures that no Google Analytics code is loaded in your development server i.e. when you run `hugo server`. This works since, by default Hugo sets `Environment=development` when you run `hugo server` which uses the configuration files from `_default` folder
+2. In `production/hugo.toml` you just need to have one line:
+
- You don't need to mention all other parameters like `title`, `baseURL`, `theme` etc. again in this config file. You need to mention only those parameters which are different or new for the production environment. This is due to the fact that Hugo is going to __merge__ this on top of `_default/hugo.toml`. Now when you run `hugo` (build command), by default hugo sets `Environment=production`, so the `G-PPPPPPPP` analytics code will be there in your production website
++ ```googleAnalytics = "G-PPPPPPPP"```
+
- ```googleAnalytics = "G-SSSSSSSS"```
++ You don't need to mention all other parameters like `title`, `baseURL`, `theme` etc. again in this configuration file. You need to mention only those parameters which are different or new for the production environment. This is due to the fact that Hugo is going to __merge__ this on top of `_default/hugo.toml`. Now when you run `hugo` (build command), by default hugo sets `Environment=production`, so the `G-PPPPPPPP` analytics code will be there in your production website
+3. Similarly in `staging/hugo.toml` you just need to have one line:
+
- Now you need to tell Hugo that you are using the staging environment. So your build command should be `hugo --environment staging` which will load the `G-SSSSSSSS` analytics code in your staging website
++ ```googleAnalytics = "G-SSSSSSSS"```
+
- ## Merge Configuration from Themes
++ Now you need to tell Hugo that you are using the staging environment. So your build command should be `hugo --environment staging` which will load the `G-SSSSSSSS` analytics code in your staging website
+
+{{% note %}}
+Default environments are __development__ with `hugo server` and __production__ with `hugo`.
+{{%/ note %}}
+
- ## All Configuration Settings
++## Merge configuration from themes
+
+The configuration value for `_merge` can be one of:
+
+none
+: No merge.
+
+shallow
+: Only add values for new keys.
+
+deep
+: Add values for new keys, merge existing.
+
+Note that you don't need to be so verbose as in the default setup below; a `_merge` value higher up will be inherited if not set.
+
+{{< code-toggle config="mergeStrategy" skipHeader=true />}}
+
- The following is the full list of Hugo-defined variables. Users may choose to override those values in their site
- config file(s).
++## All configuration settings
+
- Pass down default configuration values (front matter) to pages in the content tree. The options in site config is the same as in page front matter, see [Front Matter Cascade](/content-management/front-matter#front-matter-cascade).
++The following is the full list of Hugo-defined variables. Users may choose to override those values in their site configuration file(s).
+
+### archetypeDir
+
+**Default value:** "archetypes"
+
+The directory where Hugo finds archetype files (content templates). {{% module-mounts-note %}}
+
+### assetDir
+
+**Default value:** "assets"
+
+The directory where Hugo finds asset files used in [Hugo Pipes](/hugo-pipes/). {{% module-mounts-note %}}
+
+### baseURL
+
+The absolute URL (protocol, host, path, and trailing slash) of your published site (e.g., `https://www.example.org/docs/`).
+
+### build
+
+See [Configure Build](#configure-build)
+
+### buildDrafts (false)
+
+**Default value:** false
+
+Include drafts when building.
+
+### buildExpired
+
+**Default value:** false
+
+Include content already expired.
+
+### buildFuture
+
+**Default value:** false
+
+Include content with publishdate in the future.
+
+### caches
+
+See [Configure File Caches](#configure-file-caches)
+
+### cascade
+
- **Default value:** false
++Pass down default configuration values (front matter) to pages in the content tree. The options in site configuration is the same as in page front matter, see [Front Matter Cascade](/content-management/front-matter#front-matter-cascade).
+
+### canonifyURLs
+
+**Default value:** false
+
+Enable to turn relative URLs into absolute.
+
+### cleanDestinationDir
+
+**Default value:** false
+
+When building, removes files from destination not found in static directories.
+
+### contentDir
+
+**Default value:** "content"
+
+The directory from where Hugo reads content files. {{% module-mounts-note %}}
+
+### copyright
+
+**Default value:** ""
+
+Copyright notice for your site, typically displayed in the footer.
+
+### dataDir
+
+**Default value:** "data"
+
+The directory from where Hugo reads data files. {{% module-mounts-note %}}
+
+### defaultContentLanguage
+
+**Default value:** "en"
+
+Content without language indicator will default to this language.
+
+### defaultContentLanguageInSubdir
+
- **Default value:** false
++**Default value:** false
+
+Render the default content language in subdir, e.g. `content/en/`. The site root `/` will then redirect to `/en/`.
+
+### disableAliases
+
- **Default value:** false
++**Default value:** false
+
+Will disable generation of alias redirects. Note that even if `disableAliases` is set, the aliases themselves are preserved on the page. The motivation with this is to be able to generate 301 redirects in an `.htaccess`, a Netlify `_redirects` file or similar using a custom output format.
+
+### disableHugoGeneratorInject
+
- **Default value:** []
++**Default value:** false
+
+Hugo will, by default, inject a generator meta tag in the HTML head on the _home page only_. You can turn it off, but we would really appreciate if you don't, as this is a good way to watch Hugo's popularity on the rise.
+
+### disableKinds
+
- **Default value:** false
++**Default value:** []
+
+Enable disabling of all pages of the specified *Kinds*. Allowed values in this list: `"page"`, `"home"`, `"section"`, `"taxonomy"`, `"term"`, `"RSS"`, `"sitemap"`, `"robotsTXT"`, `"404"`.
+
+### disableLiveReload
+
+**Default value:** false
+
+Disable automatic live reloading of browser window.
+
+### disablePathToLower
+
- **Default value:** false
++**Default value:** false
+
+Do not convert the url/path to lowercase.
+
+### enableEmoji
+
- **Default value:** false
++**Default value:** false
+
+Enable Emoji emoticons support for page content; see the [Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet/).
+
+### enableGitInfo
+
- **Default value:** false
++**Default value:** false
+
+Enable `.GitInfo` object for each page (if the Hugo site is versioned by Git). This will then update the `Lastmod` parameter for each page using the last git commit date for that content file.
+
+### enableInlineShortcodes
+
- **Default value:** false
++**Default value:** false
+
+Enable inline shortcode support. See [Inline Shortcodes](/templates/shortcode-templates/#inline-shortcodes).
+
+### enableMissingTranslationPlaceholders
+
- **Default value:** false
++**Default value:** false
+
+Show a placeholder instead of the default value or an empty string if a translation is missing.
+
+### enableRobotsTXT
+
- **Default value:** ""
++**Default value:** false
+
+Enable generation of `robots.txt` file.
+
+### frontmatter
+
+See [Front matter Configuration](#configure-front-matter).
+
+### googleAnalytics
+
- See [Image Processing Config](/content-management/image-processing/#imaging-configuration).
++**Default value:** ""
+
+Google Analytics tracking ID.
+
+### hasCJKLanguage
+
+**Default value:** false
+
+If true, auto-detect Chinese/Japanese/Korean Languages in the content. This will make `.Summary` and `.WordCount` behave correctly for CJK languages.
+
+### imaging
+
- **Default value:** ""
++See [image processing configuration](/content-management/image-processing/#imaging-configuration).
+
+### languageCode
+
- Module config see [Module Config](/hugo-modules/configuration/).
++**Default value:** ""
+
+A language tag as defined by [RFC 5646](https://datatracker.ietf.org/doc/html/rfc5646). This value is used to populate:
+
+- The `<language>` element in the internal [RSS template](https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/rss.xml)
+- The `lang` attribute of the `<html>` element in the internal [alias template](https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/alias.html)
+
+### languages
+
+See [Configure Languages](/content-management/multilingual/#configure-languages).
+
+### disableLanguages
+
+See [Disable a Language](/content-management/multilingual/#disable-a-language)
+
+### markup
+
+See [Configure Markup](/getting-started/configuration-markup).
+
+### mediaTypes
+
+See [Configure Media Types](/templates/output-formats/#media-types).
+
+### menus
+
+See [Menus](/content-management/menus/#define-in-site-configuration).
+
+### minify
+
+See [Configure Minify](#configure-minify)
+
+### module
+
- : See [Module Config](/hugo-modules/configuration/#module-config-imports) for how to import a theme.
++Module configuration see [module configuration](/hugo-modules/configuration/).
+
+### newContentEditor
+
+**Default value:** ""
+
+The editor to use when creating new content.
+
+### noChmod
+
+**Default value:** false
+
+Don't sync permission mode of files.
+
+### noTimes
+
+**Default value:** false
+
+Don't sync modification time of files.
+
+### outputFormats
+
+See [Configure Output Formats](#configure-additional-output-formats).
+
+### paginate
+
+**Default value:** 10
+
+Default number of elements per page in [pagination](/templates/pagination/).
+
+### paginatePath
+
+**Default value:** "page"
+
+The path element used during pagination (`https://example.com/page/2`).
+
+### permalinks
+
+See [Content Management](/content-management/urls/#permalinks).
+
+### pluralizeListTitles
+
+**Default value:** true
+
+Pluralize titles in lists.
+
+### publishDir
+
+**Default value:** "public"
+
+The directory to where Hugo will write the final static site (the HTML files etc.).
+
+### related
+
+See [Related Content](/content-management/related/#configure-related-content).
+
+### relativeURLs
+
+**Default value:** false
+
+Enable this to make all relative URLs relative to content root. Note that this does not affect absolute URLs.
+
+### refLinksErrorLevel
+
+**Default value:** "ERROR"
+
+When using `ref` or `relref` to resolve page links and a link cannot be resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).
+
+### refLinksNotFoundURL
+
+URL to be used as a placeholder when a page reference cannot be found in `ref` or `relref`. Is used as-is.
+
+### removePathAccents
+
+**Default value:** false
+
+Removes [non-spacing marks](https://www.compart.com/en/unicode/category/Mn) from [composite characters](https://en.wikipedia.org/wiki/Precomposed_character) in content paths.
+
+```text
+content/post/hügó.md --> https://example.org/post/hugo/
+```
+
+### rssLimit
+
+**Default value:** -1 (unlimited)
+
+Maximum number of items in the RSS feed.
+
+### sectionPagesMenu
+
+See [Menus](/content-management/menus/#define-in-site-configuration).
+
+### security
+
+See [Security Policy](/about/security-model/#security-policy)
+
+### sitemap
+
+Default [sitemap configuration](/templates/sitemap-template/#configuration).
+
+### summaryLength
+
+**Default value:** 70
+
+The length of text in words to show in a [`.Summary`](/content-management/summaries/#automatic-summary-splitting).
+
+### taxonomies
+
+See [Configure Taxonomies](/content-management/taxonomies#configure-taxonomies).
+
+### theme
+
- **Default value:** "themes"
++: See [module configuration](/hugo-modules/configuration/#module-configuration-imports) for how to import a theme.
+
+### themesDir
+
- Timeout for generating page contents, specified as a [duration](https://pkg.go.dev/time#Duration) or in milliseconds. *Note:* this is used to bail out of recursive content generation. You might need to raise this limit if your pages are slow to generate (e.g., because they require large image processing or depend on remote contents).
++**Default value:** "themes"
+
+The directory where Hugo reads the themes from.
+
+### timeout
+
+**Default value:** "30s"
+
- The time zone (or location), e.g. `Europe/Oslo`, used to parse front matter dates without such information and in the [`time` function](/functions/time/). The list of valid values may be system dependent, but should include `UTC`, `Local`, and any location in the [IANA Time Zone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
++Timeout for generating page contents, specified as a [duration](https://pkg.go.dev/time#Duration) or in seconds. *Note:* this is used to bail out of recursive content generation. You might need to raise this limit if your pages are slow to generate (e.g., because they require large image processing or depend on remote contents).
+
+### timeZone
+
- **Default value:** "AP"
++The time zone (or location), e.g. `Europe/Oslo`, used to parse front matter dates without such information and in the [`time` function](/functions/time/). The list of valid values may be system dependent, but should include `UTC`, `Local`, and any location in the [IANA Time Zone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
+
+### title
+
+Site title.
+
+### titleCaseStyle
+
- ## Configure Build
++**Default value:** "ap"
+
+See [Configure Title Case](#configure-title-case)
+
+### uglyURLs
+
+**Default value:** false
+
+When enabled, creates URL of the form `/filename.html` instead of `/filename/`.
+
+### watch
+
+**Default value:** false
+
+Watch filesystem for changes and recreate as needed.
+
+{{% note %}}
+If you are developing your site on a \*nix machine, here is a handy shortcut for finding a configuration option from the command line:
+```txt
+cd ~/sites/yourhugosite
+hugo config | grep emoji
+```
+
+which shows output like
+
+```txt
+enableemoji: true
+```
+{{% /note %}}
+
- useResourceCacheWhen="fallback"
- writeStats = false
- noJSConfigInAssets = false
- [[build.cachebusters]]
- source = "assets/watching/hugo_stats\\.json"
- target = "styles\\.css"
- [[build.cachebusters]]
- source = "(postcss|tailwind)\\.config\\.js"
- target = "css"
- [[build.cachebusters]]
- source = "assets/.*\\.(js|ts|jsx|tsx)"
- target = "js"
- [[build.cachebusters]]
- source = "assets/.*\\.(.*)$"
- target = "$1"
++## Configure build
+
+The `build` configuration section contains global build-related configuration options.
+
+{{< code-toggle file="hugo" >}}
+[build]
- useResourceCacheWhen
- : When to use the cached resources in `/resources/_gen` for PostCSS and ToCSS. Valid values are `never`, `always` and `fallback`. The last value means that the cache will be tried if PostCSS/extended version is not available.
++ noJSConfigInAssets = false
++ useResourceCacheWhen = 'fallback'
++ [build.buildStats]
++ disableClasses = false
++ disableIDs = false
++ disableTags = false
++ enable = false
++[[build.cachebusters]]
++ source = 'assets/.*\.(js|ts|jsx|tsx)'
++ target = '(js|scripts|javascript)'
++[[build.cachebusters]]
++ source = 'assets/.*\.(css|sass|scss)$'
++ target = '(css|styles|scss|sass)'
++[[build.cachebusters]]
++ source = '(postcss|tailwind)\.config\.js'
++ target = '(css|styles|scss|sass)'
++[[build.cachebusters]]
++ source = 'assets/.*\.(.*)$'
++ target = '$1'
+{{< /code-toggle >}}
+
++buildStats {{< new-in "0.115.1" >}}
++: When enabled, creates a `hugo_stats.json` file in the root of your project. This file contains arrays of the `class` attributes, `id` attributes, and tags of every HTML element within your published site. Use this file as data source when [removing unused CSS] from your site. This process is also known as pruning, purging, or tree shaking.
+
- writeStats
- : When enabled, a file named `hugo_stats.json` will be written to your project root with some aggregated data about the build, e.g. list of HTML entities published to be used to do [CSS pruning](/hugo-pipes/postprocess/#css-purging-with-postcss). If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory). It's also worth mentioning that, due to the nature of the partial server builds, new HTML entities will be added when you add or change them while the server is running, but the old values will not be removed until you restart the server or run a regular `hugo` build.
++[removing unused CSS]: http://localhost:1313/hugo-pipes/postprocess/#css-purging-with-postcss
+
- **Note** that the prime use case for this is purging of unused CSS; it is built for speed and there may be false positives (e.g., detection of HTML elements that are not HTML elements).
++Exclude `class` attributes, `id` attributes, or tags from `hugo_stats.json` with the `disableClasses`, `disableIDs`, and `disableTags` keys.
+
- noJSConfigInAssets
- : Turn off writing a `jsconfig.json` into your `/assets` folder with mapping of imports from running [js.Build](https://gohugo.io/hugo-pipes/js). This file is intended to help with intellisense/navigation inside code editors such as [VS Code](https://code.visualstudio.com/). Note that if you do not use `js.Build`, no file will be written.
++{{% note %}}
++With v0.115.0 and earlier this feature was enabled by setting `writeStats` to `true`. Although still functional, the `writeStats` key will be deprecated in a future release.
+
- ## Configure Cache Busters
++Given that CSS purging is typically limited to production builds, place the `buildStats` object below [config/production].
++
++[config/production]: /getting-started/configuration/#configuration-directory
++
++Built for speed, there may be "false positive" detections (e.g., HTML elements that are not HTML elements) while parsing the published site. These "false positives" are infrequent and inconsequential.
++{{% /note %}}
++
++Due to the nature of partial server builds, new HTML entities are added while the server is running, but old values will not be removed until you restart the server or run a regular `hugo` build.
+
+cachebusters
+: See [Configure Cache Busters](#configure-cache-busters)
+
- The `build.cachebusters` configuration option was added to support development using Tailwind 3.x's JIT compiler where a `build` config may look like this:
++noJSConfigInAssets
++: Turn off writing a `jsconfig.json` into your `/assets` folder with mapping of imports from running [js.Build](/hugo-pipes/js). This file is intended to help with intellisense/navigation inside code editors such as [VS Code](https://code.visualstudio.com/). Note that if you do not use `js.Build`, no file will be written.
++
++useResourceCacheWhen
++: When to use the cached resources in `/resources/_gen` for PostCSS and ToCSS. Valid values are `never`, `always` and `fallback`. The last value means that the cache will be tried if PostCSS/extended version is not available.
++
++## Configure cache busters
+
+{{< new-in "0.112.0" >}}
+
- writeStats = true
++The `build.cachebusters` configuration option was added to support development using Tailwind 3.x's JIT compiler where a `build` configuration may look like this:
++
++<!-- TODO (jmm) writeStats => build.buildStats -->
+
+{{< code-toggle file="hugo" >}}
+[build]
- ## Configure Server
++ [build.buildStats]
++ enable = true
+ [[build.cachebusters]]
+ source = "assets/watching/hugo_stats\\.json"
+ target = "styles\\.css"
+ [[build.cachebusters]]
+ source = "(postcss|tailwind)\\.config\\.js"
+ target = "css"
+ [[build.cachebusters]]
+ source = "assets/.*\\.(js|ts|jsx|tsx)"
+ target = "js"
+ [[build.cachebusters]]
+ source = "assets/.*\\.(.*)$"
+ target = "$1"
+{{< /code-toggle >}}
+
+Some key points in the above are `writeStats = true`, which writes a `hugo_stats.json` file on each build with HTML classes etc. that's used in the rendered output. Changes to this file will trigger a rebuild of the `styles.css` file. You also need to add `hugo_stats.json` to Hugo's server watcher. See [Hugo Starter Tailwind Basic](https://github.com/bep/hugo-starter-tailwind-basic) for a running example.
+
+source
+: A regexp matching file(s) relative to one of the virtual component directories in Hugo, typically `assets/...`.
+
+target
+: A regexp matching the keys in the resource cache that should be expired when `source` changes. You can use the matching regexp groups from `source` in the expression, e.g. `$1`.
+
-
++## Configure server
+
+This is only relevant when running `hugo server`, and it allows to set HTTP headers during development, which allows you to test out your Content Security Policy and similar. The configuration format matches [Netlify's](https://docs.netlify.com/routing/headers/#syntax-for-the-netlify-configuration-file) with slightly more powerful [Glob matching](https://github.com/gobwas/glob):
+
+
+{{< code-toggle file="hugo" >}}
+[server]
+[[server.headers]]
+for = "/**"
+
+[server.headers.values]
+X-Frame-Options = "DENY"
+X-XSS-Protection = "1; mode=block"
+X-Content-Type-Options = "nosniff"
+Referrer-Policy = "strict-origin-when-cross-origin"
+Content-Security-Policy = "script-src localhost:1313"
+{{< /code-toggle >}}
+
+Since this is "development only", it may make sense to put it below the `development` environment:
+
- Setting `force=true` will make a redirect even if there is existing content in the path. Note that before Hugo 0.76 `force` was the default behavior, but this is inline with how Netlify does it.
+{{< code-toggle file="config/development/server">}}
+[[headers]]
+for = "/**"
+
+[headers.values]
+X-Frame-Options = "DENY"
+X-XSS-Protection = "1; mode=block"
+X-Content-Type-Options = "nosniff"
+Referrer-Policy = "strict-origin-when-cross-origin"
+Content-Security-Policy = "script-src localhost:1313"
+{{< /code-toggle >}}
+
+You can also specify simple redirects rules for the server. The syntax is again similar to Netlify's.
+
+Note that a `status` code of 200 will trigger a [URL rewrite](https://docs.netlify.com/routing/redirects/rewrites-proxies/), which is what you want in SPA situations, e.g:
+
+{{< code-toggle file="config/development/server">}}
+[[redirects]]
+from = "/myspa/**"
+to = "/myspa/"
+status = 200
+force = false
+{{< /code-toggle >}}
+
- ## 404 Server Error Page {#_404-server-error-page}
++Setting `force=true` will make a redirect even if there is existing content in the path. Note that before Hugo 0.76 `force` was the default behavior, but this is inline with how Netlify does it.
+
- Hugo will, by default, render all 404 errors when running `hugo server` with the `404.html` template. Note that if you have already added one or more redirects to your [Server Config](#configure-server), you need to add the 404 redirect explicitly, e.g:
++## 404 server error page {#_404-server-error-page}
+
+{{< new-in "0.103.0" >}}
+
- ## Configure Title Case
++Hugo will, by default, render all 404 errors when running `hugo server` with the `404.html` template. Note that if you have already added one or more redirects to your [server configuration](#configure-server), you need to add the 404 redirect explicitly, e.g:
+
+{{< code-toggle file="config/development/server" copy=false >}}
+[[redirects]]
+from = "/**"
+to = "/404.html"
+status = 404
+{{< /code-toggle >}}
+
- Set `titleCaseStyle` to specify the title style used by the [title](/functions/title/) template function and the automatic section titles in Hugo.
++## Configure title case
+
- * `ap` (default), the capitalization rules in the [Associated Press (AP) Stylebook]
++Set `titleCaseStyle` to specify the title style used by the [title](/functions/title/) template function and the automatic section titles in Hugo.
+
+Can be one of:
+
- ## Configuration Environment Variables
++* `ap` (default), the capitalization rules in the [Associated Press (AP) Stylebook]
+* `chicago`, the [Chicago Manual of Style]
+* `go`, Go's convention of capitalizing every word.
+* `firstupper`, capitalize the first letter of the first word.
+* `none`, no capitalization.
+
+[Associated Press (AP) Stylebook]: https://www.apstylebook.com/
+[Chicago Manual of Style]: https://www.chicagomanualofstyle.org/home.html
+[site configuration]: /getting-started/configuration/#configure-title-case
+
- ## Configuration Lookup Order
++## Configuration environment variables
+
+HUGO_NUMWORKERMULTIPLIER
+: Can be set to increase or reduce the number of workers used in parallel processing in Hugo. If not set, the number of logical CPUs will be used.
+
-
- ## Example Configuration
++## Configuration lookup order
+
+Similar to the template [lookup order], Hugo has a default set of rules for searching for a configuration file in the root of your website's source directory as a default behavior:
+
+1. `./hugo.toml`
+2. `./hugo.yaml`
+3. `./hugo.json`
+
+In your configuration file, you can direct Hugo as to how you want your website rendered, control your website's menus, and arbitrarily define site-wide parameters specific to your project.
+
- ## Configure with Environment Variables
++## Example configuration
+
+The following is a typical example of a configuration file. The values nested under `params:` will populate the [`.Site.Params`] variable for use in [templates]:
+
+{{< code-toggle file="hugo" >}}
+baseURL: "https://yoursite.example.com/"
+title: "My Hugo Site"
+permalinks:
+ posts: /:year/:month/:title/
+params:
+ Subtitle: "Hugo is Absurdly Fast!"
+ AuthorName: "Jon Doe"
+ GitHubUser: "spf13"
+ ListOfFoo:
+ - "foo1"
+ - "foo2"
+ SidebarRecentLimit: 5
+{{< /code-toggle >}}
+
- In addition to the 3 config options already mentioned, configuration key-values can be defined through operating system environment variables.
++## Configure with environment variables
+
- To set config params, prefix the name with `HUGO_PARAMS_`
++In addition to the 3 configuration options already mentioned, configuration key-values can be defined through operating system environment variables.
+
+For example, the following command will effectively set a website's title on Unix-like systems:
+
+```txt
+$ env HUGO_TITLE="Some Title" hugo
+```
+
+This is really useful if you use a service such as Netlify to deploy your site. Look at the Hugo docs [Netlify configuration file](https://github.com/gohugoio/hugoDocs/blob/master/netlify.toml) for an example.
+
+{{% note %}}
+Names must be prefixed with `HUGO_` and the configuration key must be set in uppercase when setting operating system environment variables.
+
- Test and document setting params via JSON env var.
++To set configuration parameters, prefix the name with `HUGO_PARAMS_`
+{{% /note %}}
+
+If you are using snake_cased variable names, the above will not work. Hugo determines the delimiter to use by the first character after `HUGO`. This allows you to define environment variables on the form `HUGOxPARAMSxAPI_KEY=abcdefgh`, using any [allowed](https://stackoverflow.com/questions/2821043/allowed-characters-in-linux-environment-variable-names#:~:text=So%20names%20may%20contain%20any,not%20begin%20with%20a%20digit.) delimiter.
+
+{{< todo >}}
- ## Ignore Content and Data Files when Rendering
++Test and document setting parameters via JSON env var.
+{{< /todo >}}
+
- **Note:** This works, but we recommend you use the newer and more powerful [includeFiles and excludeFiles](https://gohugo.io/hugo-modules/configuration/#module-config-mounts) mount options.
++## Ignore content and data files when rendering
+
- ## Configure Front Matter
++**Note:** This works, but we recommend you use the newer and more powerful [includeFiles and excludeFiles](/hugo-modules/configuration/#module-configuration-mounts) mount options.
+
+To exclude specific files from the `content`, `data`, and `i18n` directories when rendering your site, set `ignoreFiles` to one or more regular expressions to match against the absolute file path.
+
+To ignore files ending with `.foo` or `.boo`:
+
+{{< code-toggle copy=false file="hugo" >}}
+ignoreFiles = ['\.foo$', '\.boo$']
+{{< /code-toggle >}}
+
+To ignore a file using the absolute file path:
+
+{{< code-toggle copy=false file="hugo" >}}
+ignoreFiles = ['^/home/user/project/content/test\.md$']
+{{< /code-toggle >}}
+
- ### Configure Dates
++## Configure front matter
+
- In the list to the right, values starting with ":" are date handlers with a special meaning (see below). The others are just names of date parameters (case insensitive) in your front matter configuration. Also note that Hugo have some built-in aliases to the above: `lastmod` => `modified`, `publishDate` => `pubdate`, `published` and `expiryDate` => `unpublishdate`. With that, as an example, using `pubDate` as a date in front matter, will, by default, be assigned to `.PublishDate`.
++### Configure dates
+
+Dates are important in Hugo, and you can configure how Hugo assigns dates to your content pages. You do this by adding a `frontmatter` section to your `hugo.toml`.
+
+The default configuration is:
+
+{{< code-toggle file="hugo" >}}
+[frontmatter]
+date = ["date", "publishDate", "lastmod"]
+lastmod = [":git", "lastmod", "date", "publishDate"]
+publishDate = ["publishDate", "date"]
+expiryDate = ["expiryDate"]
+{{< /code-toggle >}}
+
+If you, as an example, have a non-standard date parameter in some of your content, you can override the setting for `date`:
+
+{{< code-toggle file="hugo" >}}
+[frontmatter]
+date = ["myDate", ":default"]
+{{< /code-toggle >}}
+
+The `:default` is a shortcut to the default settings. The above will set `.Date` to the date value in `myDate` if present, if not we will look in `date`,`publishDate`, `lastmod` and pick the first valid date.
+
-
++In the list to the right, values starting with ":" are date handlers with a special meaning (see below). The others are just names of date parameters (case insensitive) in your front matter configuration. Also note that Hugo have some built-in aliases to the above: `lastmod` => `modified`, `publishDate` => `pubdate`, `published` and `expiryDate` => `unpublishdate`. With that, as an example, using `pubDate` as a date in front matter, will, by default, be assigned to `.PublishDate`.
+
+The special date handlers are:
+
-
+`:fileModTime`
+: Fetches the date from the content file's last modification timestamp.
+
+An example:
+
+{{< code-toggle file="hugo" >}}
+[frontmatter]
+lastmod = ["lastmod", ":fileModTime", ":default"]
+{{< /code-toggle >}}
+
-
+The above will try first to extract the value for `.Lastmod` starting with the `lastmod` front matter parameter, then the content file's modification timestamp. The last, `:default` should not be needed here, but Hugo will finally look for a valid date in `:git`, `date` and then `publishDate`.
+
- : Fetches the date from the content file's filename. For example, `2018-02-22-mypage.md` will extract the date `2018-02-22`. Also, if `slug` is not set, `mypage` will be used as the value for `.Slug`.
+`:filename`
- The above will try first to extract the value for `.Date` from the filename, then it will look in front matter parameters `date`, `publishDate` and lastly `lastmod`.
-
++: Fetches the date from the content file's file name. For example, `2018-02-22-mypage.md` will extract the date `2018-02-22`. Also, if `slug` is not set, `mypage` will be used as the value for `.Slug`.
+
+An example:
+
+{{< code-toggle file="hugo" >}}
+[frontmatter]
+date = [":filename", ":default"]
+{{< /code-toggle >}}
+
- : This is the Git author date for the last revision of this content file. This will only be set if `--enableGitInfo` is set or `enableGitInfo = true` is set in site config.
++The above will try first to extract the value for `.Date` from the file name, then it will look in front matter parameters `date`, `publishDate` and lastly `lastmod`.
+
+`:git`
- ## Configure Additional Output Formats
++: This is the Git author date for the last revision of this content file. This will only be set if `--enableGitInfo` is set or `enableGitInfo = true` is set in site configuration.
+
- ## Configure Minify
++## Configure additional output formats
+
+Hugo v0.20 introduced the ability to render your content to multiple output formats (e.g., to JSON, AMP html, or CSV). See [Output Formats] for information on how to add these values to your Hugo project's configuration file.
+
- ## Configure File Caches
++## Configure minify
+
+Default configuration:
+
+{{< code-toggle config="minify" />}}
+
- : This is the value of the `cacheDir` config option if set (can also be set via OS env variable `HUGO_CACHEDIR`). It will fall back to `/opt/build/cache/hugo_cache/` on Netlify, or a `hugo_cache_$USER` directory below the OS temp dir for the others. This means that if you run your builds on Netlify, all caches configured with `:cacheDir` will be saved and restored on the next build. For other CI vendors, please read their documentation. For an CircleCI example, see [this configuration](https://github.com/bep/hugo-sass-test/blob/6c3960a8f4b90e8938228688bc49bdcdd6b2d99e/.circleci/config.yml).
++## Configure file caches
+
+Since Hugo 0.52 you can configure more than just the `cacheDir`. This is the default configuration:
+
+{{< code-toggle file="hugo" >}}
+[caches]
+[caches.getjson]
+dir = ":cacheDir/:project"
+maxAge = -1
+[caches.getcsv]
+dir = ":cacheDir/:project"
+maxAge = -1
+[caches.getresource]
+dir = ":cacheDir/:project"
+maxAge = -1
+[caches.images]
+dir = ":resourceDir/_gen"
+maxAge = -1
+[caches.assets]
+dir = ":resourceDir/_gen"
+maxAge = -1
+[caches.modules]
+dir = ":cacheDir/modules"
+maxAge = -1
+{{< /code-toggle >}}
+
+You can override any of these cache settings in your own `hugo.toml`.
+
+### The keywords explained
+
+`:cacheDir`
- : This is the value of the `resourceDir` config option.
++: This is the value of the `cacheDir` configuration option if set (can also be set via OS env variable `HUGO_CACHEDIR`). It will fall back to `/opt/build/cache/hugo_cache/` on Netlify, or a `hugo_cache_$USER` directory below the OS temp dir for the others. This means that if you run your builds on Netlify, all caches configured with `:cacheDir` will be saved and restored on the next build. For other CI vendors, please read their documentation. For an CircleCI example, see [this configuration](https://github.com/bep/hugo-sass-test/blob/6c3960a8f4b90e8938228688bc49bdcdd6b2d99e/.circleci/config.yml).
+
+`:project`
+: The base directory name of the current Hugo project. This means that, in its default setting, every project will have separated file caches, which means that when you do `hugo --gc` you will not touch files related to other Hugo projects running on the same PC.
+
+`:resourceDir`
- ## Configuration Format Specs
++: This is the value of the `resourceDir` configuration option.
+
+maxAge
+: This is the duration before a cache entry will be evicted, -1 means forever and 0 effectively turns that particular cache off. Uses Go's `time.Duration`, so valid values are `"10s"` (10 seconds), `"10m"` (10 minutes) and `"10h"` (10 hours).
+
+dir
+: The absolute path to where the files for this cache will be stored. Allowed starting placeholders are `:cacheDir` and `:resourceDir` (see above).
+
++## Configuration format specs
+
+- [TOML Spec][toml]
+- [YAML Spec][yaml]
+- [JSON Spec][json]
+
+[`.Site.Params`]: /variables/site/
+[directory structure]: /getting-started/directory-structure
+[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
+[lookup order]: /templates/lookup-order/
+[Output Formats]: /templates/output-formats/
+[templates]: /templates/
+[toml]: https://github.com/toml-lang/toml
+[yaml]: https://yaml.org/spec/
+[static-files]: /content-management/static-files/
--- /dev/null
- title: Directory Structure
+---
- categories: [getting started,fundamentals]
++title: Directory structure
+description: Hugo's CLI scaffolds a project directory structure and then takes that single directory and uses it as the input to create a complete website.
- weight: 50
- weight: 50
++categories: [fundamentals,getting started]
+keywords: [source, organization, directories]
+menu:
+ docs:
+ parent: getting-started
- ## New Site Scaffolding
++ weight: 30
++weight: 30
+aliases: [/overview/source-directory/]
+toc: true
+---
+
- ## Directory Structure Explained
++## New site scaffolding
+
+{{< youtube sB0HLHjgQ7E >}}
+
+Running `hugo new site example` from the command line creates a directory structure with the following elements:
+
+```txt
+example/
+├── archetypes/
+│ └── default.md
+├── assets/
+├── content/
+├── data/
+├── layouts/
+├── public/
+├── static/
+├── themes/
+└── hugo.toml
+```
+
- By default, Hugo will create new content files with at least `date`, `title` (inferred from the filename), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes] with custom preconfigured front matter fields as well.
++## Directory structure explained
+
+The following is a high-level overview of each of the directories with links to each of their respective sections within the Hugo docs.
+
+[`archetypes`](/content-management/archetypes/)
+: You can create new content files in Hugo using the `hugo new` command.
- The [config directory](/getting-started/configuration/#configuration-directory) is where those directives are stored as JSON, YAML, or TOML files. Every root setting object can stand as its own file and structured by environments.
++By default, Hugo will create new content files with at least `date`, `title` (inferred from the file name), and `draft = true`. This saves time and promotes consistency for sites using multiple content types. You can create your own [archetypes] with custom preconfigured front matter fields as well.
+
+[`assets`]
+: Stores all the files which need be processed by [Hugo Pipes](/hugo-pipes/). Only the files whose `.Permalink` or `.RelPermalink` are used will be published to the `public` directory.
+
+[`config`](/getting-started/configuration/)
+: Hugo ships with a large number of [configuration directives].
- Many sites may need little to no configuration, but Hugo ships with a large number of [configuration directives] for more granular directions on how you want Hugo to build your website. Note: config directory is not created by default.
++The [configuration directory](/getting-started/configuration/#configuration-directory) is where those directives are stored as JSON, YAML, or TOML files. Every root setting object can stand as its own file and structured by environments.
+Projects with minimal settings and no need for environment awareness can use a single `hugo.toml` file at its root.
+
- [starters]: /tools/starter-kits/
++Many sites may need little to no configuration, but Hugo ships with a large number of [configuration directives] for more granular directions on how you want Hugo to build your website. Note: the `config` directory is not created by default.
+
+[`content`]
+: All content for your website will live inside this directory. Each top-level folder in Hugo is considered a [content section]. For example, if your site has three main sections---`blog`, `articles`, and `tutorials`---you will have three directories at `content/blog`, `content/articles`, and `content/tutorials`. Hugo uses sections to assign default [content types].
+
+[`data`](/templates/data-templates/)
+: This directory is used to store configuration files that can be
+used by Hugo when generating your website. You can write these files in YAML, JSON, or TOML format. In addition to the files you add to this folder, you can also create [data templates] that pull from dynamic content.
+
+[`layouts`]
+: Stores templates in the form of `.html` files that specify how views of your content will be rendered into a static website. Templates include [list pages][lists], your [homepage], [taxonomy templates], [partials], [single page templates][singles], and more.
+
+[`static`]
+: Stores all the static content: images, CSS, JavaScript, etc. When Hugo builds your site, all assets inside your static directory are copied over as-is. A good example of using the `static` folder is for [verifying site ownership on Google Search Console][searchconsole], where you want Hugo to copy over a complete HTML file without modifying its content.
+
+{{% note %}}
+From **Hugo 0.31** you can have multiple static directories.
+{{% /note %}}
+
+[`resources`]
+: Caches some files to speed up generation. Can be also used by template authors to distribute built Sass files, so you don't have to have the preprocessor installed. Note: resources directory is not created by default.
+
+[archetypes]: /content-management/archetypes/
+[`assets`]: /hugo-pipes/introduction#asset-directory
+[configuration directives]: /getting-started/configuration/#all-configuration-settings
+[`content`]: /content-management/organization/
+[content section]: /content-management/sections/
+[content types]: /content-management/types/
+[data templates]: /templates/data-templates/
+[homepage]: /templates/homepage/
+[`layouts`]: /templates/
+[`static`]: /content-management/static-files/
+[`resources`]: /getting-started/configuration/#configure-file-caches
+[lists]: /templates/lists/
+[pagevars]: /variables/page/
+[partials]: /templates/partials/
+[searchconsole]: https://support.google.com/webmasters/answer/9008080#zippy=%2Chtml-file-upload
+[singles]: /templates/single-page-templates/
+[taxonomies]: /content-management/taxonomies/
+[taxonomy templates]: /templates/taxonomy-templates/
+[types]: /content-management/types/
--- /dev/null
- title: External Learning Resources
+---
- weight: 70
- weight: 70
++title: External learning resources
+description: A list of tutorials and books on Hugo.
+keywords: [books, tutorials, learning, usage]
+menu:
+ docs:
+ parent: getting-started
++ weight: 60
++weight: 60
+---
+
+## Books
+
+### Hugo In Action
+
+[](https://www.manning.com/books/hugo-in-action)
+
+Hugo in Action is a step-by-step guide to using Hugo to create static websites. Working with a complete example website and source code samples, you’ll learn how to build and host a low-maintenance, high-performance site that will wow your users and stay stable without relying on a third-party server.
+
+[Hugo In Action Home Page](https://www.manning.com/books/hugo-in-action)
+
+### Build Websites with Hugo
+
+[Build Websites with Hugo - Fast Web Development with Markdown (2020)](https://pragprog.com/titles/bhhugo/) by Brian P. Hogan.
+
+## Beginner tutorials
+
+### Hugo tutorial by CloudCannon
+
+[Step-by-step written tutorial](https://cloudcannon.com/community/learn/hugo-beginner-tutorial/) to teach you the basics of creating a Hugo site.
+
+## Video tutorials
+
+* Mike Dane explains the various features of Hugo via dedicated tutorials on [YouTube](https://www.youtube.com/watch?list=PLLAZ4kZ9dFpOnyRlyS-liKL5ReHDcj4G3&v=qtIqKaDlqXo).
+
+* [Introduction to building your first Hugo site](https://cloudcannon.com/community/learn/hugo-beginner-tutorial/) by Mike Neumegen.
--- /dev/null
- title: Quick Start
+---
- weight: 10
- weight: 10
++title: Quick start
+description: Learn to create a Hugo site in minutes.
+categories: [getting started]
+keywords: [quick start,usage]
+menu:
+ docs:
+ parent: getting-started
- PowerShell and Windows PowerShell are different applications.
++ weight: 20
++weight: 20
+toc: true
+aliases: [/quickstart/,/overview/quickstart/]
+---
+
+In this tutorial you will:
+
+1. Create a site
+2. Add content
+3. Configure the site
+4. Publish the site
+
+## Prerequisites
+
+Before you begin this tutorial you must:
+
+1. [Install Hugo] (extended edition, v0.112.0 or later)
+1. [Install Git]
+
+You must also be comfortable working from the command line.
+
+## Create a site
+
+### Commands
+
+{{% note %}}
+**If you are a Windows user:**
+
+- Do not use the Command Prompt
+- Do not use Windows PowerShell
+- Run these commands from [PowerShell] or a Linux terminal such as WSL or Git Bash
+
- git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
++PowerShell and Windows PowerShell [are different applications].
+
+[PowerShell]: https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows
++[are different applications]: https://learn.microsoft.com/en-us/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.3
+{{% /note %}}
+
+Run these commands to create a Hugo site with the [Ananke] theme. The next section provides an explanation of each command.
+
+```text
+hugo new site quickstart
+cd quickstart
+git init
- git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke themes/ananke
++git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
+echo "theme = 'ananke'" >> hugo.toml
+hugo server
+```
+
+View your site at the URL displayed in your terminal. Press `Ctrl + C` to stop Hugo's development server.
+
+### Explanation of commands
+
+Create the [directory structure] for your project in the `quickstart` directory.
+
+```text
+hugo new site quickstart
+```
+
+Change the current directory to the root of your project.
+
+```text
+cd quickstart
+```
+
+Initialize an empty Git repository in the current directory.
+
+```text
+git init
+```
+
+Clone the [Ananke] theme into the `themes` directory, adding it to your project as a [Git submodule].
+
+```text
++git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
+```
+
+Append a line to the site configuration file, indicating the current theme.
+
+```text
+echo "theme = 'ananke'" >> hugo.toml
+```
+
+Start Hugo's development server to view the site.
+
+```text
+hugo server
+```
+
+Press `Ctrl + C` to stop Hugo's development server.
+
+## Add content
+
+Add a new page to your site.
+
+```text
+hugo new posts/my-first-post.md
+```
+
+Hugo created the file in the `content/posts` directory. Open the file with your editor.
+
+```text
+---
+title: "My First Post"
+date: 2022-11-20T09:03:20-08:00
+draft: true
+---
+```
+
+Notice the `draft` value in the [front matter] is `true`. By default, Hugo does not publish draft content when you build the site. Learn more about [draft, future, and expired content].
+
+Add some [markdown] to the body of the post, but do not change the `draft` value.
+
+[markdown]: https://commonmark.org/help/
+
+```text
+---
+title: "My First Post"
+date: 2022-11-20T09:03:20-08:00
+draft: true
+---
+## Introduction
+
+This is **bold** text, and this is *emphasized* text.
+
+Visit the [Hugo](https://gohugo.io) website!
+```
+
+Save the file, then start Hugo’s development server to view the site. You can run either of the following commands to include draft content.
+
+```text
+hugo server --buildDrafts
+hugo server -D
+```
+
+View your site at the URL displayed in your terminal. Keep the development server running as you continue to add and change content.
+
+{{% note %}}
+Hugo's rendering engine conforms to the CommonMark [specification] for markdown. The CommonMark organization provides a useful [live testing tool] powered by the reference implementation.
+
+[live testing tool]: https://spec.commonmark.org/dingus/
+[specification]: https://spec.commonmark.org/
+{{% /note %}}
+
+## Configure the site
+
+With your editor, open the [site configuration] file (`hugo.toml`) in the root of your project.
+
+```text
+baseURL = 'http://example.org/'
+languageCode = 'en-us'
+title = 'My New Hugo Site'
+theme = 'ananke'
+```
+
+Make the following changes:
+
+1. Set the `baseURL` for your production site. This value must begin with the protocol and end with a slash, as shown above.
+
+2. Set the `languageCode` to your language and region.
+
+3. Set the `title` for your production site.
+
+Start Hugo's development server to see your changes, remembering to include draft content.
+
+```text
+hugo server -D
+```
+
+{{% note %}}
+Most theme authors provide configuration guidelines and options. Make sure to visit your theme's repository or documentation site for details.
+
+[The New Dynamic], authors of the Ananke theme, provide [documentation] for configuration and usage. They also provide a [demonstration site].
+
+[demonstration site]: https://gohugo-ananke-theme-demo.netlify.app/
+[documentation]: https://github.com/theNewDynamic/gohugo-theme-ananke#readme
+[The New Dynamic]: https://www.thenewdynamic.com/
+{{% /note %}}
+
+## Publish the site
+
+In this step you will _publish_ your site, but you will not _deploy_ it.
+
+When you _publish_ your site, Hugo creates the entire static site in the `public` directory in the root of your project. This includes the HTML files, and assets such as images, CSS files, and JavaScript files.
+
+When you publish your site, you typically do _not_ want to include [draft, future, or expired content]. The command is simple.
+
+```text
+hugo
+```
+
+To learn how to _deploy_ your site, see the [hosting and deployment] section.
+
+## Ask for help
+
+Hugo's [forum] is an active community of users and developers who answer questions, share knowledge, and provide examples. A quick search of over 20,000 topics will often answer your question. Please be sure to read about [requesting help] before asking your first question.
+
+## Other resources
+
+For other resources to help you learn Hugo, including books and video tutorials, see the [external learning resources](/getting-started/external-learning-resources/) page.
+
+[Ananke]: https://github.com/theNewDynamic/gohugo-theme-ananke
+[directory structure]: /getting-started/directory-structure
+[draft, future, and expired content]: /getting-started/usage/#draft-future-and-expired-content
+[draft, future, or expired content]: /getting-started/usage/#draft-future-and-expired-content
+[external learning resources]:/getting-started/external-learning-resources/
+[forum]: https://discourse.gohugo.io/
+[forum]: https://discourse.gohugo.io/
+[front matter]: /content-management/front-matter
+[Git submodule]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
+[hosting and deployment]: /hosting-and-deployment/
+[Install Git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
+[Install Hugo]: /installation/
+[Requesting Help]: https://discourse.gohugo.io/t/requesting-help/9132
+[Requesting Help]: https://discourse.gohugo.io/t/requesting-help/9132
+[site configuration]: /getting-started/configuration/
--- /dev/null
- weight: 40
- weight: 40
+---
+title: Basic usage
+description: Hugo's command line interface (CLI) is fully featured but simple to use, even for those with limited experience working from the command line.
+categories: [getting started]
+keywords: [usage,livereload,command,flags]
+menu:
+ docs:
+ parent: getting-started
++ weight: 30
++weight: 30
+aliases: [/overview/usage/,/extras/livereload/,/doc/usage/,/usage/]
+toc: true
+---
+
+## Test your installation
+
+After [installing] Hugo, test your installation by running:
+
+```bash
+hugo version
+```
+
+You should see something like:
+
+```text
+hugo v0.105.0-0e3b42b4a9bdeb4d866210819fc6ddcf51582ffa+extended linux/amd64 BuildDate=2022-10-28T12:29:05Z VendorInfo=snap:0.105.0
+```
+
+## Display available commands
+
+To see a list of the available commands and flags:
+
+```bash
+hugo help
+```
+
+To get help with a subcommand, use the `--help` flag. For example:
+
+```bash
+hugo server --help
+```
+
+## Build your site
+
+To build your site, `cd` into your project directory and run:
+
+```bash
+hugo
+```
+
+The [`hugo`] command builds your site, publishing the files to the `public` directory. To publish your site to a different directory, use the [`--destination`] flag or set [`publishDir`] in your site configuration.
+
+{{% note %}}
+Hugo does not clear the `public` directory before building your site. Existing files are overwritten, but not deleted. This behavior is intentional to prevent the inadvertent removal of files that you may have added to the `public` directory after the build.
+
+Depending on your needs, you may wish to manually clear the contents of the public directory before every build.
+{{% /note %}}
+
+## Draft, future, and expired content
+
+Hugo allows you to set `draft`, `date`, `publishDate`, and `expiryDate` in the [front matter] of your content. By default, Hugo will not publish content when:
+
+
+- The `draft` value is `true`
+- The `date` is in the future
+- The `publishDate` is in the future
+- The `expiryDate` is in the past
+
+You can override the default behavior when running `hugo` or `hugo server` with command line flags:
+
+```bash
+hugo --buildDrafts # or -D
+hugo --buildExpired # or -E
+hugo --buildFuture # or -F
+```
+
+Although you can also set these values in your site configuration, it can lead to unwanted results unless all content authors are aware of, and understand, the settings.
+
+{{% note %}}
+As noted above, Hugo does not clear the `public` directory before building your site. Depending on the _current_ evaluation of the four conditions above, after the build your `public` directory may contain extraneous files from a previous build.
+
+A common practice is to manually clear the contents of the `public` directory before each build to remove draft, expired, and future content.
+{{% /note %}}
+
+## Develop and test your site
+
+To view your site while developing layouts or creating content, `cd` into your project directory and run:
+
+```bash
+hugo server
+```
+
+The [`hugo server`] command builds your site into memory, and serves your pages using a minimal HTTP server. When you run `hugo server` it will display the URL of your local site:
+
+```text
+Web Server is available at http://localhost:1313/
+```
+
+While the server is running, it watches your project directory for changes to assets, configuration, content, data, layouts, translations, and static files. When it detects a change, the server rebuilds your site and refreshes your browser using [LiveReload].
+
+Most Hugo builds are so fast that you may not notice the change unless you are looking directly at your browser.
+
+### LiveReload
+
+While the server is running, Hugo injects JavaScript into the generated HTML pages. The LiveReload script creates a connection from the browser to the server via web sockets. You do not need to install any software or browser plugins, nor is any configuration required.
+
+### Automatic redirection
+
+When editing content, if you want your browser to automatically redirect to the page you last modified, run:
+
+```bash
+hugo server --navigateToChanged
+```
+
+## Deploy your site
+
+{{% note %}}
+As noted above, Hugo does not clear the public directory before building your site. Manually clear the contents of the public directory before each build to remove draft, expired, and future content.
+{{% /note %}}
+
+When you are ready to deploy your site, run:
+
+```bash
+hugo
+```
+
+This builds your site, publishing the files to the public directory. The directory structure will look something like this:
+
+```text
+public/
+├── categories/
+│ ├── index.html
+│ └── index.xml <-- RSS feed for this section
+├── post/
+│ ├── my-first-post/
+│ │ └── index.html
+│ ├── index.html
+│ └── index.xml <-- RSS feed for this section
+├── tags/
+│ ├── index.html
+│ └── index.xml <-- RSS feed for this section
+├── index.html
+├── index.xml <-- RSS feed for the site
+└── sitemap.xml
+```
+
+In a simple hosting environment, where you typically `ftp`, `rsync`, or `scp` your files to the root of a virtual host, the contents of the `public` directory are all that you need.
+
+Most of our users deploy their sites using a CI/CD workflow, where a push[^1] to their GitHub or GitLab repository triggers a build and deployment. Popular providers include [AWS Amplify], [CloudCannon], [Cloudflare Pages], [GitHub Pages], [GitLab Pages], and [Netlify].
+
+Learn more in the [hosting and deployment] section.
+
+[^1]: The Git repository contains the entire project directory, typically excluding the public directory because the site is built _after_ the push.
+
+[`--destination`]: /commands/hugo/#options
+[`hugo server`]: /commands/hugo_server/
+[`hugo`]: /commands/hugo/
+[`publishDir`]: /getting-started/configuration/#publishdir
+[AWS Amplify]: https://aws.amazon.com/amplify/
+[CloudCannon]: https://cloudcannon.com/
+[Cloudflare Pages]: https://pages.cloudflare.com/
+[commands]: /commands/
+[front matter]: /content-management/front-matter/
+[GitHub Pages]: https://pages.github.com/
+[GitLab Pages]: https://docs.gitlab.com/ee/user/project/pages/
+[hosting and deployment]: /hosting-and-deployment/
+[hosting]: /hosting-and-deployment/
+[installing]: /installation/
+[LiveReload]: https://github.com/livereload/livereload-js
+[Netlify]: https://www.netlify.com/
--- /dev/null
- title: Hosting & Deployment
- linktitle: Hosting & Deployment Overview
+---
- weight: 01
- weight: 01
++title: Hosting and deployment
++linkTitle: Overview
+description: Site builds, automated deployments, and popular hosting solutions.
+categories: [hosting and deployment]
+keywords: []
+menu:
+ docs:
++ identifier: hosting-and-deployment-overview
+ parent: hosting-and-deployment
++ weight: 1
++weight: 1
+---
+
+Because Hugo renders *static* websites, you can host your new Hugo website virtually anywhere. The following represent only a few of the more popular hosting and automated deployment solutions used by the Hugo community.
--- /dev/null
- title: Deployment with Rclone
+---
- weight: 80
- weight: 80
++title: Deploy with Rclone
+description: If you have access to your web host with SFTP/FTP/SSH/HTTP(DAV), you can use rclone to incrementally deploy your entire Hugo website.
+categories: [hosting and deployment]
+keywords: [rclone,sftp,deployment]
+menu:
+ docs:
+ parent: hosting-and-deployment
- ## Getting Started
+aliases: [/tutorials/deployment-with-rclone/]
+toc: true
+---
+
+## Assumptions
+
+* A web host running a web server. This could be a shared hosting environment or a VPS.
+* Access to your web host with any of the [protocols supported by rclone](https://rclone.org/#providers), such as SFTP.
+* A functional static website built with Hugo
+* Deploying from an [Rclone](https://rclone.org) compatible operating system
+* You have [installed Rclone](https://rclone.org/install/).
+
+**NB**: You can remove ``--interactive`` in the commands below once you are comfortable with rclone, if you wish. Also, ``--gc`` and ``--minify`` are optional in the ``hugo`` commands below.
+
- ## Configure Rclone for Even Easier Usage
++## Getting started
+
+The spoiler is that you can even deploy your entire website from any compatible OS with no configuration. Using SFTP for example:
+
+```txt
+hugo --gc --minify
+rclone sync --interactive --sftp-host sftp.example.com --sftp-user www-data --sftp-ask-password public/ :sftp:www/
+```
+
- The easiest way is simply to run ``rclone config``.
++## Configure Rclone for even easier usage
+
++The easiest way is simply to run `rclone config`.
+
+The [Rclone docs](https://rclone.org/docs/) provide [an example of configuring Rclone to use SFTP](https://rclone.org/sftp/).
+
+For the next commands, we will assume you configured a remote you named ``hugo-www``
+
+The above 'spoiler' commands could become:
+
+```txt
+hugo --gc --minify
+rclone sync --interactive public/ hugo-www:www/
+```
+
+After you issue the above commands (and respond to any prompts), check your website and you will see that it is deployed.
--- /dev/null
- title: Deployment with Rsync
+---
- weight: 70
- weight: 70
++title: Deploy with Rsync
+description: If you have access to your web host with SSH, you can use a simple rsync one-liner to incrementally deploy your entire Hugo website.
+categories: [hosting and deployment]
+keywords: [rsync,deployment]
+menu:
+ docs:
+ parent: hosting-and-deployment
- ## Copy Your SSH Key to your Host
+aliases: [/tutorials/deployment-with-rsync/]
+toc: true
+---
+
+## Assumptions
+
+* A web host running a web server. This could be a shared hosting environment or a VPS.
+* Access to your web host with SSH
+* A functional static website built with Hugo
+
+The spoiler is that you can deploy your entire website with a command that looks like the following:
+
+```txt
+hugo && rsync -avz --delete public/ www-data@ftp.topologix.fr:~/www/
+```
+
+As you will see, we'll put this command in a shell script file, which makes building and deployment as easy as executing `./deploy`.
+
- ## Shell Script
++## Copy Your SSH Key to your host
+
+To make logging in to your server more secure and less interactive, you can upload your SSH key. If you have already installed your SSH key to your server, you can move on to the next section.
+
+First, install the ssh client. On Debian distributions, use the following command:
+
+{{< code file="install-openssh.sh" >}}
+sudo apt-get install openssh-client
+{{< /code >}}
+
+Then generate your ssh key. First, create the `.ssh` directory in your home directory if it doesn't exist:
+
+```txt
+~$ cd && mkdir .ssh & cd .ssh
+```
+
+Next, execute this command to generate a new keypair called `rsa_id`:
+
+```txt
+~/.ssh/$ ssh-keygen -t rsa -q -C "For SSH" -f rsa_id
+```
+
+You'll be prompted for a passphrase, which is an extra layer of protection. Enter the passphrase you'd like to use, and then enter it again when prompted, or leave it blank if you don't want to have a passphrase. Not using a passphrase will let you transfer files non-interactively, as you won't be prompted for a password when you log in, but it is slightly less secure.
+
+To make logging in easier, add a definition for your web host to the file `~/.ssh/config` with the following command, replacing `HOST` with the IP address or hostname of your web host, and `USER` with the username you use to log in to your web host when transferring files:
+
+```txt
+~/.ssh/$ cat >> config <<EOF
+Host HOST
+ Hostname HOST
+ Port 22
+ User USER
+ IdentityFile ~/.ssh/rsa_id
+EOF
+```
+
+Then copy your ssh public key to the remote server with the `ssh-copy-id` command:
+
+```txt
+~/.ssh/$ ssh-copy-id -i rsa_id.pub USER@HOST.com
+```
+
+Now you can easily connect to the remote server:
+
+```txt
+~$ ssh user@host
+Enter passphrase for key '/home/mylogin/.ssh/rsa_id':
+```
+
+Now that you can log in with your SSH key, let's create a script to automate deployment of your Hugo site.
+
++## Shell script
+
+Create a new script called `deploy` the root of your Hugo tree:
+
+```txt
+~/websites/topologix.fr$ editor deploy
+```
+
+Add the following content. Replace the `USER`, `HOST`, and `DIR` values with your own values:
+
+```bash
+#!/bin/sh
+USER=my-user
+HOST=my-server.com
+DIR=my/directory/to/topologix.fr/ # the directory where your web site files should go
+
+hugo && rsync -avz --delete public/ ${USER}@${HOST}:~/${DIR} # this will delete everything on the server that's not in the local public folder
+
+exit 0
+```
+
+Note that `DIR` is the relative path from the remote user's home. If you have to specify a full path (for instance `/var/www/mysite/`) you must change `~/${DIR}` to `${DIR}` inside the command-line. For most cases you should not have to.
+
+Save and close, and make the `deploy` file executable:
+
+```txt
+~/websites/topologix.fr$ chmod +x deploy
+```
+
+Now you only have to enter the following command to deploy and update your website:
+
+```txt
+~/websites/topologix.fr$ ./deploy
+```
+
+Your site builds and deploys:
+
+```txt
+Started building sites ...
+Built site for language en:
+0 draft content
+0 future content
+0 expired content
+5 pages created
+0 non-page files copied
+0 paginator pages created
+0 tags created
+0 categories created
+total in 56 ms
+sending incremental file list
+404.html
+index.html
+index.xml
+sitemap.xml
+posts/
+posts/index.html
+
+sent 9,550 bytes received 1,708 bytes 7,505.33 bytes/sec
+total size is 966,557 speedup is 85.86
+```
+
+You can incorporate other proprocessing tasks into this deployment script as well.
--- /dev/null
- weight: 10
- weight: 10
+---
+title: Host on 21YunBox
+description: Host your Hugo site with 21YunBox's blazing fast Chinese CDN, fully-managed SSL and auto deploys from Gitee.
+categories: [hosting and deployment]
+keywords: [21yunbox,hosting,deployment]
+menu:
+ docs:
+ parent: hosting-and-deployment
+toc: true
+---
+
+[21YunBox](https://www.21yunbox.com) is a fully-managed cloud platform dedicated to make web deployment easy within the Chinese Great Firewall where you can host static sites, backend APIs, databases, cron jobs, and all your other apps in one place. It provides blazing fast Chinese CDN, continuous deployment, one-click HTTPS and [other services like managed databases and backend web services](https://www.21yunbox.com/docs/), providing an avenue to launch web projects in China.
+
+21YunBox includes the following features:
+
+- Continuous, automatic builds & deploys from GitHub and Gitee
+- Automatic SSL certificates through [Let's Encrypt](https://letsencrypt.org)
+- Instant cache invalidation with a blazing fast, Chinese CDN
+- Unlimited [custom domains](https://www.21yunbox.com/docs/#/custom-domains)
+- Automatic [Brotli compression](https://en.wikipedia.org/wiki/Brotli) for faster sites
+- Native HTTP/2 support
+- Automatic HTTP → HTTPS redirects
+- Custom URL redirects and rewrites
+
+## Prerequisites
+
+This guide assumes you already have a Hugo project to deploy. If you need a project, use the [Quick Start](/getting-started/quick-start/) to get started or fork 21YunBox's [Hugo Example](https://gitee.com/eryiyunbox-examples/hello-hugo) before continuing.
+
+## Setup
+
+You can set up a Hugo site on 21YunBox in two quick steps:
+
+1. Create a new web service on 21YunBox, and give 21YunBox permission to access your GitHub or Gitee repo.
+2. Use the following values during creation:
+
+ | Field | Value |
+ | --------------------- | ------------------------------------------------ |
+ | **Environment** | `Static Site` |
+ | **Build Command** | `hugo --gc --minify` (or your own build command) |
+ | **Publish Directory** | `./public` (or your own output directory) |
+
+That's it! Your site will be live on your 21YunBox URL (which looks like `yoursite.21yunbox.com`) as soon as the build is done.
+
+## Continuous deploys
+
+Now that 21YunBox is connected to your repo, it will automatically build and publish your site any time you push to GitHub.
+
+Every deploy automatically and instantly invalidates the CDN cache, so your users can always access the latest content on your site.
+
+## Custom domains
+
+Add your own domains to your site easily using 21YunBox's [custom domains](https://www.21yunbox.com/docs/#/custom-domains) guide.
+
+## Support
+
+Click [here](https://www.21yunbox.com/docs/#/contact) to contact with 21YunBox' experts if you need help.
--- /dev/null
- weight: 10
- weight: 10
+---
+title: Host on AWS Amplify
+description: Develop and deploy a cloud-powered web app with AWS Amplify.
+categories: [hosting and deployment]
+keywords: [amplify,hosting,deployment]
+menu:
+ docs:
+ parent: hosting-and-deployment
+toc: true
+---
+
+In this guide we'll walk through how to deploy and host your Hugo site using the [AWS Amplify Console](https://console.amplify.aws).
+
+AWS Amplify is a combination of client library, CLI toolchain, and a Console for continuous deployment and hosting. The Amplify CLI and library allow developers to get up & running with full-stack cloud-powered applications with features like authentication, storage, serverless GraphQL or REST APIs, analytics, Lambda functions, & more. The Amplify Console provides continuous deployment and hosting for modern web apps (single page apps and static site generators). Continuous deployment allows developers to deploy updates to their web app on every code commit to their Git repository. Hosting includes features such as globally available CDNs, easy custom domain setup + HTTPS, feature branch deployments, and password protection.
+
+## Pre-requisites
+
+* [Sign up for an AWS Account](https://portal.aws.amazon.com/billing/signup?redirect_url=https%3A%2F%2Faws.amazon.com%2Fregistration-confirmation). There are no upfront charges or any term commitments to create an AWS account and signing up gives you immediate access to the AWS Free Tier.
+* You have an account with GitHub, GitLab, or Bitbucket.
+* You have completed the [Quick Start] or have a Hugo website you are ready to deploy and share with the world.
+
+## Hosting
+
+1. Log in to the [AWS Amplify Console](https://console.aws.amazon.com/amplify/home) and choose Get Started under Deploy.
+ 
+
+1. Connect a branch from your GitHub, Bitbucket, GitLab, or AWS CodeCommit repository. Connecting your repository allows Amplify to deploy updates on every code commit to a branch.
+ 
+
+1. Accept the default build settings. The Amplify Console automatically detects your Hugo build settings and output directory.
+ 
+
+1. Review your changes and then choose **Save and deploy**. The Amplify Console will pull code from your repository, build changes to the backend and frontend, and deploy your build artifacts at `https://master.unique-id.amplifyapp.com`. Bonus: Screenshots of your app on different devices to find layout issues.
+
+## Using a newer version of Hugo
+
+If you need to use a different, perhaps newer, version of Hugo than the version currently supported by AWS Amplify:
+
+1. Visit the [AWS Amplify Console](https://console.aws.amazon.com/amplify/home), and click the app you would like to modify
+1. In the side navigation bar, Under App Settings, click **Build settings**
+1. On the Build settings page, near the bottom, there is a section called **Build image settings**. Click **Edit**
+1. Under **Live package updates**, click **Add package version override**
+1. From the selection, click **Hugo** and ensure the version field says `latest`
+1. Click **Save** to save the changes.
+
+[Quick Start]: /getting-started/quick-start/
--- /dev/null
- title: Hosting on Azure Static Web Apps
- description: Learn how to deploy a Hugo application to Azure Static Web Apps.
+---
- weight: 200
- weight: 200
++title: Host on Azure Static Web Apps
++description: Publish a Hugo site to Azure Static Web Apps.
+categories: [hosting and deployment]
+keywords: [hosting,Azure Static Web Apps]
+menu:
+ docs:
+ parent: hosting-and-deployment
+toc: true
+---
+
+You can create and deploy a Hugo web application to Azure Static Web Apps. The final result is a new Azure Static Web App with associated GitHub Actions that give you control over how the app is built and published. You'll learn how to create a Hugo app, set up an Azure Static Web App and deploy the Hugo app to Azure.
+
+Here's the tutorial on how to [Publish a Hugo site to Azure Static Web Apps](https://docs.microsoft.com/en-us/azure/static-web-apps/publish-hugo).
--- /dev/null
- weight: 50
- weight: 50
+---
+title: Host on Cloudflare Pages
+description: Cloudflare Pages can host your Hugo site with CDN, continuous deployment, 1-click HTTPS, an admin GUI, and its own environment variables.
+categories: [hosting and deployment]
+menu:
+ docs:
+ parent: hosting-and-deployment
+toc: true
+---
+
+[Cloudflare Pages](https://developers.cloudflare.com/pages/) are super fast, always up-to-date, and deployed directly from your [Git provider](https://developers.cloudflare.com/pages/get-started/#connect-your-git-provider-to-pages).
+
+Cloudflare Pages docs have a detailed tutorial on [how to deploy a Hugo site](https://developers.cloudflare.com/pages/framework-guides/deploy-a-hugo-site/).
--- /dev/null
- weight: 20
- weight: 20
+---
+title: Host on Firebase
+description: You can use Firebase's free tier to host your static website; this also gives you access to Firebase's NOSQL API.
+categories: [hosting and deployment]
+keywords: [hosting,firebase]
+menu:
+ docs:
+ parent: hosting-and-deployment
- ## Manual Deploy
+toc: true
+---
+
+## Assumptions
+
+1. You have an account with [Firebase][signup]. (If you don't, you can sign up for free using your Google account.)
+2. You have completed the [Quick Start] or have a completed Hugo website ready for deployment.
+
+## Initial setup
+
+Go to the [Firebase console][console] and create a new project (unless you already have a project). You will need to globally install `firebase-tools` (node.js):
+
+```txt
+npm install -g firebase-tools
+```
+
+Log in to Firebase (setup on your local machine) using `firebase login`, which opens a browser where you can select your account. Use `firebase logout` in case you are already logged in but to the wrong account.
+
+
+```txt
+firebase login
+```
+
+In the root of your Hugo project, initialize the Firebase project with the `firebase init` command:
+
+```txt
+firebase init
+```
+
+From here:
+
+1. Choose Hosting in the feature question
+2. Choose the project you just set up
+3. Accept the default for your database rules file
+4. Accept the default for the publish directory, which is `public`
+5. Choose "No" in the question if you are deploying a single-page app
+
+## Using Firebase & GitHub CI/CD
+
+In new versions of Firebase, some other questions apply:
+
+6. Set up automatic builds and deploys with GitHub?
+
+Here you will be redirected to login in your GitHub account to get permissions. Confirm.
+
+7. For which GitHub repository would you like to set up a GitHub workflow? (format: user/repository)
+
+Include the repository you will use in the format above (Account/Repo)
+Firebase script with retrive credentials, create a service account you can later manage in your GitHub settings.
+
+8. Set up the workflow to run a build script before every deploy?
+
+Here is your opportunity to include some commands before you run the deploy.
+
+9. Set up automatic deployment to your site's live channel when a PR is merged?
+
+You can let in the default option (main)
+
+After that Firebase has been set in your project with CI/CD. After that run:
+
+```
+hugo && firebase deploy
+```
+
+With this you will have the app initialized manually. After that you can manage and fix your GitHub workflow from: https://github.com/your-account/your-repo/actions
+
+Don't forget to update your static pages before push!
+
- ## CI Setup (Other tools)
++## Manual deploy
+
+To deploy your Hugo site, execute the `firebase deploy` command, and your site will be up in no time:
+
+```txt
+hugo && firebase deploy
+```
+
++## CI setup (other tools)
+
+You can generate a deploy token using
+
+```txt
+firebase login:ci
+```
+
+You can also set up your CI and add the token to a private variable like `$FIREBASE_DEPLOY_TOKEN`.
+
+{{% note %}}
+This is a private secret and it should not appear in a public repository. Make sure you understand your chosen CI and that it's not visible to others.
+{{% /note %}}
+
+You can then add a step in your build to do the deployment using the token:
+
+```txt
+firebase deploy --token $FIREBASE_DEPLOY_TOKEN
+```
+
+## Reference links
+
+* [Firebase CLI Reference](https://firebase.google.com/docs/cli/#administrative_commands)
+
+[console]: https://console.firebase.google.com/
+[Quick Start]: /getting-started/quick-start/
+[signup]: https://console.firebase.google.com/
--- /dev/null
- title: Host on GitHub
+---
- weight: 30
- weight: 30
++title: Host on GitHub Pages
+description: Deploy Hugo as a GitHub Pages project or personal/organizational site and automate the whole process with Github Actions
+categories: [hosting and deployment]
+keywords: [github,git,deployment,hosting]
+menu:
+ docs:
+ parent: hosting-and-deployment
- HUGO_VERSION: 0.111.3
+toc: true
+aliases: [/tutorials/github-pages-blog/]
+---
+
+GitHub provides free and fast static hosting over SSL for personal, organization, or project pages directly from a GitHub repository via its GitHub Pages service and automating development workflows and build with GitHub Actions.
+
+## Prerequisites
+
+1. [Create a GitHub account]
+2. [Install Git]
+3. [Create a Hugo site] and test it locally with `hugo server`.
+
+[Create a GitHub account]: https://github.com/signup
+[Install Git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
+[Create a Hugo site]: /getting-started/quick-start/
+
+## Types of sites
+
+There are three types of GitHub Pages sites: project, user, and organization. Project sites are connected to a specific project hosted on GitHub. User and organization sites are connected to a specific account on GitHub.com.
+
+{{% note %}}
+See the [GitHub Pages documentation] to understand the requirements for repository ownership and naming.
+
+[GitHub Pages documentation]: https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#types-of-github-pages-sites
+{{% /note %}}
+
+
+[GitHub Pages documentation]: https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages#types-of-github-pages-sites
+
+## Procedure
+
+Step 1
+: Create a GitHub repository.
+
+Step 2
+: Push your local repository to GitHub.
+
+Step 3
+: Visit your GitHub repository. From the main menu choose **Settings** > **Pages**. In then center of your screen you will see this:
+
+
+{style="max-width: 280px"}
+
+Step 4
+: Change the **Source** to `GitHub Actions`. The change is immediate; you do not have to press a Save button.
+
+
+{style="max-width: 280px"}
+
+Step 5
+: Create an empty file in your local repository.
+
+```text
+.github/workflows/hugo.yaml
+```
+
+Step 6
+: Copy and paste the YAML below into the file you created. Change the branch name and Hugo version as needed.
+
+{{< code file=".github/workflows/hugo.yaml" >}}
+# Sample workflow for building and deploying a Hugo site to GitHub Pages
+name: Deploy Hugo site to Pages
+
+on:
+ # Runs on pushes targeting the default branch
+ push:
+ branches:
+ - main
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
+# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
+concurrency:
+ group: "pages"
+ cancel-in-progress: false
+
+# Default to bash
+defaults:
+ run:
+ shell: bash
+
+jobs:
+ # Build job
+ build:
+ runs-on: ubuntu-latest
+ env:
- - name: Install Dart Sass Embedded
- run: sudo snap install dart-sass-embedded
++ HUGO_VERSION: 0.115.1
+ steps:
+ - name: Install Hugo CLI
+ run: |
+ wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
+ && sudo dpkg -i ${{ runner.temp }}/hugo.deb
++ - name: Install Dart Sass
++ run: sudo snap install dart-sass
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ submodules: recursive
+ fetch-depth: 0
+ - name: Setup Pages
+ id: pages
+ uses: actions/configure-pages@v3
+ - name: Install Node.js dependencies
+ run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
+ - name: Build with Hugo
+ env:
+ # For maximum backward compatibility with Hugo modules
+ HUGO_ENVIRONMENT: production
+ HUGO_ENV: production
+ run: |
+ hugo \
+ --gc \
+ --minify \
+ --baseURL "${{ steps.pages.outputs.base_url }}/"
+ - name: Upload artifact
+ uses: actions/upload-pages-artifact@v1
+ with:
+ path: ./public
+
+ # Deployment job
+ deploy:
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ runs-on: ubuntu-latest
+ needs: build
+ steps:
+ - name: Deploy to GitHub Pages
+ id: deployment
+ uses: actions/deploy-pages@v2
+{{< /code >}}
+
+Step 7
+: Commit the change to your local repository with a commit message of something like "Add workflow", and push to GitHub.
+
+Step 8
+: From GitHub's main menu, choose **Actions**. You will see something like this:
+
+
+{style="max-width: 350px"}
+
+Step 9
+: When GitHub has finished building and deploying your site, the color of the status indicator will change to green.
+
+
+{style="max-width: 350px"}
+
+Step 10
+: Click on the commit message as shown above. You will see this:
+
+
+{style="max-width: 611px"}
+
+Under the deploy step, you will see a link to your live site.
+
+In the future, whenever you push a change from your local repository, GitHub will rebuild your site and deploy the changes.
+
+## Additional resources
+
+- [Learn more about GitHub Actions](https://docs.github.com/en/actions)
+- [Caching dependencies to speed up workflows](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows)
+- [Manage a custom domain for your GitHub Pages site](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/about-custom-domains-and-github-pages)
--- /dev/null
- title: Host on GitLab
+---
- weight: 40
- weight: 40
++title: Host on GitLab Pages
+description: GitLab makes it easy to build, deploy, and host your Hugo website via their free GitLab Pages service, which provides native support for Hugo.
+categories: [hosting and deployment]
+keywords: [hosting,deployment,git,gitlab]
+menu:
+ docs:
+ parent: hosting-and-deployment
- image: registry.gitlab.com/pages/hugo/hugo_extended:latest
-
+toc: true
+aliases: [/tutorials/hosting-on-gitlab/]
+---
+
+## Assumptions
+
+* Working familiarity with Git for version control
+* Completion of the Hugo [Quick Start]
+* A [GitLab account](https://gitlab.com/users/sign_in)
+* A Hugo website on your local machine that you are ready to publish
+
+## BaseURL
+
+The `baseURL` in your [site configuration](/getting-started/configuration/) must reflect the full URL of your GitLab pages repository if you are using the default GitLab Pages URL (e.g., `https://<YourUsername>.gitlab.io/<your-hugo-site>/`) and not a custom domain.
+
+## Configure GitLab CI/CD
+
+Define your [CI/CD](https://docs.gitlab.com/ee/ci/quick_start/) jobs by creating a `.gitlab-ci.yml` file in the root of your project.
+
+{{< code file=".gitlab-ci.yml" >}}
- - hugo
+variables:
++ DART_SASS_VERSION: 1.63.6
++ HUGO_VERSION: 0.115.3
++ NODE_VERSION: 20.x
++ GIT_DEPTH: 0
++ GIT_STRATEGY: clone
+ GIT_SUBMODULE_STRATEGY: recursive
++ TZ: America/Los_Angeles
++
++image:
++ name: golang:1.20.6-bookworm
+
+pages:
+ script:
- - public
++ # Install brotli
++ - apt-get update
++ - apt-get install -y brotli
++ # Install Dart Sass
++ - curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
++ - tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
++ - cp -r dart-sass/* /usr/local/bin
++ - rm -rf dart-sass*
++ # Install Hugo
++ - curl -LJO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
++ - apt-get install -y ./hugo_extended_${HUGO_VERSION}_linux-amd64.deb
++ - rm hugo_extended_${HUGO_VERSION}_linux-amd64.deb
++ # Install Node.js
++ - curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
++ - apt-get install -y nodejs
++ # Install Node.js dependencies
++ - "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
++ # Build
++ - hugo --gc --minify
++ # Compress
++ - find public -type f -regex '.*\.\(css\|html\|js\|txt\|xml\)$' -exec gzip -f -k {} \;
++ - find public -type f -regex '.*\.\(css\|html\|js\|txt\|xml\)$' -exec brotli -f -k {} \;
+ artifacts:
+ paths:
- - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- {{< /code >}}
-
- {{% note %}}
- See [this list](https://gitlab.com/pages/hugo/container_registry) if you wish to use a particular Hugo version to build your site.
- {{% /note %}}
++ - public
+ rules:
++ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
++{{% /code %}}
+
+## Push your Hugo website to GitLab
+
+Next, create a new repository on GitLab. It is *not* necessary to make the repository public. In addition, you might want to add `/public` to your .gitignore file, as there is no need to push compiled assets to GitLab or keep your output website in version control.
+
+```bash
+# initialize new git repository
+git init
+
+# add /public directory to our .gitignore file
+echo "/public" >> .gitignore
+
+# commit and push code to master branch
+git add .
+git commit -m "Initial commit"
+git remote add origin https://gitlab.com/YourUsername/your-hugo-site.git
+git push -u origin master
+```
+
+## Wait for your page to build
+
+That's it! You can now follow the CI agent building your page at `https://gitlab.com/<YourUsername>/<your-hugo-site>/pipelines`.
+
+After the build has passed, your new website is available at `https://<YourUsername>.gitlab.io/<your-hugo-site>/`.
+
+## Next steps
+
+GitLab supports using custom CNAME's and TLS certificates. For more details on GitLab Pages, see the [GitLab Pages setup documentation](https://about.gitlab.com/2016/04/07/gitlab-pages-setup/).
+
+[Quick Start]: /getting-started/quick-start/
--- /dev/null
- title: "Host on KeyCDN"
+---
- weight: 40
++title: Host on KeyCDN
+description: "Accelerate your Hugo site globally with a KeyCDN integration. This tutorial shows you how to set up your static site as a GitLab page behind a KeyCDN pull zone."
+categories: [hosting and deployment]
+keywords: [keycdn,hosting,deployment,cdn]
+menu:
+ docs:
+ parent: hosting-and-deployment
- ## Push Your Changes to GitLab
+---
+
+[KeyCDN](https://www.keycdn.com/) provides a multitude of features to help accelerate and secure your Hugo site globally including Brotli compression, Let's Encrypt support, Origin Shield, and more.
+
+## Assumptions
+
+- You already have a Hugo page configured
+- You have a GitLab account
+- You have a KeyCDN account
+
+## Create a KeyCDN Pull Zone
+
+The first step will be to log in to your KeyCDN account and create a new zone. Name this whatever you like and select the [Pull Zone](https://www.keycdn.com/support/create-a-pull-zone/) option. As for the origin URL, your site will be running on [GitLab Pages](https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html) with a URL of `https://youruser.gitlab.io/reponame/`. Use this as the Origin URL.
+
+
+
+While the origin location doesn’t exist yet, you will need to use your new Zone URL address (or [Zone Alias](https://www.keycdn.com/support/create-a-zone-alias/)) in the `.gitlab-ci.yml` file that will be uploaded to your GitLab project.
+
+Ensure that you use your Zone URL or Zone alias as the `BASEURL` variable in the example below. This will be the user-visible website address.
+
+## Configure Your .gitlab-ci.yml File
+
+Your `.gitlab-ci.yml` file should look similar to the example below. Be sure to modify any variables that are specific to your setup.
+
+```yml
+image: alpine:latest
+
+variables:
+ BASEURL: "https://cipull-7bb7.kxcdn.com/"
+ HUGO_VERSION: "0.26"
+ HUGO_CHECKSUM: "67e4ba5ec2a02c8164b6846e30a17cc765b0165a5b183d5e480149baf54e1a50"
+ KEYCDN_ZONE_ID: "75544"
+
+before_script:
+ - apk update
+ - apk add curl
+
+pages:
+ stage: deploy
+ script:
+ - apk add git
+ - git submodule update --init
+ - curl -sSL https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz -o /tmp/hugo.tar.gz
+ - echo "${HUGO_CHECKSUM} /tmp/hugo.tar.gz" | sha256sum -c
+ - tar xf /tmp/hugo.tar.gz hugo -C /tmp/ && cp /tmp/hugo /usr/bin
+ - hugo --baseURL ${BASEURL}
+ - curl "https://api.keycdn.com/zones/purge/${KEYCDN_ZONE_ID}.json" -u "${KEYCDN_API_KEY}:"
+ artifacts:
+ paths:
+ - public
+ only:
+ - master
+
+```
+Using this integration method, you will have to specify the Zone ID and your [KeyCDN API](https://www.keycdn.com/api) key as secret variables. To do this, navigate to the top-left menu bar in GitLab and select Projects. Then, select your project and click on the Settings page. Finally, select Pipelines from the sub-menu and scroll down to the Secret Variable section.
+
+The Secret Variable for your Zone ID should look similar to:
+
+
+
+While the Secret Variable for your API Key will look similar to:
+
+
+
+The Zone ID and API key are used to purge your zone – it’s not strictly needed but otherwise, the CDN might deliver older versions of your assets for quite a while.
+
++## Push your changes to GitLab
+
+Now it’s time to push the newly created repository to GitLab:
+
+```bash
+git remote add origin git@gitlab.com:youruser/ci-example.git
+git push -u origin master
+```
+
+You can watch the progress and CI job output in your GitLab project under “Pipelines”.
+
+After verifying your CI job ran without issues, first check that your GitLab page shows up under `https://youruser.gitlab.io/reponame/` (it might look broken depending on your browser settings as all links point to your KeyCDN zone – don’t worry about that) and then by heading to whatever Zone alias / Zone URL you defined.
+
+To learn more about Hugo hosting options with KeyCDN, check out the complete [Hugo hosting with KeyCDN integration guide](https://www.keycdn.com/support/hugo-hosting/).
--- /dev/null
- weight: 10
- weight: 10
+---
+title: Host on Netlify
+description: Netlify can host your Hugo site with CDN, continuous deployment, 1-click HTTPS, an admin GUI, and its own CLI.
+categories: [hosting and deployment]
+keywords: [netlify,hosting,deployment]
+menu:
+ docs:
+ parent: hosting-and-deployment
- Once selected, you'll be brought to a screen for basic setup. Here you can select the branch you want to publish, your [build command], and your publish (i.e. deploy) directory. The publish directory should mirror that of what you've set in your [site configuration][config], the default of which is `public`. The following steps assume you are publishing from the `master` branch.
+toc: true
+---
+
+[Netlify][netlify] provides continuous deployment services, global CDN, ultra-fast DNS, atomic deploys, instant cache invalidation, one-click SSL, a browser-based interface, a CLI, and many other features for managing your Hugo website.
+
+## Assumptions
+
+* You have an account with GitHub, GitLab, or Bitbucket.
+* You have completed the [Quick Start] or have a Hugo website you are ready to deploy and share with the world.
+* You do not already have a Netlify account.
+
+## Create a Netlify account
+
+Go to [app.netlify.com] and select your preferred signup method. This will likely be a hosted Git provider, although you also have the option to sign up with an email address.
+
+The following examples use GitHub, but other git providers will follow a similar process.
+
+
+
+Selecting GitHub will bring up an authorization modal for authentication. Select "Authorize application."
+
+
+
+## Create a new site with continuous deployment
+
+You're now already a Netlify member and should be brought to your new dashboard. Select "New site from git."
+
+
+
+Netlify will then start walking you through the steps necessary for continuous deployment. First, you'll need to select your git provider again, but this time you are giving Netlify added permissions to your repositories.
+
+
+
+And then again with the GitHub authorization modal:
+
+
+
+Select the repo you want to use for continuous deployment. If you have a large number of repositories, you can filter through them in real time using repo search:
+
+
+
- ## Build and Deploy Site
++Once selected, you'll be brought to a screen for basic setup. Here you can select the branch you want to publish, your [build command], and your publish (i.e. deploy) directory. The publish directory should mirror that of what you've set in your [site configuration], the default of which is `public`. The following steps assume you are publishing from the `master` branch.
+
+## Configure Hugo version in Netlify
+
+You can [set Hugo version](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) for your environments in `netlify.toml` file or set `HUGO_VERSION` as a build environment variable in the Netlify console.
+
+For production:
+
+{{< code file="netlify.toml" >}}
+[context.production.environment]
+ HUGO_VERSION = "0.99.1"
+{{< /code >}}
+
+For testing:
+
+{{< code file="netlify.toml" >}}
+[context.deploy-preview.environment]
+ HUGO_VERSION = "0.99.1"
+{{< /code >}}
+
+The Netlify configuration file can be a little hard to understand and get right for the different environment, and you may get some inspiration and tips from this site's `netlify.toml`:
+
+{{< readfile file="netlify.toml" highlight="toml" >}}
+
- ## Use Hugo Themes with Netlify
++## Build and deploy site
+
+In the Netlify console, selecting "Deploy site" will immediately take you to a terminal for your build:.
+
+
+
+Once the build is finished---this should only take a few seconds--you should now see a "Hero Card" at the top of your screen letting you know the deployment is successful. The Hero Card is the first element that you see in most pages. It allows you to see a quick summary of the page and gives access to the most common/pertinent actions and information. You'll see that the URL is automatically generated by Netlify. You can update the URL in "Settings."
+
+
+
+
+
+[Visit the live site][visit].
+
+Now every time you push changes to your hosted git repository, Netlify will rebuild and redeploy your site.
+
+See [this blog post](https://www.netlify.com/blog/2017/04/11/netlify-plus-hugo-0.20-and-beyond/) for more details about how Netlify handles Hugo versions.
+
- ## Next Steps
++## Use Hugo themes with Netlify
+
+The `git clone` method for installing themes is not supported by Netlify. If you were to use `git clone`, it would require you to recursively remove the `.git` subdirectory from the theme folder and would therefore prevent compatibility with future versions of the theme.
+
+A *better* approach is to install a theme as a proper git submodule. You can [read the GitHub documentation for submodules][ghsm] or those found on [Git's website][gitsm] for more information, but the command is similar to that of `git clone`:
+
+```txt
+cd themes
+git submodule add https://github.com/<THEMECREATOR>/<THEMENAME>
+```
+
+It is recommended to only use stable versions of a theme (if it’s versioned) and always check the changelog. This can be done by checking out a specific release within the theme's directory.
+
+Switch to the theme's directory and list all available versions:
+
+```txt
+cd themes/<theme>
+git tag
+# exit with q
+```
+
+You can checkout a specific version as follows:
+
+```txt
+git checkout tags/<version-name>
+```
+
+You can update a theme to the latest version by executing the following command in the *root* directory of your project:
+
+```txt
+git submodule update --rebase --remote
+```
+
- [config]: /getting-started/configuration/
++## Next steps
+
+You now have a live website served over HTTPS, distributed through CDN, and configured for continuous deployment. Dig deeper into the Netlify documentation:
+
+1. [Using a Custom Domain]
+2. [Setting up HTTPS on Custom Domains][httpscustom]
+3. [Redirects and Rewrite Rules]
+
+[app.netlify.com]: https://app.netlify.com
+[build command]: /getting-started/usage/#build-your-site
++[site configuration]: /getting-started/configuration/
+[ghsm]: https://github.com/blog/2104-working-with-submodules
+[gitsm]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
+[httpscustom]: https://www.netlify.com/docs/ssl/
+[hugoversions]: https://github.com/netlify/build-image/blob/master/Dockerfile#L216
+[netlify]: https://www.netlify.com/
+[netlifysignup]: https://app.netlify.com/signup
+[Quick Start]: /getting-started/quick-start/
+[Redirects and Rewrite Rules]: https://www.netlify.com/docs/redirects/
+[Using a Custom Domain]: https://www.netlify.com/docs/custom-domains/
+[visit]: https://hugo-netlify-example.netlify.com
--- /dev/null
- weight: 10
- weight: 10
+---
+title: Host on Render
+description: Host your Hugo site for free with Render's global CDN, fully-managed SSL and auto deploys from GitHub.
+categories: [hosting and deployment]
+keywords: [hosting,deployment]
+menu:
+ docs:
+ parent: hosting-and-deployment
- ## Continuous Deploys
+toc: true
+---
+
+## Introduction
+
+[Render](https://render.com) is a fully-managed cloud platform where you can host static sites, backend APIs, databases, cron jobs, and all your other apps in one place.
+
+Static sites are **completely free** on Render and include the following:
+
+- Continuous, automatic builds & deploys from [GitHub](https://render.com/docs/github) and [GitLab](https://render.com/docs/gitlab).
+- Automatic SSL certificates through [Let's Encrypt](https://letsencrypt.org).
+- Instant cache invalidation with a lightning fast, global CDN.
+- Unlimited collaborators.
+- Unlimited [custom domains](https://render.com/docs/custom-domains).
+- Automatic [Brotli compression](https://en.wikipedia.org/wiki/Brotli) for faster sites.
+- Native HTTP/2 support.
+- [Pull Request Previews](https://render.com/docs/pull-request-previews).
+- Automatic HTTP → HTTPS redirects.
+- Custom URL redirects and rewrites.
+
+## Assumptions
+
+- You have an account with GitHub or GitLab.
+- You have completed the [Quick Start] or have a Hugo website you are ready to deploy and share with the world.
+- You have a Render account. You can sign up at https://render.com/register.
+
+## Deployment
+
+You can set up a Hugo site on Render in two quick steps:
+
+1. Create a new **Static Site** on Render, and give Render permission to access your GitHub/GitLab repo.
+2. Use the following values during creation:
+
+ Field | Value
+ ------------------- | -------------------
+ **Build Command** | `hugo --gc --minify` (or your own build command)
+ **Publish Directory** | `public` (or your own output directory)
+
+That's it! Your site will be live on your Render URL (which looks like `yoursite.onrender.com`) as soon as the build is done.
+
- ## CDN and Cache Invalidation
++## Continuous deploys
+
+Now that Render is connected to your repo, it will **automatically build and publish your site** any time you push to your GitHub/GitLab.
+
+You can choose to disable auto deploys under the **Settings** section for your site and deploy it manually from the Render dashboard.
+
- ## Custom Domains
++## CDN and cache invalidation
+
+Render hosts your site on a global, lightning fast CDN which ensures the fastest possible download times for all your users across the globe.
+
+Every deploy automatically and instantly invalidates the CDN cache, so your users can always access the latest content on your site.
+
- ## Pull Request Previews
++## Custom domains
+
+Add your own domains to your site easily using Render's [custom domains](https://render.com/docs/custom-domains) guide.
+
- ## Hugo Themes
++## Pull Request previews
+
+With Pull Request (PR) previews, you can visualize changes introduced in a pull request instead of simply relying on code reviews.
+
+Once enabled, every PR for your site will automatically generate a new static site based on the code in the PR. It will have its own URL, and it will be deleted automatically when the PR is closed.
+
+Read more about [Pull Request Previews](https://render.com/docs/pull-request-previews) on Render.
+
++## Hugo themes
+
+Render automatically downloads all Git submodules defined in your Git repo on every build. This way Hugo themes added as submodules work as expected.
+
+## Support
+
+Chat with Render developers at https://render.com/chat or email `support@render.com` if you need help.
+
+[Quick Start]: /getting-started/quick-start/
--- /dev/null
- weight: 2
- weight: 2
+---
+title: Hugo Deploy
+description: You can upload your site to GCS, S3, or Azure using the Hugo CLI.
+categories: [hosting and deployment]
+keywords: [s3,gcs,azure,hosting,deployment]
+menu:
+ docs:
+ parent: hosting-and-deployment
++ weight: 20
++weight: 20
+toc: true
+---
+
+You can use the "hugo deploy" command to upload your site directly to a Google Cloud Storage (GCS) bucket, an AWS S3 bucket, and/or an Azure Storage container.
+
+## Assumptions
+
+* You have completed the [Quick Start] or have a Hugo website you are ready to deploy and share with the world.
+* You have an account with the service provider ([Google Cloud](https://cloud.google.com/), [AWS](https://aws.amazon.com), or [Azure](https://azure.microsoft.com)) that you want to deploy to.
+* You have authenticated.
+ * Google Cloud: [Install the CLI](https://cloud.google.com/sdk) and run [`gcloud auth login`](https://cloud.google.com/sdk/gcloud/reference/auth/login).
+ * AWS: [Install the CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) and run [`aws configure`](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html).
+ * Azure: [Install the CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) and run [`az login`](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli).
+ * NOTE: Each service supports alternatives for authentication, including using environment variables. See [here](https://gocloud.dev/howto/blob/#services) for more details.
+
+## Create a bucket to deploy to
+
+Create a storage bucket to deploy your site to. If you want your site to be
+public, be sure to configure the bucket to be publicly readable.
+
+### Google Cloud Storage (GCS)
+
+Follow the [GCS instructions for how to create a bucket](https://cloud.google.com/storage/docs/creating-buckets).
+
+### AWS S3
+
+Follow the [AWS instructions for how to create a bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/CreatingABucket.html).
+
+### Azure Storage
+
+Follow the [Azure instructions for how to create a storage container](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-portal).
+
+## Configure the deployment
+
+In the configuration file for your site, add a `[deployment]` section with one
+or more `[[deployment.targets]]` section, one for each deployment target. Here's
+a detailed example:
+
+```toml
+[deployment]
+# By default, files are uploaded in an arbitrary order.
+# Files that match the regular expressions in the "Order" list
+# will be uploaded first, in the listed order.
+order = [".jpg$", ".gif$"]
+
+
+[[deployment.targets]]
+# An arbitrary name for this target.
+name = "mydeployment"
+# The Go Cloud Development Kit URL to deploy to. Examples:
+# GCS; see https://gocloud.dev/howto/blob/#gcs
+# URL = "gs://<Bucket Name>"
+
+# S3; see https://gocloud.dev/howto/blob/#s3
+# For S3-compatible endpoints, see https://gocloud.dev/howto/blob/#s3-compatible
+# URL = "s3://<Bucket Name>?region=<AWS region>"
+
+# Azure Blob Storage; see https://gocloud.dev/howto/blob/#azure
+# URL = "azblob://$web"
+
+# You can use a "prefix=" query parameter to target a subfolder of the bucket:
+# URL = "gs://<Bucket Name>?prefix=a/subfolder/"
+
+# If you are using a CloudFront CDN, deploy will invalidate the cache as needed.
+cloudFrontDistributionID = <ID>
+
+# Optionally, you can include or exclude specific files.
+# See https://godoc.org/github.com/gobwas/glob#Glob for the glob pattern syntax.
+# If non-empty, the pattern is matched against the local path.
+# All paths are matched against in their filepath.ToSlash form.
+# If exclude is non-empty, and a local or remote file's path matches it, that file is not synced.
+# If include is non-empty, and a local or remote file's path does not match it, that file is not synced.
+# As a result, local files that don't pass the include/exclude filters are not uploaded to remote,
+# and remote files that don't pass the include/exclude filters are not deleted.
+# include = "**.html" # would only include files with ".html" suffix
+# exclude = "**.{jpg, png}" # would exclude files with ".jpg" or ".png" suffix
+
+
+# [[deployment.matchers]] configure behavior for files that match the Pattern.
+# See https://golang.org/pkg/regexp/syntax/ for pattern syntax.
+# Pattern searching is stopped on first match.
+
+# Samples:
+
+[[deployment.matchers]]
+# Cache static assets for 1 year.
+pattern = "^.+\\.(js|css|svg|ttf)$"
+cacheControl = "max-age=31536000, no-transform, public"
+gzip = true
+
+[[deployment.matchers]]
+pattern = "^.+\\.(png|jpg)$"
+cacheControl = "max-age=31536000, no-transform, public"
+gzip = false
+
+[[deployment.matchers]]
+# Set custom content type for /sitemap.xml
+pattern = "^sitemap\\.xml$"
+contentType = "application/xml"
+gzip = true
+
+[[deployment.matchers]]
+pattern = "^.+\\.(html|xml|json)$"
+gzip = true
+```
+
+## Deploy
+
+To deploy to a target:
+
+```bash
+hugo deploy [--target=<target name>, defaults to first target]
+```
+
+Hugo will identify and apply any local changes that need to be reflected to the
+remote target. You can use `--dryRun` to see the changes without applying them,
+or `--confirm` to be prompted before making changes.
+
+See `hugo help deploy` for more command-line options.
+
+[Quick Start]: /getting-started/quick-start/
+[Google Cloud]: [https://cloud.google.com]
+[AWS]: [https://aws.amazon.com]
+[Azure]: [https://azure.microsoft.com]
--- /dev/null
- linktitle: Hugo Modules Overview
+---
+title: Hugo Modules
- weight: 01
- weight: 01
++linkTitle: Overview
+description: How to use Hugo Modules.
+menu:
+ docs:
++ identifier: hugo-modules-overview
+ parent: modules
- This is all very much brand new and there are only a few example projects around:
++ weight: 10
++weight: 10
+categories: [hugo modules]
+keywords: [themes,modules]
+aliases: [/themes/overview/,/themes/]
+toc: true
+---
+
+**Hugo Modules** are the core building blocks in Hugo. A _module_ can be your main project or a smaller module providing one or more of the 7 component types defined in Hugo: **static**, **content**, **layouts**, **data**, **assets**, **i18n**, and **archetypes**.
+
+You can combine modules in any combination you like, and even mount directories from non-Hugo projects, forming a big, virtual union file system.
+
+Hugo Modules are powered by Go Modules. For more information about Go Modules, see:
+
+- [https://github.com/golang/go/wiki/Modules](https://github.com/golang/go/wiki/Modules)
+- [https://go.dev/blog/using-go-modules](https://go.dev/blog/using-go-modules)
+
++Some example projects:
+
+- [https://github.com/bep/docuapi](https://github.com/bep/docuapi) is a theme that has been ported to Hugo Modules while testing this feature. It is a good example of a non-Hugo-project mounted into Hugo’s folder structure. It even shows a JS Bundler implementation in regular Go templates.
+- [https://github.com/bep/my-modular-site](https://github.com/bep/my-modular-site) is a very simple site used for testing.
--- /dev/null
- title: Configure Modules
+---
- weight: 10
- weight: 10
++title: Configure Hugo modules
+description: This page describes the configuration options for a module.
+categories: [hugo modules]
+keywords: [themes, source, organization, directories]
+menu:
+ docs:
+ parent: modules
- ## Module Config: Top level
++ weight: 20
++weight: 20
+toc: true
+---
+
- : The workspace file to use. This enables Go workspace mode. Note that this can also be set via OS env, e.g. `export HUGO_MODULE_WORKSPACE=/my/hugo.work` This only works with Go 1.18+. In Hugo `v0.109.0` we changed the default to `off` and we now resolve any relative work filenames relative to the working directory.
++## Module configuration: top level
+
+{{< code-toggle file="hugo" >}}
+[module]
+noVendor = ""
+proxy = "direct"
+noProxy = "none"
+private = "*.*"
+replacements = ""
+workspace = "off"
+{{< /code-toggle >}}
+
+noVendor
+: A optional Glob pattern matching module paths to skip when vendoring, e.g. "github.com/**"
+
+vendorClosest
+: When enabled, we will pick the vendored module closest to the module using it. The default behavior is to pick the first. Note that there can still be only one dependency of a given module path, so once it is in use it cannot be redefined.
+
+proxy
+: Defines the proxy server to use to download remote modules. Default is `direct`, which means "git clone" and similar.
+
+noProxy
+: Comma separated glob list matching paths that should not use the proxy configured above.
+
+private
+: Comma separated glob list matching paths that should be treated as private.
+
+workspace
- : A comma-separated list of mappings from module paths to directories, e.g. `github.com/bep/my-theme -> ../..,github.com/bep/shortcodes -> /some/path`. This is mostly useful for temporary local development of a module, in which case you might want to save it as an environment variable, e.g: `env HUGO_MODULE_REPLACEMENTS="github.com/bep/my-theme -> ../.."`. Relative paths are relative to [themesDir](https://gohugo.io/getting-started/configuration/#all-configuration-settings). Absolute paths are allowed.
++: The workspace file to use. This enables Go workspace mode. Note that this can also be set via OS env, e.g. `export HUGO_MODULE_WORKSPACE=/my/hugo.work` This only works with Go 1.18+. In Hugo `v0.109.0` we changed the default to `off` and we now resolve any relative work file names relative to the working directory.
+
+replacements
- ## Module Config: hugoVersion
++: A comma-separated list of mappings from module paths to directories, e.g. `github.com/bep/my-theme -> ../..,github.com/bep/shortcodes -> /some/path`. This is mostly useful for temporary local development of a module, in which case you might want to save it as an environment variable, e.g: `env HUGO_MODULE_REPLACEMENTS="github.com/bep/my-theme -> ../.."`. Relative paths are relative to [themesDir](/getting-started/configuration/#all-configuration-settings). Absolute paths are allowed.
+
+Note that the above terms maps directly to their counterparts in Go Modules. Some of these setting may be natural to set as OS environment variables. To set the proxy server to use, as an example:
+
+```txt
+env HUGO_MODULE_PROXY=https://proxy.example.org hugo
+```
+
+{{< gomodules-info >}}
+
- ## Module Config: imports
++## Module configuration: hugoVersion
+
+If your module requires a particular version of Hugo to work, you can indicate that in the `module` section and the user will be warned if using a too old/new version.
+
+{{< code-toggle file="hugo" >}}
+[module]
+[module.hugoVersion]
+ min = ""
+ max = ""
+ extended = false
+
+{{< /code-toggle >}}
+
+Any of the above can be omitted.
+
+min
+: The minimum Hugo version supported, e.g. `0.55.0`
+
+max
+: The maximum Hugo version supported, e.g. `0.55.0`
+
+extended
+: Whether the extended version of Hugo is required.
+
- ## Module Config: mounts
++## Module configuration: imports
+
+{{< code-toggle file="hugo" >}}
+[module]
+[[module.imports]]
+ path = "github.com/gohugoio/hugoTestModules1_linux/modh1_2_1v"
+ ignoreConfig = false
+ ignoreImports = false
+ disable = false
+[[module.imports]]
+ path = "my-shortcodes"
+{{< /code-toggle >}}
+
+path
+: Can be either a valid Go Module module path, e.g. `github.com/gohugoio/myShortcodes`, or the directory name for the module as stored in your themes folder.
+
+ignoreConfig
+: If enabled, any module configuration file, e.g. `hugo.toml`, will not be loaded. Note that this will also stop the loading of any transitive module dependencies.
+
+ignoreImports
+: If enabled, module imports will not be followed.
+
+disable
+: Set to `true` to disable the module while keeping any version info in the `go.*` files.
+
+noMounts
+: Do not mount any folder in this import.
+
+noVendor
+: Never vendor this import (only allowed in main project).
+
+{{< gomodules-info >}}
+
- When the `mounts` config was introduced in Hugo 0.56.0, we were careful to preserve the existing `contentDir`, `staticDir`, and similar configuration to make sure all existing sites just continued to work. But you should not have both: if you add a `mounts` section you should remove the old `contentDir`, `staticDir`, etc. settings.
++## Module configuration: mounts
+
+{{% note %}}
- The glob patterns are matched to the filenames starting from the `source` root, they should have Unix styled slashes even on Windows, `/` matches the mount root and `**` can be used as a super-asterisk to match recursively down all directories, e.g `/posts/**.jpg`.
++When the `mounts` configuration was introduced in Hugo 0.56.0, we were careful to preserve the existing `contentDir`, `staticDir`, and similar configuration to make sure all existing sites just continued to work. But you should not have both: if you add a `mounts` section you should remove the old `contentDir`, `staticDir`, etc. settings.
+{{% /note %}}
+
+{{% note %}}
+When you add a mount, the default mount for the concerned target root is ignored: be sure to explicitly add it.
+{{% /note %}}
+
+**Default mounts**
+{{< code-toggle file="hugo" >}}
+[module]
+[[module.mounts]]
+ source="content"
+ target="content"
+[[module.mounts]]
+ source="static"
+ target="static"
+[[module.mounts]]
+ source="layouts"
+ target="layouts"
+[[module.mounts]]
+ source="data"
+ target="data"
+[[module.mounts]]
+ source="assets"
+ target="assets"
+[[module.mounts]]
+ source="i18n"
+ target="i18n"
+[[module.mounts]]
+ source="archetypes"
+ target="archetypes"
+{{< /code-toggle >}}
+
+source
+: The source directory of the mount. For the main project, this can be either project-relative or absolute and even a symbolic link. For other modules it must be project-relative.
+
+target
+: Where it should be mounted into Hugo's virtual filesystem. It must start with one of Hugo's component folders: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, or `archetypes`. E.g. `content/blog`.
+
+lang
+: The language code, e.g. "en". Only relevant for `content` mounts, and `static` mounts when in multihost mode.
+
+includeFiles (string or slice)
+: One or more [glob](https://github.com/gobwas/glob) patterns matching files or directories to include. If `excludeFiles` is not set, the files matching `includeFiles` will be the files mounted.
+
++The glob patterns are matched to the file names starting from the `source` root, they should have Unix styled slashes even on Windows, `/` matches the mount root and `**` can be used as a super-asterisk to match recursively down all directories, e.g `/posts/**.jpg`.
+
+The search is case-insensitive.
+
+excludeFiles (string or slice)
+: One or more glob patterns matching files to exclude.
+
+**Example**
+{{< code-toggle file="hugo" >}}
+[module]
+[[module.mounts]]
+ source="content"
+ target="content"
+ excludeFiles="docs/*"
+[[module.mounts]]
+ source="node_modules"
+ target="assets"
+[[module.mounts]]
+ source="assets"
+ target="assets"
+{{< /code-toggle >}}
--- /dev/null
- title: Theme Components
+---
- weight: 50
- weight: 50
++title: Theme components
+description: Hugo provides advanced theming support with Theme Components.
+categories: [hugo modules]
+keywords: [themes, theme, source, organization, directories]
+menu:
+ docs:
+ parent: modules
- The same rules apply here: The left-most param/menu etc. with the same ID will win. There are some hidden and experimental namespace support in the above, which we will work to improve in the future, but theme authors are encouraged to create their own namespaces to avoid naming conflicts.
++ weight: 40
++weight: 40
+aliases: [/themes/customize/,/themes/customizing/]
+toc: true
+---
+
++
++
++
+{{% note %}}
+This section contain information that may be outdated and is in the process of being rewritten.
+{{% /note %}}
+Since Hugo `0.42` a project can configure a theme as a composite of as many theme components you need:
+
+{{< code-toggle file="hugo" >}}
+theme = ["my-shortcodes", "base-theme", "hyde"]
+{{< /code-toggle >}}
+
+You can even nest this, and have the theme component itself include theme components in its own `hugo.toml` (theme inheritance).[^1]
+
+The theme definition example above in `hugo.toml` creates a theme with 3 theme components with precedence from left to right.
+
+For any given file, data entry, etc., Hugo will look first in the project and then in `my-shortcodes`, `base-theme`, and lastly `hyde`.
+
+Hugo uses two different algorithms to merge the filesystems, depending on the file type:
+
+* For `i18n` and `data` files, Hugo merges deeply using the translation ID and data key inside the files.
+* For `static`, `layouts` (templates), and `archetypes` files, these are merged on file level. So the left-most file will be chosen.
+
+The name used in the `theme` definition above must match a folder in `/your-site/themes`, e.g. `/your-site/themes/my-shortcodes`. There are plans to improve on this and get a URL scheme so this can be resolved automatically.
+
+Also note that a component that is part of a theme can have its own configuration file, e.g. `hugo.toml`. There are currently some restrictions to what a theme component can configure:
+
+* `params` (global and per language)
+* `menu` (global and per language)
+* `outputformats` and `mediatypes`
+
++The same rules apply here: The left-most parameter/menu etc. with the same ID will win. There are some hidden and experimental namespace support in the above, which we will work to improve in the future, but theme authors are encouraged to create their own namespaces to avoid naming conflicts.
+
+[^1]: For themes hosted on the [Hugo Themes Showcase](https://themes.gohugo.io/) components need to be added as git submodules that point to the directory `exampleSite/themes`
--- /dev/null
- weight: 20
- weight: 20
+---
+title: Use Hugo Modules
+description: How to use Hugo Modules to build and manage your site.
+categories: [hugo modules]
+keywords: [install, themes, source, organization, directories,usage,modules]
+menu:
+ docs:
+ parent: modules
- ## Initialize a New Module
++ weight: 30
++weight: 30
+aliases: [/themes/usage/,/themes/installing/,/installing-and-using-themes/]
+toc: true
+---
+
+## Prerequisite
+
+{{< gomodules-info >}}
+
- ## Use a Module for a Theme
++## Initialize a new module
+
+Use `hugo mod init` to initialize a new Hugo Module. If it fails to guess the module path, you must provide it as an argument, e.g.:
+
+```bash
+hugo mod init github.com/gohugoio/myShortcodes
+```
+
+Also see the [CLI Doc](/commands/hugo_mod_init/).
+
- The easiest way to use a Module for a theme is to import it in the config.
++## Use a module for a theme
+
- ## Update Modules
++The easiest way to use a Module for a theme is to import it in the configuration.
+
+1. Initialize the hugo module system: `hugo mod init github.com/<your_user>/<your_project>`
+2. Import the theme:
+
+{{< code-toggle file="hugo" >}}
+[module]
+ [[module.imports]]
+ path = "github.com/spf13/hyde"
+{{< /code-toggle >}}
+
- Modules will be downloaded and added when you add them as imports to your configuration, see [Module Imports](/hugo-modules/configuration/#module-config-imports).
++## Update modules
+
- ### Update All Modules
++Modules will be downloaded and added when you add them as imports to your configuration, see [Module Imports](/hugo-modules/configuration/#module-configuration-imports).
+
+To update or manage versions, you can use `hugo mod get`.
+
+Some examples:
+
- ### Update All Modules Recursively
++### Update all modules
+
+```bash
+hugo mod get -u
+```
+
- ### Update One Module
++### Update all modules recursively
+
+```bash
+hugo mod get -u ./...
+```
+
- ### Get a Specific Version
++### Update one module
+
+```bash
+hugo mod get -u github.com/gohugoio/myShortcodes
+```
+
- Instead of modifying the `go.mod` files, you can also use the modules config [`replacements`](https://gohugo.io/hugo-modules/configuration/#module-config-top-level) option.
++### Get a specific version
+
+```bash
+hugo mod get github.com/gohugoio/myShortcodes@v1.0.7
+```
+
+Also see the [CLI Doc](/commands/hugo_mod_get/).
+
+## Make and test changes in a module
+
+One way to do local development of a module imported in a project is to add a replace directive to a local directory with the source in `go.mod`:
+
+```bash
+replace github.com/bep/hugotestmods/mypartials => /Users/bep/hugotestmods/mypartials
+```
+
+If you have the `hugo server` running, the configuration will be reloaded and `/Users/bep/hugotestmods/mypartials` put on the watch list.
+
- ## Print Dependency Graph
++Instead of modifying the `go.mod` files, you can also use the modules configuration [`replacements`](/hugo-modules/configuration/#module-configuration-top-level) option.
+
- ## Vendor Your Modules
++## Print dependency graph
+
+Use `hugo mod graph` from the relevant module directory and it will print the dependency graph, including vendoring, module replacement or disabled status.
+
+E.g.:
+
+```txt
+hugo mod graph
+
+github.com/bep/my-modular-site github.com/bep/hugotestmods/mymounts@v1.2.0
+github.com/bep/my-modular-site github.com/bep/hugotestmods/mypartials@v1.0.7
+github.com/bep/hugotestmods/mypartials@v1.0.7 github.com/bep/hugotestmods/myassets@v1.0.4
+github.com/bep/hugotestmods/mypartials@v1.0.7 github.com/bep/hugotestmods/myv2@v1.0.0
+DISABLED github.com/bep/my-modular-site github.com/spf13/hyde@v0.0.0-20190427180251-e36f5799b396
+github.com/bep/my-modular-site github.com/bep/hugo-fresh@v1.0.1
+github.com/bep/my-modular-site in-themesdir
+
+```
+
+Also see the [CLI Doc](/commands/hugo_mod_graph/).
+
- ## Clean Module Cache
++## Vendor your modules
+
+`hugo mod vendor` will write all the module dependencies to a `_vendor` folder, which will then be used for all subsequent builds.
+
+Note that:
+
+* You can run `hugo mod vendor` on any level in the module tree.
+* Vendoring will not store modules stored in your `themes` folder.
+* Most commands accept a `--ignoreVendorPaths` flag, which will then not use the vendored modules in `_vendor` for the module paths matching the [Glob](https://github.com/gobwas/glob) pattern given.
+
+Also see the [CLI Doc](/commands/hugo_mod_vendor/).
+
+## Tidy go.mod, go.sum
+
+Run `hugo mod tidy` to remove unused entries in `go.mod` and `go.sum`.
+
+Also see the [CLI Doc](/commands/hugo_mod_clean/).
+
- ## Module Workspaces
++## Clean module cache
+
+Run `hugo mod clean` to delete the entire modules cache.
+
+Note that you can also configure the `modules` cache with a `maxAge`, see [File Caches](/getting-started/configuration/#configure-file-caches).
+
+Also see the [CLI Doc](/commands/hugo_mod_clean/).
+
- ```
++## Module workspaces
+
+{{< new-in "0.109.0" >}}
+
+Workspace support was added in [Go 1.18](https://go.dev/blog/get-familiar-with-workspaces) and Hugo got solid support for it in the `v0.109.0` version.
+
+A common use case for a workspace is to simplify local development of a site with its theme modules.
+
+A workspace can be configured in a `*.work` file and activated with the [module.workspace](/hugo-modules/configuration/) setting, which for this use is commonly controlled via the `HUGO_MODULE_WORKSPACE` OS environment variable.
+
+See the [hugo.work](https://github.com/gohugoio/hugo/blob/master/hugo.work) file in the Hugo Docs repo for an example:
+
- ```
++```text
+go 1.19
+
+use .
+use ../gohugoioTheme
+```
+
+Using the `use` directive, list all the modules you want to work on, pointing to its relative location. As in the example above, it's recommended to always include the main project (the ".") in the list.
+
+With that you can start the Hugo server with that workspace enabled:
+
++```bash
+HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**"
+```
+
+The `--ignoreVendorPaths` flag is added above to ignore any of the vendored dependencies inside `_vendor`. If you don't use vendoring, you don't need that flag. But now the server is set up watching the files and directories in the workspace and you can see your local edits reloaded.
--- /dev/null
- title: Hugo Pipes Overview
+---
- parent: pipes
++title: Hugo Pipes
++linkTitle: Overview
+categories: [asset management]
+keywords: []
+menu:
+ docs:
++ identifier: hugo-pipes-overview
++ parent: hugo-pipes
+ weight: 10
+weight: 10
+---
--- /dev/null
- parent: pipes
- weight: 48
- weight: 48
+---
+title: Babel
+description: Hugo Pipes can process JS files with Babel.
+categories: [asset management]
+keywords: []
+menu:
+ docs:
- ### Config
++ parent: hugo-pipes
++ weight: 70
++weight: 70
+signature: ["resources.Babel RESOURCE [OPTIONS]", "babel RESOURCE [OPTIONS]"]
+---
+
+## Usage
+
+Any JavaScript resource file can be transpiled to another JavaScript version using `resources.Babel` which takes for argument the resource object and an optional dict of options listed below. Babel uses the [babel cli](https://babeljs.io/docs/en/babel-cli).
+
+
+{{% note %}}
+Hugo Pipe's Babel requires the `@babel/cli` and `@babel/core` JavaScript packages to be installed in the project or globally (`npm install -g @babel/cli @babel/core`) along with any Babel plugin(s) or preset(s) used (e.g., `npm install @babel/preset-env --save-dev`).
+
+If you are using the Hugo Snap package, Babel and plugin(s) need to be installed locally within your Hugo site directory, e.g., `npm install @babel/cli @babel/core --save-dev` without the `-g` flag.
+{{% /note %}}
+
- : Output `inline` or `external` sourcemap from the babel compile. External sourcemaps will be written to the target with the output filename + ".map". Input sourcemaps can be read from js.Build and node modules and combined into the output sourcemaps.
++### configuration
+
+We add the main project's `node_modules` to `NODE_PATH` when running Babel and similar tools. There are some known [issues](https://github.com/babel/babel/issues/5618) with Babel in this area, so if you have a `babel.config.js` living in a Hugo Module (and not in the project itself), we recommend using `require` to load the presets/plugins, e.g.:
+
+
+```js
+module.exports = {
+ presets: [
+ [
+ require("@babel/preset-env"),
+ {
+ useBuiltIns: "entry",
+ corejs: 3,
+ },
+ ],
+ ],
+};
+```
+
+### Options
+
+config [string]
+: Path to the Babel configuration file. Hugo will, by default, look for a `babel.config.js` in your project. More information on these configuration files can be found here: [babel configuration](https://babeljs.io/docs/en/configuration).
+
+minified [bool]
+: Save as many bytes as possible when printing
+
+noComments [bool]
+: Write comments to generated output (true by default)
+
+compact [bool]
+: Do not include superfluous whitespace characters and line terminators. Defaults to `auto` if not set.
+
+verbose [bool]
+: Log everything
+
+sourceMap [string]
++: Output `inline` or `external` sourcemap from the babel compile. External sourcemaps will be written to the target with the output file name + ".map". Input sourcemaps can be read from js.Build and node modules and combined into the output sourcemaps.
+
+
+### Examples
+
+```go-html-template
+{{- $transpiled := resources.Get "scripts/main.js" | babel -}}
+```
+
+Or with options:
+
+```go-html-template
+{{ $opts := dict "noComments" true }}
+{{- $transpiled := resources.Get "scripts/main.js" | babel $opts -}}
+```
--- /dev/null
- parent: pipes
- weight: 60
- weight: 60
+---
+title: Concat
+linkTitle: Concatenating assets
+description: Bundle any number of assets into one resource.
+categories: [asset management]
+keywords: []
+menu:
+ docs:
++ parent: hugo-pipes
++ weight: 90
++weight: 90
+signature: ["resources.Concat TARGET_PATH SLICE_RESOURCES"]
+---
+
+## Usage
+
+Asset files of the same MIME type can be bundled into one resource using `resources.Concat` which takes two arguments, the target path for the created resource bundle and a slice of resource objects to be concatenated.
+
+```go-html-template
+{{ $plugins := resources.Get "js/plugins.js" }}
+{{ $global := resources.Get "js/global.js" }}
+{{ $js := slice $plugins $global | resources.Concat "js/bundle.js" }}
+```
--- /dev/null
- linkTitle: Fingerprinting and SRI
+---
+title: Fingerprint
- parent: pipes
- weight: 70
- weight: 70
++linkTitle: Fingerprinting and SRI hashing
+description: Process a given resource, adding a hash string of the resource's content.
+categories: [asset management]
+keywords: []
+menu:
+ docs:
++ parent: hugo-pipes
++ weight: 100
++weight: 100
+signature: ["resources.Fingerprint RESOURCE [ALGORITHM]", "fingerprint RESOURCE [ALGORITHM]"]
+---
+
+## Usage
+
+Fingerprinting and [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) can be applied to any asset file using `resources.Fingerprint` which takes two arguments, the resource object and an optional [hash algorithm](https://en.wikipedia.org/wiki/Secure_Hash_Algorithms).
+
+The default hash algorithm is `sha256`. Other available algorithms are `sha384` and (as of Hugo `0.55`) `sha512` and `md5`.
+
+Any so processed asset will bear a `.Data.Integrity` property containing an integrity string, which is made up of the name of the hash algorithm, one hyphen and the base64-encoded hash sum.
+
+```go-html-template
+{{ $js := resources.Get "js/global.js" }}
+{{ $secureJS := $js | resources.Fingerprint "sha512" }}
+<script src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
+```
--- /dev/null
- title: Hugo Pipes Introduction
- linkTitle: Hugo Pipes
+---
- parent: pipes
++title: Hugo Pipes
++linkTitle: Introduction
+description: Hugo Pipes is Hugo's asset processing set of functions.
+categories: [asset management]
+keywords: []
+menu:
+ docs:
- weight: 01
++ parent: hugo-pipes
+ weight: 20
- ## Find Resources in /assets
++weight: 20
+toc: true
+aliases: [/assets/]
+---
+
- Note that you can mount any directory into Hugo's virtual `assets` folder using the [Mount Configuration](/hugo-modules/configuration/#module-config-mounts).
++## Find resources in /assets
+
+This is about the global Resources mounted inside `/assets`. For the `.Page` scoped Resources, see [Page Resources](/content-management/page-resources/).
+
- | `resources.Get` | Get locates the filename given in Hugo's assets filesystem and creates a `Resource` object that can be used for further transformations. See [Get Resource with resources.Get and resources.GetRemote](#get-resource-with-resourcesget-and-resourcesgetremote). |
- | `resources.GetRemote` | Same as `Get`, but it accepts remote URLs. See [Get Resource with resources.Get and resources.GetRemote](#get-resource-with-resourcesget-and-resourcesgetremote).|
++Note that you can mount any directory into Hugo's virtual `assets` folder using the [Mount Configuration](/hugo-modules/configuration/#module-configuration-mounts).
+
+| Function | Description |
+| ------------- | ------------- |
- ## Get Resource with resources.Get and resources.GetRemote
++| `resources.Get` | Get locates the file name given in Hugo's assets filesystem and creates a `Resource` object that can be used for further transformations. See [Get a resource](#get-a-resource). |
++| `resources.GetRemote` | Same as `Get`, but it accepts remote URLs. See [Get a resource](#get-a-resource).|
+| `resources.GetMatch` | `GetMatch` finds the first Resource matching the given pattern, or nil if none found. See Match for a more complete explanation about the rules used. |
+| `resources.Match` | `Match` gets all resources matching the given base path prefix, e.g "*.png" will match all png files. The "*" does not match path delimiters (/), so if you organize your resources in sub-folders, you need to be explicit about it, e.g.: "images/*.png". To match any PNG image anywhere in the bundle you can do "\*\*.png", and to match all PNG images below the images folder, use "images/\*\*.jpg". The matching is case insensitive. Match matches by using the files name with path relative to the file system root with Unix style slashes (/) and no leading slash, e.g. "images/logo.png". See https://github.com/gobwas/glob for the full rules set.|
+
+See the [GoDoc Page](https://pkg.go.dev/github.com/gohugoio/hugo@v0.93.1/tpl/resources) for the `resources` package for an up to date overview of all template functions in this namespace.
+
- ### Error Handling
++## Get a resource
+
+In order to process an asset with Hugo Pipes, it must be retrieved as a `Resource` using `resources.Get` or `resources.GetRemote`.
+
+With `resources.Get`, the first argument is a local path relative to the `assets` directory/directories:
+
+```go-html-template
+{{ $local := resources.Get "sass/main.scss" }}
+```
+
+With `resources.GetRemote`, the first argument is a remote URL:
+
+```go-html-template
+{{ $remote := resources.GetRemote "https://www.example.com/styles.scss" }}
+```
+
+`resources.Get` and `resources.GetRemote` return `nil` if the resource is not found.
+
+{{< new-in "0.110.0" >}} You can get information about the HTTP Response using `.Data` in the returned `Resource`. This is especially useful for HEAD request without any body. The Data object contains:
+
+StatusCode
+: The HTTP status code, e.g. 200
+Status
+: The HTTP status text, e.g. "200 OK"
+TransferEncoding
+: The transfer encoding, e.g. "chunked"
+ContentLength
+: The content length, e.g. 1234
+ContentType
+: The content type, e.g. "text/html"
+
+### Caching
+
+By default, Hugo calculates a cache key based on the `URL` and the `options` (e.g. headers) given.
+
+{{< new-in "0.97.0" >}} You can override this by setting a `key` in the options map. This can be used to get more fine grained control over how often a remote resource is fetched, e.g.:
+
+
+```go-html-template
+{{ $cacheKey := print $url (now.Format "2006-01-02") }}
+{{ $resource := resource.GetRemote $url (dict "key" $cacheKey) }}
+```
+
- ### Remote Options
++### Error handling
+
+The return value from `resources.GetRemote` includes an `.Err` method that will return an error if the call failed. If you want to just log any error as a `WARNING` you can use a construct similar to the one below.
+
+```go-html-template
+{{ with resources.GetRemote "https://gohugo.io/images/gohugoio-card-1.png" }}
+ {{ with .Err }}
+ {{ warnf "%s" . }}
+ {{ else }}
+ <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
+ {{ end }}
+{{ end }}
+```
+
+Note that if you do not handle `.Err` yourself, Hugo will fail the build the first time you start using the `Resource` object.
+
- ### Caching of Remote Resources
++### Remote options
+
+When fetching a remote `Resource`, `resources.GetRemote` takes an optional options map as the second argument, e.g.:
+
+```go-html-template
+{{ $resource := resources.GetRemote "https://example.org/api" (dict "headers" (dict "Authorization" "Bearer abcd")) }}
+```
+
+If you need multiple values for the same header key, use a slice:
+
+```go-html-template
+{{ $resource := resources.GetRemote "https://example.org/api" (dict "headers" (dict "X-List" (slice "a" "b" "c"))) }}
+```
+
+You can also change the request method and set the request body:
+
+```go-html-template
+{{ $postResponse := resources.GetRemote "https://example.org/api" (dict
+ "method" "post"
+ "body" `{"complete": true}`
+ "headers" (dict
+ "Content-Type" "application/json"
+ )
+)}}
+```
+
- ## Copy a Resource
++### Caching of remote resources
+
+Remote resources fetched with `resources.GetRemote` will be cached on disk. See [Configure File Caches](/getting-started/configuration/#configure-file-caches) for details.
+
- `resources.Copy` allows you to copy almost any Hugo `Resource` (the one exception is the `Page`), possibly most useful for renaming things:
++## Copy a resource
+
+{{< new-in "0.100.0" >}}
+
- ### Asset Publishing
++Use `resources.Copy` to copy a page resource or a global resource. Commonly used to change a resource's published path, `resources.Copy` takes two arguments: the target path relative to the root of the `publishDir` (with or without a leading `/`), and the resource to copy.
+
+```go-html-template
+{{ with resources.Get "img/a.jpg" }}
+ {{ with .Resize "300x" }}
+ {{ with resources.Copy "img/a-new.jpg" . }}
+ <img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
+ {{ end }}
+ {{ end }}
+{{ end }}
+```
+
+{{% note %}}
+The target path must be different than the source path, as shown in the example above. See GitHub issue [#10412](https://github.com/gohugoio/hugo/issues/10412).
+{{% /note %}}
+
+## Asset directory
+
+Asset files must be stored in the asset directory. This is `/assets` by default, but can be configured via the configuration file's `assetDir` key.
+
++### Asset publishing
+
+Hugo publishes assets to the `publishDir` (typically `public`) when you invoke `.Permalink`, `.RelPermalink`, or `.Publish`. You can use `.Content` to inline the asset.
+
+## Go Pipes
+
+For improved readability, the Hugo Pipes examples of this documentation will be written using [Go Pipes](/templates/introduction/#pipes):
+
+```go-html-template
+{{ $style := resources.Get "sass/main.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
+<link rel="stylesheet" href="{{ $style.Permalink }}">
+```
+
+## Method aliases
+
+Each Hugo Pipes `resources` transformation method uses a __camelCased__ alias (`toCSS` for `resources.ToCSS`).
+Non-transformation methods deprived of such aliases are `resources.Get`, `resources.FromString`, `resources.ExecuteAsTemplate` and `resources.Concat`.
+
+The example above can therefore also be written as follows:
+
+```go-html-template
+{{ $style := resources.Get "sass/main.scss" | toCSS | minify | fingerprint }}
+<link rel="stylesheet" href="{{ $style.Permalink }}">
+```
+
+## Caching
+
+Hugo Pipes invocations are cached based on the entire *pipe chain*.
+
+An example of a pipe chain is:
+
+```go-html-template
+{{ $mainJs := resources.Get "js/main.js" | js.Build "main.js" | minify | fingerprint }}
+```
+
+The pipe chain is only invoked the first time it is encountered in a site build, and results are otherwise loaded from cache. As such, Hugo Pipes can be used in templates which are executed thousands or millions of times without negatively impacting the build performance.
--- /dev/null
- linkTitle: JavaScript Building
+---
+title: js.Build
- parent: pipes
- weight: 45
- weight: 45
++linkTitle: JavaScript building
+description: Process a JavaScript file with [ESBuild](https://github.com/evanw/esbuild).
+categories: [asset management]
+keywords: []
+menu:
+ docs:
- Note that this is meant for small data sets, e.g. config settings. For larger data, please put/mount the files into `/assets` and import them directly.
++ parent: hugo-pipes
++ weight: 60
++weight: 60
+signature: ["js.Build RESOURCE [OPTIONS]"]
+---
+
+## Usage
+
+Any JavaScript resource file can be transpiled and "tree shaken" using `js.Build` which takes for argument either a string for the filepath or a dict of options listed below.
+
+### Options
+
+targetPath [string]
+: If not set, the source path will be used as the base target path.
+Note that the target path's extension may change if the target MIME type is different, e.g. when the source is TypeScript.
+
+params [map or slice]
+: Params that can be imported as JSON in your JS files, e.g.:
+
+```go-html-template
+{{ $js := resources.Get "js/main.js" | js.Build (dict "params" (dict "api" "https://example.org/api")) }}
+```
+And then in your JS file:
+
+```js
+import * as params from '@params';
+```
+
- : Whether to generate `inline` or `external` source maps from esbuild. External source maps will be written to the target with the output filename + ".map". Input source maps can be read from js.Build and node modules and combined into the output source maps. By default, source maps are not created.
++Note that this is meant for small data sets, e.g. configuration settings. For larger data, please put/mount the files into `/assets` and import them directly.
+
+minify [bool]
+: Let `js.Build` handle the minification.
+
+inject [slice]
+: This option allows you to automatically replace a global variable with an import from another file. The path names must be relative to `assets`. See https://esbuild.github.io/api/#inject
+
+shims [map]
+: This option allows swapping out a component with another. A common use case is to load dependencies like React from a CDN (with _shims_) when in production, but running with the full bundled `node_modules` dependency during development:
+
+```go-html-template
+{{ $shims := dict "react" "js/shims/react.js" "react-dom" "js/shims/react-dom.js" }}
+{{ $js = $js | js.Build dict "shims" $shims }}
+```
+
+The _shim_ files may look like these:
+
+```js
+// js/shims/react.js
+module.exports = window.React;
+```
+
+```js
+// js/shims/react-dom.js
+module.exports = window.ReactDOM;
+```
+
+With the above, these imports should work in both scenarios:
+
+```js
+import * as React from 'react'
+import * as ReactDOM from 'react-dom';
+```
+
+target [string]
+: The language target.
+ One of: `es5`, `es2015`, `es2016`, `es2017`, `es2018`, `es2019`, `es2020` or `esnext`.
+ Default is `esnext`.
+
+externals [slice]
+: External dependencies. Use this to trim dependencies you know will never be executed. See https://esbuild.github.io/api/#external
+
+
+defines [map]
+: Allow to define a set of string replacement to be performed when building. Should be a map where each key is to be replaced by its value.
+
+```go-html-template
+{{ $defines := dict "process.env.NODE_ENV" `"development"` }}
+```
+
+format [string]
+: The output format.
+ One of: `iife`, `cjs`, `esm`.
+ Default is `iife`, a self-executing function, suitable for inclusion as a <script> tag.
+
+sourceMap [string]
- ### Include Dependencies In package.json / node_modules
++: Whether to generate `inline` or `external` source maps from esbuild. External source maps will be written to the target with the output file name + ".map". Input source maps can be read from js.Build and node modules and combined into the output source maps. By default, source maps are not created.
+
+### Import JS code from /assets
+
+`js.Build` has full support for the virtual union file system in [Hugo Modules](/hugo-modules/). You can see some simple examples in this [test project](https://github.com/gohugoio/hugoTestProjectJSModImports), but in short this means that you can do this:
+
+```js
+import { hello } from 'my/module';
+```
+
+And it will resolve to the top-most `index.{js,ts,tsx,jsx}` inside `assets/my/module` in the layered file system.
+
+```js
+import { hello3 } from 'my/module/hello3';
+```
+
+Will resolve to `hello3.{js,ts,tsx,jsx}` inside `assets/my/module`.
+
+Any imports starting with `.` is resolved relative to the current file:
+
+```js
+import { hello4 } from './lib';
+```
+
+For other files (e.g. `JSON`, `CSS`) you need to use the relative path including any extension, e.g:
+
+```js
+import * as data from 'my/module/data.json';
+```
+
+Any imports in a file outside `/assets` or that does not resolve to a component inside `/assets` will be resolved by [ESBuild](https://esbuild.github.io/) with the **project directory** as the resolve directory (used as the starting point when looking for `node_modules` etc.). Also see [hugo mod npm pack](/commands/hugo_mod_npm_pack/). If you have any imported npm dependencies in your project, you need to make sure to run `npm install` before you run `hugo`.
+
+Also note the new `params` option that can be passed from template to your JS files, e.g.:
+
+```go-html-template
+{{ $js := resources.Get "js/main.js" | js.Build (dict "params" (dict "api" "https://example.org/api")) }}
+```
+And then in your JS file:
+
+```js
+import * as params from '@params';
+```
+
+Hugo will, by default, generate a `assets/jsconfig.json` file that maps the imports. This is useful for navigation/intellisense help inside code editors, but if you don't need/want it, you can [turn it off](/getting-started/configuration/#configure-build).
+
+
++### Include dependencies In package.json / node_modules
+
+Any imports in a file outside `/assets` or that does not resolve to a component inside `/assets` will be resolved by [ESBuild](https://esbuild.github.io/) with the **project directory** as the resolve directory (used as the starting point when looking for `node_modules` etc.). Also see [hugo mod npm pack](/commands/hugo_mod_npm_pack/). If you have any imported npm dependencies in your project, you need to make sure to run `npm install` before you run `hugo`.
+
+The start directory for resolving npm packages (aka. packages that live inside a `node_modules` folder) is always the main project folder.
+
+**Note:** If you're developing a theme/component that is supposed to be imported and depends on dependencies inside `package.json`, we recommend reading about [hugo mod npm pack](/commands/hugo_mod_npm_pack/), a tool to consolidate all the npm dependencies in a project.
+
+
+### Examples
+
+```go-html-template
+{{ $built := resources.Get "js/index.js" | js.Build "main.js" }}
+```
+
+Or with options:
+
+```go-html-template
+{{ $externals := slice "react" "react-dom" }}
+{{ $defines := dict "process.env.NODE_ENV" `"development"` }}
+
+{{ $opts := dict "targetPath" "main.js" "externals" $externals "defines" $defines }}
+{{ $built := resources.Get "scripts/main.js" | js.Build $opts }}
+<script src="{{ $built.RelPermalink }}" defer></script>
+```
--- /dev/null
- parent: pipes
- weight: 50
- weight: 50
+---
+title: Minify
+linkTitle: Asset minification
+description: Minifies a given resource.
+categories: [asset management]
+keywords: []
+menu:
+ docs:
++ parent: hugo-pipes
++ weight: 80
++weight: 80
+signature: ["resources.Minify RESOURCE", "minify RESOURCE"]
+---
+
+## Usage
+
+Any CSS, JS, JSON, HTML, SVG or XML resource can be minified using `resources.Minify` which takes for argument the resource object.
+
+```go-html-template
+{{ $css := resources.Get "css/main.css" }}
+{{ $style := $css | resources.Minify }}
+```
+
+Note that you can also minify the final HTML output to `/public` by running `hugo --minify`.
--- /dev/null
- parent: pipes
+---
+title: PostCSS
+description: Process CSS files with PostCSS, using any of the available plugins.
+categories: [asset management]
+keywords: []
+menu:
+ docs:
- The current Hugo environment name (set by `--environment` or in config or OS environment) is available in the Node context, which allows constructs like this:
++ parent: hugo-pipes
+ weight: 40
+toc: true
+weight: 40
+signature: ["resources.PostCSS RESOURCE [OPTIONS]", "postCSS RESOURCE [OPTIONS]"]
+---
+
+## Setup
+
+Follow the steps below to transform CSS using any of the [available PostCSS plugins](https://www.postcss.parts/).
+
+Step 1
+: Install [Node.js](https://nodejs.org/en/download).
+
+Step 2
+: Install the required Node.js packages in the root of your project. For example, to add vendor prefixes to CSS rules:
+
+```bash
+npm install postcss postcss-cli autoprefixer
+```
+
+Step 3
+: Create a PostCSS configuration file in the root of your project. You must name this file `postcss.config.js` or one of the other [supported file names]. For example:
+
+[supported file names]: https://github.com/postcss/postcss-load-config#usage
+
+{{< code file="postcss.config.js" >}}
+module.exports = {
+ plugins: [
+ require('autoprefixer')
+ ]
+};
+{{< /code >}}
+
+{{% note %}}
+If you are a Windows user, and the path to your project contains a space, you must place the PostCSS configuration within the package.json file. See [this example](https://github.com/postcss/postcss-load-config#packagejson) and issue [#7333](https://github.com/gohugoio/hugo/issues/7333).
+{{% /note %}}
+
+Step 4
+: Place your CSS file within the `assets` directory.
+
+Step 5
+: Capture the CSS file as a resource and pipe it through `resources.PostCSS` (alias `postCSS`):
+
+{{< code file="layouts/partials/css.html" >}}
+{{ with resources.Get "css/main.css" | postCSS }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}">
+{{ end }}
+{{< /code >}}
+
+If starting with a Sass file within the `assets` directory:
+
+{{< code file="layouts/partials/css.html" >}}
+{{ with resources.Get "sass/main.scss" | toCSS | postCSS }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}">
+{{ end }}
+{{< /code >}}
+
+## Options
+
+The `resources.PostCSS` method takes an optional map of options.
+
+config
+: (`string`) The directory that contains the PostCSS configuration file. Default is the root of the project directory.
+
+noMap
+: (`bool`) Default is `false`. If `true`, disables inline sourcemaps.
+
+inlineImports
+: (`bool`) Default is `false`. Enable inlining of @import statements. It does so recursively, but will only import a file once.
+URL imports (e.g. `@import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap');`) and imports with media queries will be ignored.
+Note that this import routine does not care about the CSS spec, so you can have @import anywhere in the file.
+Hugo will look for imports relative to the module mount and will respect theme overrides.
+
+skipInlineImportsNotFound {{< new-in "0.99.0" >}}
+: (`bool`) Default is `false`. Before Hugo 0.99.0 when `inlineImports` was enabled and we failed to resolve an import, we logged it as a warning. We now fail the build. If you have regular CSS imports in your CSS that you want to preserve, you can either use imports with URL or media queries (Hugo does not try to resolve those) or set `skipInlineImportsNotFound` to true.
+
+{{< code file="layouts/partials/css.html" >}}
+{{ $opts := dict "config" "config-directory" "noMap" true }}
+{{ with resources.Get "css/main.css" | postCSS $opts }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}">
+{{ end }}
+{{< /code >}}
+
+## No configuration file
+
+To avoid using a PostCSS configuration file, you can specify a minimal configuration using the options map.
+
+use
+: (`string`) A space-delimited list of PostCSS plugins to use.
+
+parser
+: (`string`) A custom PostCSS parser.
+
+stringifier
+: (`string`) A custom PostCSS stringifier.
+
+syntax
+: (`string`) Custom postcss syntax.
+
+{{< code file="layouts/partials/css.html" >}}
+{{ $opts := dict "use" "autoprefixer postcss-color-alpha" }}
+{{ with resources.Get "css/main.css" | postCSS $opts }}
+ <link rel="stylesheet" href="{{ .RelPermalink }}">
+{{ end }}
+{{< /code >}}
+
+## Check Hugo environment
+
++The current Hugo environment name (set by `--environment` or in configuration or OS environment) is available in the Node context, which allows constructs like this:
+
+{{< code file="postcss.config.js" >}}
+module.exports = {
+ plugins: [
+ require('autoprefixer'),
+ ...process.env.HUGO_ENVIRONMENT === 'production'
+ ? [purgecss]
+ : []
+ ]
+}
+{{< /code >}}
--- /dev/null
- parent: pipes
- weight: 39
- weight: 39
+---
+title: PostProcess
+description: Allows delaying of resource transformations to after the build.
+categories: [asset management]
+keywords: []
+menu:
+ docs:
- [build]
- writeStats = true
++ parent: hugo-pipes
++ weight: 50
++weight: 50
+signature: ["resources.PostProcess RESOURCE"]
+---
+
+## Usage
+
+Marking a resource with `resources.PostProcess` delays any transformations to after the build, typically because one or more of the steps in the transformation chain depends on the result of the build (e.g. files in `public`).
+
+A prime use case for this is [CSS purging with PostCSS](#css-purging-with-postcss).
+
+There are currently two limitations to this:
+
+1. This only works in `*.html` templates (i.e. templates that produces HTML files).
+2. You cannot manipulate the values returned from the resource's methods. E.g. the `upper` in this example will not work as expected:
+
+ ```go-html-template
+ {{ $css := resources.Get "css/main.css" }}
+ {{ $css = $css | resources.PostCSS | minify | fingerprint | resources.PostProcess }}
+ {{ $css.RelPermalink | upper }}
+ ```
+
+## CSS purging with PostCSS
+
+{{% note %}}
+There are several ways to set up CSS purging with PostCSS in Hugo. If you have a simple project, you should consider going the simpler route and drop the use of `resources.PostProcess` and just extract keywords from the templates. See the [Tailwind documentation](https://tailwindcss.com/docs/controlling-file-size/#app) for some examples.
+{{% /note %}}
+
+The below configuration will write a `hugo_stats.json` file to the project root as part of the build. If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory).
+
++<!-- TODO (jmm) writeStats => build.buildStats -->
++
+{{< code-toggle file="hugo" >}}
- ## Hugo Environment variables available in PostCSS
++[build.buildStats]
++ enable = true
+{{< /code-toggle >}}
+
++See the [configure build] documentation for details and options.
++
++[configure build]: /getting-started/configuration/#configure-build
++
+`postcss.config.js`
+
+```js
+const purgecss = require('@fullhuman/postcss-purgecss')({
+ content: [ './hugo_stats.json' ],
+ defaultExtractor: (content) => {
+ let els = JSON.parse(content).htmlElements;
+ return els.tags.concat(els.classes, els.ids);
+ }
+});
+
+module.exports = {
+ plugins: [
+ ...(process.env.HUGO_ENVIRONMENT === 'production' ? [ purgecss ] : [])
+ ]
+ };
+```
+
+Note that in the example above, the "CSS purge step" will only be applied to the production build. This means that you need to do something like this in your head template to build and include your CSS:
+
+```go-html-template
+{{ $css := resources.Get "css/main.css" }}
+{{ $css = $css | resources.PostCSS }}
+{{ if hugo.IsProduction }}
+{{ $css = $css | minify | fingerprint | resources.PostProcess }}
+{{ end }}
+<link href="{{ $css.RelPermalink }}" rel="stylesheet" />
+```
+
+
- ```
++## Hugo environment variables available in PostCSS
+
+These are the environment variables Hugo passes down to PostCSS (and Babel), which allows you do do `process.env.HUGO_ENVIRONMENT === 'production' ? [autoprefixer] : []` and similar:
+
+PWD
+: The absolute path to the project working directory.
+HUGO_ENVIRONMENT (and the alias HUGO_ENV)
+: The value e.g. set with `hugo -e production` (defaults to `production` for `hugo` and `development` for `hugo server`).
+
+HUGO_PUBLISHDIR
+: {{< new-in "0.109.0" >}} The absolute path to the publish directory (the `public` directory). Note that the value will always point to a directory on disk even when running `hugo server` in memory mode. If you write to this folder from PostCSS when running the server, you could run the server with one of these flags:
+
++```text
+hugo server --renderToDisk
+hugo server --renderStaticToDisk
+```
+
+Also, Hugo will add environment variables for all files mounted below `assets/_jsconfig`. A default mount will be set up with files in the project root matching this regexp: `(babel|postcss|tailwind)\.config\.js`.
+
+These will get environment variables named on the form `HUGO_FILE_:filename:` where `:filename:` is all upper case with periods replaced with underscore. This allows you to do this and similar:
+
+```js
+let tailwindConfig = process.env.HUGO_FILE_TAILWIND_CONFIG_JS || './tailwind.config.js';
+```
--- /dev/null
- linkTitle: Resource from String
+---
+title: FromString
- parent: pipes
- weight: 90
- weight: 90
++linkTitle: Resource from string
+description: Creates a resource from a string.
+categories: [asset management]
+keywords: []
+menu:
+ docs:
++ parent: hugo-pipes
++ weight: 110
++weight: 110
+signature: ["resources.FromString TARGET_PATH CONTENT"]
+---
+
+## Usage
+
+It is possible to create a resource directly from the template using `resources.FromString` which takes two arguments, the target path for the created resource and the given content string.
+
++The result is cached using the target path as the cache key.
++
+The following example creates a resource file containing localized variables for every project's languages.
+
+```go-html-template
+{{ $string := (printf "var rootURL = '%s'; var apiURL = '%s';" (absURL "/") (.Param "API_URL")) }}
+{{ $targetPath := "js/vars.js" }}
+{{ $vars := $string | resources.FromString $targetPath }}
+{{ $global := resources.Get "js/global.js" | resources.Minify }}
+
+<script src="{{ $vars.Permalink }}"></script>
+<script src="{{ $global.Permalink }}"></script>
+```
--- /dev/null
- linkTitle: Resource from Template
+---
+title: ExecuteAsTemplate
- parent: pipes
- weight: 80
- weight: 80
++linkTitle: Resource from template
+description: Creates a resource from a template
+categories: [asset management]
+keywords: []
+menu:
+ docs:
- The function takes three arguments: the target path for the created resource, the template context, and the resource object.
++ parent: hugo-pipes
++ weight: 120
++weight: 120
+signature: ["resources.ExecuteAsTemplate TARGET_PATH CONTEXT RESOURCE"]
+---
+
+## Usage
+
+In order to use Hugo Pipes function on an asset file containing Go Template magic the function `resources.ExecuteAsTemplate` must be used.
+
++The function takes three arguments: the target path for the created resource, the template context, and the resource object. The target path is used to cache the result.
+
+```go-html-template
+// assets/sass/template.scss
+$backgroundColor: {{ .Param "backgroundColor" }};
+$textColor: {{ .Param "textColor" }};
+body{
+ background-color:$backgroundColor;
+ color: $textColor;
+}
+// [...]
+```
+
+```go-html-template
+{{ $sassTemplate := resources.Get "sass/template.scss" }}
+{{ $style := $sassTemplate | resources.ExecuteAsTemplate "main.scss" . | resources.ToCSS }}
+```
--- /dev/null
--- /dev/null
++---
++title: ToCSS
++linkTitle: Transpile Sass to CSS
++description: Transpile Sass to CSS.
++categories: [asset management]
++keywords: []
++menu:
++ docs:
++ parent: hugo-pipes
++ weight: 30
++weight: 30
++signature: ["resources.ToCSS RESOURCE [OPTIONS]", "toCSS RESOURCE [OPTIONS]"]
++toc: true
++aliases: [/hugo-pipes/transform-to-css/]
++---
++
++## Usage
++
++Transpile Sass to CSS using the LibSass transpiler included in Hugo's extended edition, or [install Dart Sass](#dart-sass) to use the latest features of the Sass language.
++
++```go-html-template
++{{ $options := dict "transpiler" "libsass" "targetPath" "css/style.css" }}
++{{ with resources.Get "sass/main.scss" | toCSS $options | minify | fingerprint }}
++ <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
++{{ end }}
++```
++
++Sass has two forms of syntax: [SCSS] and [indented]. Hugo supports both.
++
++[scss]: https://sass-lang.com/documentation/syntax#scss
++[indented]: https://sass-lang.com/documentation/syntax#the-indented-syntax
++
++
++## Options
++
++transpiler
++: (`string`) The transpiler to use, either `libsass` (default) or `dartsass`. Hugo's extended edition includes the LibSass transpiler. To use the Dart Sass transpiler, see the [installation instructions](#dart-sass) below.
++
++targetPath
++: (`string`) If not set, the transformed resource's target path will be the original path of the asset file with its extension replaced by `.css`.
++
++vars {{< new-in "0.109.0" >}}
++: (`map`) A map of key/value pairs that will be available in the `hugo:vars` namespace. Useful for [initializing Sass variables from Hugo templates](https://discourse.gohugo.io/t/42053/).
++
++```scss
++// LibSass
++@import "hugo:vars";
++
++// Dart Sass
++@use "hugo:vars" as v;
++```
++
++outputStyle
++: (`string`) Output styles available to LibSass include `nested` (default), `expanded`, `compact`, and `compressed`. Output styles available to Dart Sass include `expanded` (default) and `compressed`.
++
++precision
++: (`int`) Precision of floating point math. Not applicable to Dart Sass.
++
++enableSourceMap
++: (`bool`) If `true`, generates a source map.
++
++sourceMapIncludeSources {{< new-in "0.108.0" >}}
++: (`bool`) If `true`, embeds sources in the generated source map. Not applicable to LibSass.
++
++includePaths
++: (`slice`) A slice of paths, relative to the project root, that the transpiler will use when resolving `@use` and `@import` statements.
++
++```go-html-template
++{{ $options := dict
++ "transpiler" "dartsass"
++ "targetPath" "css/style.css"
++ "vars" site.Params.styles
++ "enableSourceMap" (not hugo.IsProduction)
++ "includePaths" (slice "node_modules/bootstrap/scss")
++}}
++{{ with resources.Get "sass/main.scss" | toCSS $options | minify | fingerprint }}
++ <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
++{{ end }}
++```
++
++## Dart Sass
++
++The extended version of Hugo includes [LibSass] to transpile Sass to CSS. In 2020, the Sass team deprecated LibSass in favor of [Dart Sass].
++
++Use the latest features of the Sass language by installing Dart Sass in your development and production environments.
++
++### Installation overview
++
++Dart Sass is compatible with Hugo v0.114.0 and later.
++
++If you have been using Embedded Dart Sass[^1] with Hugo v0.113.0 and earlier, uninstall Embedded Dart Sass, then install Dart Sass. If you have installed both, Hugo will use Dart Sass.
++
++If you install Hugo as a [Snap package] there is no need to install Dart Sass. The Hugo Snap package includes Dart Sass.
++
++[^1]: In 2023, the Sass team deprecated Embedded Dart Sass in favor of Dart Sass.
++
++### Installing in a development environment
++
++When you install Dart Sass somewhere in your PATH, Hugo will find it.
++
++OS|Package manager|Site|Installation
++:--|:--|:--|:--
++Linux|Homebrew|[brew.sh]|`brew install sass/sass/sass`
++Linux|Snap|[snapcraft.io]|`sudo snap install dart-sass`
++macOS|Homebrew|[brew.sh]|`brew install sass/sass/sass`
++Windows|Chocolatey|[chocolatey.org]|`choco install sass`
++Windows|Scoop|[scoop.sh]|`scoop install sass`
++
++You may also install [prebuilt binaries] for Linux, macOS, and Windows.
++
++Run `hugo env` to list the active transpilers.
++
++### Installing in a production environment
++
++For [CI/CD] deployments (e.g., GitHub Pages, GitLab Pages, Netlify, etc.) you must edit the workflow to install Dart Sass before Hugo builds the site[^2]. Some providers allow you to use one of the package managers above, or you can download and extract one of the prebuilt binaries.
++
++[^2]: You do not have to do this if (a) you have not modified the assets cache location, and (b) you have not set `useResourceCacheWhen` to `never` in your [site configuration], and (c) you add and commit your resources directory to your repository.
++
++#### GitHub Pages
++
++To install Dart Sass for your builds on GitHub Pages, add this step to the GitHub Pages workflow file:
++
++```yaml
++- name: Install Dart Sass
++ run: sudo snap install dart-sass
++```
++
++If you are using GitHub Pages for the first time with your repository, GitHub provides a [starter workflow] for Hugo that includes Dart Sass. This is the simplest way to get started.
++
++#### GitLab Pages
++
++To install Dart Sass for your builds on GitLab Pages, the `.gitlab-ci.yml` file should look something like this:
++
++```yaml
++variables:
++ HUGO_VERSION: 0.115.1
++ DART_SASS_VERSION: 1.63.6
++ GIT_DEPTH: 0
++ GIT_STRATEGY: clone
++ GIT_SUBMODULE_STRATEGY: recursive
++ TZ: America/Los_Angeles
++image:
++ name: golang:1.20-buster
++pages:
++ script:
++ # Install Dart Sass
++ - curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
++ - tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
++ - cp -r dart-sass/* /usr/local/bin
++ - rm -rf dart-sass*
++ # Install Hugo
++ - curl -LJO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
++ - apt install -y ./hugo_extended_${HUGO_VERSION}_linux-amd64.deb
++ - rm hugo_extended_${HUGO_VERSION}_linux-amd64.deb
++ # Build
++ - hugo --gc --minify
++ artifacts:
++ paths:
++ - public
++ rules:
++ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
++```
++
++#### Netlify
++
++To install Dart Sass for your builds on Netlify, the `netlify.toml` file should look something like this:
++
++```toml
++[build.environment]
++HUGO_VERSION = "0.115.1"
++DART_SASS_VERSION = "1.63.6"
++TZ = "America/Los_Angeles"
++
++[build]
++publish = "public"
++command = """\
++ curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \
++ tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \
++ rm dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \
++ export PATH=/opt/build/repo/dart-sass:$PATH && \
++ hugo --gc --minify \
++ """
++```
++
++### Example
++
++To transpile with Dart Sass, set `transpiler` to `dartsass` in the options map passed to `resources.ToCSS`. For example:
++
++```go-html-template
++{{ $options := dict "transpiler" "dartsass" "targetPath" "css/style.css" }}
++{{ with resources.Get "sass/main.scss" | toCSS $options | minify | fingerprint }}
++ <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
++{{ end }}
++```
++
++### Miscellaneous
++
++If you build Hugo from source and run `mage test -v`, the test will fail if you install Dart Sass as a Snap package. This is due to the Snap package's strict confinement model.
++
++[brew.sh]: https://brew.sh/
++[chocolatey.org]: https://community.chocolatey.org/packages/sass
++[ci/cd]: https://en.wikipedia.org/wiki/CI/CD
++[dart sass]: https://sass-lang.com/dart-sass
++[libsass]: https://sass-lang.com/libsass
++[prebuilt binaries]: https://github.com/sass/dart-sass/releases/latest
++[scoop.sh]: https://scoop.sh/#/apps?q=sass
++[site configuration]: /getting-started/configuration/#configure-build
++[snap package]: /installation/linux/#snap
++[snapcraft.io]: https://snapcraft.io/dart-sass
++[starter workflow]: https://github.com/actions/starter-workflows/blob/main/pages/hugo.yml
--- /dev/null
- linkTitle: Installation overview
+---
+title: Installation
++linkTitle: Overview
+description: Install Hugo on macOS, Linux, Windows, BSD, and on any machine that can run the Go compiler tool chain.
+aliases: [/getting-started/installing/]
+categories: [installation]
+keywords: [installation]
+menu:
+ docs:
++ identifier: installation-overview
+ parent: installation
+ weight: 10
++weight: 10
+---
+
+{{% param "description" %}}
--- /dev/null
- - Encode WebP images (you can decode WebP images with both editions)
- - Transpile Sass to CSS using the embedded LibSass transpiler
+## Editions
+
+Hugo is available in two editions: standard and extended. With the extended edition you can:
+
++- Encode to the WebP format when [processing images]. You can decode WebP images with either edition.
++- [Transpile Sass to CSS] using the embedded LibSass transpiler. The extended edition is not required to use the [Dart Sass] transpiler.
+
+We recommend that you install the extended edition.
++
++[dart sass]: /hugo-pipes/transpile-sass-to-css/#dart-sass
++[processing images]: /content-management/image-processing/
++[transpile sass to css]: /hugo-pipes/transpile-sass-to-css/
--- /dev/null
- Although not required in all cases, Git and Go are often used when working with Hugo.
+## Prerequisites
+
- - Use the [Hugo Modules] feature
++Although not required in all cases, [Git], [Go], and [Dart Sass] are commonly used when working with Hugo.
+
+Git is required to:
+
- - Host your site with services such as [AWS Amplify], [CloudCannon], [Cloudflare Pages], [GitHub Pages], [GitLab Pages], and [Netlify].
+- Build Hugo from source
++- Use the [Hugo Modules] feature
+- Install a theme as a Git submodule
+- Access [commit information] from a local Git repository
- - Use the Hugo Modules feature
++- Host your site with services such as [CloudCannon], [Cloudflare Pages], [GitHub Pages], [GitLab Pages], and [Netlify]
+
+Go is required to:
+
- Please refer to the [Git] and [Go] documentation for installation instructions.
+- Build Hugo from source
++- Use the Hugo Modules feature
++
++Dart Sass is required to transpile Sass to CSS when using the latest features of the Sass language.
++
++Please refer to the relevant documentation for installation instructions:
+
- [AWS Amplify]: https://aws.amazon.com/amplify/
- [CloudCannon]: https://cloudcannon.com/
- [Cloudflare Pages]: https://pages.cloudflare.com/
- [Git]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
- [GitHub Pages]: https://pages.github.com/
- [GitLab Pages]: https://docs.gitlab.com/ee/user/project/pages/
- [Go]: https://go.dev/doc/install
- [Netlify]: https://www.netlify.com/
++- [Git][git install]
++- [Go][go install]
++- [Dart Sass][dart sass install]
+
++[cloudcannon]: https://cloudcannon.com/
++[cloudflare pages]: https://pages.cloudflare.com/
++[dart sass install]: /hugo-pipes/transpile-sass-to-css/#dart-sass
++[dart sass]: https://sass-lang.com/dart-sass
++[git install]: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
++[git]: https://git-scm.com/
++[github pages]: https://pages.github.com/
++[gitlab pages]: https://docs.gitlab.com/ee/user/project/pages/
++[go install]: https://go.dev/doc/install
++[go]: https://go.dev/
++[netlify]: https://www.netlify.com/
--- /dev/null
- [commit information]: https://gohugo.io/variables/git
+## Prebuilt binaries
+
+Prebuilt binaries are available for a variety of operating systems and architectures. Visit the [latest release] page, and scroll down to the Assets section.
+
+<!-- markdownlint-disable-next-line MD051 -->
+1. Download the archive for the desired [edition], operating system, and architecture
+1. Extract the archive
+1. Move the executable to the desired directory
+1. Add this directory to the PATH environment variable
+1. Verify that you have _execute_ permission on the file
+
+Please consult your operating system documentation if you need help setting file permissions or modifying your PATH environment variable.
+
+If you do not see a prebuilt binary for the desired edition, operating system, and architecture, install Hugo using one of the methods described below.
+
++[commit information]: /variables/git
+[edition]: #editions
+[Git]: https://git-scm.com/
+[Go]: https://go.dev/
+[Hugo Modules]: /hugo-modules/
+[latest release]: https://github.com/gohugoio/hugo/releases/latest
--- /dev/null
+---
+title: Linux
+description: Install Hugo on Linux.
+categories: [installation]
+menu:
+ docs:
+ parent: installation
+ weight: 30
+toc: true
+weight: 30
+---
+{{% readfile file="/installation/common/01-editions.md" %}}
+
+{{% readfile file="/installation/common/02-prerequisites.md" %}}
+
+{{% readfile file="/installation/common/03-prebuilt-binaries.md" %}}
+
+## Package managers
+
+### Snap
+
+[Snap] is a free and open source package manager for Linux. Available for [most distributions], snap packages are simple to install and are automatically updated.
+
+The Hugo snap package is [strictly confined]. Strictly confined snaps run in complete isolation, up to a minimal access level that’s deemed always safe. The sites you create and build must be located within your home directory, or on removable media.
+
+This will install the extended edition of Hugo:
+
+```sh
+sudo snap install hugo
+```
+
++To enable access to removable media:
++
++```sh
++sudo snap connect hugo:removable-media
++```
++
++To revoke access to removable media:
++
++```sh
++sudo snap disconnect hugo:removable-media
++```
++
+[most distributions]: https://snapcraft.io/docs/installing-snapd
+[strictly confined]: https://snapcraft.io/docs/snap-confinement
+[Snap]: https://snapcraft.io/
+
+{{% readfile file="/installation/common/homebrew.md" %}}
+
+## Repository packages
+
+Most Linux distributions maintain a repository for commonly installed applications. Please note that these repositories may not contain the [latest release].
+
+[latest release]: https://github.com/gohugoio/hugo/releases/latest
+
+### Arch Linux
+
+Derivatives of the [Arch Linux] distribution of Linux include [EndeavourOS], [Garuda Linux], [Manjaro], and others. This will install the extended edition of Hugo:
+
+```sh
+sudo pacman -S hugo
+```
+
+[Arch Linux]: https://archlinux.org/
+[EndeavourOS]: https://endeavouros.com/
+[Manjaro]: https://manjaro.org/
+[Garuda Linux]: https://garudalinux.org/
+
+### Debian
+
+Derivatives of the [Debian] distribution of Linux include [elementary OS], [KDE neon], [Linux Lite], [Linux Mint], [MX Linux], [Pop!_OS], [Ubuntu], [Zorin OS], and others. This will install the extended edition of Hugo:
+
+```sh
+sudo apt install hugo
+```
+
+You can also download Debian packages from the [latest release] page.
+
+[Debian]: https://www.debian.org/
+[elementary OS]: https://elementary.io/
+[KDE neon]: https://neon.kde.org/
+[Linux Lite]: https://www.linuxliteos.com/
+[Linux Mint]: https://linuxmint.com/
+[MX Linux]: https://mxlinux.org/
+[Pop!_OS]: https://pop.system76.com/
+[Ubuntu]: https://ubuntu.com/
+[Zorin OS]: https://zorin.com/os/
+
+### Fedora
+
+Derivatives of the [Fedora] distribution of Linux include [CentOS], [Red Hat Enterprise Linux], and others. This will install the extended edition of Hugo:
+
+
+```sh
+sudo dnf install hugo
+```
+
+[CentOS]: https://www.centos.org/
+[Fedora]: https://getfedora.org/
+[Red Hat Enterprise Linux]: https://www.redhat.com/
+
+### openSUSE
+
+Derivatives of the [openSUSE] distribution of Linux include [GeckoLinux], [Linux Karmada], and others. This will install the extended edition of Hugo:
+
+
+```sh
+sudo zypper install hugo
+```
+
+[GeckoLinux]: https://geckolinux.github.io/
+[Linux Karmada]: https://linuxkamarada.com/
+[openSUSE]: https://www.opensuse.org/
+
+### Solus
+
+The [Solus] distribution of Linux includes Hugo in its package repository. This will install the _standard_ edition of Hugo:
+
+```sh
+sudo eopkg install hugo
+```
+
+[Solus]: https://getsol.us/
+
+{{% readfile file="/installation/common/04-docker.md" %}}
+
+{{% readfile file="/installation/common/05-build-from-source.md" %}}
+
+## Comparison
+
+||Prebuilt binaries|Package managers|Repository packages|Docker|Build from source
+:--|:--:|:--:|:--:|:--:|:--:
+Easy to install?|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:
+Easy to upgrade?|:heavy_check_mark:|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
+Easy to downgrade?|:heavy_check_mark:|:heavy_check_mark: [^1]|varies|:heavy_check_mark:|:heavy_check_mark:
+Automatic updates?|:x:|varies [^2]|:x:|:x: [^3]|:x:
+Latest version available?|:heavy_check_mark:|:heavy_check_mark:|varies|:heavy_check_mark:|:heavy_check_mark:
+
+[^1]: Easy if a previous version is still installed.
+[^2]: Snap packages are automatically updated. Homebrew requires advanced configuration.
+[^3]: Possible but requires advanced configuration.
--- /dev/null
- title: "Hugo Christmas Edition!"
+
+---
+date: 2019-12-23
-
-
-
-
-
++title: Hugo Christmas edition!
+description: "Hugo 0.62 brings Markdown Render Hooks. And it's faster!"
+categories: ["Releases"]
+---
+
+From all of us to all of you, a **very Merry Christmas** -- and Hugo `0.62.0`! This version brings [Markdown Render Hooks](https://gohugo.io/getting-started/configuration-markup/#markdown-render-hooks). This gives you full control over how links and images in Markdown are rendered without using any shortcodes. With this, you can get Markdown links that work on both GitHub and Hugo, resize images etc. It is a very long sought after feature, that has been hard to tackle until we got [Goldmark](https://github.com/yuin/goldmark/), the new Markdown engine, by [@yuin](https://github.com/yuin). When you read up on this new feature in the documentation, also note the new [.RenderString](https://gohugo.io/functions/renderstring/) method on `Page`.
+
+Adding these render hooks also had the nice side effect of making Hugo **faster and more memory effective**. We could have just added this feature on top of what we got, getting it to work. But you like Hugo's fast builds, you love instant browser-refreshes on change. So we had to take a step back and redesign how we detect "what changed?" for templates referenced from content files, either directly or indirectly. And by doing that we greatly simplified how we handle all the templates. Which accidentally makes this version **the fastest to date**. It's not an "every site will be much faster" statement. This depends. Sites with many languages and/or many templates will benefit more from this. We have benchmarks with site-building showing about 15% improvement in build speed and memory efficiency.
+
+This release represents **25 contributions by 5 contributors** to the main Hugo code base. [@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@gavinhoward](https://github.com/gavinhoward), [@niklasfasching](https://github.com/niklasfasching), and [@zaitseff](https://github.com/zaitseff) for their ongoing contributions. And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) and [@onedrawingperday](https://github.com/onedrawingperday) for their relentless work on keeping the themes site in pristine condition and to [@kaushalmodi](https://github.com/kaushalmodi) for his great work on the documentation site.
+
+Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs), which has received **8 contributions by 5 contributors**. A special thanks to [@bep](https://github.com/bep), [@DirtyF](https://github.com/DirtyF), [@pfhawkins](https://github.com/pfhawkins), and [@bubelov](https://github.com/bubelov) for their work on the documentation site.
+
+Also a big shoutout and thanks to the very active and helpful moderators on the [Hugo Discourse](https://discourse.gohugo.io/), making it a first class forum for Hugo questions and discussions.
+
+Hugo now has:
+
+* 40362+ [stars](https://github.com/gohugoio/hugo/stargazers)
+* 440+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
+* 284+ [themes](http://themes.gohugo.io/)
+
+## Notes
+
+* Ace and Amber support is now removed from Hugo. See [#6609](https://github.com/gohugoio/hugo/issues/6609) for more information.
+* The `markdownify` template function does not, yet, support render hooks. We recommend you look at the new and more powerful [.RenderString](https://gohugo.io/functions/renderstring/) method on `Page`.
+* If you have output format specific behaviour in a template used from a content file, you must create a output format specific template, e.g. `myshortcode.amp.html`. This also applies to the new rendering hooks introduced in this release. This has been the intended behaviour all the time, but a failing test (now fixed) shows that the implementation of this has not been as strict as specified, hence this note.
+* The `errorf` does not return any value anymore. This means that the ERROR will just be printed to the console. We have also added a `warnf` template func.
+
+
+## Enhancements
+
+### Templates
+
+* Do not return any value in errorf [50cc7fe5](https://github.com/gohugoio/hugo/commit/50cc7fe54580018239ea95aafe67f6a158cdcc9f) [@bep](https://github.com/bep) [#6653](https://github.com/gohugoio/hugo/issues/6653)
+* Add a warnf template func [1773d71d](https://github.com/gohugoio/hugo/commit/1773d71d5b40f5a6a14edca417d2818607a499f1) [@bep](https://github.com/bep) [#6628](https://github.com/gohugoio/hugo/issues/6628)
+* Some more params merge adjustments [ccb1bf1a](https://github.com/gohugoio/hugo/commit/ccb1bf1abb7341fa1be23a90b66c14ae89790f49) [@bep](https://github.com/bep) [#6633](https://github.com/gohugoio/hugo/issues/6633)
+* Get rid of the custom template truth logic [d20ca370](https://github.com/gohugoio/hugo/commit/d20ca3700512d661247b44d953515b9455e57ed6) [@bep](https://github.com/bep) [#6615](https://github.com/gohugoio/hugo/issues/6615)
+* Add some comments [92c7f7ab](https://github.com/gohugoio/hugo/commit/92c7f7ab85a40cae8f36f2348d86f3e47d811eb5) [@bep](https://github.com/bep)
+
+### Core
+
+* Improve error and reload handling of hook templates in server mode [8a58ebb3](https://github.com/gohugoio/hugo/commit/8a58ebb311fd079f65068e7e37725e4d43f17ab5) [@bep](https://github.com/bep) [#6635](https://github.com/gohugoio/hugo/issues/6635)
+
+### Other
+
+* Update Goldmark to v1.1.18 [1fb17be9](https://github.com/gohugoio/hugo/commit/1fb17be9a008b549d11b622849adbaad01d4023d) [@bep](https://github.com/bep) [#6649](https://github.com/gohugoio/hugo/issues/6649)
+* Update go-org [51d89dab](https://github.com/gohugoio/hugo/commit/51d89dab1827ae80f9d865f5c38cb5f6a3a11f68) [@niklasfasching](https://github.com/niklasfasching)
+* More on hooks [c8bfe47c](https://github.com/gohugoio/hugo/commit/c8bfe47c6a740c5fedfdb5b7465d7ae1db44cb65) [@bep](https://github.com/bep)
+* Update to Goldmark v1.1.17 [04536838](https://github.com/gohugoio/hugo/commit/0453683816cfbc94e1e19c644f5f84213bb8cf35) [@bep](https://github.com/bep) [#6641](https://github.com/gohugoio/hugo/issues/6641)
+* Regen docshelper [55c29d4d](https://github.com/gohugoio/hugo/commit/55c29d4de38df67dd116f1845f7cc69ca7e35843) [@bep](https://github.com/bep)
+* Preserve HTML Text for image render hooks [a67d95fe](https://github.com/gohugoio/hugo/commit/a67d95fe1a033ca4934957b5a98b12ecc8a9edbd) [@bep](https://github.com/bep) [#6639](https://github.com/gohugoio/hugo/issues/6639)
+* Update Goldmark [eef934ae](https://github.com/gohugoio/hugo/commit/eef934ae7eabc38eeba386831de6013eec0285f2) [@bep](https://github.com/bep) [#6626](https://github.com/gohugoio/hugo/issues/6626)
+* Preserve HTML Text for link render hooks [00954c5d](https://github.com/gohugoio/hugo/commit/00954c5d1fda0b18cd1b847ee580d5f4caa76c70) [@bep](https://github.com/bep) [#6629](https://github.com/gohugoio/hugo/issues/6629)
+* Footnote [3e316155](https://github.com/gohugoio/hugo/commit/3e316155c5d4fbf166d38e997a41101b6aa501d5) [@bep](https://github.com/bep)
+* Add render template hooks for links and images [e625088e](https://github.com/gohugoio/hugo/commit/e625088ef5a970388ad50e464e87db56b358dac4) [@bep](https://github.com/bep) [#6545](https://github.com/gohugoio/hugo/issues/6545)[#4663](https://github.com/gohugoio/hugo/issues/4663)[#6043](https://github.com/gohugoio/hugo/issues/6043)
+* Enhance accessibility to issues [0947cf95](https://github.com/gohugoio/hugo/commit/0947cf958358e5a45b4f605e2a5b2504896fa360) [@peaceiris](https://github.com/peaceiris) [#6233](https://github.com/gohugoio/hugo/issues/6233)
+* Re-introduce the correct version of Goldmark [03d6960a](https://github.com/gohugoio/hugo/commit/03d6960a15dcc8efc164e5ed310b12bd1ffdd930) [@bep](https://github.com/bep)
+* Rework template handling for function and map lookups [a03c631c](https://github.com/gohugoio/hugo/commit/a03c631c420a03f9d90699abdf9be7e4fca0ff61) [@bep](https://github.com/bep) [#6594](https://github.com/gohugoio/hugo/issues/6594)
+* Create lightweight forks of text/template and html/template [167c0153](https://github.com/gohugoio/hugo/commit/167c01530bb295c8b8d35921eb27ffa5bee76dfe) [@bep](https://github.com/bep) [#6594](https://github.com/gohugoio/hugo/issues/6594)
+* Add config option for ordered list [4c804319](https://github.com/gohugoio/hugo/commit/4c804319f6db0b8459cc9b5df4a904fd2c55dedd) [@gavinhoward](https://github.com/gavinhoward)
+
+## Fixes
+
+### Templates
+
+* Fix merge vs Params [1b785a7a](https://github.com/gohugoio/hugo/commit/1b785a7a6d3c264e39e4976c59b618c0ac1ba5f9) [@bep](https://github.com/bep) [#6633](https://github.com/gohugoio/hugo/issues/6633)
+
+### Core
+
+* Fix test [3c24ae03](https://github.com/gohugoio/hugo/commit/3c24ae030fe08ba259dd3de7ffea6c927c01e070) [@bep](https://github.com/bep)
+
+### Other
+
+* Fix abs path handling in module mounts [ad6504e6](https://github.com/gohugoio/hugo/commit/ad6504e6b504277bbc7b60d093cdccd4f3baaa4f) [@bep](https://github.com/bep) [#6622](https://github.com/gohugoio/hugo/issues/6622)
+* Fix incorrect MIME type from image/jpg to image/jpeg [158e7ec2](https://github.com/gohugoio/hugo/commit/158e7ec204e5149d77893d353cac9f55946d3e9a) [@zaitseff](https://github.com/zaitseff)
--- /dev/null
- title: "Markdown Render Hooks for Headings"
+
+---
+date: 2020-05-18
-
-
-
-
-
++title: Markdown render hooks for headings
+description: "Render hooks for headings, update to Go 1.14.3, several bug fixes etc."
+categories: ["Releases"]
+---
+
+Hugo 0.71 brings [Markdown render hooks for headings](https://gohugo.io/getting-started/configuration-markup#markdown-render-hooks), a set of bug fixes and more.
+
+This release represents **12 contributions by 7 contributors** to the main Hugo code base. [@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@anthonyfok](https://github.com/anthonyfok), [@apexskier](https://github.com/apexskier), and [@johnweldon](https://github.com/johnweldon) for their ongoing contributions.
+
+And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) and [@onedrawingperday](https://github.com/onedrawingperday) for their relentless work on keeping the themes site in pristine condition and to [@davidsneighbour](https://github.com/davidsneighbour) and [@kaushalmodi](https://github.com/kaushalmodi) for all the great work on the documentation site.
+
+Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
+which has received **8 contributions by 7 contributors**. A special thanks to [@bep](https://github.com/bep), [@mikeee](https://github.com/mikeee), [@h-enk](https://github.com/h-enk), and [@tjamet](https://github.com/tjamet) for their work on the documentation site.
+
+
+Hugo now has:
+
+* 44043+ [stars](https://github.com/gohugoio/hugo/stargazers)
+* 437+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
+* 322+ [themes](http://themes.gohugo.io/)
+
+## Enhancements
+
+### Other
+
+* Use WARN log level also for the early initialization [518d1496](https://github.com/gohugoio/hugo/commit/518d149646c13fb49c296a63e61a048f5e672179) [@bep](https://github.com/bep) [#7285](https://github.com/gohugoio/hugo/issues/7285)
+* Update to Go 1.14.3 and Go 1.13.11 [3cc41523](https://github.com/gohugoio/hugo/commit/3cc41523bef802d1942f3d31018547a18cc55923) [@bep](https://github.com/bep)
+* Improve error message when no Babel installed [2fd0a5a6](https://github.com/gohugoio/hugo/commit/2fd0a5a6781456e88745b370d12aaf5351a020ff) [@bep](https://github.com/bep)
+* Add test for headings render hook [6e051c05](https://github.com/gohugoio/hugo/commit/6e051c053e2b5b8419f357ed8acd177440266d07) [@apexskier](https://github.com/apexskier)
+* Add render template hooks for headings [423b8f2f](https://github.com/gohugoio/hugo/commit/423b8f2fb834139cf31514b14b1c1bf28e43b384) [@elihunter173](https://github.com/elihunter173) [#6713](https://github.com/gohugoio/hugo/issues/6713)
+* Add math.Pow [99193449](https://github.com/gohugoio/hugo/commit/991934497e88dcd4134a369a213bb5072c51c139) [@jmooring](https://github.com/jmooring) [#7266](https://github.com/gohugoio/hugo/issues/7266)
+* Do not suppress .well-known/ directory [558c0930](https://github.com/gohugoio/hugo/commit/558c09305e2be16953238c6c0e828f62b950e4f5) [@johnweldon](https://github.com/johnweldon) [#6691](https://github.com/gohugoio/hugo/issues/6691)
+* Quote "@babel/cli" to solve build error [b69a3614](https://github.com/gohugoio/hugo/commit/b69a36140f42ec99ffa2d1e029b8b86ecf8ff929) [@anthonyfok](https://github.com/anthonyfok)
+* Remove custom x-nodejs plugin [a0103864](https://github.com/gohugoio/hugo/commit/a0103864ab76c6a1462a6dee538801740acf4858) [@anthonyfok](https://github.com/anthonyfok)
+* Use .Lastmod for og:updated_time [6205d56b](https://github.com/gohugoio/hugo/commit/6205d56b85fea31e008cd0fef26805bab8084786) [@dtip](https://github.com/dtip)
+
+## Fixes
+
+### Other
+
+* Fix Babel on Windows [723ec555](https://github.com/gohugoio/hugo/commit/723ec555e75fbfa94d90d3ecbcd5775d6c7800e1) [@bep](https://github.com/bep) [#7251](https://github.com/gohugoio/hugo/issues/7251)
+* Upgrade chroma to 0.7.3 to fix invalid css [b342e8fb](https://github.com/gohugoio/hugo/commit/b342e8fbdb23157f3979af91cb5d8d3438003707) [@apexskier](https://github.com/apexskier) [#7207](https://github.com/gohugoio/hugo/issues/7207)
--- /dev/null
- * We have added `Replacements` to the [Module Configuration](https://gohugo.io/hugo-modules/configuration/#module-config-top-level). This should enable a much simpler developer workflow, simpler to set up preview sites for your remote theme etc, as you now can do `env HUGO_MODULE_REPLACEMENTS="github.com/bep/myprettytheme -> ../.." hugo` and similar.
+
+---
+date: 2020-10-30
+title: "Hugo 0.77.0: Hugo Modules Improvements and More "
+description: "New Replacements config option for simpler development workflows, ignore errors from getJSON, localized dates, and more."
+categories: ["Releases"]
+---
+
+Hugo `0.77.0` is a small, but useful release. Some notable updates are:
+
+* **time.AsTime** accepts an optional location as second parameter, allowing timezone aware printing of dates.
+* You can now build with `go install -tags nodeploy` if you don't need the **`hugo deploy`** feature.
+* Remote **`getJSON`** errors can now be ignored by adding `ignoreErrors = ["error-remote-getjson"]` to your site config.
+
+There are also several useful **[Hugo Modules](https://gohugo.io/hugo-modules/)** enhancements:
+
-
-
-
-
-
++* We have added `Replacements` to the [Module Configuration](https://gohugo.io/hugo-modules/configuration/#module-configuration-top-level). This should enable a much simpler developer workflow, simpler to set up preview sites for your remote theme etc, as you now can do `env HUGO_MODULE_REPLACEMENTS="github.com/bep/myprettytheme -> ../.." hugo` and similar.
+* The module `Path` for local modules can now be absolute for imports defined in the project.
+
+This release represents **38 contributions by 11 contributors** to the main Hugo code base. [@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@moorereason](https://github.com/moorereason), and [@anthonyfok](https://github.com/anthonyfok) for their ongoing contributions.
+
+And a big thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his relentless work on keeping the themes site in pristine condition and to [@davidsneighbour](https://github.com/davidsneighbour), [@coliff](https://github.com/coliff) and [@kaushalmodi](https://github.com/kaushalmodi) for all the great work on the documentation site.
+
+Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
+which has received **3 contributions by 3 contributors**.
+
+Hugo now has:
+
+* 47530+ [stars](https://github.com/gohugoio/hugo/stargazers)
+* 438+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
+* 361+ [themes](http://themes.gohugo.io/)
+
+## Enhancements
+
+### Templates
+
+* Refactor time.AsTime location implementation [807db97a](https://github.com/gohugoio/hugo/commit/807db97af83ff61b022cbc8af80b9dc9cdb8dd43) [@moorereason](https://github.com/moorereason)
+* Update Hugo time to support optional [LOCATION] parameter [26eeb291](https://github.com/gohugoio/hugo/commit/26eeb2914720929d2d778f14d6a4bf737014e9e3) [@virgofx](https://github.com/virgofx)
+* Improve layout path construction [acfa1538](https://github.com/gohugoio/hugo/commit/acfa153863d6ff2acf17ffb4395e05d102229905) [@moorereason](https://github.com/moorereason)
+* Test all lookup permutations in TestLayout [78b26d53](https://github.com/gohugoio/hugo/commit/78b26d538c716d463b30c23de7df5eaa4d5504fd) [@moorereason](https://github.com/moorereason)
+* Reformat TestLayout table [28179bd5](https://github.com/gohugoio/hugo/commit/28179bd55619847f46ca0ffd316ef52fc9c96f1e) [@moorereason](https://github.com/moorereason)
+
+### Other
+
+* Allow absolute paths for project imports [beabc8d9](https://github.com/gohugoio/hugo/commit/beabc8d998249ecc5dd522d696dc6233a29131c2) [@bep](https://github.com/bep) [#7910](https://github.com/gohugoio/hugo/issues/7910)
+* Regen docs helper [332b65e4](https://github.com/gohugoio/hugo/commit/332b65e4ccb6ac0d606de2a1b23f5189c72542be) [@bep](https://github.com/bep)
+* Add module.replacements [173187e2](https://github.com/gohugoio/hugo/commit/173187e2633f3fc037c83e1e3de2902ae3c93b92) [@bep](https://github.com/bep) [#7904](https://github.com/gohugoio/hugo/issues/7904)[#7908](https://github.com/gohugoio/hugo/issues/7908)
+* Do not call CDN service invalidation when executing a dry run deployment [56a34350](https://github.com/gohugoio/hugo/commit/56a343507ca28254edb891bc1c21b6c8ca017982) [@zemanel](https://github.com/zemanel) [#7884](https://github.com/gohugoio/hugo/issues/7884)
+* Pass editor arguments from newContentEditor correctly [d48a98c4](https://github.com/gohugoio/hugo/commit/d48a98c477a818d28008d9771050d2681e63e880) [@bhavin192](https://github.com/bhavin192)
+* Bump github.com/spf13/cobra from 0.0.7 to 1.1.1 [3261678f](https://github.com/gohugoio/hugo/commit/3261678f63fd66810db77ccaf9a0c0e426be5380) [@anthonyfok](https://github.com/anthonyfok)
+* Allow optional "nodeploy" tag to exclude deploy command from bin [f465c5c3](https://github.com/gohugoio/hugo/commit/f465c5c3079261eb7fa513e2d2793851b9c52b83) [@emhagman](https://github.com/emhagman) [#7826](https://github.com/gohugoio/hugo/issues/7826)
+* Allow cascade _target to work with non toml fm [3400aff2](https://github.com/gohugoio/hugo/commit/3400aff2588cbf9dd4629c05537d16b019d0fdf5) [@gwatts](https://github.com/gwatts) [#7874](https://github.com/gohugoio/hugo/issues/7874)
+* Allow getJSON errors to be ignored [fdfa4a5f](https://github.com/gohugoio/hugo/commit/fdfa4a5fe62232f65f1dd8d6fe0c500374228788) [@bep](https://github.com/bep) [#7866](https://github.com/gohugoio/hugo/issues/7866)
+* bump github.com/evanw/esbuild from 0.7.15 to 0.7.18 [8cbe2bbf](https://github.com/gohugoio/hugo/commit/8cbe2bbfad6aa4de267921e24e166d4addf47040) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Revert "Add benchmark for building docs site" [b886fa46](https://github.com/gohugoio/hugo/commit/b886fa46bb92916152476cfac45c7a5ee5e5820a) [@bep](https://github.com/bep)
+* Avoid making unnecessary allocation [14bce18a](https://github.com/gohugoio/hugo/commit/14bce18a6c5aca8cb3e70a74d5045ca8b2358fee) [@moorereason](https://github.com/moorereason)
+* Add benchmark for building docs site [837e084b](https://github.com/gohugoio/hugo/commit/837e084bbe53e9e2e6cd471d2a3daf273a874d92) [@moorereason](https://github.com/moorereason)
+* Always show page number when 5 pages or less [08e4f9ff](https://github.com/gohugoio/hugo/commit/08e4f9ff9cc448d5fea9b8a62a23aed8aad0d047) [@moorereason](https://github.com/moorereason) [#7523](https://github.com/gohugoio/hugo/issues/7523)
+* bump github.com/frankban/quicktest from 1.11.0 to 1.11.1 [f033d9f0](https://github.com/gohugoio/hugo/commit/f033d9f01d13d8cd08205ccfaa09919ed15dca77) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/evanw/esbuild from 0.7.14 to 0.7.15 [59fe2794](https://github.com/gohugoio/hugo/commit/59fe279424c66ac6a89cafee01a5b2e34dbcc1fb) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Merge branch 'release-0.76.5' [62119022](https://github.com/gohugoio/hugo/commit/62119022d1be41e423ef3bcf467a671ce6c4f7dd) [@bep](https://github.com/bep)
+* Render aliases even if render=link [79a022a1](https://github.com/gohugoio/hugo/commit/79a022a15c5f39b8ae87a94665f14bf1797b605c) [@bep](https://github.com/bep) [#7832](https://github.com/gohugoio/hugo/issues/7832)
+* Render aliases even if render=link [ead5799f](https://github.com/gohugoio/hugo/commit/ead5799f7ea837fb2ca1879a6d37ba364e53827f) [@bep](https://github.com/bep) [#7832](https://github.com/gohugoio/hugo/issues/7832)
+* bump github.com/spf13/afero from 1.4.0 to 1.4.1 [d57be113](https://github.com/gohugoio/hugo/commit/d57be113243be4b76310d4476fbb7525d1452658) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/evanw/esbuild from 0.7.9 to 0.7.14 [d0705966](https://github.com/gohugoio/hugo/commit/d070596694a3edbf42fc315bb326505aa39fce90) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Update to Go 1.15 and Alpine 3.12 [f5ea359d](https://github.com/gohugoio/hugo/commit/f5ea359dd34bf59a2944f1d9667838202af13c93) [@ducksecops](https://github.com/ducksecops)
+* Install postcss v8 explicitly as it is now a peer dependency [e9a7ebaf](https://github.com/gohugoio/hugo/commit/e9a7ebaf67a63ffe5e64c3b3aaefe66feb7f1868) [@anthonyfok](https://github.com/anthonyfok)
+* Merge branch 'release-0.76.3' [49972d07](https://github.com/gohugoio/hugo/commit/49972d07925604fea45afe1ace7b5dcc6efc30bf) [@bep](https://github.com/bep)
+* Add merge helper [c98132e3](https://github.com/gohugoio/hugo/commit/c98132e30e01a9638e61bd888c769d30e4e43ad5) [@bep](https://github.com/bep)
+* Add workaround for known language, but missing plural rule error [33e9d79b](https://github.com/gohugoio/hugo/commit/33e9d79b78b32d0cc19693ab3c29ba9941d80f8f) [@bep](https://github.com/bep) [#7798](https://github.com/gohugoio/hugo/issues/7798)
+* Update to github.com/tdewolff/minify v2.9.4" [6dd60fca](https://github.com/gohugoio/hugo/commit/6dd60fca73ff96b48064bb8c6586631a2370ffc6) [@bep](https://github.com/bep) [#7792](https://github.com/gohugoio/hugo/issues/7792)
+
+## Fixes
+
+### Templates
+
+* Fix reflection bug in merge [6d95dc9d](https://github.com/gohugoio/hugo/commit/6d95dc9d74681cba53b46e79c6e1d58d27fcdfb0) [@moorereason](https://github.com/moorereason) [#7899](https://github.com/gohugoio/hugo/issues/7899)
+
+### Other
+
+* Fix setting HUGO_MODULE_PROXY etc. via env vars [8a1c637c](https://github.com/gohugoio/hugo/commit/8a1c637c4494751046142e0ef345fce38fc1431b) [@bep](https://github.com/bep) [#7903](https://github.com/gohugoio/hugo/issues/7903)
+* Fix for language code case issue with pt-br etc. [50682043](https://github.com/gohugoio/hugo/commit/506820435cacb39ce7bb1835f46a15e913b95828) [@bep](https://github.com/bep) [#7804](https://github.com/gohugoio/hugo/issues/7804)
+* Fix for bare TOML keys [fc6abc39](https://github.com/gohugoio/hugo/commit/fc6abc39c75c152780151c35bc95b12bee01b09c) [@bep](https://github.com/bep)
+* Fix i18n .Count regression [f9e798e8](https://github.com/gohugoio/hugo/commit/f9e798e8c4234bd60277e3cb10663ba254d4ecb7) [@bep](https://github.com/bep) [#7787](https://github.com/gohugoio/hugo/issues/7787)
+* Fix typo in 0.76.0 release note [ee56efff](https://github.com/gohugoio/hugo/commit/ee56efffcb3f81120b0d3e0297b4fb5966124354) [@digitalcraftsman](https://github.com/digitalcraftsman)
--- /dev/null
- We have added the [configuration settings](https://gohugo.io/hugo-modules/configuration/#module-config-mounts) **includeFiles** and **excludeFiles** to the mount configuration. This allows fine grained control over what files to include, and it works for all of Hugo's file systems (including `/static`).
+
+---
+date: 2021-11-02
+title: "Fine Grained File Filters"
+description: "Hugo 0.89.0 brings fine grained file filters, archetype rewrite, dependency refresh, and more ..."
+categories: ["Releases"]
+---
+
+This release is a dependency refresh (the new Goldmark version comes with a lot of bug fixes, as one example), many bug fixes, but also some nice new features:
+
++We have added the [configuration settings](https://gohugo.io/hugo-modules/configuration/#module-configuration-mounts) **includeFiles** and **excludeFiles** to the mount configuration. This allows fine grained control over what files to include, and it works for all of Hugo's file systems (including `/static`).
+
+We have also [reimplemented archetypes](https://github.com/gohugoio/hugo/pull/9045). The old implementation had some issues, mostly related to the context (e.g. name, file paths) passed to the template. This new implementation is using the exact same code path for evaluating the pages as in a regular build. This also makes it more robust and easier to reason about in a multilingual setup. Now, if you are explicit about the target path, Hugo will now always pick the correct mount and language:
+
+```
+hugo new content/en/posts/my-first-post.md
+```
+
+This release represents **50 contributions by 13 contributors** to the main Hugo code base. [@bep](https://github.com/bep) leads the Hugo development with a significant amount of contributions, but also a big shoutout to [@dependabot[bot]](https://github.com/apps/dependabot), [@jmooring](https://github.com/jmooring), and [@anthonyfok](https://github.com/anthonyfok) for their ongoing contributions.
+And thanks to [@digitalcraftsman](https://github.com/digitalcraftsman) for his ongoing work on keeping the themes site in pristine condition.
+
+Many have also been busy writing and fixing the documentation in [hugoDocs](https://github.com/gohugoio/hugoDocs),
+which has received **23 contributions by 9 contributors**. A special thanks to [@jmooring](https://github.com/jmooring), [@bep](https://github.com/bep), [@coliff](https://github.com/coliff), and [@vipkr](https://github.com/vipkr) for their work on the documentation site.
+
+
+Hugo now has:
+
+* 54999+ [stars](https://github.com/gohugoio/hugo/stargazers)
+* 430+ [contributors](https://github.com/gohugoio/hugo/graphs/contributors)
+* 413+ [themes](http://themes.gohugo.io/)
+
+
+## Notes
+
+* Hugo now writes an empty file named `.hugo_build.lock` to the root of the project when building (also when doing `hugo new mypost.md` and other commands that requires a build). We recommend you just leave this file alone. Put it in `.gitignore` or similar if you don't want the file in your source repository.
+* We have updated to ESBuild `v0.13.12`. The release notes for [v0.13.0](https://github.com/evanw/esbuild/releases/tag/v0.13.0) mentions a potential breaking change.
+* We now only build AMD64 release binaries (see [this issue](https://github.com/gohugoio/hugo/issues/9102)) for the Unix OSes (e.g. NetBSD). If you need, say, a binary for ARM64, you need to build it yourself.
+* We now build only one release binary/archive for MacOS (see [this issue](https://github.com/gohugoio/hugo/issues/9035)) that works on both Intel and the new Arm M1 systems.
+* `.File.ContentBaseName` now returns the owning directory name for all bundles (branch an leaf). This is a bug fix, but worth mentioning. See [this issue](https://github.com/gohugoio/hugo/issues/9112).
+* We have updated the Twitter shortcode to use Twitter's new API. See [this issue](https://github.com/gohugoio/hugo/pull/9106) for details.
+
+## Enhancements
+
+### Templates
+
+* Use configured location when date passed to Format is string [e82cbd74](https://github.com/gohugoio/hugo/commit/e82cbd746fd4b07e40fedacc4247b9cd50ef70e7) [@bep](https://github.com/bep) [#9084](https://github.com/gohugoio/hugo/issues/9084)
+* Add path.Clean [e55466ce](https://github.com/gohugoio/hugo/commit/e55466ce70363418309d465a0f2aa6c7ada1e51d) [@bradcypert](https://github.com/bradcypert) [#8885](https://github.com/gohugoio/hugo/issues/8885)
+
+### Other
+
+* Regen CLI docs [f503b639](https://github.com/gohugoio/hugo/commit/f503b6395707f8e576af734efab83092d62fae37) [@bep](https://github.com/bep)
+* Make ContentBaseName() return the directory for branch bundles [30aba7fb](https://github.com/gohugoio/hugo/commit/30aba7fb099678363b0a4828936ed28e740e00e2) [@bep](https://github.com/bep) [#9112](https://github.com/gohugoio/hugo/issues/9112)
+* Update Twitter shortcode oEmbed endpoint [0cc39af6](https://github.com/gohugoio/hugo/commit/0cc39af68232f1a4981aae2e72cf65da762b5768) [@jmooring](https://github.com/jmooring) [#8130](https://github.com/gohugoio/hugo/issues/8130)
+* bump github.com/evanw/esbuild from 0.13.10 to 0.13.12 [7fa66425](https://github.com/gohugoio/hugo/commit/7fa66425aa0a918b4bf5eb9a21f6e567e0a7e876) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/yuin/goldmark from 1.4.1 to 1.4.2 [69210cfd](https://github.com/gohugoio/hugo/commit/69210cfdf341d1faef23f4e9290d51448dd5e0c6) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/aws/aws-sdk-go from 1.40.8 to 1.41.14 [3339c2bb](https://github.com/gohugoio/hugo/commit/3339c2bb618c29bb3ad442c71fe1542ad7195971) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/getkin/kin-openapi from 0.79.0 to 0.80.0 [03bbdba8](https://github.com/gohugoio/hugo/commit/03bbdba8be19929cb6a14243b690372fbfbc6aa6) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/evanw/esbuild from 0.13.8 to 0.13.10 [a772b8fc](https://github.com/gohugoio/hugo/commit/a772b8fc3833e010553c412dd5daa0175e6ccead) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Rename excepted filenames for image golden testdata [dce49d13](https://github.com/gohugoio/hugo/commit/dce49d13336f3dbadaa1359322a277ad4cb55679) [@anthonyfok](https://github.com/anthonyfok) [#6387](https://github.com/gohugoio/hugo/issues/6387)
+* bump github.com/frankban/quicktest from 1.13.1 to 1.14.0 [61c5b7a2](https://github.com/gohugoio/hugo/commit/61c5b7a2e623255be99da7adf200f0591c9a1195) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Validate the target path in hugo new [75c9b893](https://github.com/gohugoio/hugo/commit/75c9b893d98961a504cff9ed3c89055d16e315d6) [@bep](https://github.com/bep) [#9072](https://github.com/gohugoio/hugo/issues/9072)
+* Set zone of datetime from from `go-toml` [b959ecbc](https://github.com/gohugoio/hugo/commit/b959ecbc8175e2bf260f10b08965531bce9bcb7e) [@satotake](https://github.com/satotake) [#8895](https://github.com/gohugoio/hugo/issues/8895)
+* Added nodesource apt repository to snap package [70e45481](https://github.com/gohugoio/hugo/commit/70e454812ef684d02ffa881becf0f8ce6a1b5f8c) [@sergiogarciadev](https://github.com/sergiogarciadev)
+* Set HUGO_ENABLEGITINFO=false override in Set_in_string [355ff83e](https://github.com/gohugoio/hugo/commit/355ff83e74f6e27c79033b8dfb899e3a3b529049) [@anthonyfok](https://github.com/anthonyfok)
+* Add includeFiles and excludeFiles to mount configuration [471ed91c](https://github.com/gohugoio/hugo/commit/471ed91c60cd36645794925cb4892cc820eae626) [@bep](https://github.com/bep) [#9042](https://github.com/gohugoio/hugo/issues/9042)
+* bump github.com/mitchellh/mapstructure from 1.4.1 to 1.4.2 [94a5bac5](https://github.com/gohugoio/hugo/commit/94a5bac5b29bbba1ca4809752fe3fd04a58547b6) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Always preserve the original transform error [9830ca9e](https://github.com/gohugoio/hugo/commit/9830ca9e319f6ce313f4e542a202bd0d0469a9ed) [@bep](https://github.com/bep)
+* Add hyperlink to the banner [b64fd057](https://github.com/gohugoio/hugo/commit/b64fd0577b0fb222bea22ae347acb5dd17b2aa04) [@itsAftabAlam](https://github.com/itsAftabAlam)
+* bump github.com/getkin/kin-openapi from 0.78.0 to 0.79.0 [2706437a](https://github.com/gohugoio/hugo/commit/2706437a7d593b66b0fbad0235dbaf917593971b) [@dependabot[bot]](https://github.com/apps/dependabot)
+* github.com/evanw/esbuild v0.13.5 => v0.13.8 [ec7c993c](https://github.com/gohugoio/hugo/commit/ec7c993cfe216b8a3c6fbac85669cefef59778dd) [@bep](https://github.com/bep)
+* Return error on no content dirs [32c6f656](https://github.com/gohugoio/hugo/commit/32c6f656d93ecf4308f7c30848b13b4c6f157436) [@bep](https://github.com/bep) [#9056](https://github.com/gohugoio/hugo/issues/9056)
+* Add a cross process build lock and use it in the archetype content builder [ba35e698](https://github.com/gohugoio/hugo/commit/ba35e69856900b6fc92681aa841cdcaefbb4b121) [@bep](https://github.com/bep) [#9048](https://github.com/gohugoio/hugo/issues/9048)
+* github.com/alecthomas/chroma v0.9.2 => v0.9.4 [bb053770](https://github.com/gohugoio/hugo/commit/bb053770337e214f41bc1c524d458ba7fbe1fc08) [@bep](https://github.com/bep) [#8532](https://github.com/gohugoio/hugo/issues/8532)
+* Reimplement archetypes [9185e11e](https://github.com/gohugoio/hugo/commit/9185e11effa682ea1ef7dc98f2943743671023a6) [@bep](https://github.com/bep) [#9032](https://github.com/gohugoio/hugo/issues/9032)[#7589](https://github.com/gohugoio/hugo/issues/7589)[#9043](https://github.com/gohugoio/hugo/issues/9043)[#9046](https://github.com/gohugoio/hugo/issues/9046)[#9047](https://github.com/gohugoio/hugo/issues/9047)
+* bump github.com/tdewolff/minify/v2 from 2.9.21 to 2.9.22 [168a3aab](https://github.com/gohugoio/hugo/commit/168a3aab4622786ccd0943137fce3912707f2a46) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Update github.com/evanw/esbuild v0.13.5 [8bcfa3bd](https://github.com/gohugoio/hugo/commit/8bcfa3bdf65492329da8093d841dd04c7a5a10c8) [@bep](https://github.com/bep)
+* bump github.com/mattn/go-isatty from 0.0.13 to 0.0.14 [cd4e67af](https://github.com/gohugoio/hugo/commit/cd4e67af182a1b3aa19db7609c7581c424e9310f) [@dependabot[bot]](https://github.com/apps/dependabot)
+* bump github.com/getkin/kin-openapi from 0.75.0 to 0.78.0 [e6ad1f0e](https://github.com/gohugoio/hugo/commit/e6ad1f0e763ee891bf4d71df0168b6949369c793) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Allow multiple plugins in the PostCSS options map [64abc83f](https://github.com/gohugoio/hugo/commit/64abc83fc4b70c70458c582ae2cf67fc9c67bb3f) [@jmooring](https://github.com/jmooring) [#9015](https://github.com/gohugoio/hugo/issues/9015)
+* Create path.Clean documentation [f8d132d7](https://github.com/gohugoio/hugo/commit/f8d132d731cf8e27c8c17931597fd975e8a7c3cc) [@jmooring](https://github.com/jmooring)
+* Skip a test assertion on CI [26f1919a](https://github.com/gohugoio/hugo/commit/26f1919ae0cf57d754bb029270c20e76cc32cf4d) [@bep](https://github.com/bep)
+* Remove tracking image [ecf025f0](https://github.com/gohugoio/hugo/commit/ecf025f006f22061728e78f2cf50257dde2225ee) [@kambojshalabh35](https://github.com/kambojshalabh35)
+* Revert "Remove credit from release notes" [fab1e43d](https://github.com/gohugoio/hugo/commit/fab1e43de59f3a7596ab23347387d846139bc3a3) [@digitalcraftsman](https://github.com/digitalcraftsman)
+* Pass minification errors to the user [e03f82ee](https://github.com/gohugoio/hugo/commit/e03f82eef2679ec8963894d0b911363eef40941a) [@ptgott](https://github.com/ptgott) [#8954](https://github.com/gohugoio/hugo/issues/8954)
+* Clarify "precision" in currency format functions [a864ffe9](https://github.com/gohugoio/hugo/commit/a864ffe9acf295034bb38e789a0efa62906b2ae4) [@ptgott](https://github.com/ptgott)
+* bump github.com/evanw/esbuild from 0.12.24 to 0.12.29 [b49da332](https://github.com/gohugoio/hugo/commit/b49da33280cb01795ce833e70c2b7b78cca1867e) [@dependabot[bot]](https://github.com/apps/dependabot)
+* Use default math/rand.Source for concurrency safety [7c21eca7](https://github.com/gohugoio/hugo/commit/7c21eca74f95b61d6813d0c0b155bf07c9aa8575) [@odeke-em](https://github.com/odeke-em) [#8981](https://github.com/gohugoio/hugo/issues/8981)
+* Make the error handling for the mod commands more lenient [13ad8408](https://github.com/gohugoio/hugo/commit/13ad8408fc6b645b12898fb8053388fc4848dfbd) [@bep](https://github.com/bep)
+* Add some help text to the 'unknown revision' error [1cabf61d](https://github.com/gohugoio/hugo/commit/1cabf61ddf96b89c95c3ba77a985168184920feb) [@bep](https://github.com/bep) [#6825](https://github.com/gohugoio/hugo/issues/6825)
+* Update github.com/yuin/goldmark v1.4.0 => v1.4.1 [268e3069](https://github.com/gohugoio/hugo/commit/268e3069f37df01a5a58b615844652fb75b8503a) [@jmooring](https://github.com/jmooring) [#8855](https://github.com/gohugoio/hugo/issues/8855)
+
+## Fixes
+
+### Templates
+
+* Fix time.Format with Go layouts [ed6fd26c](https://github.com/gohugoio/hugo/commit/ed6fd26ce884c49b02497728a99e90b92dd65f1f) [@bep](https://github.com/bep) [#9107](https://github.com/gohugoio/hugo/issues/9107)
+
+### Other
+
+* Fix description of lang.FormatNumberCustom [04a3b45d](https://github.com/gohugoio/hugo/commit/04a3b45db4cd28b4821b5c98cd67dfbf1d098957) [@jmooring](https://github.com/jmooring)
+* Fix typo in error message [1d60bd1e](https://github.com/gohugoio/hugo/commit/1d60bd1efa943349636edad3dd8c5427312ab0f1) [@jmooring](https://github.com/jmooring)
+* Fix panic when specifying multiple excludeFiles directives [64e1613f](https://github.com/gohugoio/hugo/commit/64e1613fb390bd893900dc0596e5c3f3c8e1cd8c) [@bep](https://github.com/bep) [#9076](https://github.com/gohugoio/hugo/issues/9076)
+* Fix file permissions in new archetype implementation [e02e0727](https://github.com/gohugoio/hugo/commit/e02e0727e57f123f9a8de506e9c098bb374f7a23) [@bep](https://github.com/bep) [#9057](https://github.com/gohugoio/hugo/issues/9057)
+* Fix the "page picker" logic in --navigateToChanged [096f5e19](https://github.com/gohugoio/hugo/commit/096f5e19217e985bccbf6c539e1b220541ffa6f6) [@bep](https://github.com/bep) [#9051](https://github.com/gohugoio/hugo/issues/9051)
+* Fix a typo on OpenBSD [c7957c90](https://github.com/gohugoio/hugo/commit/c7957c90e83ff2b2cc958bd61486a244f0fd8891) [@nabbisen](https://github.com/nabbisen)
+* Fix value of useResourceCacheWhen in TestResourceChainPostCSS [e6e44b7c](https://github.com/gohugoio/hugo/commit/e6e44b7c41a9b517ffc3775ea0a6aec2b1d4591b) [@jmooring](https://github.com/jmooring)
--- /dev/null
- ### Hugo Date Templating Reference
+Go templates [format your dates][time] according to a single reference time:
+
+```txt
+Mon Jan 2 15:04:05 MST 2006
+```
+
+You can think of `MST` as `07`, thus making the reference format string a sequence of numbers. The following is [taken directly from the Go docs][gdex]:
+
+```txt
+Jan 2 15:04:05 2006 MST
+ 1 2 3 4 5 6 -7
+```
+
- ### Cardinal Numbers and Ordinal Abbreviations
++### Hugo date templating reference
+
+Each of the following examples show the reference formatting string followed by the string Hugo will output in your HTML.
+
+Note that the examples were rendered and tested in [CST] and pull from a single example date you might have in your content's front matter:
+
+```yml
+date: 2017-03-03T14:15:59-06:00
+```
+
+`.Date` (i.e. called via [page variable][pagevars])
+: **Returns**: `2017-03-03 14:15:59 -0600 CST`
+
+`"Monday, January 2, 2006"`
+: **Returns**: `Friday, March 3, 2017`
+
+`"Mon Jan 2 2006"`
+: **Returns**: `Fri Mar 3 2017`
+
+`"January 2nd"`
+: **Returns**: `March 3rd`
+
+`"January 2006"`
+: **Returns**: `March 2017`
+
+`"2006-01-02"`
+: **Returns**: `2017-03-03`
+
+`"Monday"`
+: **Returns**: `Friday`
+
+`"02 Jan 06 15:04 MST"` (RFC822)
+: **Returns**: `03 Mar 17 14:15 CST`
+
+`"02 Jan 06 15:04 -0700"` (RFC822Z)
+: **Returns**: `03 Mar 17 14:15 -0600`
+
+`"Mon, 02 Jan 2006 15:04:05 MST"` (RFC1123)
+: **Returns**: `Fri, 03 Mar 2017 14:15:59 CST`
+
+`"Mon, 02 Jan 2006 15:04:05 -0700"` (RFC339)
+: **Returns**: `Fri, 03 Mar 2017 14:15:59 -0600`
+
++### Cardinal numbers and ordinal abbreviations
+
+Spelled-out cardinal numbers (e.g. "one", "two", and "three") and ordinal abbreviations (e.g. "1st", "2nd", and "3rd") are not currently supported.
+
+To continue with the example above:
+
+```go-html-template
+{{ .Date.Format "Jan 2nd 2006" }}
+```
+
+Hugo assumes you want to append `nd` as a string to the day of the month and outputs the following:
+
+```txt
+Mar 2nd 2017
+```
+
+### Use `.Local` and `.UTC`
+
+In conjunction with the [`dateFormat` function][dateFormat], you can also convert your dates to `UTC` or to local timezones:
+
+`{{ dateFormat "02 Jan 06 15:04 MST" .Date.UTC }}`
+: **Returns**: `03 Mar 17 20:15 UTC`
+
+`{{ dateFormat "02 Jan 06 15:04 MST" .Date.Local }}`
+: **Returns**: `03 Mar 17 14:15 CST`
+
+[CST]: https://en.wikipedia.org/wiki/Central_Time_Zone
+[dateFormat]: /functions/dateformat/
+[gdex]: https://golang.org/pkg/time/#example_Time_Format
+[pagevars]: /variables/page/
+[time]: https://golang.org/pkg/time/
--- /dev/null
- In terms of PDF generation, we utilized [custom output formats](https://gohugo.io/templates/output-formats/) to produce intermediary document representations, which are consumed by our custom tool transforming them to TeX documents, which are finally used to produce PDF files.
+---
+title: Ampio Knowledge Base
+date: 2022-10-30
+
+description: "Knowledge base for the Ampio building automation system."
+siteURL: https://help.ampio.com/
+---
+
+As a company that specializes in highly customizable smart solutions for various industries, Ampio has accumulated a vast amount of knowledge throughout the years. We were on the lookout for a user-friendly platform to impart this knowledge to our clients and installers. Delivering a service that caters to both audiences, scattered around the globe with vastly divergent needs and expectations, was a challenge.
+
+On the one hand, we needed something that would let us educate a client with no technical knowledge about our system in a visually appealing way.
+
+On the other hand, our installers required technical drawings, offline manuals, and a deep dive into highly specialized subjects.
+
+Over and above that, we could not overlook the fact that our internal team of editors and maintainers of the Knowledge Base included non-programmers who had to be able to create content and navigate the architecture of the site just as well as those adept at coding.
+
+We started our journey with the following requirements:
+
+ - Ease of contribution
+ - Efficient search capabilities
+ - The possibility of deployment to simple shared hosting
+ - Proper support for multilingualism
+
+## Dark ages of WordPress
+
+With the above-mentioned in mind, we built our first revision of the service in WordPress with a commercial knowledge base plugin. The initial requirements seemed not to be exorbitant, and yet we were surprised to see that only a few of the available solutions covered them. Especially, the case of multilingualism appeared to be particularly neglected across the available products.
+
+The WordPress-based products made big promises: pay some bucks, bootstrap the service in minutes, and forget about all the development troubles. And although those promises could possibly be deliverable on WordPress' end, it was definitely not true for anything more than the most generic deployments. In our case, we were dealing with more and more trade-offs. Plus, the solution was just slow on the simple shared hosting environment that we dedicated to the job.
+
+## Turning point
+
+The turning point was the introduction of a new key requirement---each document was to be downloadable in the PDF format. Such functionality was not available in the plugins we owned, nor did it look like any of the other existing WordPress plugins could fulfill our needs to a satisfactory degree. Nobody in our team was brave enough to add such a functionality to the current stack, so we decided to start from scratch.
+
+On top of that new development, we had to remember another one of our key requirements, namely, that mostly non-programmers were to be responsible for the service maintenance and content creation. Initially, we were leaning towards headless CMS-based solutions, but finally we made a bold move and decided to create a Git-managed Jamstack service and see what happens.
+
+## Hugo to the rescue!
+
+Hugo was our first choice of SSG. The multilingualism support was the primary feature that convinced us. Later on, going through the documentation, we continued to discover new exciting features that we didn't even know we needed when we started.
+
+The rich functionalities of WordPress WYSIWYG editors soon turned out to be a curse. It became burdensome to maintain formatting consistency across documents prepared by multiple contributors. When we considered Markdown, we knew that it would give us a lot less flexibility. In our case, it proved to be a blessing in disguise---the constraints imposed by the notation ensured that each document was prepared in the same way. And in the cases where Markdown was not enough, Hugo shortcodes gave us all that we needed to get the results we anticipated.
+
++In terms of PDF generation, we utilized [custom output formats](/templates/output-formats/) to produce intermediary document representations, which are consumed by our custom tool transforming them to TeX documents, which are finally used to produce PDF files.
+
+Custom output formats were also used to create search indexes. The search functionality is built on the brilliant [TNTSearch](https://github.com/teamtnt/tntsearch) library. The search queries and results are handled by PHP snippets embedded into static documents handled by Hugo.
+
+We even implemented a simple REST API generated by Hugo! We have yet to find something that cannot be achieved with this stack, while in WordPress-based solutions we were struggling with things as simple as defining custom document ordering in one of the categories list views.
+
+When talking about Hugo, we cannot forget about the speed. At the beginning we were not considering it a killer feature, but as our document base grew bigger, we appreciated it more and more. Dry-runs are not so common---most of the time we are working on one of the documents with cache already built during one of the previous Hugo runs. In such a scenario, Hugo rebuilds the site in about a second and we consider it a very good result.
+
+```
+ | EN | PL
+-------------------+-----+------
+ Pages | 483 | 486
+ Paginator pages | 56 | 55
+ Non-page files | 745 | 749
+ Static files | 917 | 917
+ Processed images | 487 | 490
+ Aliases | 80 | 79
+ Sitemaps | 2 | 1
+ Cleaned | 0 | 0
+
+Total in 1096 ms
+```
+
+## Adaptation among the contributors
+
+Very quickly it became apparent that our initial concerns about the adaptation of the workflow among contributors were grossly exaggerated. Markdown is fairly straightforward and did not cause any trouble for the contributors.
+
+We recommended that our colleagues use Visual Studio Code as a tool for content creation. The project’s repository tracks project-scoped configuration of the editor, which includes a set of _tasks_ allowing to run a live server from the GUI level. This is very useful for those who are easily frightened when faced with the mighty terminal.
+
+The basic skills of the Git workflow were also easily acquired. At the end of the day, builds and deployments are fully managed by CI/CD processes, so the administration of the service drills down to reviewing and accepting merge requests in the Git frontend. As a side effect, we receive a full and clear history of contributions, which is well appreciated by our quality assurance auditors.
+
+We could even say that our experiment spread the love for Git among non-programmers in our organization!
+
+## Summary
+
+Hugo is the best! Definitely give it a try if you are ever faced with a challenge similar to ours. And do not give it a second thought if your service contributors are not too technically inclined---it might still turn out great!
--- /dev/null
- ## Open Tools
+---
+title: Digital.gov
+date: 2020-05-01
+description: "Showcase: \"Guidance on building better digital services in government.\""
+siteURL: https://digital.gov/
+siteSource: https://github.com/gsa/digitalgov.gov
+---
+
+For over a decade, Digital.gov has provided guidance, training, and community support to the people who are responsible for delivering digital services in the U.S. government. Essentially, it is a place where people can find examples of problems being solved in government, and get links to the tools and resources they need.
+
+Through collaboration in our communities of practice, Digital.gov is a window into the people who work in technology in government and the challenges they face making digital services stronger and more effective. [Read more about our site »](https://digital.gov/2019/12/19/a-new-digitalgov/)
+
+Digital.gov is built using the [U.S. Web Design System](https://designsystem.digital.gov/) (USWDS) and have followed the [design principles](https://designsystem.digital.gov/maturity-model/) in building out our new site:
+
+- **Start with real user needs** — We used human-centered design methods to inform our product decisions (like qualitative user research), and gathered feedback from real users. We also continually test our assumptions with small experiments.
+- **Earn trust** —We recognize that trust has to be earned every time. We are including all [required links and content](https://digital.gov/resources/required-web-content-and-links/) on our site, clearly identifying as a government site, building with modern best practices, and using HTTPS.
+- **Embrace accessibility** — [Accessibility](https://digital.gov/resources/intro-accessibility/) affects everybody, and we built it into every decision. We’re continually working to conform to Section 508 requirements, use user experience best practices, and support a wide range of devices.
+- **Promote continuity** — We started from shared solutions like USWDS and [Federalist](https://federalist.18f.gov/). We designed our site to clearly identify as a government site by including USWDS’s .gov banner, common colors and patterns, and built with modern best practices.
+- **Listen** — We actively collect user feedback and web metrics. We use the [Digital Analytics Program](https://digital.gov/services/dap/) (DAP) and analyze the data to discover actionable insights. We make small, incremental changes to continuously improve our website by listening to readers and learning from what we hear.
+
+_More on the [USWDS maturity model »](https://designsystem.digital.gov/maturity-model/)_
+
++## Open tools
+
+We didn’t start from scratch. We built and designed the Digital.gov using many of the open-source tools and services that we develop for government here in the [Technology Transformation Services](https://www.gsa.gov/tts/) (TTS).
+
+Using services that make it possible to design, build, and iterate quickly are essential to modern web design and development, which is why [Federalist](https://federalist.18f.gov/) and the [U.S. Web Design System](https://designsystem.digital.gov/) are such a great combination.
+
+**Why Hugo?** Well, with around `~3,000` files _(and growing)_ and `~9,000` built pages, we needed a site generator that could handle that volume with lightning fast speed.
+
+Hugo was the clear option. The [Federalist](https://federalist.18f.gov/) team quickly added it to their available site generators, and we were off.
+
+At the moment, it takes around `32 seconds` to build close to `~10,000` pages!
+
+Take a look:
+
+```bash
+
+ | EN
+-------------------+-------
+ Pages | 7973
+ Paginator pages | 600
+ Non-page files | 108
+ Static files | 851
+ Processed images | 0
+ Aliases | 1381
+ Sitemaps | 1
+ Cleaned | 0
+
+Built in 32.427 seconds
+
+```
+
+In addition to Hugo, we are proudly using a number of other tools and services, all built by government are free to use:
+
+- [Federalist](https://federalist.18f.gov/)
+- [Search.gov](https://www.search.gov/) — A free, hosted search platform for federal websites.
+- [Cloud.gov](https://www.cloud.gov/) — helps teams build, run, and authorize cloud-ready or legacy government systems quickly and cheaply.
+- [Federal CrowdSource Mobile Testing Program](https://digital.gov/services/mobile-application-testing-program/) — Free mobile compatibility testing by feds, for feds.
+- [Digital Analytics Program](https://digital.gov/services/dap/) (DAP) — A free analytics tool for measuring digital services in the federal government
+- [Section508.gov](https://www.section508.gov/) and [PlainLanguage.gov](https://www.plainlanguage.gov/) resources
+- [API.data.gov](https://api.data.gov/) — a free API management service for federal agencies
+- [U.S. Digital Registry](https://digital.gov/services/u-s-digital-registry/) — A resource for confirming the official status of government social media accounts, mobile apps, and mobile websites.
+
+
+**Questions or feedback?** [Submit an issue](https://github.com/GSA/digitalgov.gov/issues) or send us an email to [digitalgov@gsa.gov](mailto:digitalgov@gsa.gov) :heart:
--- /dev/null
- * We can’t stop raving about [**Algolia**](https://www.algolia.com/). Chris loves it and even wrote a tutorial on [how to implement Algolia](https://forestry.io/blog/search-with-algolia-in-hugo/) into static sites using Hugo’s [Custom Outputs](https://gohugo.io/templates/output-formats/).
+---
+title: Forestry.io
+date: 2018-03-16
+description: "Showcase: \"Seeing Hugo in action is a whole different world of awesome.\""
+siteURL: https://forestry.io/
+siteSource: https://github.com/forestryio/forestry.io
+---
+
+It was clear from the get-go that we had to go with a static site generator. Static sites are secure, performant, and give you 100% flexibility. At [Forestry.io](https://forestry.io/) we provide Content Management Solutions for websites built with static site generators, so we might be a little biased. The only question: Which static site generator was the right choice for us?
+
+### Why Hugo?
+
+In our early research we looked at Ionic’s [site](https://github.com/ionic-team/ionic) to get some inspiration. They used Jekyll to build their website. While Jekyll is a great generator, the build times for larger sites can be painfully slow. With more than 150 pages plus many custom configurations and add-ons, our website doesn’t fall into the low-volume category anymore. Our developers want a smooth experience when working on the website and our content editors need the ability to preview content quickly. In short, we need our builds to be lightning fast.
+
+We knew Hugo was fast but we did [some additional benchmarking](https://forestry.io/blog/hugo-vs-jekyll-benchmark/) before making our decision. Seeing Hugo in action is a whole different world of awesome. Hugo takes less than one second to build our 150-page site! Take a look:
+
+```bash
+ | EN
++------------------+-----+
+ Pages | 141
+ Paginator pages | 4
+ Non-page files | 0
+ Static files | 537
+ Processed images | 0
+ Aliases | 60
+ Sitemaps | 1
+ Cleaned | 0
+
+Total in 739 ms
+```
+
+In fact, we liked Hugo so much that our wizard Chris made his workflow public and we started the open-source project [Create-Static-Site](https://github.com/forestryio/create-static-site). It's [a simple way to spin up sites](https://forestry.io/blog/up-and-running-with-hugo/) and set up a modern web development workflow with one line of code. Essentially it adds build configurations as a dependency for JS, CSS and Image Processing.
+
+Lastly, we want to take the opportunity to give some love to other amazing tools we used building our website.
+
+### What tools did we use?
+
+* Our Norwegian designer Nichlas is in love with [**Sketch**](https://www.sketchapp.com/). From what we hear it’s a designer’s dream come true.
+* Some say our main graphic is [mesmerizing](https://twitter.com/hmncllctv/status/968907474664284160). Nichlas created it using [**3DS Max**](https://www.autodesk.com/products/3ds-max/overview).
+* [**Hugo**](https://gohugo.io/) -- of course.
+* Chris can’t think of modern web development without [**Gulp**](https://gulpjs.com/) & [**Webpack**](https://webpack.js.org/). We used them to add additional build steps such as Browsersync, CSS, JS and SVG optimization.
+* Speaking about adding steps to our build, our lives would be much harder without [**CircleCI**](https://circleci.com/) for continuous deployment and automated testing purposes.
- * We also use browser cookies and JS to customize our user’s experience and give it a more dynamic feel.
++* We can’t stop raving about [**Algolia**](https://www.algolia.com/). Chris loves it and even wrote a tutorial on [how to implement Algolia](https://forestry.io/blog/search-with-algolia-in-hugo/) into static sites using Hugo’s [Custom Outputs](/templates/output-formats/).
+* [**Cloudinary**](https://cloudinary.com/) is probably one of the easiest ways to get responsive images into your website.
+* We might be a little biased on this one - We think [**Forestry.io**](https://forestry.io/) is a great way to add a content management system with a clean UI on top of your site without interrupting your experience as a developer.
+* For hosting purposes we use the almighty [**AWS**](https://aws.amazon.com/).
+* [**Formspree.io**](https://formspree.io/) is managing our support and enterprise requests.
++* We also use browser cookies and JS to customize our user’s experience and give it a more dynamic feel.
--- /dev/null
- title: "Let’s Encrypt"
+---
- That site is bookmarked in many browsers, so preserving the URLs was a must. Hugo's URL handling is very flexible, but there was one challenge. The website has a mix of standard and what we in Hugo call _ugly URLs_ (`https://letsencrypt.org/2017/12/07/looking-forward-to-2018.html`). In Hugo this is handled automatically, and you can turn it on globally or per language. But before Hugo `0.33` you could not configure it for parts of your site. You could set it manually for the relevant pages in front matter -- which is how it was done in Jekyll -- but that would be hard to manage, especially when you start to introduce translations. So, in [Hugo 0.33](https://gohugo.io/news/0.33-relnotes/) I added support for _ugly URLs_ per section and also `url` set in front matter for list pages (`https://letsencrypt.org/blog/`).
++title: Let’s Encrypt
+date: 2018-03-13
+description: "Showcase: Lessons learned from taking letsencrypt.org to Hugo."
+siteURL: https://letsencrypt.org/
+siteSource: https://github.com/letsencrypt/website
+byline: "[bep](https://github.com/bep), Hugo Lead"
+---
+
+The **Let’s Encrypt website** has a common set of elements: A landing page and some other static info-pages, a document section, a blog, and a documentation section. Having it moved to Hugo was mostly motivated by a _simpler administration and Hugo's [multilingual support](/content-management/multilingual/)_. They already serve HTTPS to more than 60 million domains, and having the documentation available in more languages will increase that reach.[^1]
+
+{{< tweet user="letsencrypt" id="971755920639307777" >}}
+
+I helped them port the site from Jekyll to Hugo. There are usually very few surprises doing this. I know Hugo very well, but working on sites with a history usually comes up with something new.
+
++That site is bookmarked in many browsers, so preserving the URLs was a must. Hugo's URL handling is very flexible, but there was one challenge. The website has a mix of standard and what we in Hugo call _ugly URLs_ (`https://letsencrypt.org/2017/12/07/looking-forward-to-2018.html`). In Hugo this is handled automatically, and you can turn it on globally or per language. But before Hugo `0.33` you could not configure it for parts of your site. You could set it manually for the relevant pages in front matter -- which is how it was done in Jekyll -- but that would be hard to manage, especially when you start to introduce translations. So, in [Hugo 0.33](/news/0.33-relnotes) I added support for _ugly URLs_ per section and also `url` set in front matter for list pages (`https://letsencrypt.org/blog/`).
+
+The lessons learned from this also lead to [disableLanguages](/content-management/multilingual/#disable-a-language) in Hugo `0.34` (a way to turn off languages during translation). And I also registered [this issue](https://github.com/gohugoio/hugo/issues/4463). Once fixed it will make it easier to handle partially translated sites.
+
+
+[^1]: The work on getting the content translated is in progress.
--- /dev/null
- title: Custom 404 Page
- linktitle: 404 Page
+---
- weight: 120
- weight: 120
++title: Custom 404 page
++linkTitle: 404 page
+description: If you know how to create a single page template, you have unlimited options for creating a custom 404.
+categories: [templates]
+keywords: [404, page not found]
+menu:
+ docs:
+ parent: templates
- ## Automatic Loading
++ weight: 220
++weight: 220
+---
+
+When using Hugo with [GitHub Pages](https://pages.github.com/), you can provide your own template for a [custom 404 error page](https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site) by creating a 404.html template file in the root of your `layouts` folder. When Hugo generates your site, the `404.html` file will be placed in the root.
+
+404 pages will have all the regular [page variables][pagevars] available to use in the templates.
+
+In addition to the standard page variables, the 404 page has access to all site content accessible from `.Pages`.
+
+```txt
+▾ layouts/
+ 404.html
+```
+
+## 404.html
+
+This is a basic example of a 404.html template:
+
+{{< code file="layouts/404.html" >}}
+{{ define "main" }}
+ <main id="main">
+ <div>
+ <h1 id="title"><a href="{{ "" | relURL }}">Go Home</a></h1>
+ </div>
+ </main>
+{{ end }}
+{{< /code >}}
+
++## Automatic loading
+
+Your 404.html file can be set to load automatically when a visitor enters a mistaken URL path, dependent upon the web serving environment you are using. For example:
+
+* [GitHub Pages](/hosting-and-deployment/hosting-on-github/), [GitLab Pages](/hosting-and-deployment/hosting-on-gitlab/) and [Cloudflare Pages](/hosting-and-deployment/hosting-on-cloudflare-pages/). The 404 page is automatic.
+* Apache. You can specify `ErrorDocument 404 /404.html` in an `.htaccess` file in the root of your site.
+* Nginx. You might specify `error_page 404 /404.html;` in your `nginx.conf` file. [Details here](https://nginx.org/en/docs/http/ngx_http_core_module.html#error_page).
+* Amazon AWS S3. When setting a bucket up for static web serving, you can specify the error file from within the S3 GUI.
+* Amazon CloudFront. You can specify the page in the Error Pages section in the CloudFront Console. [Details here](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html)
+* Caddy Server. Use the `handle_errors` directive to specify error pages for one or more status codes. [Details here](https://caddyserver.com/docs/caddyfile/directives/handle_errors)
+* Netlify. Add `/* /404.html 404` to `content/_redirects`. [Details Here](https://www.netlify.com/docs/redirects/#custom-404)
+* Azure Static Web App. set `responseOverrides.404.rewrite` and `responseOverrides.404.statusCode` in configfile `staticwebapp.config.json`. [Details here](https://docs.microsoft.com/en-us/azure/static-web-apps/configuration#response-overrides)
+* Azure Storage as Static Web Site Hosting. You can specify the `Error document path` in the Static website configuration page of the Azure portal. [Details here](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-static-website).
+* DigitalOcean App Platform. You can specify `error_document` in your app specification file or use control panel to set up error document. [Details here](https://docs.digitalocean.com/products/app-platform/how-to/manage-static-sites/#configure-a-static-site).
+* [Firebase Hosting](https://firebase.google.com/docs/hosting/full-config#404): `/404.html` automatically gets used as the 404 page.
+
+[pagevars]: /variables/page/
--- /dev/null
- linktitle: Templates Overview
+---
+title: Templates
- weight: 01
- weight: 01
++linkTitle: Overview
+description: Go templating, template types and lookup order, shortcodes, and data.
+menu:
+ docs:
++ identifier: templates-overview
+ parent: templates
++ weight: 10
++weight: 10
+categories: [templates]
+keywords: []
+aliases: [/templates/overview/,/templates/content]
+---
--- /dev/null
- title: Base Templates and Blocks
+---
- categories: [templates,fundamentals]
++title: Base templates and blocks
+description: The base and block constructs allow you to define the outer shell of your master templates (i.e., the chrome of the page).
- weight: 20
- weight: 20
++categories: [fundamentals,templates]
+keywords: [blocks,base]
+menu:
+ docs:
+ parent: templates
- ## Base Template Lookup Order
++ weight: 40
++weight: 40
+aliases: [/templates/blocks/,/templates/base-templates-and-blocks/]
+toc: true
+---
+
+The `block` keyword allows you to define the outer shell of your pages' one or more master template(s) and then fill in or override portions as necessary.
+
+{{< youtube QVOMCYitLEc >}}
+
- ## Define the Base Template
++## Base template lookup order
+
+The base template lookup order closely follows that of the template it applies to (e.g. `_default/list.html`).
+
+See [Template Lookup Order](/templates/lookup-order/) for details and examples.
+
- ## Override the Base Template
++## Define the base template
+
+The following defines a simple base template at `_default/baseof.html`. As a default template, it is the shell from which all your pages will be rendered unless you specify another `*baseof.html` closer to the beginning of the lookup order.
+
+{{< code file="layouts/_default/baseof.html" >}}
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>{{ block "title" . }}
+ <!-- Blocks may include default content. -->
+ {{ .Site.Title }}
+ {{ end }}</title>
+ </head>
+ <body>
+ <!-- Code that all your templates share, like a header -->
+ {{ block "main" . }}
+ <!-- The part of the page that begins to differ between templates -->
+ {{ end }}
+ {{ block "footer" . }}
+ <!-- More shared code, perhaps a footer but that can be overridden if need be in -->
+ {{ end }}
+ </body>
+</html>
+{{< /code >}}
+
++## Override the base template
+
+From the above base template, you can define a [default list template][hugolists]. The default list template will inherit all of the code defined above and can then implement its own `"main"` block from:
+
+{{< code file="layouts/_default/list.html" >}}
+{{ define "main" }}
+ <h1>Posts</h1>
+ {{ range .Pages }}
+ <article>
+ <h2>{{ .Title }}</h2>
+ {{ .Content }}
+ </article>
+ {{ end }}
+{{ end }}
+{{< /code >}}
+
+This replaces the contents of our (basically empty) "main" block with something useful for the list template. In this case, we didn't define a `"title"` block, so the contents from our base template remain unchanged in lists.
+
+{{% note %}}
+Code that you put outside the block definitions *can* break your layout. This even includes HTML comments. For example:
+
+```go-html-template
+<!-- Seemingly harmless HTML comment..that will break your layout at build -->
+{{ define "main" }}
+...your code here
+{{ end }}
+```
+[See this thread from the Hugo discussion forums.](https://discourse.gohugo.io/t/baseof-html-block-templates-and-list-types-results-in-empty-pages/5612/6)
+{{% /note %}}
+
+The following shows how you can override both the `"main"` and `"title"` block areas from the base template with code unique to your [default single page template][singletemplate]:
+
+{{< code file="layouts/_default/single.html" >}}
+{{ define "title" }}
+ <!-- This will override the default value set in baseof.html; i.e., "{{ .Site.Title }}" in the original example-->
+ {{ .Title }} – {{ .Site.Title }}
+{{ end }}
+{{ define "main" }}
+ <h1>{{ .Title }}</h1>
+ {{ .Content }}
+{{ end }}
+{{< /code >}}
+
+[hugolists]: /templates/lists
+[lookup]: /templates/lookup-order/
+[rendering the section]: /templates/section-templates/
+[singletemplate]: /templates/single-page-templates/
--- /dev/null
- title: Data Templates
+---
- weight: 80
- weight: 80
++title: Data templates
+description: In addition to Hugo's built-in variables, you can specify your own custom data in templates or shortcodes that pull from both local and dynamic sources.
+categories: [templates]
+keywords: [data,dynamic,csv,json,toml,yaml,xml]
+menu:
+ docs:
+ parent: templates
- ## The Data Folder
++ weight: 150
++weight: 150
+aliases: [/extras/datafiles/,/extras/datadrivencontent/,/doc/datafiles/]
+toc: true
+---
+
+<!-- begin data files -->
+
+Hugo supports loading data from YAML, JSON, XML, and TOML files located in the `data` directory at the root of your Hugo project.
+
+{{< youtube FyPgSuwIMWQ >}}
+
- To access the data using the `site.Data.filename` notation, the filename must begin with an underscore or a Unicode letter, followed by zero or more underscores, Unicode letters, or Unicode digits. For example:
++## The data folder
+
+The `data` folder should store additional data for Hugo to use when generating your site.
+
+Data files are not for generating standalone pages. They should supplement content files by:
+
+- extending the content when the front matter fields grow out of control, or
+- showing a larger dataset in a template (see the example below).
+
+In both cases, it's a good idea to outsource the data in their (own) files.
+
+These files must be YAML, JSON, XML, or TOML files (using the `.yml`, `.yaml`, `.json`, `.xml`, or `.toml` extension). The data will be accessible as a `map` in the `.Site.Data` variable.
+
- To access the data using the [`index`](/functions/index-function/) function, the filename is irrelevant. For example:
++To access the data using the `site.Data.filename` notation, the file name must begin with an underscore or a Unicode letter, followed by zero or more underscores, Unicode letters, or Unicode digits. For example:
+
+- `123.json` - Invalid
+- `x123.json` - Valid
+- `_123.json` - Valid
+
- ## Data Files in Themes
++To access the data using the [`index`](/functions/index-function/) function, the file name is irrelevant. For example:
+
+Data file|Template code
+:--|:--
+`123.json`|`{{ index .Site.Data "123" }}`
+`x123.json`|`{{ index .Site.Data "x123" }}`
+`_123.json`|`{{ index .Site.Data "_123" }}`
+`x-123.json`|`{{ index .Site.Data "x-123" }}`
+
- The list of bass players can be accessed via `.Site.Data.jazz.bass`, a single bass player by adding the filename without the suffix, e.g. `.Site.Data.jazz.bass.jacopastorius`.
++## Data files in themes
+
+Data Files can also be used in themes.
+
+However, note that the theme data files are merged with the project directory taking precedence. That is, Given two files with the same name and relative path, the data in the file in the root project `data` directory will override the data from the file in the `themes/<THEME>/data` directory *for keys that are duplicated*).
+
+Therefore, theme authors should be careful not to include data files that could be easily overwritten by a user who decides to [customize a theme][customize]. For theme-specific data items that shouldn't be overridden, it can be wise to prefix the folder structure with a namespace; e.g. `mytheme/data/<THEME>/somekey/...`. To check if any such duplicate exists, run hugo with the `-v` flag.
+
+The keys in the map created with data templates from data files will be a dot-chained set of `path`, `filename`, and `key` in the file (if applicable).
+
+This is best explained with an example:
+
+## Example: Jaco Pastorius' Solo Discography
+
+[Jaco Pastorius](https://en.wikipedia.org/wiki/Jaco_Pastorius_discography) was a great bass player, but his solo discography is short enough to use as an example. [John Patitucci](https://en.wikipedia.org/wiki/John_Patitucci) is another bass giant.
+
+The example below is a bit contrived, but it illustrates the flexibility of data Files. This example uses TOML as its file format with the two following data files:
+
+* `data/jazz/bass/jacopastorius.toml`
+* `data/jazz/bass/johnpatitucci.toml`
+
+`jacopastorius.toml` contains the content below. `johnpatitucci.toml` contains a similar list:
+
+{{< code-toggle file="jacopastorius" >}}
+discography = [
+"1974 - Modern American Music … Period! The Criteria Sessions",
+"1974 - Jaco",
+"1976 - Jaco Pastorius",
+"1981 - Word of Mouth",
+"1981 - The Birthday Concert (released in 1995)",
+"1982 - Twins I & II (released in 1999)",
+"1983 - Invitation",
+"1986 - Broadway Blues (released in 1998)",
+"1986 - Honestly Solo Live (released in 1990)",
+"1986 - Live In Italy (released in 1991)",
+"1986 - Heavy'n Jazz (released in 1992)",
+"1991 - Live In New York City, Volumes 1-7.",
+"1999 - Rare Collection (compilation)",
+"2003 - Punk Jazz: The Jaco Pastorius Anthology (compilation)",
+"2007 - The Essential Jaco Pastorius (compilation)"
+]
+{{< /code-toggle >}}
+
- ## Example: Accessing Named Values in a Data File
++The list of bass players can be accessed via `.Site.Data.jazz.bass`, a single bass player by adding the file name without the suffix, e.g. `.Site.Data.jazz.bass.jacopastorius`.
+
+You can now render the list of recordings for all the bass players in a template:
+
+```go-html-template
+{{ range $.Site.Data.jazz.bass }}
+ {{ partial "artist.html" . }}
+{{ end }}
+```
+
+And then in the `partials/artist.html`:
+
+```go-html-template
+<ul>
+{{ range .discography }}
+ <li>{{ . }}</li>
+{{ end }}
+</ul>
+```
+
+Discover a new favorite bass player? Just add another `.toml` file in the same directory.
+
- ## Get Remote Data
++## Example: accessing named values in a data file
+
+Assume you have the following data structure in your `User0123.[yml|toml|xml|json]` data file located directly in `data/`:
+
+{{< code-toggle file="User0123" >}}
+Name: User0123
+"Short Description": "He is a **jolly good** fellow."
+Achievements:
+ - "Can create a Key, Value list from Data File"
+ - "Learns Hugo"
+ - "Reads documentation"
+{{</ code-toggle >}}
+
+You can use the following code to render the `Short Description` in your layout:
+
+```go-html-template
+<div>Short Description of {{ .Site.Data.User0123.Name }}: <p>{{ index .Site.Data.User0123 "Short Description" | markdownify }}</p></div>
+```
+
+Note the use of the [`markdownify` template function][markdownify]. This will send the description through the Markdown rendering engine.
+
+
- ### Authentication When Using REST URLs
++## Get remote data
+
+Use `getJSON` or `getCSV` to get remote data:
+
+```go-html-template
+{{ $dataJ := getJSON "url" }}
+{{ $dataC := getCSV "separator" "url" }}
+```
+
+If you use a prefix or postfix for the URL, the functions accept [variadic arguments][variadic]:
+
+```go-html-template
+{{ $dataJ := getJSON "url prefix" "arg1" "arg2" "arg n" }}
+{{ $dataC := getCSV "separator" "url prefix" "arg1" "arg2" "arg n" }}
+```
+
+The separator for `getCSV` must be put in the first position and can only be one character long.
+
+All passed arguments will be joined to the final URL:
+
+```go-html-template
+{{ $urlPre := "https://api.github.com" }}
+{{ $gistJ := getJSON $urlPre "/users/GITHUB_USERNAME/gists" }}
+```
+
+This will resolve internally to the following:
+
+```go-html-template
+{{ $gistJ := getJSON "https://api.github.com/users/GITHUB_USERNAME/gists" }}
+```
+
+### Add HTTP headers
+
+Both `getJSON` and `getCSV` takes an optional map as the last argument, e.g.:
+
+```go-html-template
+{{ $data := getJSON "https://example.org/api" (dict "Authorization" "Bearer abcd") }}
+```
+
+If you need multiple values for the same header key, use a slice:
+
+```go-html-template
+{{ $data := getJSON "https://example.org/api" (dict "X-List" (slice "a" "b" "c")) }}
+```
+
+### Example for CSV files
+
+For `getCSV`, the one-character-long separator must be placed in the first position followed by the URL. The following is an example of creating an HTML table in a [partial template][partials] from a published CSV:
+
+{{< code file="layouts/partials/get-csv.html" >}}
+ <table>
+ <thead>
+ <tr>
+ <th>Name</th>
+ <th>Position</th>
+ <th>Salary</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ $url := "https://example.com/finance/employee-salaries.csv" }}
+ {{ $sep := "," }}
+ {{ range $i, $r := getCSV $sep $url }}
+ <tr>
+ <td>{{ index $r 0 }}</td>
+ <td>{{ index $r 1 }}</td>
+ <td>{{ index $r 2 }}</td>
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+{{< /code >}}
+
+The expression `{{ index $r number }}` must be used to output the nth-column from the current row.
+
+### Cache URLs
+
+Each downloaded URL will be cached in the default folder `$TMPDIR/hugo_cache_$USER/`. The variable `$TMPDIR` will be resolved to your system-dependent temporary directory.
+
+With the command-line flag `--cacheDir`, you can specify any folder on your system as a caching directory.
+
+You can also set `cacheDir` in the [main configuration file][config].
+
+If you don't like caching at all, you can fully disable caching with the command-line flag `--ignoreCache`.
+
- ## Load Local files
++### Authentication when using REST URLs
+
+Currently, you can only use those authentication methods that can be put into an URL. [OAuth] and other authentication methods are not implemented.
+
- ## LiveReload with Data Files
++## Load local files
+
+To load local files with `getJSON` and `getCSV`, the source files must reside within Hugo's working directory. The file extension does not matter, but the content does.
+
+It applies the same output logic as above in [Get Remote Data](#get-remote-data).
+
+{{% note %}}
+The local CSV files to be loaded using `getCSV` must be located **outside** the `data` directory.
+{{% /note %}}
+
- ## Examples of Data-driven Content
++## LiveReload with data files
+
+There is no chance to trigger a [LiveReload] when the content of a URL changes. However, when a *local* file changes (i.e., `data/*` and `themes/<THEME>/data/*`), a LiveReload will be triggered. Symlinks are not supported. Note too that because downloading data takes a while, Hugo stops processing your Markdown files until the data download has been completed.
+
+{{% warning "URL Data and LiveReload" %}}
+If you change any local file and the LiveReload is triggered, Hugo will read the data-driven (URL) content from the cache. If you have disabled the cache (i.e., by running the server with `hugo server --ignoreCache`), Hugo will re-download the content every time LiveReload triggers. This can create *huge* traffic. You may reach API limits quickly.
+{{% /note %}}
+
- ## Specs for Data Formats
++## Examples of data-driven content
+
+- Photo gallery JSON powered: [https://github.com/pcdummy/hugo-lightslider-example](https://github.com/pcdummy/hugo-lightslider-example)
+- GitHub Starred Repositories [in a post](https://github.com/SchumacherFM/blog-cs/blob/master/content%2Fposts%2Fgithub-starred.md) using data-driven content in a [custom short code](https://github.com/SchumacherFM/blog-cs/blob/master/layouts%2Fshortcodes%2FghStarred.html).
+
++## Specs for data formats
+
+* [TOML Spec][toml]
+* [YAML Spec][yaml]
+* [JSON Spec][json]
+* [CSV Spec][csv]
+* [XML Spec][xml]
+
+[config]: /getting-started/configuration/
+[csv]: https://tools.ietf.org/html/rfc4180
+[customize]: /hugo-modules/theme-components/
+[json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
+[LiveReload]: /getting-started/usage/#livereload
+[lookup]: /templates/lookup-order/
+[markdownify]: /functions/markdownify/
+[OAuth]: https://en.wikipedia.org/wiki/OAuth
+[partials]: /templates/partials/
+[toml]: https://github.com/toml-lang/toml
+[variadic]: https://en.wikipedia.org/wiki/Variadic_function
+[vars]: /variables/
+[yaml]: https://yaml.org/spec/
+[xml]: https://www.w3.org/XML/
--- /dev/null
- title: Local File Templates
+---
- weight: 110
- weight: 110
++title: Local file templates
+description: Hugo's `readDir` and `readFile` functions make it easy to traverse your project's directory structure and write file contents to your templates.
+categories: [templates]
+keywords: [files,directories]
+menu:
+ docs:
+ parent: templates
- ## Traverse Local Files
++ weight: 180
++weight: 180
+aliases: [/extras/localfiles/,/templates/local-files/]
+toc: true
+---
+
++## Traverse local files
+
+With Hugo's [`readDir`][readDir] and [`readFile`][readFile] template functions, you can traverse your website's files on your server.
+
+## Use `readDir`
+
+The [`readDir` function][readDir] returns an array of [`os.FileInfo`][osfileinfo]. It takes the file's `path` as a single string argument. This path can be to any directory of your website (i.e., as found on your server's file system).
+
+Whether the path is absolute or relative does not matter because---at least for `readDir`---the root of your website (typically `./public/`) in effect becomes both:
+
+1. The file system root
+2. The current working directory
+
+## Use `readFile`
+
+The [`readfile` function][readFile] reads a file from disk and converts it into a string to be manipulated by other Hugo functions or added as-is. `readFile` takes the file, including path, as an argument passed to the function.
+
+To use the `readFile` function in your templates, make sure the path is relative to your *Hugo project's root directory*:
+
+```go-html-template
+{{ readFile "/content/templates/local-file-templates" }}
+```
+
+### `readFile` Example: Add a Project File to Content
+
+As `readFile` is a function, it is only available to you in your templates and not your content. However, we can create a simple [shortcode template][sct] that calls `readFile`, passes the first argument through the function, and then allows an optional second argument to send the file through the Markdown processor. The pattern for adding this shortcode to your content will be as follows:
+
+```go-html-template
+{{</* readfile file="/path/to/local/file.txt" markdown="true" */>}}
+```
+
+{{% note %}}
+If you are going to create [custom shortcodes](/templates/shortcode-templates/) with `readFile` for a theme, note that usage of the shortcode will refer to the project root and *not* your `themes` directory.
+{{% /note %}}
+
+[called directly in the Hugo docs]: https://github.com/gohugoio/hugoDocs/blob/master/content/en/templates/files.md
+[osfileinfo]: https://golang.org/pkg/os/#FileInfo
+[readDir]: /functions/readdir/
+[readFile]: /functions/readfile/
+[sc]: /content-management/shortcodes/
+[sct]: /templates/shortcode-templates/
+[readfilesource]: https://github.com/gohugoio/hugoDocs/blob/master/layouts/shortcodes/readfile.html
+[testfile]: https://github.com/gohugoio/hugoDocs/blob/master/content/en/readfiles/testing.txt
--- /dev/null
- title: Homepage Template
- linktitle: Homepage Template
+---
- weight: 30
- weight: 30
++title: Homepage template
+description: The homepage of a website is often formatted differently than the other pages. For this reason, Hugo makes it easy for you to define your new site's homepage as a unique template.
+categories: [templates]
+keywords: [homepage]
+menu:
+ docs:
+ parent: templates
- ## Homepage Template Lookup Order
++ weight: 70
++weight: 70
+aliases: [/layout/homepage/,/templates/homepage-template/]
+toc: true
+---
+
+Homepage is a `Page` and therefore has all the [page variables][pagevars] and [site variables][sitevars] available for use.
+
+{{% note %}}
+The homepage template is the *only* required template for building a site and therefore useful when bootstrapping a new site and template. It is also the only required template if you are developing a single-page website.
+{{% /note %}}
+
+{{< youtube ut1xtRZ1QOA >}}
+
- ## Add Content and Front Matter to the Homepage
++## Homepage template lookup order
+
+See [Template Lookup](/templates/lookup-order/).
+
- ## Example Homepage Template
++## Add content and front matter to the homepage
+
+The homepage, similar to other [list pages in Hugo][lists], accepts content and front matter from an `_index.md` file. This file should live at the root of your `content` folder (i.e., `content/_index.md`). You can then add body copy and metadata to your homepage the way you would any other content file.
+
+See the homepage template below or [Content Organization][contentorg] for more information on the role of `_index.md` in adding content and front matter to list pages.
+
++## Example homepage template
+
+The following is an example of a homepage template that uses [partial][partials], [base] templates, and a content file at `content/_index.md` to populate the `{{ .Title }}` and `{{ .Content }}` [page variables][pagevars].
+
+{{< code file="layouts/index.html" >}}
+{{ define "main" }}
+ <main aria-role="main">
+ <header class="homepage-header">
+ <h1>{{ .Title }}</h1>
+ {{ with .Params.subtitle }}
+ <span class="subtitle">{{ . }}</span>
+ {{ end }}
+ </header>
+ <div class="homepage-content">
+ <!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md -->
+ {{ .Content }}
+ </div>
+ <div>
+ {{ range first 10 .Site.RegularPages }}
+ {{ .Render "summary" }}
+ {{ end }}
+ </div>
+ </main>
+{{ end }}
+{{< /code >}}
+
+[base]: /templates/base/
+[contentorg]: /content-management/organization/
+[lists]: /templates/lists/
+[lookup]: /templates/lookup-order/
+[pagevars]: /variables/page/
+[partials]: /templates/partials/
+[sitevars]: /variables/site/
--- /dev/null
- title: Internal Templates
+---
- weight: 168
- weight: 168
++title: Internal templates
+description: Hugo ships with a group of boilerplate templates that cover the most common use cases for static websites.
+categories: [templates]
+keywords: [internal, analytics,]
+menu:
+ docs:
+ parent: templates
- ### Use the Google Analytics Template
++ weight: 190
++weight: 190
+toc: true
+---
+<!-- reference: https://discourse.gohugo.io/t/lookup-order-for-partials/5705/6
+code: https://github.com/gohugoio/hugo/blob/e445c35d6a0c7f5fc2f90f31226cd1d46e048bbc/tpl/template_embedded.go#L147 -->
+
+{{% note %}}
+While the following internal templates are called similar to partials, they do *not* observe the partial template lookup order.
+{{% /note %}}
+
+## Google Analytics
+
+Hugo ships with internal templates supporting Google Analytics, both [Google Analytics 4][GA4] (GA4) and Universal Analytics.
+
+**Note:** Universal Analytics are deprecated. For details, see [Universal Analytics will be going away].
+
+[GA4]: https://support.google.com/analytics/answer/10089681
+[Universal Analytics will be going away]: https://support.google.com/analytics/answer/11583528
+
+### Configure Google Analytics
+
+Provide your tracking ID in your configuration file:
+
+**Google Analytics 4 (gtag.js)**
+{{< code-toggle file="hugo" >}}
+googleAnalytics = "G-MEASUREMENT_ID"
+{{</ code-toggle >}}
+
+**Google Universal Analytics (analytics.js)**
+{{< code-toggle file="hugo" >}}
+googleAnalytics = "UA-PROPERTY_ID"
+{{</ code-toggle >}}
+
- ### Use the Disqus Template
++### Use the Google Analytics template
+
+You can then include the Google Analytics internal template:
+
+```go-html-template
+{{ template "_internal/google_analytics_async.html" . }}
+```
+
+**Note:** The async template is _not_ suitable for Google Analytics 4.
+
+```go-html-template
+{{ template "_internal/google_analytics.html" . }}
+```
+
+If you want to create your own template, you can access the configured ID with `{{ site.Config.Services.GoogleAnalytics.ID }}`.
+
+## Disqus
+
+Hugo also ships with an internal template for [Disqus comments][disqus], a popular commenting system for both static and dynamic websites. In order to effectively use Disqus, you will need to secure a Disqus "shortname" by [signing up for the free service][disqussignup].
+
+### Configure Disqus
+
+To use Hugo's Disqus template, you first need to set a single configuration value:
+
+{{< code-toggle file="hugo" >}}
+disqusShortname = "your-disqus-shortname"
+{{</ code-toggle >}}
+
+You also have the option to set the following in the front matter for a given piece of content:
+
+* `disqus_identifier`
+* `disqus_title`
+* `disqus_url`
+
- A `.Site.DisqusShortname` variable is also exposed from the config.
++### Use the Disqus template
+
+To add Disqus, include the following line in templates where you want your comments to appear:
+
+```go-html-template
+{{ template "_internal/disqus.html" . }}
+```
+
- ### Conditional Loading of Disqus Comments
++A `.Site.DisqusShortname` variable is also exposed from the configuration.
+
- If [page bundles](/content-management/page-bundles/) are used and the `images` array is empty or undefined, images with filenames matching `*feature*` or `*cover*,*thumbnail*` are used for image metadata.
++### Conditional loading of Disqus comments
+
+Users have noticed that enabling Disqus comments when running the Hugo web server on `localhost` (i.e. via `hugo server`) causes the creation of unwanted discussions on the associated Disqus account.
+
+You can create the following `layouts/partials/disqus.html`:
+
+{{< code file="layouts/partials/disqus.html" >}}
+<div id="disqus_thread"></div>
+<script type="text/javascript">
+
+(function() {
+ // Don't ever inject Disqus on localhost--it creates unwanted
+ // discussions from 'localhost:1313' on your Disqus account...
+ if (window.location.hostname == "localhost")
+ return;
+
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ var disqus_shortname = '{{ .Site.DisqusShortname }}';
+ dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+})();
+</script>
+<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+<a href="https://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
+{{< /code >}}
+
+The `if` statement skips the initialization of the Disqus comment injection when you are running on `localhost`.
+
+You can then render your custom Disqus partial template as follows:
+
+```go-html-template
+{{ partial "disqus.html" . }}
+```
+
+## Open Graph
+
+An internal template for the [Open Graph protocol](https://ogp.me/), metadata that enables a page to become a rich object in a social graph.
+This format is used for Facebook and some other sites.
+
+### Configure Open Graph
+
+Hugo's Open Graph template is configured using a mix of configuration variables and [front-matter](/content-management/front-matter/) on individual pages.
+
+{{< code-toggle file="hugo" >}}
+[params]
+ title = "My cool site"
+ images = ["site-feature-image.jpg"]
+ description = "Text about my cool site"
+[taxonomies]
+ series = "series"
+{{</ code-toggle >}}
+
+{{< code-toggle file="content/blog/my-post" >}}
+title = "Post title"
+description = "Text about this post"
+date = "2006-01-02"
+images = ["post-cover.png"]
+audio = []
+videos = []
+series = []
+tags = []
+{{</ code-toggle >}}
+
+Hugo uses the page title and description for the title and description metadata.
+The first 6 URLs from the `images` array are used for image metadata.
- ### Use the Open Graph Template
++If [page bundles](/content-management/page-bundles/) are used and the `images` array is empty or undefined, images with file names matching `*feature*` or `*cover*,*thumbnail*` are used for image metadata.
+
+Various optional metadata can also be set:
+
+- Date, published date, and last modified data are used to set the published time metadata if specified.
+- `audio` and `videos` are URL arrays like `images` for the audio and video metadata tags, respectively.
+- The first 6 `tags` on the page are used for the tags metadata.
+- The `series` taxonomy is used to specify related "see also" pages by placing them in the same series.
+
+If using YouTube this will produce a og:video tag like `<meta property="og:video" content="url">`. Use the `https://youtu.be/<id>` format with YouTube videos (example: `https://youtu.be/qtIqKaDlqXo`).
+
- The `.Site.Social.twitter` variable is exposed from the config as the value for `twitter:site`.
++### Use the Open Graph template
+
+To add Open Graph metadata, include the following line between the `<head>` tags in your templates:
+
+```go-html-template
+{{ template "_internal/opengraph.html" . }}
+```
+
+## Twitter Cards
+
+An internal template for [Twitter Cards](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards),
+metadata used to attach rich media to Tweets linking to your site.
+
+### Configure Twitter Cards
+
+Hugo's Twitter Card template is configured using a mix of configuration variables and [front-matter](/content-management/front-matter/) on individual pages.
+
+{{< code-toggle file="hugo" >}}
+[params]
+ images = ["site-feature-image.jpg"]
+ description = "Text about my cool site"
+{{</ code-toggle >}}
+
+{{< code-toggle file="content/blog/my-post" >}}
+title = "Post title"
+description = "Text about this post"
+images = ["post-cover.png"]
+{{</ code-toggle >}}
+
+If `images` aren't specified in the page front-matter, then hugo searches for [image page resources](/content-management/image-processing/) with `feature`, `cover`, or `thumbnail` in their name.
+If no image resources with those names are found, the images defined in the [site config](/getting-started/configuration/) are used instead.
+If no images are found at all, then an image-less Twitter `summary` card is used instead of `summary_large_image`.
+
+Hugo uses the page title and description for the card's title and description fields. The page summary is used if no description is given.
+
- ### Use the Twitter Cards Template
++The `.Site.Social.twitter` variable is exposed from the configuration as the value for `twitter:site`.
+
+{{< code-toggle file="hugo" >}}
+[social]
+ twitter = "GoHugoIO"
+{{</ code-toggle >}}
+
+NOTE: The `@` will be added for you
+
+```html
+<meta name="twitter:site" content="@GoHugoIO"/>
+```
+
- ## The Internal Templates
++### Use the Twitter Cards template
+
+To add Twitter card metadata, include the following line immediately after the `<head>` element in your templates:
+
+```go-html-template
+{{ template "_internal/twitter_cards.html" . }}
+```
+
++## The internal templates
+
+The code for these templates is located [here](https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates).
+
+* `_internal/disqus.html`
+* `_internal/google_analytics.html`
+* `_internal/google_analytics_async.html`
+* `_internal/opengraph.html`
+* `_internal/pagination.html`
+* `_internal/schema.html`
+* `_internal/twitter_cards.html`
+
+[disqus]: https://disqus.com
+[disqussignup]: https://disqus.com/profile/signup/
--- /dev/null
- title: Introduction to Hugo Templating
- linktitle: Templating
+---
- categories: [templates,fundamentals]
++title: Templating
++linkTitle: Templating
+description: Hugo uses Go's `html/template` and `text/template` libraries as the basis for the templating.
- weight: 10
- weight: 10
++categories: [fundamentals,templates]
+keywords: [go]
+menu:
+ docs:
+ parent: templates
- ## Basic Syntax
++ weight: 20
++weight: 20
+aliases: [/layouts/introduction/,/layout/introduction/, /templates/go-templates/]
+toc: true
+---
+
+{{% note %}}
+The following is only a primer on Go Templates. For an in-depth look into Go Templates, check the official [Go docs](https://golang.org/pkg/text/template/).
+{{% /note %}}
+
+Go Templates provide an extremely simple template language that adheres to the belief that only the most basic of logic belongs in the template or view layer.
+
- ### Access a Predefined Variable
++## Basic syntax
+
+Go Templates are HTML files with the addition of [variables][variables] and [functions][functions]. Go Template variables and functions are accessible within `{{ }}`.
+
- #### Methods and Fields are Accessed via dot Notation
++### Access a predefined variable
+
+A _predefined variable_ could be a variable already existing in the
+current scope (like the `.Title` example in the [Variables](#variables) section below) or a custom variable (like the
+`$address` example in that same section).
+
+
+```go-html-template
+{{ .Title }}
+{{ $address }}
+```
+
+Parameters for functions are separated using spaces. The general syntax is:
+
+```go-html-template
+{{ FUNCTION ARG1 ARG2 .. }}
+```
+
+The following example calls the `add` function with inputs of `1` and `2`:
+
+```go-html-template
+{{ add 1 2 }}
+```
+
- #### Parentheses Can be Used to Group Items Together
++#### Methods and fields are accessed via dot notation
+
+Accessing the Page Parameter `bar` defined in a piece of content's [front matter].
+
+```go-html-template
+{{ .Params.bar }}
+```
+
- #### A Single Statement Can be Split over Multiple Lines
++#### Parentheses can be used to group items together
+
+```go-html-template
+{{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }}
+```
+
- #### Raw String Literals Can Include Newlines
++#### A single statement can be split over multiple lines
+
+```go-html-template
+{{ if or
+ (isset .Params "alt")
+ (isset .Params "caption")
+}}
+```
+
- ## Variables {#variables}
++#### Raw string literals can include newlines
+
+```go-html-template
+{{ $msg := `Line one.
+Line two.` }}
+```
+
- ### Example 1: Adding Numbers
++## Variables
+
+Each Go Template gets a data object. In Hugo, each template is passed
+a `Page`. In the below example, `.Title` is one of the elements
+accessible in that [`Page` variable][pagevars].
+
+With the `Page` being the default scope of a template, the `Title`
+element in current scope (`.` -- "the **dot**") is accessible simply
+by the dot-prefix (`.Title`):
+
+```go-html-template
+<title>{{ .Title }}</title>
+```
+
+Values can also be stored in custom variables and referenced later:
+
+{{% note %}}
+The custom variables need to be prefixed with `$`.
+{{% /note %}}
+
+```go-html-template
+{{ $address := "123 Main St." }}
+{{ $address }}
+```
+
+Variables can be re-defined using the `=` operator. The example below
+prints "Var is Hugo Home" on the home page, and "Var is Hugo Page" on
+all other pages:
+
+```go-html-template
+{{ $var := "Hugo Page" }}
+{{ if .IsHome }}
+ {{ $var = "Hugo Home" }}
+{{ end }}
+Var is {{ $var }}
+```
+
+## Functions
+
+Go Templates only ship with a few basic functions but also provide a mechanism for applications to extend the original set.
+
+[Hugo template functions][functions] provide additional functionality specific to building websites. Functions are called by using their name followed by the required parameters separated by spaces. Template functions cannot be added without recompiling Hugo.
+
- ### Example 2: Comparing Numbers
++### Example 1: adding numbers
+
+```go-html-template
+{{ add 1 2 }}
+<!-- prints 3 -->
+```
+
- #### Example 1: Using Context (`.`)
++### Example 2: comparing numbers
+
+```go-html-template
+{{ lt 1 2 }}
+<!-- prints true (i.e., since 1 is less than 2) -->
+```
+
+Note that both examples make use of Go Template's [math][math] functions.
+
+{{% note %}}
+There are more boolean operators than those listed in the Hugo docs in the [Go Template documentation](https://golang.org/pkg/text/template/#hdr-Functions).
+{{% /note %}}
+
+## Includes
+
+When including another template, you will need to pass it the data that it would
+need to access.
+
+{{% note %}}
+To pass along the current context, please remember to include a trailing **dot**.
+{{% /note %}}
+
+The templates location will always be starting at the `layouts/` directory
+within Hugo.
+
+### Partial
+
+The [`partial`][partials] function is used to include _partial_ templates using
+the syntax `{{ partial "<PATH>/<PARTIAL>.<EXTENSION>" . }}`.
+
+Example of including a `layouts/partials/header.html` partial:
+
+```go-html-template
+{{ partial "header.html" . }}
+```
+
+### Template
+
+The `template` function was used to include _partial_ templates
+in much older Hugo versions. Now it's useful only for calling
+[_internal_ templates][internal templates]. The syntax is `{{ template
+"_internal/<TEMPLATE>.<EXTENSION>" . }}`.
+
+{{% note %}}
+The available **internal** templates can be found
+[here](https://github.com/gohugoio/hugo/tree/master/tpl/tplimpl/embedded/templates).
+{{% /note %}}
+
+Example of including the internal `opengraph.html` template:
+
+```go-html-template
+{{ template "_internal/opengraph.html" . }}
+```
+
+## Logic
+
+Go Templates provide the most basic iteration and conditional logic.
+
+### Iteration
+
+The Go Templates make heavy use of `range` to iterate over a _map_,
+_array_, or _slice_. The following are different examples of how to
+use `range`.
+
- #### Example 2: Declaring a variable name for an array element's value
++#### Example 1: using context (`.`)
+
+```go-html-template
+{{ range $array }}
+ {{ . }} <!-- The . represents an element in $array -->
+{{ end }}
+```
+
- #### Example 3: Declaring variable names for an array element's index _and_ value
++#### Example 2: declaring a variable name for an array element's value
+
+```go-html-template
+{{ range $elem_val := $array }}
+ {{ $elem_val }}
+{{ end }}
+```
+
- #### Example 4: Declaring variable names for a map element's key _and_ value
++#### Example 3: declaring variable names for an array element's index _and_ value
+
+For an array or slice, the first declared variable will map to each
+element's index.
+
+```go-html-template
+{{ range $elem_index, $elem_val := $array }}
+ {{ $elem_index }} -- {{ $elem_val }}
+{{ end }}
+```
+
- #### Example 5: Conditional on empty _map_, _array_, or _slice_
++#### Example 4: declaring variable names for a map element's key _and_ value
+
+For a map, the first declared variable will map to each map element's
+key.
+
+```go-html-template
+{{ range $elem_key, $elem_val := $map }}
+ {{ $elem_key }} -- {{ $elem_val }}
+{{ end }}
+```
+
- If you need to access page-level data (e.g., page params set in front
++#### Example 5: conditional on empty _map_, _array_, or _slice_
+
+If the _map_, _array_, or _slice_ passed into the range is zero-length then the else statement is evaluated.
+
+```go-html-template
+{{ range $array }}
+ {{ . }}
+{{ else }}
+ <!-- This is only evaluated if $array is empty -->
+{{ end }}
+```
+
+### Conditionals
+
+`if`, `else`, `with`, `or`, `and` and `not` provide the framework for handling conditional logic in Go Templates. Like `range`, `if` and `with` statements are closed with an `{{ end }}`.
+
+Go Templates treat the following values as **false**:
+
+- `false` (boolean)
+- 0 (integer)
+- any zero-length array, slice, map, or string
+
+#### Example 1: `with`
+
+It is common to write "if something exists, do this" kind of
+statements using `with`.
+
+{{% note %}}
+`with` rebinds the context `.` within its scope (just like in `range`).
+{{% /note %}}
+
+It skips the block if the variable is absent, or if it evaluates to
+"false" as explained above.
+
+```go-html-template
+{{ with .Params.title }}
+ <h4>{{ . }}</h4>
+{{ end }}
+```
+
+#### Example 2: `with` .. `else`
+
+Below snippet uses the "description" front-matter parameter's value if
+set, else uses the default `.Summary` [Page variable][pagevars]:
+
+
+```go-html-template
+{{ with .Param "description" }}
+ {{ . }}
+{{ else }}
+ {{ .Summary }}
+{{ end }}
+```
+
+See the [`.Param` function][param].
+
+#### Example 3: `if`
+
+An alternative (and a more verbose) way of writing `with` is using
+`if`. Here, the `.` does not get rebound.
+
+Below example is "Example 1" rewritten using `if`:
+
+```go-html-template
+{{ if isset .Params "title" }}
+ <h4>{{ index .Params "title" }}</h4>
+{{ end }}
+```
+
+#### Example 4: `if` .. `else`
+
+Below example is "Example 2" rewritten using `if` .. `else`, and using
+[`isset` function][isset] + `.Params` variable (different from the
+[`.Param` **function**][param]) instead:
+
+```go-html-template
+{{ if (isset .Params "description") }}
+ {{ index .Params "description" }}
+{{ else }}
+ {{ .Summary }}
+{{ end }}
+```
+
+#### Example 5: `if` .. `else if` .. `else`
+
+Unlike `with`, `if` can contain `else if` clauses too.
+
+```go-html-template
+{{ if (isset .Params "description") }}
+ {{ index .Params "description" }}
+{{ else if (isset .Params "summary") }}
+ {{ index .Params "summary" }}
+{{ else }}
+ {{ .Summary }}
+{{ end }}
+```
+
+#### Example 6: `and` & `or`
+
+```go-html-template
+{{ if (and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")) }}
+```
+
+## Pipes
+
+One of the most powerful components of Go Templates is the ability to stack actions one after another. This is done by using pipes. Borrowed from Unix pipes, the concept is simple: each pipeline's output becomes the input of the following pipe.
+
+Because of the very simple syntax of Go Templates, the pipe is essential to being able to chain together function calls. One limitation of the pipes is that they can only work with a single value and that value becomes the last parameter of the next pipeline.
+
+A few simple examples should help convey how to use the pipe.
+
+### Example 1: `shuffle`
+
+The following two examples are functionally the same:
+
+```go-html-template
+{{ shuffle (seq 1 5) }}
+```
+
+
+```go-html-template
+{{ (seq 1 5) | shuffle }}
+```
+
+### Example 2: `index`
+
+The following accesses the page parameter called "disqus_url" and escapes the HTML. This example also uses the [`index` function](/functions/index-function/), which is built into Go Templates:
+
+```go-html-template
+{{ index .Params "disqus_url" | html }}
+```
+
+### Example 3: `or` with `isset`
+
+```go-html-template
+{{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr") }}
+Stuff Here
+{{ end }}
+```
+
+Could be rewritten as
+
+```go-html-template
+{{ if isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" }}
+Stuff Here
+{{ end }}
+```
+
+## Context (aka "the dot") {#the-dot}
+
+The most easily overlooked concept to understand about Go Templates is
+that `{{ . }}` always refers to the **current context**.
+
+- In the top level of your template, this will be the data set made
+ available to it.
+- Inside an iteration, however, it will have the value of the
+ current item in the loop; i.e., `{{ . }}` will no longer refer to
+ the data available to the entire page.
+
- ### 1. Define a Variable Independent of Context
++If you need to access page-level data (e.g., page parameters set in front
+matter) from within the loop, you will likely want to do one of the
+following:
+
- ### 2. Use `$.` to Access the Global Context
++### 1. Define a variable independent of context
+
+The following shows how to define a variable independent of the context.
+
+{{< code file="tags-range-with-page-variable.html" >}}
+{{ $title := .Site.Title }}
+<ul>
+{{ range .Params.tags }}
+ <li>
+ <a href="/tags/{{ . | urlize }}">{{ . }}</a>
+ - {{ $title }}
+ </li>
+{{ end }}
+</ul>
+{{< /code >}}
+
+{{% note %}}
+Notice how once we have entered the loop (i.e. `range`), the value of `{{ . }}` has changed. We have defined a variable outside the loop (`{{ $title }}`) that we've assigned a value so that we have access to the value from within the loop as well.
+{{% /note %}}
+
- ### Go Templates comments
++### 2. Use `$.` to access the global context
+
+`$` has special significance in your templates. `$` is set to the starting value of `.` ("the dot") by default. This is a [documented feature of Go text/template][dotdoc]. This means you have access to the global context from anywhere. Here is an equivalent example of the preceding code block but now using `$` to grab `.Site.Title` from the global context:
+
+{{< code file="range-through-tags-w-global.html" >}}
+<ul>
+{{ range .Params.tags }}
+ <li>
+ <a href="/tags/{{ . | urlize }}">{{ . }}</a>
+ - {{ $.Site.Title }}
+ </li>
+{{ end }}
+</ul>
+{{< /code >}}
+
+{{% warning "Don't Redefine the Dot" %}}
+The built-in magic of `$` would cease to work if someone were to mischievously redefine the special character; e.g. `{{ $ := .Site }}`. *Don't do it.* You may, of course, recover from this mischief by using `{{ $ := . }}` in a global context to reset `$` to its default value.
+{{% /note %}}
+
+## Whitespace
+
+Go 1.6 includes the ability to trim the whitespace from either side of a Go tag by including a hyphen (`-`) and space immediately beside the corresponding `{{` or `}}` delimiter.
+
+For instance, the following Go Template will include the newlines and horizontal tab in its HTML output:
+
+```go-html-template
+<div>
+ {{ .Title }}
+</div>
+```
+
+Which will output:
+
+```html
+<div>
+ Hello, World!
+</div>
+```
+
+Leveraging the `-` in the following example will remove the extra white space surrounding the `.Title` variable and remove the newline:
+
+```go-html-template
+<div>
+ {{- .Title -}}
+</div>
+```
+
+Which then outputs:
+
+```html
+<div>Hello, World!</div>
+```
+
+Go considers the following characters _whitespace_:
+
+* <kbd>space</kbd>
+* horizontal <kbd>tab</kbd>
+* carriage <kbd>return</kbd>
+* newline
+
+## Comments
+
+In order to keep your templates organized and share information throughout your team, you may want to add comments to your templates. There are two ways to do that with Hugo.
+
- If you need variables to construct such HTML comments, just pipe `printf` to `safeHTML`.
++### Go templates comments
+
+Go Templates support `{{/*` and `*/}}` to open and close a comment block. Nothing within that block will be rendered.
+
+For example:
+
+```go-html-template
+Bonsoir, {{/* {{ add 0 + 2 }} */}}Eliott.
+```
+
+Will render `Bonsoir, Eliott.`, and not care about the syntax error (`add 0 + 2`) in the comment block.
+
+### HTML comments
+
+You can add html comments by piping a string HTML code comment to `safeHTML`.
+
+For example:
+
+```go-html-template
+{{ "<!-- This is an HTML comment -->" | safeHTML }}
+```
+
- #### HTML comments containing Go Templates
++If you need variables to construct such HTML comments, just pipe `printf` to `safeHTML`.
+
+For example:
+
+```go-html-template
+{{ printf "<!-- Our website is named: %s -->" .Site.Title | safeHTML }}
+```
+
- ## Hugo Parameters
++#### HTML comments containing Go templates
+
+HTML comments are by default stripped, but their content is still evaluated. That means that although the HTML comment will never render any content to the final HTML pages, code contained within the comment may fail the build process.
+
+{{% note %}}
+Do **not** try to comment out Go Template code using HTML comments.
+{{% /note %}}
+
+```go-html-template
+<!-- {{ $author := "Emma Goldman" }} was a great woman. -->
+{{ $author }}
+```
+
+The templating engine will strip the content within the HTML comment, but will first evaluate any Go Template code if present within. So the above example will render `Emma Goldman`, as the `$author` variable got evaluated in the HTML comment. But the build would have failed if that code in the HTML comment had an error.
+
- ## Use Content (`Page`) Parameters
++## Hugo parameters
+
+Hugo provides the option of passing values to your template layer through your [site configuration][config] (i.e. for site-wide values) or through the metadata of each specific piece of content (i.e. the [front matter]). You can define any values of any type and use them however you want in your templates, as long as the values are supported by the [front matter format](/content-management/front-matter#front-matter-formats).
+
- ## Use Site Configuration Parameters
++## Use content (`Page`) parameters
+
+You can provide variables to be used by templates in individual content's [front matter].
+
+An example of this is used in the Hugo docs. Most of the pages benefit from having the table of contents provided, but sometimes the table of contents doesn't make a lot of sense. We've defined a `notoc` variable in our front matter that will prevent a table of contents from rendering when specifically set to `true`.
+
+Here is the example front matter:
+
+{{< code-toggle file="content/example.md" fm=true copy=false >}}
+title: Example
+notoc: true
+{{< /code-toggle >}}
+
+Here is an example of corresponding code that could be used inside a `toc.html` [partial template][partials]:
+
+{{< code file="layouts/partials/toc.html" >}}
+{{ if not .Params.notoc }}
+<aside>
+ <header>
+ <a href="#{{ .Title | urlize }}">
+ <h3>{{ .Title }}</h3>
+ </a>
+ </header>
+ {{ .TableOfContents }}
+</aside>
+<a href="#" id="toc-toggle"></a>
+{{ end }}
+{{< /code >}}
+
+We want the *default* behavior to be for pages to include a TOC unless otherwise specified. This template checks to make sure that the `notoc:` field in this page's front matter is not `true`.
+
- Within a footer layout, you might then declare a `<footer>` that is only rendered if the `copyrighthtml` parameter is provided. If it *is* provided, you will then need to declare the string is safe to use via the [`safeHTML` function][safehtml] so that the HTML entity is not escaped again. This would let you easily update just your top-level config file each January 1st, instead of hunting through your templates.
++## Use site configuration parameters
+
+You can arbitrarily define as many site-level parameters as you want in your [site's configuration file][config]. These parameters are globally available in your templates.
+
+For instance, you might declare the following:
+
+{{< code-toggle file="hugo" >}}
+params:
+ copyrighthtml: "Copyright © 2017 John Doe. All Rights Reserved."
+ twitteruser: "spf13"
+ sidebarrecentlimit: 5
+{{< /code >}}
+
- ## Example: Show Future Events
++Within a footer layout, you might then declare a `<footer>` that is only rendered if the `copyrighthtml` parameter is provided. If it *is* provided, you will then need to declare the string is safe to use via the [`safeHTML` function][safehtml] so that the HTML entity is not escaped again. This would let you easily update just your top-level configuration file each January 1st, instead of hunting through your templates.
+
+```go-html-template
+{{ if .Site.Params.copyrighthtml }}
+ <footer>
+ <div class="text-center">{{ .Site.Params.CopyrightHTML | safeHTML }}</div>
+ </footer>
+{{ end }}
+```
+
+An alternative way of writing the "`if`" and then referencing the same value is to use [`with`][with] instead. `with` rebinds the context (`.`) within its scope and skips the block if the variable is absent:
+
+{{< code file="layouts/partials/twitter.html" >}}
+{{ with .Site.Params.twitteruser }}
+ <div>
+ <a href="https://twitter.com/{{ . }}" rel="author">
+ <img src="/images/twitter.png" width="48" height="48" title="Twitter: {{ . }}" alt="Twitter"></a>
+ </div>
+{{ end }}
+{{< /code >}}
+
+Finally, you can pull "magic constants" out of your layouts as well. The following uses the [`first`][first] function, as well as the [`.RelPermalink`][relpermalink] page variable and the [`.Site.Pages`][sitevars] site variable.
+
+```go-html-template
+<nav>
+ <h1>Recent Posts</h1>
+ <ul>
+ {{- range first .Site.Params.SidebarRecentLimit .Site.Pages -}}
+ <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
+ {{- end -}}
+ </ul>
+</nav>
+```
+
++## Example: show future events
+
+Given the following content structure and [front matter]:
+
+```text
+content/
+└── events/
+ ├── event-1.md
+ ├── event-2.md
+ └── event-3.md
+```
+
+{{< code-toggle file="content/events/event-1.md" copy=false >}}
+title = 'Event 1'
+date = 2021-12-06T10:37:16-08:00
+draft = false
+start_date = 2021-12-05T09:00:00-08:00
+end_date = 2021-12-05T11:00:00-08:00
+{{< /code-toggle >}}
+
+This [partial template][partials] renders future events:
+
+{{< code file="layouts/partials/future-events.html" >}}
+<h2>Future Events</h2>
+<ul>
+ {{ range where site.RegularPages "Type" "events" }}
+ {{ if gt (.Params.start_date | time.AsTime) now }}
+ {{ $startDate := .Params.start_date | time.Format ":date_medium" }}
+ <li>
+ <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> - {{ $startDate }}
+ </li>
+ {{ end }}
+ {{ end }}
+</ul>
+{{< /code >}}
+
+If you restrict front matter to the TOML format, and omit quotation marks surrounding date fields, you can perform date comparisons without casting.
+
+{{< code file="layouts/partials/future-events.html" >}}
+<h2>Future Events</h2>
+<ul>
+ {{ range where (where site.RegularPages "Type" "events") "Params.start_date" "gt" now }}
+ {{ $startDate := .Params.start_date | time.Format ":date_medium" }}
+ <li>
+ <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> - {{ $startDate }}
+ </li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
+[dotdoc]: https://golang.org/pkg/text/template/#hdr-Variables
+[config]: /getting-started/configuration
+[first]: /functions/first
+[front matter]: /content-management/front-matter
+[functions]: /functions
+[internal templates]: /templates/internal
+[isset]: /functions/isset
+[math]: /functions/math
+[pagevars]: /variables/page
+[param]: /functions/param
+[partials]: /templates/partials
+[relpermalink]: /variables/page#page-variables
+[safehtml]: /functions/safehtml
+[sitevars]: /variables/site
+[variables]: /variables
+[with]: /functions/with
--- /dev/null
- title: Lists of Content in Hugo
- linktitle: List Templates
+---
- weight: 22
- weight: 22
++title: Lists of content in Hugo
++linkTitle: List templates
+description: Lists have a specific meaning and usage in Hugo when it comes to rendering your site homepage, section page, taxonomy list, or taxonomy terms list.
+categories: [templates]
+keywords: [lists,sections,rss,taxonomies,terms]
+menu:
+ docs:
+ parent: templates
- ## What is a List Page Template?
++ weight: 60
++weight: 60
+aliases: [/templates/list/,/layout/indexes/]
+toc: true
+---
+
- * [Taxonomy terms pages][taxterms]
- * [Taxonomy list pages][taxlists]
- * [Section list pages][sectiontemps]
- * [RSS][rss]
++## What is a list page template?
+
+{{< youtube 8b2YTSMdMps >}}
+
+A list page template is a template used to render multiple pieces of content in a single HTML page. The exception to this rule is the homepage, which is still a list but has its own [dedicated template][homepage].
+
+Hugo uses the term *list* in its truest sense; i.e. a sequential arrangement of material, especially in alphabetical or numerical order. Hugo uses list templates on any output HTML page where content is traditionally listed:
+
- ## List Defaults
++* [Home page](/templates/homepage)
++* [Section pages](/templates/section-templates)
++* [Taxonomy pages](/templates/taxonomy-templates)
++* [Taxonomy term pages](/templates/taxonomy-templates)
++* [RSS feeds](/templates/rss)
++* [Sitemaps](/templates/sitemap-template)
+
+For template lookup order, see [Template Lookup](/templates/lookup-order/).
+
+The idea of a list page comes from the [hierarchical mental model of the web][mentalmodel] and is best demonstrated visually:
+
+[](site-hierarchy.svg)
+
- ### Default Templates
++## List defaults
+
- ## Add Content and Front Matter to List Pages
++### Default templates
+
+Since section lists and taxonomy lists (N.B., *not* [taxonomy terms lists][taxterms]) are both *lists* with regards to their templates, both have the same terminating default of `_default/list.html` or `themes/<THEME>/layouts/_default/list.html` in their lookup order. In addition, both [section lists][sectiontemps] and [taxonomy lists][taxlists] have their own default list templates in `_default`.
+
+See [Template Lookup Order](/templates/lookup-order/) for the complete reference.
+
- ### Example Project Directory
++## Add content and front matter to list pages
+
+Since v0.18, [everything in Hugo is a `Page`][bepsays]. This means list pages and the homepage can have associated content files (i.e. `_index.md`) that contain page metadata (i.e., front matter) and content.
+
+This new model allows you to include list-specific front matter via `.Params` and also means that list templates (e.g., `layouts/_default/list.html`) have access to all [page variables][pagevars].
+
+{{% note %}}
+It is important to note that all `_index.md` content files will render according to a *list* template and not according to a [single page template](/templates/single-page-templates/).
+{{% /note %}}
+
- <h1>{{ .Title} }</h1>
++### Example project directory
+
+The following is an example of a typical Hugo project directory's content:
+
+```txt
+.
+...
+├── content
+| ├── posts
+| | ├── _index.md
+| | ├── post-01.md
+| | └── post-02.md
+| └── quote
+| | ├── quote-01.md
+| | └── quote-02.md
+...
+```
+
+Using the above example, let's assume you have the following in `content/posts/_index.md`:
+
+{{< code file="content/posts/_index.md" >}}
+---
+title: My Go Journey
+date: 2017-03-23
+publishdate: 2017-03-24
+---
+
+I decided to start learning Go in March 2017.
+
+Follow my journey through this new blog.
+{{< /code >}}
+
+You can now access this `_index.md`'s' content in your list template:
+
+{{< code file="layouts/_default/list.html" >}}
+{{ define "main" }}
+<main>
+ <article>
+ <header>
- <!-- "{{ .Content} }" pulls from the markdown content of the corresponding _index.md -->
++ <h1>{{ .Title }}</h1>
+ </header>
- ### List Pages Without `_index.md`
++ <!-- "{{ .Content }}" pulls from the markdown content of the corresponding _index.md -->
+ {{ .Content }}
+ </article>
+ <ul>
+ <!-- Ranges through content/posts/*.md -->
+ {{ range .Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Date.Format "2006-01-02" }} | {{ .Title }}</a>
+ </li>
+ {{ end }}
+ </ul>
+</main>
+{{ end }}
+{{< /code >}}
+
+This above will output the following HTML:
+
+{{< code file="example.com/posts/index.html" copy=false >}}
+<!--top of your baseof code-->
+<main>
+ <article>
+ <header>
+ <h1>My Go Journey</h1>
+ </header>
+ <p>I decided to start learning Go in March 2017.</p>
+ <p>Follow my journey through this new blog.</p>
+ </article>
+ <ul>
+ <li><a href="/posts/post-01/">Post 1</a></li>
+ <li><a href="/posts/post-02/">Post 2</a></li>
+ </ul>
+</main>
+<!--bottom of your baseof-->
+{{< /code >}}
+
- ## Example List Templates
++### List pages without `_index.md`
+
+You do *not* have to create an `_index.md` file for every list page (i.e. section, taxonomy, taxonomy terms, etc) or the homepage. If Hugo does not find an `_index.md` within the respective content section when rendering a list template, the page will be created but with no `{{ .Content }}` and only the default values for `.Title` etc.
+
+Using this same `layouts/_default/list.html` template and applying it to the `quotes` section above will render the following output. Note that `quotes` does not have an `_index.md` file to pull from:
+
+{{< code file="example.com/quote/index.html" copy=false >}}
+<!--baseof-->
+<main>
+ <article>
+ <header>
+ <!-- Hugo assumes that .Title is the name of the section since there is no _index.md content file from which to pull a "title:" field -->
+ <h1>Quotes</h1>
+ </header>
+ </article>
+ <ul>
+ <li><a href="https://example.com/quote/quotes-01/">Quote 1</a></li>
+ <li><a href="https://example.com/quote/quotes-02/">Quote 2</a></li>
+ </ul>
+</main>
+<!--baseof-->
+{{< /code >}}
+
+{{% note %}}
+The default behavior of Hugo is to pluralize list titles; hence the inflection of the `quote` section to "Quotes" when called with the `.Title` [page variable](/variables/page/). You can change this via the `pluralizeListTitles` directive in your [site configuration](/getting-started/configuration/).
+{{% /note %}}
+
- ### Section Template
++## Example list templates
+
- ### Taxonomy Template
++### Section template
+
+This list template has been modified slightly from a template originally used in [spf13.com](https://spf13.com/). It makes use of [partial templates][partials] for the chrome of the rendered page rather than using a [base template][base]. The examples that follow also use the [content view templates][views] `li.html` or `summary.html`.
+
+{{< code file="layouts/section/posts.html" >}}
+{{ partial "header.html" . }}
+{{ partial "subheader.html" . }}
+<main>
+ <div>
+ <h1>{{ .Title }}</h1>
+ <ul>
+ <!-- Renders the li.html content view for each content/posts/*.md -->
+ {{ range .Pages }}
+ {{ .Render "li" }}
+ {{ end }}
+ </ul>
+ </div>
+</main>
+{{ partial "footer.html" . }}
+{{< /code >}}
+
- ## Order Content
++### Taxonomy template
+
+{{< code file="layouts/_default/taxonomy.html" >}}
+{{ define "main" }}
+<main>
+ <div>
+ <h1>{{ .Title }}</h1>
+ <!-- ranges through each of the content files associated with a particular taxonomy term and renders the summary.html content view -->
+ {{ range .Pages }}
+ {{ .Render "summary" }}
+ {{ end }}
+ </div>
+</main>
+{{ end }}
+{{< /code >}}
+
- ### By Weight
++## Order content
+
+Hugo lists render the content based on metadata you provide in [front matter]. In addition to sane defaults, Hugo also ships with multiple methods to make quick work of ordering content inside list templates:
+
+### Default: Weight > Date > LinkTitle > FilePath
+
+{{< code file="layouts/partials/default-order.html" >}}
+<ul>
+ {{ range .Pages }}
+ <li>
+ <h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
+ <time>{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
+ </li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
- ### By Date
++### By weight
+
+Lower weight gets higher precedence. So content with lower weight will come first.
+
+{{< code file="layouts/partials/by-weight.html" >}}
+<ul>
+ {{ range .Pages.ByWeight }}
+ <li>
+ <h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
+ <time>{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
+ </li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
- ### By Publish Date
++### By date
+
+{{< code file="layouts/partials/by-date.html" >}}
+<ul>
+ <!-- orders content according to the "date" field in front matter -->
+ {{ range .Pages.ByDate }}
+ <li>
+ <h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
+ <time>{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
+ </li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
- ### By Expiration Date
++### By publish date
+
+{{< code file="layouts/partials/by-publish-date.html" >}}
+<ul>
+ <!-- orders content according to the "publishdate" field in front matter -->
+ {{ range .Pages.ByPublishDate }}
+ <li>
+ <h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
+ <time>{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
+ </li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
- ### By Last Modified Date
++### By expiration date
+
+{{< code file="layouts/partials/by-expiry-date.html" >}}
+<ul>
+ {{ range .Pages.ByExpiryDate }}
+ <li>
+ <h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
+ <time>{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
+ </li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
- ### By Length
++### By last modified date
+
+{{< code file="layouts/partials/by-last-mod.html" >}}
+<ul>
+ <!-- orders content according to the "lastmod" field in front matter -->
+ {{ range .Pages.ByLastmod }}
+ <li>
+ <h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
+ <time>{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
+ </li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
- ### By Title
++### By length
+
+{{< code file="layouts/partials/by-length.html" >}}
+<ul>
+ <!-- orders content according to content length in ascending order (i.e., the shortest content will be listed first) -->
+ {{ range .Pages.ByLength }}
+ <li>
+ <h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
+ <time>{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
+ </li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
- ### By Link Title
++### By title
+
+{{< code file="layouts/partials/by-title.html" >}}
+<ul>
+ <!-- ranges through content in ascending order according to the "title" field set in front matter -->
+ {{ range .Pages.ByTitle }}
+ <li>
+ <h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
+ <time>{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
+ </li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
- ### By Parameter
++### By link title
+
+{{< code file="layouts/partials/by-link-title.html" >}}
+<ul>
+ <!-- ranges through content in ascending order according to the "linktitle" field in front matter. If a "linktitle" field is not set, the range will start with content that only has a "title" field and use that value for .LinkTitle -->
+ {{ range .Pages.ByLinkTitle }}
+ <li>
+ <h1><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></h1>
+ <time>{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
+ </li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
- ### Reverse Order
++### By page parameter
+
+Order based on the specified front matter parameter. Content that does not have the specified front matter field will use the site's `.Site.Params` default. If the parameter is not found at all in some entries, those entries will appear together at the end of the ordering.
+
+{{< code file="layouts/partials/by-rating.html" >}}
+<!-- Ranges through content according to the "rating" field set in front matter -->
+{{ range (.Pages.ByParam "rating") }}
+ <!-- ... -->
+{{ end }}
+{{< /code >}}
+
+If the targeted front matter field is nested beneath another field, you can access the field using dot notation.
+
+{{< code file="layouts/partials/by-nested-param.html" >}}
+{{ range (.Pages.ByParam "author.last_name") }}
+ <!-- ... -->
+{{ end }}
+{{< /code >}}
+
- ## Group Content
++### Reverse order
+
+Reversing order can be applied to any of the above methods. The following uses `ByDate` as an example:
+
+{{< code file="layouts/partials/by-date-reverse.html" >}}
+<ul>
+ {{ range .Pages.ByDate.Reverse }}
+ <li>
+ <h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
+ <time>{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
+ </li>
+ {{ end }}
+</ul>
+{{< /code >}}
+
- ### By Page Field
++## Group content
+
+Hugo provides some functions for grouping pages by Section, Type, Date, etc.
+
- ### By Date
++### By page field
+
+{{< code file="layouts/partials/by-page-field.html" >}}
+<!-- Groups content according to content section. The ".Key" in this instance will be the section's title. -->
+{{ range .Pages.GroupBy "Section" }}
+<h3>{{ .Key }}</h3>
+<ul>
+ {{ range .Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ <div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
+In the above example, you may want `{{ .Title }}` to point the `title` field you have added to your `_index.md` file instead. You can access this value using the [`.GetPage` function][getpage]:
+
+{{< code file="layouts/partials/by-page-field.html" >}}
+<!-- Groups content according to content section.-->
+{{ range .Pages.GroupBy "Section" }}
+<!-- Checks for existence of _index.md for a section; if available, pulls from "title" in front matter -->
+{{ with $.Site.GetPage "section" .Key }}
+<h3>{{ .Title }}</h3>
+{{ else }}
+<!-- If no _index.md is available, ".Key" defaults to the section title and filters to title casing -->
+<h3>{{ .Key | title }}</h3>
+{{ end }}
+<ul>
+ {{ range .Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ <div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
- ### By Publish Date
++### By date
+
+{{< code file="layouts/partials/by-page-date.html" >}}
+<!-- Groups content by month according to the "date" field in front matter -->
+{{ range .Pages.GroupByDate "2006-01" }}
+<h3>{{ .Key }}</h3>
+<ul>
+ {{ range .Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ <div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
+{{< new-in "0.97.0" >}} `GroupByDate` accepts the same time layouts as in [time.Format](/functions/dateformat/) and The `.Key` in the result will be localized for the current language.
+
- ### By Lastmod
++### By publish date
+
+{{< code file="layouts/partials/by-page-publish-date.html" >}}
+<!-- Groups content by month according to the "publishDate" field in front matter -->
+{{ range .Pages.GroupByPublishDate "2006-01" }}
+<h3>{{ .Key }}</h3>
+<ul>
+ {{ range .Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ <div class="meta">{{ .PublishDate.Format "Mon, Jan 2, 2006" }}</div>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
+{{< new-in "0.97.0" >}} `GroupByDate` accepts the same time layouts as in [time.Format](/functions/dateformat/) and The `.Key` in the result will be localized for the current language.
+
- {{< code file="layouts/partials/by-page-lastmod.html" >}}
- <!-- Groups content by month according to the "lastMod" field in front matter -->
- {{ range .Pages.GroupByLastmod "2006-01" }}
+
- <div class="meta">{{ .Lastmod.Format "Mon, Jan 2, 2006" }}</div>
++### By expiration date
++
++{{< code file="layouts/partials/by-page-expiry-date.html" >}}
++<!-- Groups content by month according to the "expiryDate" field in front matter -->
++{{ range .Pages.GroupByExpiryDate "2006-01" }}
+<h3>{{ .Key }}</h3>
+<ul>
+ {{ range .Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
- ### By Expiry Date
++ <div class="meta">{{ .ExpiryDate.Format "Mon, Jan 2, 2006" }}</div>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
+{{< new-in "0.97.0" >}} `GroupByDate` accepts the same time layouts as in [time.Format](/functions/dateformat/) and The `.Key` in the result will be localized for the current language.
+
- {{< code file="layouts/partials/by-page-expiry-date.html" >}}
- <!-- Groups content by month according to the "expiryDate" field in front matter -->
- {{ range .Pages.GroupByExpiryDate "2006-01" }}
++### By last modified date
+
- <div class="meta">{{ .ExpiryDate.Format "Mon, Jan 2, 2006" }}</div>
++{{< code file="layouts/partials/by-page-lastmod.html" >}}
++<!-- Groups content by month according to the "lastMod" field in front matter -->
++{{ range .Pages.GroupByLastmod "2006-01" }}
+<h3>{{ .Key }}</h3>
+<ul>
+ {{ range .Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
- ### By Page Parameter
++ <div class="meta">{{ .Lastmod.Format "Mon, Jan 2, 2006" }}</div>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
+{{< new-in "0.97.0" >}} `GroupByDate` accepts the same time layouts as in [time.Format](/functions/dateformat/) and The `.Key` in the result will be localized for the current language.
+
- ### By Page Parameter in Date Format
++### By page parameter
+
+{{< code file="layouts/partials/by-page-param.html" >}}
+<!-- Groups content according to the "param_key" field in front matter -->
+{{ range .Pages.GroupByParam "param_key" }}
+<h3>{{ .Key }}</h3>
+<ul>
+ {{ range .Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ <div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
- ### Reverse Key Order
++### By page parameter in date format
+
+The following template takes grouping by `date` a step further and uses Go's layout string. See the [`Format` function] for more examples of how to use Go's layout string to format dates in Hugo.
+
+{{< code file="layouts/partials/by-page-param-as-date.html" >}}
+<!-- Groups content by month according to the "param_key" field in front matter -->
+{{ range .Pages.GroupByParamDate "param_key" "2006-01" }}
+<h3>{{ .Key }}</h3>
+<ul>
+ {{ range .Pages }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ <div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
- #### 1. Adding the Reverse Method
++### Reverse key order
+
+Ordering of groups is performed by keys in alphanumeric order (A–Z, 1–100) and in reverse chronological order (i.e., with the newest first) for dates.
+
+While these are logical defaults, they are not always the desired order. There are two different syntaxes to change Hugo's default ordering for groups, both of which work the same way.
+
- #### 2. Providing the Alternate Direction
++#### 1. Adding the reverse method
+
+```go-html-template
+{{ range (.Pages.GroupBy "Section").Reverse }}
+```
+
+```go-html-template
+{{ range (.Pages.GroupByDate "2006-01").Reverse }}
+```
+
- ### Order Within Groups
++#### 2. Providing the alternate direction
+
+```go-html-template
+{{ range .Pages.GroupByDate "2006-01" "asc" }}
+```
+
+```go-html-template
+{{ range .Pages.GroupBy "Section" "desc" }}
+```
+
- ## Filtering and Limiting Lists {#filtering-and-limiting-lists}
++### Order within groups
+
+Because Grouping returns a `{{ .Key }}` and a slice of pages, all the ordering methods listed above are available.
+
+Here is the ordering for the example that follows:
+
+1. Content is grouped by month according to the `date` field in front matter.
+2. Groups are listed in ascending order (i.e., the oldest groups first)
+3. Pages within each respective group are ordered alphabetically according to the `title`.
+
+{{< code file="layouts/partials/by-group-by-page.html" >}}
+{{ range .Pages.GroupByDate "2006-01" "asc" }}
+<h3>{{ .Key }}</h3>
+<ul>
+ {{ range .Pages.ByTitle }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ <div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
+{{< /code >}}
+
++## Filtering and limiting lists
+
+Sometimes you only want to list a subset of the available content. A
+common is to only display posts from [**main sections**][mainsections]
+on the blog's homepage.
+
+See the documentation on [`where` function][wherefunction] and
+[`first` function][firstfunction] for further details.
+
+[base]: /templates/base/
+[bepsays]: https://bepsays.com/en/2016/12/19/hugo-018/
+[directorystructure]: /getting-started/directory-structure/
+[`Format` function]: /functions/format/
+[front matter]: /content-management/front-matter/
+[getpage]: /functions/getpage/
+[homepage]: /templates/homepage/
+[homepage]: /templates/homepage/
+[mentalmodel]: https://webstyleguide.com/wsg3/3-information-architecture/3-site-structure.html
+[pagevars]: /variables/page/
+[partials]: /templates/partials/
+[RSS 2.0]: https://cyber.harvard.edu/rss/rss.html "RSS 2.0 Specification"
+[rss]: /templates/rss/
+[sections]: /content-management/sections/
+[sectiontemps]: /templates/section-templates/
+[sitevars]: /variables/site/
+[taxlists]: /templates/taxonomy-templates/#taxonomy-list-templates
+[taxterms]: /templates/taxonomy-templates/#taxonomy-terms-templates
+[taxvars]: /variables/taxonomy/
+[views]: /templates/views/
+[wherefunction]: /functions/where/
+[firstfunction]: /functions/first/
+[mainsections]: /functions/where/#mainsections
--- /dev/null
- title: Hugo's Lookup Order
- linktitle: Template Lookup Order
- description: Hugo searches for the layout to use for a given page in a well defined order, starting from the most specific.
- categories: [templates,fundamentals]
+---
- weight: 15
- quicklinks:
- weight: 15
++title: Template lookup order
++description: Hugo uses the rules below to select a template for a given page, starting from the most specific.
++categories: [fundamentals,templates]
+keywords: [templates]
+menu:
+ docs:
+ parent: templates
- ## Hugo Layouts Lookup Rules
-
- Hugo takes the parameters listed below into consideration when choosing a layout for a given page. They are listed in a priority order. This should feel natural, but look at the table below for concrete examples of the different parameter variations.
++ weight: 30
++weight: 30
++toc: true
+---
+
- : Can be set in page front matter.
++## Lookup rules
+
++Hugo takes the parameters listed below into consideration when choosing a template for a given page. The templates are ordered by specificity. This should feel natural, but look at the table below for concrete examples of the different parameter variations.
+
+Kind
+: The page `Kind` (the home page is one). See the example tables below per kind. This also determines if it is a **single page** (i.e. a regular content page. We then look for a template in `_default/single.html` for HTML) or a **list page** (section listings, home page, taxonomy lists, taxonomy terms. We then look for a template in `_default/list.html` for HTML).
+
+Layout
- : We will consider a language code in the template name. If the site language is `fr`, `index.fr.amp.html` will win over `index.amp.html`, but `index.amp.html` will be chosen before `index.fr.html`.
++: Can be set in front matter.
+
+Output Format
+: See [Custom Output Formats](/templates/output-formats). An output format has both a `name` (e.g. `rss`, `amp`, `html`) and a `suffix` (e.g. `xml`, `html`). We prefer matches with both (e.g. `index.amp.html`, but look for less specific templates.
+
+Note that if the output format's Media Type has more than one suffix defined, only the first is considered.
+
+Language
- **Tip:** The examples below look long and complex. That is the flexibility talking. Most Hugo sites contain just a handful of templates:
-
- ```bash
- ├── _default
- │ ├── baseof.html
- │ ├── list.html
- │ └── single.html
- └── index.html
- ```
++: We will consider a language tag in the template name. If the site language is `fr`, `index.fr.amp.html` will win over `index.amp.html`, but `index.amp.html` will be chosen before `index.fr.html`.
+
+Type
+: Is value of `type` if set in front matter, else it is the name of the root section (e.g. "blog"). It will always have a value, so if not set, the value is "page".
+
+Section
+: Is relevant for `section`, `taxonomy` and `term` types.
+
+{{% note %}}
-
- ## Hugo Layouts Lookup Rules With Theme
-
- In Hugo, layouts can live in either the project's or the themes' layout folders, and the most specific layout will be chosen. Hugo will interleave the lookups listed below, finding the most specific one either in the project or themes.
-
- ## Examples: Layout Lookup for Regular Pages
++Templates can live in either the project's or the themes' layout folders, and the most specific templates will be chosen. Hugo will interleave the lookups listed below, finding the most specific one either in the project or themes.
+{{% /note %}}
+
- ## Examples: Layout Lookup for Home Page
++## Regular pages
+
+{{< datatable-filtered "output" "layouts" "Kind == page" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
+
- ## Examples: Layout Lookup for Section Pages
++## Home page
+
+{{< datatable-filtered "output" "layouts" "Kind == home" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
+
- ## Examples: Layout Lookup for Taxonomy Pages
++## Section pages
+
+{{< datatable-filtered "output" "layouts" "Kind == section" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
+
- ## Examples: Layout Lookup for Term Pages
++## Taxonomy pages
+
+{{< datatable-filtered "output" "layouts" "Kind == taxonomy" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
+
++## Term pages
+
+{{< datatable-filtered "output" "layouts" "Kind == term" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
--- /dev/null
- title: Menu Templates
+---
- weight: 130
++title: Menu templates
+description: Use menu variables and methods in your templates to render a menu.
+categories: [templates]
+keywords: [lists,sections,menus]
+menu:
+ docs:
+ parent: templates
- weight: 130
++ weight: 140
+toc: true
++weight: 140
+aliases: [/templates/menus/]
+---
+
+## Overview
+
+After [defining menu entries], use [menu variables and methods] to render a menu.
+
+Three factors determine how to render a menu:
+
+1. The method used to define the menu entries: [automatic], [in front matter], or [in site configuration]
+1. The menu structure: flat or nested
+1. The method used to [localize the menu entries]: site configuration or translation tables
+
+The example below handles every combination.
+
+## Example
+
+This partial template recursively "walks" a menu structure, rendering a localized, accessible nested list.
+
+{{< code file="layouts/partials/menu.html" >}}
+{{- $page := .page }}
+{{- $menuID := .menuID }}
+
+{{- with index site.Menus $menuID }}
+ <nav>
+ <ul>
+ {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
+ </ul>
+ </nav>
+{{- end }}
+
+{{- define "partials/inline/menu/walk.html" }}
+ {{- $page := .page }}
+ {{- range .menuEntries }}
+ {{- $attrs := dict "href" .URL }}
+ {{- if $page.IsMenuCurrent .Menu . }}
+ {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
+ {{- else if $page.HasMenuCurrent .Menu .}}
+ {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
+ {{- end }}
+ <li>
+ <a
+ {{- range $k, $v := $attrs }}
+ {{- with $v }}
+ {{- printf " %s=%q" $k $v | safeHTMLAttr }}
+ {{- end }}
+ {{- end -}}
+ >{{ or (T .Identifier) .Name | safeHTML }}</a>
+ {{- with .Children }}
+ <ul>
+ {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
+ </ul>
+ {{- end }}
+ </li>
+ {{- end }}
+{{- end }}
+{{< /code >}}
+
+Call the partial above, passing a menu ID and the current page in context.
+
+{{< code file="layouts/_default/single.html" >}}
+{{ partial "menu.html" (dict "menuID" "main" "page" .) }}
+{{ partial "menu.html" (dict "menuID" "footer" "page" .) }}
+{{< /code >}}
+
+## Page references
+
+Regardless of how you [define menu entries], an entry associated with a page has access to page variables and methods.
+
+This simplistic example renders a page parameter named `version` next to each entry's `name`. Code defensively using `with` or `if` to handle entries where (a) the entry points to an external resource, or (b) the `version` parameter is not defined.
+
+{{< code file="layouts/_default/single.html" >}}
+{{- range site.Menus.main }}
+ <a href="{{ .URL }}">
+ {{ .Name }}
+ {{- with .Page }}
+ {{- with .Params.version -}}
+ ({{ . }})
+ {{- end }}
+ {{- end }}
+ </a>
+{{- end }}
+{{< /code >}}
+
+## Menu entry parameters
+
+When you define menu entries [in site configuration] or [in front matter], you can include a `params` key as shown in these examples:
+
+- [Menu entry defined in site configuration]
+- [Menu entry defined in front matter]
+
+This simplistic example renders a `class` attribute for each anchor element. Code defensively using `with` or `if` to handle entries where `params.class` is not defined.
+
+{{< code file="layouts/partials/menu.html" >}}
+{{- range site.Menus.main }}
+ <a {{ with .Params.class -}} class="{{ . }}" {{ end -}} href="{{ .URL }}">
+ {{ .Name }}
+ </a>
+{{- end }}
+{{< /code >}}
+
+## Localize
+
+Hugo provides two methods to localize your menu entries. See [multilingual].
+
+[automatic]: /content-management/menus/#define-automatically
+[define menu entries]: /content-management/menus/
+[defining menu entries]: /content-management/menus/
+[in front matter]: /content-management/menus/#define-in-front-matter
+[in site configuration]: /content-management/menus/#define-in-site-configuration
+[localize the menu entries]: /content-management/multilingual/#menus
+[menu entry defined in front matter]: /content-management/menus/#example-front-matter
+[menu entry defined in site configuration]: /content-management/menus/#example-site-configuration
+[menu variables and methods]: /variables/menus/
+[multilingual]: /content-management/multilingual/#menus
--- /dev/null
- title: Custom Output Formats
+---
- categories: [templates]
++title: Custom output formats
+description: Hugo can output content in multiple formats, including calendar events, e-book formats, Google AMP, and JSON search indexes, or any custom text format.
- weight: 18
- weight: 18
++categories: [fundamentals,templates]
+keywords: ["amp", "outputs", "rss"]
+menu:
+ docs:
+ parent: templates
- ## Media Types
++ weight: 210
++weight: 210
+aliases: [/templates/outputs/,/extras/output-formats/,/content-management/custom-outputs/]
+toc: true
+---
+
+This page describes how to properly configure your site with the media types and output formats, as well as where to create your templates for your custom outputs.
+
- - `Suffixes` are the values that will be used for URLs and filenames for that media type in Hugo.
++## Media types
+
+A [media type] (also known as _MIME type_ and _content type_) is a two-part identifier for file formats and format contents transmitted on the internet.
+
+This is the full set of built-in media types in Hugo:
+
+{{< datatable "media" "types" "type" "suffixes" >}}
+
+**Note:**
+
+- It is possible to add custom media types or change the defaults; e.g., if you want to change the suffix for `text/html` to `asp`.
- To add or modify a media type, define it in a `mediaTypes` section in your [site configuration][config], either for all sites or for a given language.
++- `Suffixes` are the values that will be used for URLs and file names for that media type in Hugo.
+- The `Type` is the identifier that must be used when defining new/custom `Output Formats` (see below).
+- The full set of media types will be registered in Hugo's built-in development server to make sure they are recognized by the browser.
+
- # Redefine HTML to update its media type.
++To add or modify a media type, define it in a `mediaTypes` section in your [site configuration], either for all sites or for a given language.
+
+{{< code-toggle file="hugo" >}}
+[mediaTypes]
+ [mediaTypes."text/enriched"]
+ suffixes = ["enr"]
+ [mediaTypes."text/html"]
+ suffixes = ["asp"]
+{{</ code-toggle >}}
+
+The above example adds one new media type, `text/enriched`, and changes the suffix for the built-in `text/html` media type.
+
+**Note:** these media types are configured for **your output formats**. If you want to redefine one of Hugo's default output formats (e.g. `HTML`), you also need to redefine the media type. So, if you want to change the suffix of the `HTML` output format from `html` (default) to `htm`:
+
+{{< code-toggle file="hugo" >}}
+[mediaTypes]
+ [mediaTypes."text/html"]
+ suffixes = ["htm"]
+
- **Note** that for the above to work, you also need to add an `outputs` definition in your site config.
+[outputFormats]
+ [outputFormats.HTML]
+ mediaType = "text/html"
+{{</ code-toggle >}}
+
- ## Output Format Definitions
++**Note** that for the above to work, you also need to add an `outputs` definition in your site configuration.
+
- ### Configure Output Formats
++## Output format definitions
+
+Given a media type and some additional configuration, you get an **Output Format**.
+
+This is the full set of Hugo's built-in output formats:
+
+{{< datatable "output" "formats" "name" "mediaType" "path" "baseName" "rel" "protocol" "isPlainText" "isHTML" "noUgly" "permalinkable" >}}
+
+- A page can be output in as many output formats as you want, and you can have an infinite amount of output formats defined **as long as they resolve to a unique path on the file system**. In the above table, the best example of this is `AMP` vs. `HTML`. `AMP` has the value `amp` for `Path` so it doesn't overwrite the `HTML` version; e.g. we can now have both `/index.html` and `/amp/index.html`.
+- The `MediaType` must match the `Type` of an already defined media type.
+- You can define new output formats or redefine built-in output formats; e.g., if you want to put `AMP` pages in a different path.
+
+To add or modify an output format, define it in an `outputFormats` section in your site's [configuration file](/getting-started/configuration/), either for all sites or for a given language.
+
+{{< code-toggle file="hugo" >}}
+[outputFormats.MyEnrichedFormat]
+mediaType = "text/enriched"
+baseName = "myindex"
+isPlainText = true
+protocol = "bep://"
+{{</ code-toggle >}}
+
+The above example is fictional, but if used for the homepage on a site with `baseURL` `https://example.org`, it will produce a plain text homepage with the URL `bep://example.org/myindex.enr`.
+
- : the base filename for the list filenames (homepage, etc.). **Default:** `index`.
++### Configure output formats
+
+The following is the full list of configuration options for output formats and their default values:
+
+`name`
+: the output format identifier. This is used to define what output format(s) you want for your pages.
+
+`mediaType`
+: this must match the `Type` of a defined media type.
+
+`path`
+: sub path to save the output files.
+
+`baseName`
- ## Output Formats for Pages
++: the base file name for the list file names (homepage, etc.). **Default:** `index`.
+
+`rel`
+: can be used to create `rel` values in `link` tags. **Default:** `alternate`.
+
+`protocol`
+: will replace the "http://" or "https://" in your `baseURL` for this output format.
+
+`isPlainText`
+: use Go's plain text templates parser for the templates. **Default:** `false`.
+
+`isHTML`
+: used in situations only relevant for `HTML`-type formats; e.g., page aliases. **Default:** `false`.
+
+`noUgly`
+: used to turn off ugly URLs If `uglyURLs` is set to `true` in your site. **Default:** `false`.
+
+`notAlternative`
+: enable if it doesn't make sense to include this format in an `AlternativeOutputFormats` format listing on `Page` (e.g., with `CSS`). Note that we use the term _alternative_ and not _alternate_ here, as it does not necessarily replace the other format. **Default:** `false`.
+
+`permalinkable`
+: make `.Permalink` and `.RelPermalink` return the rendering Output Format rather than main ([see below](#link-to-output-formats)). This is enabled by default for `HTML` and `AMP`. **Default:** `false`.
+
+`weight`
+: Setting this to a non-zero value will be used as the first sort criteria.
+
- ### Default Output Formats
++## Output formats for pages
+
+A `Page` in Hugo can be rendered to multiple _output formats_ on the file
+system.
+
- ### Customizing Output Formats
++### Default output formats
+
+Every `Page` has a [`Kind`][page_kinds] attribute, and the default Output
+Formats are set based on that.
+
+| Kind | Default Output Formats |
+| ---------- | ---------------------- |
+| `page` | HTML |
+| `home` | HTML, RSS |
+| `section` | HTML, RSS |
+| `taxonomy` | HTML, RSS |
+| `term` | HTML, RSS |
+
- Example from site config file:
++### Customizing output formats
+
+This can be changed by defining an `outputs` list of output formats in either
+the `Page` front matter or in the site configuration (either for all sites or
+per language).
+
- ## List Output formats
++Example from site configuration file:
+
+{{< code-toggle file="hugo" >}}
+[outputs]
+ home = ["HTML", "AMP", "RSS"]
+ page = ["HTML"]
+{{</ code-toggle >}}
+
+Note that in the above examples, the _output formats_ for `section`,
+`taxonomy` and `term` will stay at their default value `["HTML", "RSS"]`.
+
+{{% page-kinds %}}
+
+* The `outputs` definition is per [`Page` `Kind`][page_kinds] (`page`, `home`, `section`, `taxonomy`, or `term`).
+* The names (e.g. `HTML`, `AMP`) used must match the `Name` of a defined *Output Format*.
+ * These names are case insensitive.
+* These can be overridden per `Page` in the front matter of content files.
+
+The following is an example of front matter in a content file that defines output formats for the rendered `Page`:
+
+{{< code-toggle file="content/example.md" fm=true copy=false >}}
+title: Example
+outputs:
+- html
+- amp
+- json
+{{< /code-toggle >}}
+
- ## Link to Output Formats
++## List output formats
+
+Each `Page` has both an `.OutputFormats` (all formats, including the current) and an `.AlternativeOutputFormats` variable, the latter of which is useful for creating a `link rel` list in your site's `<head>`:
+
+```go-html-template
+{{ range .AlternativeOutputFormats -}}
+<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
+{{ end -}}
+```
+
- ## Templates for Your Output Formats
++## Link to output formats
+
+`.Permalink` and `.RelPermalink` on `Page` will return the first output format defined for that page (usually `HTML` if nothing else is defined). This is regardless of the template file they are being called from.
+
+__from `single.json.json`:__
+```go-html-template
+{{ .RelPermalink }} > /that-page/
+{{ with .OutputFormats.Get "json" -}}
+{{ .RelPermalink }} > /that-page/index.json
+{{- end }}
+```
+
+In order for them to return the output format of the current template file instead, the given output format should have its `permalinkable` setting set to true.
+
+**Same template file as above with json output format's `permalinkable` set to true:**
+
+```go-html-template
+{{ .RelPermalink }} > /that-page/index.json
+{{ with .OutputFormats.Get "html" -}}
+{{ .RelPermalink }} > /that-page/
+{{- end }}
+```
+
+From content files, you can use the [`ref` or `relref` shortcodes](/content-management/shortcodes/#ref-and-relref):
+
+```go-html-template
+[Neat]({{</* ref "blog/neat.md" "amp" */>}})
+[Who]({{</* relref "about.md#who" "amp" */>}})
+```
+
- [config]: /getting-started/configuration/
++## Templates for your output formats
+
+A new output format needs a corresponding template in order to render anything useful.
+
+{{% note %}}
+The key distinction for Hugo versions 0.20 and newer is that Hugo looks at an output format's `Name` and MediaType's `Suffixes` when choosing the template used to render a given `Page`.
+{{% /note %}}
+
+The following table shows examples of different output formats, the suffix used, and Hugo's respective template [lookup order]. All the examples in the table can:
+
+* Use a [base template][base].
+* Include [partial templates][partials]
+
+{{< datatable "output" "layouts" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
+
+Hugo will now also detect the media type and output format of partials, if possible, and use that information to decide if the partial should be parsed as a plain text template or not.
+
+Hugo will look for the name given, so you can name it whatever you want. But if you want it treated as plain text, you should use the file suffix and, if needed, the name of the Output Format. The pattern is as follows:
+
+```go-html-template
+[partial name].[OutputFormat].[suffix]
+```
+
+The partial below is a plain text template (Output Format is `CSV`, and since this is the only output format with the suffix `csv`, we don't need to include the Output Format's `Name`):
+
+```go-html-template
+{{ partial "mytextpartial.csv" . }}
+```
+
+[base]: /templates/base/
++[site configuration]: /getting-started/configuration/
+[lookup order]: /templates/lookup-order/
+[media type]: https://en.wikipedia.org/wiki/Media_type
+[partials]: /templates/partials/
+[page_kinds]: /templates/section-templates/#page-kinds
--- /dev/null
- linktitle: Pagination
+---
+title: Pagination
- weight: 140
- weight: 140
+description: Hugo supports pagination for your homepage, section pages, and taxonomies.
+categories: [templates]
+keywords: [lists,sections,pagination]
+menu:
+ docs:
+ parent: templates
- ## Configure Pagination
++ weight: 100
++weight: 100
+aliases: [/extras/pagination,/doc/pagination/]
+toc: true
+---
+
+The real power of Hugo pagination shines when combined with the [`where` function][where] and its SQL-like operators: [`first`], [`last`], and [`after`]. You can even [order the content][lists] the way you've become used to with Hugo.
+
- ## List Paginator Pages
++## Configure pagination
+
+Pagination can be configured in your [site configuration][configuration]:
+
+`paginate`
+: default = `10`. This setting can be overridden within the template.
+
+`paginatePath`
+: default = `page`. Allows you to set a different path for your pagination pages.
+
+Setting `paginate` to a positive value will split the list pages for the homepage, sections and taxonomies into chunks of that size. But note that the generation of the pagination pages for sections, taxonomies and homepage is *lazy* --- the pages will not be created if not referenced by a `.Paginator` (see below).
+
+`paginatePath` is used to adapt the `URL` to the pages in the paginator (the default setting will produce URLs on the form `/page/1/`.
+
++## List paginator pages
+
+{{% note %}}
+`.Paginator` is provided to help you build a pager menu. This feature is currently only supported on homepage and list pages (i.e., taxonomies and section lists).
+{{% /note %}}
+
+There are two ways to configure and use a `.Paginator`:
+
+1. The simplest way is just to call `.Paginator.Pages` from a template. It will contain the pages for *that page*.
+2. Select another set of pages with the available template functions and ordering options, and pass the slice to `.Paginate`, e.g.
+ * `{{ range (.Paginate ( first 50 .Pages.ByTitle )).Pages }}` or
+ * `{{ range (.Paginate .RegularPagesRecursive).Pages }}`.
+
+For a given **Page**, it's one of the options above. The `.Paginator` is static and cannot change once created.
+
+If you call `.Paginator` or `.Paginate` multiple times on the same page, you should ensure all the calls are identical. Once *either* `.Paginator` or `.Paginate` is called while generating a page, its result is cached, and any subsequent similar call will reuse the cached result. This means that any such calls which do not match the first one will not behave as written.
+
+(Remember that function arguments are eagerly evaluated, so a call like `$paginator := cond x .Paginator (.Paginate .RegularPagesRecursive)` is an example of what you should *not* do. Use `if`/`else` instead to ensure exactly one evaluation.)
+
+The global page size setting (`Paginate`) can be overridden by providing a positive integer as the last argument. The examples below will give five items per page:
+
+* `{{ range (.Paginator 5).Pages }}`
+* `{{ $paginator := .Paginate (where .Pages "Type" "posts") 5 }}`
+
+It is also possible to use the `GroupBy` functions in combination with pagination:
+
+```go-html-template
+{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
+```
+
+## Build the navigation
+
+The `.Paginator` contains enough information to build a paginator interface.
+
+The easiest way to add this to your pages is to include the built-in template (with `Bootstrap`-compatible styles):
+
+```go-html-template
+{{ template "_internal/pagination.html" . }}
+```
+
+{{% note %}}
+If you use any filters or ordering functions to create your `.Paginator` *and* you want the navigation buttons to be shown before the page listing, you must create the `.Paginator` before it's used.
+{{% /note %}}
+
+The following example shows how to create `.Paginator` before its used:
+
+```go-html-template
+{{ $paginator := .Paginate (where .Pages "Type" "posts") }}
+{{ template "_internal/pagination.html" . }}
+{{ range $paginator.Pages }}
+ {{ .Title }}
+{{ end }}
+```
+
+Without the `where` filter, the above example is even simpler:
+
+```go-html-template
+{{ template "_internal/pagination.html" . }}
+{{ range .Paginator.Pages }}
+ {{ .Title }}
+{{ end }}
+```
+
+If you want to build custom navigation, you can do so using the `.Paginator` object, which includes the following properties:
+
+`PageNumber`
+: The current page's number in the pager sequence
+
+`URL`
+: The relative URL to the current pager
+
+`Pages`
+: The pages in the current pager
+
+`NumberOfElements`
+: The number of elements on this page
+
+`HasPrev`
+: Whether there are page(s) before the current
+
+`Prev`
+: The pager for the previous page
+
+`HasNext`
+: Whether there are page(s) after the current
+
+`Next`
+: The pager for the next page
+
+`First`
+: The pager for the first page
+
+`Last`
+: The pager for the last page
+
+`Pagers`
+: A list of pagers that can be used to build a pagination menu
+
+`PageSize`
+: Size of each pager
+
+`TotalPages`
+: The number of pages in the paginator
+
+`TotalNumberOfElements`
+: The number of elements on all pages in this paginator
+
+## Additional information
+
+The pages are built on the following form (`BLANK` means no value):
+
+```txt
+[SECTION/TAXONOMY/BLANK]/index.html
+[SECTION/TAXONOMY/BLANK]/page/1/index.html => redirect to [SECTION/TAXONOMY/BLANK]/index.html
+[SECTION/TAXONOMY/BLANK]/page/2/index.html
+....
+```
+
+[`first`]: /functions/first/
+[`last`]: /functions/last/
+[`after`]: /functions/after/
+[configuration]: /getting-started/configuration/
+[lists]: /templates/lists/
+[where]: /functions/where/
--- /dev/null
- title: Partial Templates
+---
- weight: 90
- weight: 90
++title: Partial templates
+description: Partials are smaller, context-aware components in your list and page templates that can be used economically to keep your templating DRY.
+categories: [templates]
+keywords: [lists,sections,partials]
+menu:
+ docs:
+ parent: templates
- ## Partial Template Lookup Order
++ weight: 120
++weight: 120
+aliases: [/templates/partial/,/layout/chrome/,/extras/analytics/]
+toc: true
+---
+
+{{< youtube pjS4pOLyB7c >}}
+
- ## Use Partials in your Templates
++## Partial template lookup order
+
+Partial templates---like [single page templates][singletemps] and [list page templates][listtemps]---have a specific [lookup order]. However, partials are simpler in that Hugo will only check in two places:
+
+1. `layouts/partials/*<PARTIALNAME>.html`
+2. `themes/<THEME>/layouts/partials/*<PARTIALNAME>.html`
+
+This allows a theme's end user to copy a partial's contents into a file of the same name for [further customization][customize].
+
- ### Variable Scoping
++## Use partials in your templates
+
+All partials for your Hugo project are located in a single `layouts/partials` directory. For better organization, you can create multiple subdirectories within `partials` as well:
+
+```txt
+layouts/
+└── partials/
+ ├── footer/
+ │ ├── scripts.html
+ │ └── site-footer.html
+ ├── head/
+ │ ├── favicons.html
+ │ ├── metadata.html
+ │ ├── prerender.html
+ │ └── twitter.html
+ └── header/
+ ├── site-header.html
+ └── site-nav.html
+```
+
+All partials are called within your templates using the following pattern:
+
+```go-html-template
+{{ partial "<PATH>/<PARTIAL>.html" . }}
+```
+
+{{% note %}}
+One of the most common mistakes with new Hugo users is failing to pass a context to the partial call. In the pattern above, note how "the dot" (`.`) is required as the second argument to give the partial context. You can read more about "the dot" in the [Hugo templating introduction](/templates/introduction/).
+{{% /note %}}
+
+{{% note %}}
+`<PARTIAL>` including `baseof` is reserved. ([#5373](https://github.com/gohugoio/hugo/issues/5373))
+{{% /note %}}
+
+As shown in the above example directory structure, you can nest your directories within `partials` for better source organization. You only need to call the nested partial's path relative to the `partials` directory:
+
+```go-html-template
+{{ partial "header/site-header.html" . }}
+{{ partial "footer/scripts.html" . }}
+```
+
- ## Returning a value from a Partial
++### Variable scoping
+
+The second argument in a partial call is the variable being passed down. The above examples are passing the `.`, which tells the template receiving the partial to apply the current [context][context].
+
+This means the partial will *only* be able to access those variables. The partial is isolated and *has no access to the outer scope*. From within the partial, `$.Var` is equivalent to `.Var`.
+
- ## Inline Partials
++## Returning a value from a partial
+
+In addition to outputting markup, partials can be used to return a value of any type. In order to return a value, a partial must include a lone `return` statement *at the end of the partial*.
+
+### Example GetFeatured
+
+```go-html-template
+{{/* layouts/partials/GetFeatured.html */}}
+{{ return first . (where site.RegularPages "Params.featured" true) }}
+```
+
+```go-html-template
+{{/* layouts/index.html */}}
+{{ range partial "GetFeatured.html" 5 }}
+ [...]
+{{ end }}
+```
+
+### Example GetImage
+
+```go-html-template
+{{/* layouts/partials/GetImage.html */}}
+{{ $image := false }}
+{{ with .Params.gallery }}
+ {{ $image = index . 0 }}
+{{ end }}
+{{ with .Params.image }}
+ {{ $image = . }}
+{{ end }}
+{{ return $image }}
+```
+
+```go-html-template
+{{/* layouts/_default/single.html */}}
+{{ with partial "GetImage.html" . }}
+ [...]
+{{ end }}
+```
+
+{{% note %}}
+Only one `return` statement is allowed per partial file.
+{{% /note %}}
+
- ## Cached Partials
++## Inline partials
+
+You can also define partials inline in the template. But remember that template namespace is global, so you need to make sure that the names are unique to avoid conflicts.
+
+```go-html-template
+Value: {{ partial "my-inline-partial.html" . }}
+
+{{ define "partials/my-inline-partial.html" }}
+{{ $value := 32 }}
+{{ return $value }}
+{{ end }}
+```
+
++## Cached partials
+
+The [`partialCached` template function][partialcached] can offer significant performance gains for complex templates that don't need to be re-rendered on every invocation. The simplest usage is as follows:
+
+```go-html-template
+{{ partialCached "footer.html" . }}
+```
+
+You can also pass additional parameters to `partialCached` to create *variants* of the cached partial.
+
+For example, you can tell Hugo to only render the partial `footer.html` once per section:
+
+```go-html-template
+{{ partialCached "footer.html" . .Section }}
+```
+
+If you need to pass additional parameters to create unique variants, you can pass as many variant parameters as you need:
+
+```go-html-template
+{{ partialCached "footer.html" . .Params.country .Params.province }}
+```
+
+Note that the variant parameters are not made available to the underlying partial template. They are only use to create a unique cache key.
+
+### Example `header.html`
+
+The following `header.html` partial template is used for [spf13.com](https://spf13.com/):
+
+{{< code file="layouts/partials/header.html" >}}
+<!DOCTYPE html>
+<html class="no-js" lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#">
+<head>
+ <meta charset="utf-8">
+
+ {{ partial "meta.html" . }}
+
+ <base href="{{ .Site.BaseURL }}">
+ <title> {{ .Title }} : spf13.com </title>
+ <link rel="canonical" href="{{ .Permalink }}">
+ {{ if .RSSLink }}<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Title }}" />{{ end }}
+
+ {{ partial "head_includes.html" . }}
+</head>
+{{< /code >}}
+
+{{% note %}}
+The `header.html` example partial was built before the introduction of block templates to Hugo. Read more on [base templates and blocks](/templates/base/) for defining the outer chrome or shell of your master templates (i.e., your site's head, header, and footer). You can even combine blocks and partials for added flexibility.
+{{% /note %}}
+
+### Example `footer.html`
+
+The following `footer.html` partial template is used for [spf13.com](https://spf13.com/):
+
+{{< code file="layouts/partials/footer.html" >}}
+<footer>
+ <div>
+ <p>
+ © 2013-14 Steve Francia.
+ <a href="https://creativecommons.org/licenses/by/3.0/" title="Creative Commons Attribution">Some rights reserved</a>;
+ please attribute properly and link back.
+ </p>
+ </div>
+</footer>
+{{< /code >}}
+
+[context]: /templates/introduction/
+[customize]: /hugo-modules/theme-components/
+[listtemps]: /templates/lists/
+[lookup order]: /templates/lookup-order/
+[partialcached]: /functions/partialcached/
+[singletemps]: /templates/single-page-templates/
+[themes]: /themes/
--- /dev/null
- title: "Markdown Render Hooks"
- linkTitle: "Render Hooks"
- description: "Render Hooks allow custom templates to override markdown rendering functionality."
+---
- weight: 20
++title: Markdown render hooks
++linkTitle: Render hooks
++description: Render Hooks allow custom templates to override markdown rendering functionality.
+categories: [templates]
+keywords: [markdown]
+toc: true
+menu:
+ docs:
+ parent: templates
- ## Render Hooks for Headings, Links and Images
++ weight: 200
++weight: 200
+---
+
+Note that this is only supported with the [Goldmark](/getting-started/configuration-markup#goldmark) renderer.
+
+You can override certain parts of the default Markdown rendering to HTML by creating templates with base names `render-{kind}` in `layouts/_default/_markup`.
+
+You can also create type/section specific hooks in `layouts/[type/section]/_markup`, e.g.: `layouts/blog/_markup`.
+
+The hook kinds currently supported are:
+
+* `image`
+* `link`
+* `heading`
+* `codeblock`{{< new-in "0.93.0" >}}
+
+You can define [Output-Format-](/templates/output-formats) and [language-](/content-management/multilingual/)specific templates if needed. Your `layouts` folder may look like this:
+
+```text
+layouts/
+└── _default/
+ └── _markup/
+ ├── render-codeblock-bash.html
+ ├── render-codeblock.html
+ ├── render-heading.html
+ ├── render-image.html
+ ├── render-image.rss.xml
+ └── render-link.html
+```
+
+Some use cases for the above:
+
+* Resolve link references using `.GetPage`. This would make links portable as you could translate `./my-post.md` (and similar constructs that would work on GitHub) into `/blog/2019/01/01/my-post/` etc.
+* Add `target=_blank` to external links.
+* Resolve and [process](/content-management/image-processing/) images.
+* Add [header links](https://remysharp.com/2014/08/08/automatic-permalinks-for-blog-posts).
+
- : Returns true if this is a standalone image and the config option [markup.goldmark.parser.wrapStandAloneImageWithinParagraph](/getting-started/configuration-markup/#goldmark) is disabled.
++## Render hooks for headings, links and images
+
+### Context passed to `render-link` and `render-image`
+
+The `render-link` and `render-image` templates will receive this context:
+
+Page
+: The [Page](/variables/page/) being rendered.
+
+Destination
+: The URL.
+
+Title
+: The title attribute.
+
+Text
+: The rendered (HTML) link text.
+
+PlainText
+: The plain variant of the above.
+
+### Context passed to `render-heading`
+
+The `render-heading` template will receive this context:
+
+Page
+: The [Page](/variables/page/) being rendered.
+
+Level
+: The header level (1--6)
+
+Anchor
+: An auto-generated html id unique to the header within the page
+
+Text
+: The rendered (HTML) text.
+
+PlainText
+: The plain variant of the above.
+
+Attributes (map)
+: A map of attributes (e.g. `id`, `class`). Note that this will currently always be empty for links.
+
+The `render-image` templates will also receive:
+
+IsBlock {{< new-in "0.108.0" >}}
- ### Link with title Markdown example
++: Returns true if this is a standalone image and the configuration option [markup.goldmark.parser.wrapStandAloneImageWithinParagraph](/getting-started/configuration-markup/#goldmark) is disabled.
+
+Ordinal {{< new-in "0.108.0" >}}
+: Zero-based ordinal for all the images in the current document.
+
+
- ### Image Markdown example
++### Link with title markdown example
+
+```md
+[Text](https://www.gohugo.io "Title")
+```
+
+Here is a code example for how the render-link.html template could look:
+
+{{< code file="layouts/_default/_markup/render-link.html" >}}
+<a href="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>
+{{< /code >}}
+
- ## Render Hooks for Code Blocks
++### Image markdown example
+
+```md
+
+```
+
+Here is a code example for how the render-image.html template could look:
+
+{{< code file="layouts/_default/_markup/render-image.html" >}}
+<p class="md__image">
+ <img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title }} title="{{ . }}"{{ end }} />
+</p>
+{{< /code >}}
+
+### Heading link example
+
+Given this template file
+
+{{< code file="layouts/_default/_markup/render-heading.html" >}}
+<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }} <a href="#{{ .Anchor | safeURL }}">¶</a></h{{ .Level }}>
+{{< /code >}}
+
+And this markdown
+
+```md
+### Section A
+```
+
+The rendered html will be
+
+```html
+<h3 id="section-a">Section A <a href="#section-a">¶</a></h3>
+```
+
- : Useful in error logging as it prints the filename and position (linenumber, column), e.g. `{{ errorf "error in code block: %s" .Position }}`.
++## Render hooks for code blocks
+
+{{< new-in "0.93.0" >}}
+
+You can add a hook template for either all code blocks or for a specific type/language (`bash` in the example below):
+
+```goat { class="black f7" }
+layouts
+└── _default
+ └── _markup
+ └── render-codeblock.html
+ └── render-codeblock-bash.html
+```
+
+The default behavior for these code blocks is to do [Code Highlighting](/content-management/syntax-highlighting/#highlighting-in-code-fences), but since you can pass attributes to these code blocks, they can be used for almost anything. One example would be the built-in [GoAT Diagrams](/content-management/diagrams/#goat-diagrams-ascii) or this [Mermaid Diagram Code Block Hook](/content-management/diagrams/#mermaid-diagrams) example.
+
+The context (the ".") you receive in a code block template contains:
+
+Type (string)
+: The type of code block. This will be the programming language, e.g. `bash`, when doing code highlighting.
+
+Attributes (map)
+: Attributes passed in from Markdown (e.g. `{ attrName1=attrValue1 attrName2="attr Value 2" }`).
+
+Options (map)
+: Chroma highlighting processing options. This will only be filled if `Type` is a known [Chroma Lexer](/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages).
+
+Inner (string)
+: The text between the code fences.
+
+Ordinal (integer)
+: Zero-based ordinal for all code blocks in the current document.
+
+Page
+: The owning `Page`.
+
+Position
++: Useful in error logging as it prints the file name and position (linenumber, column), e.g. `{{ errorf "error in code block: %s" .Position }}`.
--- /dev/null
- title: Robots.txt File
- linktitle: Robots.txt
+---
- weight: 165
- weight: 165
++title: Robots.txt file
++linkTitle: Robots.txt
+description: Hugo can generate a customized robots.txt in the same way as any other template.
+categories: [templates]
+keywords: [robots,search engines]
+menu:
+ docs:
+ parent: templates
- To generate a robots.txt file from a template, change the [site configuration][config]:
++ weight: 230
++weight: 230
+aliases: [/extras/robots-txt/]
+---
+
- ## Robots.txt Template Lookup Order
++To generate a robots.txt file from a template, change the [site configuration]:
+
+{{< code-toggle file="hugo" >}}
+enableRobotsTXT = true
+{{< /code-toggle >}}
+
+By default, Hugo generates robots.txt using an [internal template][internal].
+
+```text
+User-agent: *
+```
+
+Search engines that honor the Robots Exclusion Protocol will interpret this as permission to crawl everything on the site.
+
- ## Robots.txt Template Example
++## robots.txt template lookup order
+
+You may overwrite the internal template with a custom template. Hugo selects the template using this lookup order:
+
+1. `/layouts/robots.txt`
+2. `/themes/<THEME>/layouts/robots.txt`
+
- 1. Set `enableRobotsTXT` to `false` in the [site configuration][config].
++## robots.txt template example
+
+{{< code file="layouts/robots.txt" >}}
+User-agent: *
+{{ range .Pages }}
+Disallow: {{ .RelPermalink }}
+{{ end }}
+{{< /code >}}
+
+This template creates a robots.txt file with a `Disallow` directive for each page on the site. Search engines that honor the Robots Exclusion Protocol will not crawl any page on the site.
+
+{{% note %}}
+To create a robots.txt file without using a template:
+
- [config]: /getting-started/configuration/
++1. Set `enableRobotsTXT` to `false` in the [site configuration].
+2. Create a robots.txt file in the `static` directory.
+
+Remember that Hugo copies everything in the [static directory][static] to the root of `publishDir` (typically `public`) when you build your site.
+
- [config]: /getting-started/configuration/
+[static]: /getting-started/directory-structure/
+{{% /note %}}
+
++[site configuration]: /getting-started/configuration/
+[internal]: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/robots.txt
--- /dev/null
- title: RSS Templates
+---
- weight: 150
- weight: 150
++title: RSS templates
+description: Hugo ships with its own RSS 2.0 template that requires almost no configuration, or you can create your own RSS templates.
+keywords: [rss, xml, templates]
+categories: [templates]
+menu:
+ docs:
+ parent: templates
- ## RSS Template Lookup Order
++ weight: 160
++weight: 160
+toc: true
+---
+
- Hugo ships with its own [RSS 2.0 template](#the-embedded-rssxml). The embedded template will be sufficient for most use cases.
++## RSS template lookup order
+
+See [Template Lookup Order](/templates/lookup-order/) for the complete reference.
+
+{{% note %}}
- ## Lookup Order for RSS Templates
++Hugo ships with its own [RSS 2.0 template](#the-embedded-rssxml-template). The embedded template will be sufficient for most use cases.
+{{% /note %}}
+
+RSS pages are of the type `Page` and have all the [page variables](/variables/page/) available to use in the templates.
+
+### Section RSS
+
+A [section’s][section] RSS will be rendered at `/<SECTION>/index.xml` (e.g., [https://spf13.com/project/index.xml](https://spf13.com/project/index.xml)).
+
+Hugo provides the ability for you to define any RSS type you wish and can have different RSS files for each section and taxonomy.
+
- ## The Embedded rss.xml
++## Lookup order for RSS templates
+
+The table below shows the RSS template lookup order for the different page kinds. The first listing shows the lookup order when running with a theme (`demoTheme`).
+
+{{< datatable-filtered "output" "layouts" "OutputFormat == RSS" "Example" "OutputFormat" "Suffix" "Template Lookup Order" >}}
+
+## Configure RSS
+
+By default, Hugo will create an unlimited number of RSS entries. You can limit the number of articles included in the built-in RSS templates by assigning a numeric value to `rssLimit:` field in your project's configuration file.
+
+The following values will also be included in the RSS output if specified:
+
+{{< code-toggle file="hugo" >}}
+languageCode = "en-us"
+copyright = "This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License."
+
+[author]
+ name = "My Name Here"
+{{< /code-toggle >}}
+
- ## Reference your RSS Feed in `<head>`
++## The embedded rss.xml template
+
+This is the default RSS template that ships with Hugo:
+
+<https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/rss.xml>
+
- [config]: /getting-started/configuration/
++## Reference your RSS feed in `<head>`
+
+In your `header.html` template, you can specify your RSS feed in your `<head></head>` tag using Hugo's [Output Formats][Output Formats] like this:
+
+```go-html-template
+{{ range .AlternativeOutputFormats -}}
+ {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
+{{ end -}}
+```
+
+If you only want the RSS link, you can query the formats:
+
+```go-html-template
+{{ with .OutputFormats.Get "rss" -}}
+ {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
+{{ end -}}
+```
+
+Either of the two snippets above will generate the below `link` tag on the site homepage for RSS output:
+
+```html
+<link rel="alternate" type="application/rss+xml" href="https://example.com/index.xml" title="Site Title">
+```
+
+_We are assuming `BaseURL` to be `https://example.com/` and `$.Site.Title` to be `"Site Title"` in this example._
+
+[embedded]: #the-embedded-rss-xml
+[RSS 2.0]: https://cyber.harvard.edu/rss/rss.html "RSS 2.0 Specification"
+[section]: /content-management/sections/
+[Output Formats]: /templates/output-formats/#link-to-output-formats
--- /dev/null
- title: Section Page Templates
- linktitle: Section Templates
+---
- weight: 40
- weight: 40
++title: Section page templates
++linkTitle: Section templates
+description: Templates used for section pages are **lists** and therefore have all the variables and methods available to list pages.
+categories: [templates]
+keywords: [lists,sections,templates]
+menu:
+ docs:
+ parent: templates
- ## Add Content and Front Matter to Section Templates
++ weight: 80
++weight: 80
+aliases: [/templates/sections/]
+toc: true
+---
+
- ## Section Template Lookup Order
++## Add content and front matter to section templates
+
+To effectively leverage section page templates, you should first understand Hugo's [content organization](/content-management/organization/) and, specifically, the purpose of `_index.md` for adding content and front matter to section and other list pages.
+
- ## Page Kinds
++## Section template lookup order
+
+See [Template Lookup](/templates/lookup-order/).
+
- ## `.Site.GetPage` with Sections
++## Page kinds
+
+Every `Page` in Hugo has a `.Kind` attribute.
+
+{{% page-kinds %}}
+
- ## Example: Creating a Default Section Template
++## `.Site.GetPage` with sections
+
+`Kind` can easily be combined with the [`where` function][where] in your templates to create kind-specific lists of content. This method is ideal for creating lists, but there are times where you may want to fetch just the index page of a single section via the section's path.
+
+The [`.GetPage` function][getpage] looks up an index page of a given `Kind` and `path`.
+
+You can call `.Site.GetPage` with two arguments: `kind` (one of the valid values
+of `Kind` from above) and `kind value`.
+
+Examples:
+
+- `{{ .Site.GetPage "section" "posts" }}`
+- `{{ .Site.GetPage "page" "search" }}`
+
- ### Example: Using `.Site.GetPage`
++## Example: creating a default section template
+
+{{< code file="layouts/_default/section.html" >}}
+{{ define "main" }}
+ <main>
+ {{ .Content }}
+ <ul class="contents">
+ {{ range .Paginator.Pages }}
+ <li>{{ .Title }}
+ <div>
+ {{ partial "summary.html" . }}
+ </div>
+ </li>
+ {{ end }}
+ </ul>
+ {{ partial "pagination.html" . }}
+ </main>
+{{ end }}
+{{< /code >}}
+
++### Example: using `.Site.GetPage`
+
+The `.Site.GetPage` example that follows assumes the following project directory structure:
+
+```txt
+.
+└── content
+ ├── blog
+ │ ├── _index.md # "title: My Hugo Blog" in the front matter
+ │ ├── post-1.md
+ │ ├── post-2.md
+ │ └── post-3.md
+ └── events #Note there is no _index.md file in "events"
+ ├── event-1.md
+ └── event-2.md
+```
+
+`.Site.GetPage` will return `nil` if no `_index.md` page is found. Therefore, if `content/blog/_index.md` does not exist, the template will output the section name:
+
+```go-html-template
+<h1>{{ with .Site.GetPage "section" "blog" }}{{ .Title }}{{ end }}</h1>
+```
+
+Since `blog` has a section index page with front matter at `content/blog/_index.md`, the above code will return the following result:
+
+```html
+<h1>My Hugo Blog</h1>
+```
+
+If we try the same code with the `events` section, however, Hugo will default to the section title because there is no `content/events/_index.md` from which to pull content and front matter:
+
+```go-html-template
+<h1>{{ with .Site.GetPage "section" "events" }}{{ .Title }}{{ end }}</h1>
+```
+
+Which then returns the following:
+
+```html
+<h1>Events</h1>
+```
+
+[contentorg]: /content-management/organization/
+[getpage]: /functions/getpage/
+[lists]: /templates/lists/
+[lookup]: /templates/lookup-order/
+[where]: /functions/where/
+[sections]: /content-management/sections/
--- /dev/null
- title: Create Your Own Shortcodes
- linktitle: Shortcode Templates
+---
- weight: 100
- weight: 100
++title: Create your own shortcodes
++linkTitle: Shortcode templates
+description: You can extend Hugo's built-in shortcodes by creating your own using the same templating syntax as that for single and list pages.
+categories: [templates]
+keywords: [shortcodes,templates]
+menu:
+ docs:
+ parent: templates
- ## Create Custom Shortcodes
++ weight: 130
++weight: 130
+toc: true
+---
+
+Shortcodes are a means to consolidate templating into small, reusable snippets that you can embed directly inside your content. In this sense, you can think of shortcodes as the intermediary between [page and list templates][templates] and [basic content files].
+
+{{% note %}}
+Hugo also ships with built-in shortcodes for common use cases. (See [Content Management: Shortcodes](/content-management/shortcodes/).)
+{{% /note %}}
+
- ### File Location
++## Create custom shortcodes
+
+Hugo's built-in shortcodes cover many common, but not all, use cases. Luckily, Hugo provides the ability to easily create custom shortcodes to meet your website's needs.
+
+{{< youtube Eu4zSaKOY4A >}}
+
- ### Shortcode Template Lookup Order
++### File location
+
+To create a shortcode, place an HTML template in the `layouts/shortcodes` directory of your [source organization]. Consider the file name carefully since the shortcode name will mirror that of the file but without the `.html` extension. For example, `layouts/shortcodes/myshortcode.html` will be called with either `{{</* myshortcode /*/>}}` or `{{%/* myshortcode /*/%}}`.
+
+You can organize your shortcodes in subfolders, e.g. in `layouts/shortcodes/boxes`. These shortcodes would then be accessible with their relative path, e.g:
+
+```go-html-template
+{{</* boxes/square */>}}
+```
+
+Note the forward slash.
+
- ### Positional vs Named Parameters
++### Shortcode template lookup order
+
+Shortcode templates have a simple [lookup order]:
+
+1. `/layouts/shortcodes/<SHORTCODE>.html`
+2. `/themes/<THEME>/layouts/shortcodes/<SHORTCODE>.html`
+
- ### Access Parameters
++### Positional vs. named parameters
+
+You can create shortcodes using the following types of parameters:
+
+* Positional parameters
+* Named parameters
+* Positional *or* named parameters (i.e, "flexible")
+
+In shortcodes with positional parameters, the order of the parameters is important. If a shortcode has a single required value (e.g., the `youtube` shortcode below), positional parameters work very well and require less typing from content authors.
+
+For more complex layouts with multiple or optional parameters, named parameters work best. While less terse, named parameters require less memorization from a content author and can be added in a shortcode declaration in any order.
+
+Allowing both types of parameters (i.e., a "flexible" shortcode) is useful for complex layouts where you want to set default values that can be easily overridden by users.
+
- : refers to the page's params; the "page" in this case refers to the content file in which the shortcode is declared (e.g., a `shortcode_color` field in a content's front matter could be accessed via `$.Page.Params.shortcode_color`).
++### Access parameters
+
+All shortcode parameters can be accessed via the `.Get` method. Whether you pass a key (i.e., string) or a number to the `.Get` method depends on whether you are accessing a named or positional parameter, respectively.
+
+To access a parameter by name, use the `.Get` method followed by the named parameter as a quoted string:
+
+```go-html-template
+{{ .Get "class" }}
+```
+
+To access a parameter by position, use the `.Get` followed by a numeric position, keeping in mind that positional parameters are zero-indexed:
+
+```go-html-template
+{{ .Get 0 }}
+```
+
+For the second position, you would just use:
+
+```go-html-template
+{{ .Get 1 }}
+```
+
+`with` is great when the output depends on a parameter being set:
+
+```go-html-template
+{{ with .Get "class" }} class="{{ . }}"{{ end }}
+```
+
+`.Get` can also be used to check if a parameter has been provided. This is
+most helpful when the condition depends on either of the values, or both:
+
+```go-html-template
+{{ if or (.Get "title") (.Get "alt") }} alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "title" }}{{ end }}"{{ end }}
+```
+
+#### `.Inner`
+
+If a closing shortcode is used, the `.Inner` variable will be populated with the content between the opening and closing shortcodes. If a closing shortcode is required, you can check the length of `.Inner` as an indicator of its existence.
+
+A shortcode with content declared via the `.Inner` variable can also be declared without the content and without the closing tag by using the self-closing syntax:
+
+```go-html-template
+{{</* innershortcode /*/>}}
+```
+
+{{% note %}}
+Any shortcode that refers to `.Inner` must be closed or self-closed.
+
+{{% /note %}}
+
+#### `.Params`
+
+The `.Params` variable in shortcodes contains the list parameters passed to shortcode for more complicated use cases. You can also access higher-scoped parameters with the following logic:
+
+`$.Params`
+: these are the parameters passed directly into the shortcode declaration (e.g., a YouTube video ID)
+
+`$.Page.Params`
- ### Checking for Existence
++: refers to the page's parameters; the "page" in this case refers to the content file in which the shortcode is declared (e.g., a `shortcode_color` field in a content's front matter could be accessed via `$.Page.Params.shortcode_color`).
+
+`$.Page.Site.Params`
+: refers to global variables as defined in your [site's configuration file][config].
+
+#### `.IsNamedParams`
+
+The `.IsNamedParams` variable checks whether the shortcode declaration uses named parameters and returns a boolean value.
+
+For example, you could create an `image` shortcode that can take either a `src` named parameter or the first positional parameter, depending on the preference of the content's author. Let's assume the `image` shortcode is called as follows:
+
+```go-html-template
+{{</* image src="images/my-image.jpg" */>}}
+```
+
+You could then include the following as part of your shortcode templating:
+
+```go-html-template
+{{ if .IsNamedParams }}
+<img src="{{ .Get "src" }}" alt="">
+{{ else }}
+<img src="{{ .Get 0 }}" alt="">
+{{ end }}
+```
+
+See the [example Vimeo shortcode][vimeoexample] below for `.IsNamedParams` in action.
+
+{{% note %}}
+While you can create shortcode templates that accept both positional and named parameters, you *cannot* declare shortcodes in content with a mix of parameter types. Therefore, a shortcode declared like `{{</* image src="images/my-image.jpg" "This is my alt text" */>}}` will return an error.
+{{% /note %}}
+
+You can also use the variable `.Page` to access all the normal [page variables][pagevars].
+
+A shortcodes can also be nested. In a nested shortcode, you can access the parent shortcode context with [`.Parent` variable][shortcodesvars]. This can be very useful for inheritance of common shortcode parameters from the root.
+
- ## Custom Shortcode Examples
++### Checking for existence
+
+You can check if a specific shortcode is used on a page by calling `.HasShortcode` in that page template, providing the name of the shortcode. This is sometimes useful when you want to include specific scripts or styles in the header that are only used by that shortcode.
+
- ### Single-word Example: `year`
++## Custom shortcode examples
+
+The following are examples of the different types of shortcodes you can create via shortcode template files in `/layouts/shortcodes`.
+
- ### Single Positional Example: `youtube`
++### Single-word example: `year`
+
+Let's assume you would like to keep mentions of your copyright year current in your content files without having to continually review your Markdown. Your goal is to be able to call the shortcode as follows:
+
+```go-html-template
+{{</* year */>}}
+```
+
+{{< code file="/layouts/shortcodes/year.html" >}}
+{{ now.Format "2006" }}
+{{< /code >}}
+
- ### Single Named Example: `image`
++### Single positional example: `youtube`
+
+Embedded videos are a common addition to Markdown content that can quickly become unsightly. The following is the code used by [Hugo's built-in YouTube shortcode][youtubeshortcode]:
+
+```go-html-template
+{{</* youtube 09jf3ow9jfw */>}}
+```
+
+Would load the template at `/layouts/shortcodes/youtube.html`:
+
+{{< code file="/layouts/shortcodes/youtube.html" >}}
+<div class="embed video-player">
+<iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube.com/embed/{{ index .Params 0 }}" allowfullscreen frameborder="0">
+</iframe>
+</div>
+{{< /code >}}
+
+{{< code file="youtube-embed.html" copy=false >}}
+<div class="embed video-player">
+ <iframe class="youtube-player" type="text/html"
+ width="640" height="385"
+ src="https://www.youtube.com/embed/09jf3ow9jfw"
+ allowfullscreen frameborder="0">
+ </iframe>
+</div>
+{{< /code >}}
+
- ### Single Flexible Example: `vimeo`
++### Single named example: `image`
+
+Let's say you want to create your own `img` shortcode rather than use Hugo's built-in [`figure` shortcode][figure]. Your goal is to be able to call the shortcode as follows in your content files:
+
+{{< code file="content-image.md" >}}
+{{</* img src="/media/spf13.jpg" title="Steve Francia" */>}}
+{{< /code >}}
+
+You have created the shortcode at `/layouts/shortcodes/img.html`, which loads the following shortcode template:
+
+{{< code file="/layouts/shortcodes/img.html" >}}
+<!-- image -->
+<figure {{ with .Get "class" }}class="{{ . }}"{{ end }}>
+ {{ with .Get "link" }}<a href="{{ . }}">{{ end }}
+ <img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" }}{{ end }}"{{ end }} />
+ {{ if .Get "link" }}</a>{{ end }}
+ {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr") }}
+ <figcaption>{{ if isset .Params "title" }}
+ <h4>{{ .Get "title" }}</h4>{{ end }}
+ {{ if or (.Get "caption") (.Get "attr") }}<p>
+ {{ .Get "caption" }}
+ {{ with .Get "attrlink" }}<a href="{{ . }}"> {{ end }}
+ {{ .Get "attr" }}
+ {{ if .Get "attrlink" }}</a> {{ end }}
+ </p> {{ end }}
+ </figcaption>
+ {{ end }}
+</figure>
+<!-- image -->
+{{< /code >}}
+
+Would be rendered as:
+
+{{< code file="img-output.html" copy=false >}}
+<figure>
+ <img src="/media/spf13.jpg" />
+ <figcaption>
+ <h4>Steve Francia</h4>
+ </figcaption>
+</figure>
+{{< /code >}}
+
- ### Paired Example: `highlight`
++### Single flexible example: `vimeo`
+
+```go-html-template
+{{</* vimeo 49718712 */>}}
+{{</* vimeo id="49718712" class="flex-video" */>}}
+```
+
+Would load the template found at `/layouts/shortcodes/vimeo.html`:
+
+{{< code file="/layouts/shortcodes/vimeo.html" >}}
+{{ if .IsNamedParams }}
+ <div class="{{ if .Get "class" }}{{ .Get "class" }}{{ else }}vimeo-container{{ end }}">
+ <iframe src="https://player.vimeo.com/video/{{ .Get "id" }}" allowfullscreen></iframe>
+ </div>
+{{ else }}
+ <div class="{{ if len .Params | eq 2 }}{{ .Get 1 }}{{ else }}vimeo-container{{ end }}">
+ <iframe src="https://player.vimeo.com/video/{{ .Get 0 }}" allowfullscreen></iframe>
+ </div>
+{{ end }}
+{{< /code >}}
+
+Would be rendered as:
+
+{{< code file="vimeo-iframes.html" copy=false >}}
+<div class="vimeo-container">
+ <iframe src="https://player.vimeo.com/video/49718712" allowfullscreen></iframe>
+</div>
+<div class="flex-video">
+ <iframe src="https://player.vimeo.com/video/49718712" allowfullscreen></iframe>
+</div>
+{{< /code >}}
+
- ### Nested Shortcode: Image Gallery
++### Paired example: `highlight`
+
+The following is taken from `highlight`, which is a [built-in shortcode] that ships with Hugo.
+
+{{< code file="highlight-example.md" >}}
+{{</* highlight html */>}}
+ <html>
+ <body> This HTML </body>
+ </html>
+{{</* /highlight */>}}
+{{< /code >}}
+
+The template for the `highlight` shortcode uses the following code, which is already included in Hugo:
+
+```go-html-template
+{{ .Get 0 | highlight .Inner }}
+```
+
+The rendered output of the HTML example code block will be as follows:
+
+{{< code file="syntax-highlighted.html" copy=false >}}
+<div class="highlight" style="background: #272822"><pre style="line-height: 125%"><span style="color: #f92672"><html></span>
+ <span style="color: #f92672"><body></span> This HTML <span style="color: #f92672"></body></span>
+<span style="color: #f92672"></html></span>
+</pre></div>
+{{< /code >}}
+
- ## Error Handling in Shortcodes
++### Nested shortcode: image gallery
+
+Hugo's [`.Parent` shortcode variable][parent] provides access to the parent shortcode context when the shortcode in question is called within the context of a *parent* shortcode. This provides an inheritance model for common shortcode parameters.
+
+The following example is contrived but demonstrates the concept. Assume you have a `gallery` shortcode that expects one named `class` parameter:
+
+{{< code file="layouts/shortcodes/gallery.html" >}}
+<div class="{{ .Get "class" }}">
+ {{ .Inner }}
+</div>
+{{< /code >}}
+
+You also have an `img` shortcode with a single named `src` parameter that you want to call inside of `gallery` and other shortcodes, so that the parent defines the context of each `img`:
+
+{{< code file="layouts/shortcodes/img.html" >}}
+{{- $src := .Get "src" -}}
+{{- with .Parent -}}
+ <img src="{{ $src }}" class="{{ .Get "class" }}-image">
+{{- else -}}
+ <img src="{{ $src }}">
+{{- end -}}
+{{< /code >}}
+
+You can then call your shortcode in your content as follows:
+
+```go-html-template
+{{</* gallery class="content-gallery" */>}}
+ {{</* img src="/images/one.jpg" */>}}
+ {{</* img src="/images/two.jpg" */>}}
+{{</* /gallery */>}}
+{{</* img src="/images/three.jpg" */>}}
+```
+
+This will output the following HTML. Note how the first two `img` shortcodes inherit the `class` value of `content-gallery` set with the call to the parent `gallery`, whereas the third `img` only uses `src`:
+
+```html
+<div class="content-gallery">
+ <img src="/images/one.jpg" class="content-gallery-image">
+ <img src="/images/two.jpg" class="content-gallery-image">
+</div>
+<img src="/images/three.jpg">
+```
+
- {{ errorf "missing value for param 'name': %s" .Position }}
++## Error handling in shortcodes
+
+Use the [errorf](/functions/errorf) template func and [.Position](/variables/shortcodes/) variable to get useful error messages in shortcodes:
+
+```bash
+{{ with .Get "name" }}
+{{ else }}
- ERROR 2018/11/07 10:05:55 missing value for param name: "/Users/bep/dev/go/gohugoio/hugo/docs/content/en/variables/shortcodes.md:32:1"
++{{ errorf "missing value for parameter 'name': %s" .Position }}
+{{ end }}
+```
+
+When the above fails, you will see an `ERROR` log similar to the below:
+
+```bash
- ## More Shortcode Examples
++ERROR 2018/11/07 10:05:55 missing value for parameter name: "/Users/bep/dev/go/gohugoio/hugo/docs/content/en/variables/shortcodes.md:32:1"
+```
+
- ## Inline Shortcodes
++## More shortcode examples
+
+More shortcode examples can be found in the [shortcodes directory for spf13.com][spfscs] and the [shortcodes directory for the Hugo docs][docsshortcodes].
+
- This feature is disabled by default, but can be enabled in your site config:
++## Inline shortcodes
+
+You can also implement your shortcodes inline -- e.g. where you use them in the content file. This can be useful for scripting that you only need in one place.
+
- The same inline shortcode can be reused later in the same content file, with different params if needed, using the self-closing syntax:
++This feature is disabled by default, but can be enabled in your site configuration:
+
+{{< code-toggle file="hugo" >}}
+enableInlineShortcodes = true
+{{< /code-toggle >}}
+
+It is disabled by default for security reasons. The security model used by Hugo's template handling assumes that template authors are trusted, but that the content files are not, so the templates are injection-safe from malformed input data. But in most situations you have full control over the content, too, and then `enableInlineShortcodes = true` would be considered safe. But it's something to be aware of: It allows ad-hoc [Go Text templates](https://golang.org/pkg/text/template/) to be executed from the content files.
+
+And once enabled, you can do this in your content files:
+
+ ```go-text-template
+ {{</* time.inline */>}}{{ now }}{{</* /time.inline */>}}
+ ```
+
+The above will print the current date and time.
+
+ Note that an inline shortcode's inner content is parsed and executed as a Go text template with the same context as a regular shortcode template.
+
+This means that the current page can be accessed via `.Page.Title` etc. This also means that there are no concept of "nested inline shortcodes".
+
- [basic content files]: /content-management/formats/ "See how Hugo leverages markdown--and other supported formats--to create content for your website."
++The same inline shortcode can be reused later in the same content file, with different parameters if needed, using the self-closing syntax:
+
+ ```go-text-template
+{{</* time.inline /*/>}}
+```
+
- [config]: /getting-started/configuration/ "Learn more about Hugo's built-in configuration variables as well as how to us your site's configuration file to include global key-values that can be used throughout your rendered website."
- [Content Management: Shortcodes]: /content-management/shortcodes/#using-hugo-s-built-in-shortcodes "Check this section if you are not familiar with the definition of what a shortcode is or if you are unfamiliar with how to use Hugo's built-in shortcodes in your content files."
- [source organization]: /getting-started/directory-structure/#directory-structure-explained "Learn how Hugo scaffolds new sites and what it expects to find in each of your directories."
- [docsshortcodes]: https://github.com/gohugoio/hugo/tree/master/docs/layouts/shortcodes "See the shortcode source directory for the documentation site you're currently reading."
++[basic content files]: /content-management/formats/
+[built-in shortcode]: /content-management/shortcodes/
- [lookup order]: /templates/lookup-order/ "See the order in which Hugo traverses your template files to decide where and how to render your content at build time"
- [pagevars]: /variables/page/ "See which variables you can leverage in your templating for page vs list templates."
++[config]: /getting-started/configuration/
++[Content Management: Shortcodes]: /content-management/shortcodes/#using-hugo-s-built-in-shortcodes
++[source organization]: /getting-started/directory-structure/#directory-structure-explained
++[docsshortcodes]: https://github.com/gohugoio/hugo/tree/master/docs/layouts/shortcodes
+[figure]: /content-management/shortcodes/#figure
+[hugosc]: /content-management/shortcodes/#using-hugo-s-built-in-shortcodes
- [shortcodesvars]: /variables/shortcodes/ "Certain variables are specific to shortcodes, although most .Page variables can be accessed within your shortcode template."
- [spfscs]: https://github.com/spf13/spf13.com/tree/master/layouts/shortcodes "See more examples of shortcodes by visiting the shortcode directory of the source for spf13.com, the blog of Hugo's creator, Steve Francia."
- [templates]: /templates/ "The templates section of the Hugo docs."
++[lookup order]: /templates/lookup-order/
++[pagevars]: /variables/page/
+[parent]: /variables/shortcodes/
- [youtubeshortcode]: /content-management/shortcodes/#youtube "See how to use Hugo's built-in YouTube shortcode."
++[shortcodesvars]: /variables/shortcodes/
++[spfscs]: https://github.com/spf13/spf13.com/tree/master/layouts/shortcodes
+[vimeoexample]: #single-flexible-example-vimeo
++[youtubeshortcode]: /content-management/shortcodes/#youtube
--- /dev/null
- title: Single Page Templates
+---
- weight: 60
- weight: 60
++title: Single page templates
+description: The primary view of content in Hugo is the single view. Hugo will render every Markdown file provided with a corresponding single template.
+categories: [templates]
+keywords: [page, templates]
+menu:
+ docs:
+ parent: templates
- ## Single Page Template Lookup Order
++ weight: 50
++weight: 50
+aliases: [/layout/content/]
+toc: true
+---
+
- ## Example Single Page Templates
++## Single page template lookup order
+
+See [Template Lookup](/templates/lookup-order/).
+
-
- <section id="main">
- <h1 id="title">{{ .Title }}</h1>
- <div>
- <article id="content">
- {{ .Content }}
- </article>
- </div>
- </section>
- <aside id="meta">
- <div>
- <section>
- <h4 id="date"> {{ .Date.Format "Mon Jan 2, 2006" }} </h4>
- <h5 id="wordcount"> {{ .WordCount }} Words </h5>
++## Example single page templates
+
+Content pages are of the type `page` and will therefore have all the [page variables][pagevars] and [site variables] available to use in their templates.
+
+### `posts/single.html`
+
+This single page template makes use of Hugo [base templates], the [`.Format` function] for dates, the [`.WordCount` page variable][pagevars], and ranges through the single content's specific [taxonomies][pagetaxonomy]. [`with`] is also used to check whether the taxonomies are set in the front matter.
+
+{{< code file="layouts/posts/single.html" >}}
+{{ define "main" }}
- {{ with .GetTerms "topics" }}
- <ul id="topics">
- {{ range . }}
- <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
- {{ end }}
- </ul>
- {{ end }}
- {{ with .GetTerms "tags" }}
- <ul id="tags">
- {{ range . }}
- <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
- {{ end }}
- </ul>
- {{ end }}
- </div>
- <div>
- {{ with .PrevInSection }}
- <a class="previous" href="{{ .Permalink }}"> {{ .Title }}</a>
- {{ end }}
- {{ with .NextInSection }}
- <a class="next" href="{{ .Permalink }}"> {{ .Title }}</a>
- {{ end }}
- </div>
- </aside>
++ <section id="main">
++ <h1 id="title">{{ .Title }}</h1>
++ <div>
++ <article id="content">
++ {{ .Content }}
++ </article>
++ </div>
+ </section>
- [config]: /getting-started/configuration/
++ <aside id="meta">
++ <div>
++ <section>
++ <h4 id="date"> {{ .Date.Format "Mon Jan 2, 2006" }} </h4>
++ <h5 id="wordcount"> {{ .WordCount }} Words </h5>
++ </section>
++ {{ with .GetTerms "topics" }}
++ <ul id="topics">
++ {{ range . }}
++ <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
++ {{ end }}
++ </ul>
++ {{ end }}
++ {{ with .GetTerms "tags" }}
++ <ul id="tags">
++ {{ range . }}
++ <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
++ {{ end }}
++ </ul>
++ {{ end }}
++ </div>
++ <div>
++ {{ with .PrevInSection }}
++ <a class="previous" href="{{ .Permalink }}"> {{ .Title }}</a>
++ {{ end }}
++ {{ with .NextInSection }}
++ <a class="next" href="{{ .Permalink }}"> {{ .Title }}</a>
++ {{ end }}
++ </div>
++ </aside>
+{{ end }}
+{{< /code >}}
+
+To easily generate new instances of a content type (e.g., new `.md` files in a section like `project/`) with preconfigured front matter, use [content archetypes][archetypes].
+
+[archetypes]: /content-management/archetypes/
+[base templates]: /templates/base/
- [pagetaxonomy]: /templates/taxonomy-templates/#display-a-single-piece-of-contents-taxonomies
+[content type]: /content-management/types/
+[directory structure]: /getting-started/directory-structure/
+[dry]: https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
+[`.format` function]: /functions/format/
+[front matter]: /content-management/front-matter/
++[pagetaxonomy]: /templates/taxonomy-templates/#list-terms-assigned-to-a-page
+[pagevars]: /variables/page/
+[partials]: /templates/partials/
+[section]: /content-management/sections/
+[site variables]: /variables/site/
+[spf13]: https://spf13.com/
+[`with`]: /functions/with/
--- /dev/null
- title: Sitemap Templates
+---
- weight: 160
- weight: 160
++title: Sitemap templates
+description: Hugo provides built-in sitemap templates.
+categories: [templates]
+keywords: [sitemap, xml, templates]
+menu:
+ docs:
+ parent: templates
- ## Override Default Values
++ weight: 170
++weight: 170
+aliases: [/layout/sitemap/,/templates/sitemap/]
+toc: true
+---
+
+## Overview
+
+Hugo's built-in sitemap templates conform to v0.9 of the [sitemap protocol].
+
+With a monolingual project, Hugo generates a sitemap.xml file in the root of the [`publishDir`] using the built-in [sitemap.xml] template.
+
+With a multilingual project, Hugo generates:
+
+- A sitemap.xml file in the root of each site (language) using the built-in [sitemap.xml] template
+- A sitemap.xml file in the root of the [`publishDir`] using the built-in [sitemapindex.xml] template
+
+## Configuration
+
+Set the default values for [change frequency] and [priority], and the name of the generated file, in your site configuration.
+
+{{< code-toggle file="hugo" >}}
+[sitemap]
+ changefreq = 'monthly'
+ filename = 'sitemap.xml'
+ priority = 0.5
+{{</ code-toggle >}}
+
+changefreq
+: How frequently a page is likely to change. Valid values are `always`, `hourly`, `daily`, `weekly`, `monthly`, `yearly`, and `never`. Default is `""` (change frequency omitted from rendered sitemap).
+
+filename
+: The name of the generated file. Default is `sitemap.xml`.
+
+priority
+: The priority of a page relative to any other page on the site. Valid values range from 0.0 to 1.0. Default is `-1` (priority omitted from rendered sitemap).
+
- ## Override Built-in Templates
++## Override default values
+
+Override the default values for a given page in front matter.
+
+{{< code-toggle file="news.md" fm=true >}}
+title = 'News'
+[sitemap]
+ changefreq = 'weekly'
+ priority = 0.8
+{{</ code-toggle >}}
+
- ## Disable Sitemap Generation
++## Override built-in templates
+
+To override the built-in sitemap.xml template, create a new file in either of these locations:
+
+- layouts/sitemap.xml
+- layouts/_default/sitemap.xml
+
+When ranging through the page collection, access the _change frequency_ and _priority_ with `.Sitemap.ChangeFreq` and `.Sitemap.Priority` respectively.
+
+To override the built-in sitemapindex.xml template, create a new file in either of these locations:
+
+- layouts/sitemapindex.xml
+- layouts/_default/sitemapindex.xml
+
++## Disable sitemap generation
+
+You may disable sitemap generation in your site configuration:
+
+{{< code-toggle file="hugo" >}}
+disableKinds = ['sitemap']
+{{</ code-toggle >}}
+
+[`publishDir`]: /getting-started/configuration#publishdir
+[change frequency]: <https://www.sitemaps.org/protocol.html#changefreqdef>
+[priority]: <https://www.sitemaps.org/protocol.html#priority>
+[sitemap protocol]: <https://www.sitemaps.org/protocol.html>
+[sitemap.xml]: <https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/sitemap.xml>
+[sitemapindex.xml]: <https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/sitemapindex.xml>
--- /dev/null
- title: Taxonomy Templates
+---
- weight: 50
- weight: 50
++title: Taxonomy templates
+description: Taxonomy templating includes taxonomy list pages, taxonomy terms pages, and using taxonomies in your single page templates.
+categories: [templates]
+keywords: [taxonomies,metadata,front matter,terms,templates]
+menu:
+ docs:
+ parent: templates
- ## Taxonomy List Templates
++ weight: 90
++weight: 90
+aliases: [/taxonomies/displaying/,/templates/terms/,/indexes/displaying/,/taxonomies/templates/,/indexes/ordering/, /templates/taxonomies/, /templates/taxonomy/]
+toc: true
+---
+
+<!-- NOTE! Check on https://github.com/gohugoio/hugo/issues/2826 for shifting of terms' pages to .Data.Pages AND
+https://discourse.gohugo.io/t/how-to-specify-category-slug/4856/15 for original discussion.-->
+
+Hugo includes support for user-defined groupings of content called **taxonomies**. Taxonomies are classifications that demonstrate logical relationships between content. See [Taxonomies under Content Management](/content-management/taxonomies) if you are unfamiliar with how Hugo leverages this powerful feature.
+
+Hugo provides multiple ways to use taxonomies throughout your project templates:
+
+* Order the way content associated with a taxonomy term is displayed in a [taxonomy list template](#taxonomy-list-templates)
+* Order the way the terms for a taxonomy are displayed in a [taxonomy terms template](#taxonomy-terms-templates)
+* List a single content's taxonomy terms within a [single page template]
+
- ### Taxonomy List Template Lookup Order
++## Taxonomy list templates
+
+Taxonomy list page templates are lists and therefore have all the variables and methods available to [list pages][lists].
+
- ## Taxonomy Terms Templates
++### Taxonomy list template lookup order
+
+See [Template Lookup](/templates/lookup-order/).
+
- ### Taxonomy Terms Templates Lookup Order
++## Taxonomy terms templates
+
- ### Taxonomy Methods
++### Taxonomy terms templates lookup order
+
+See [Template Lookup](/templates/lookup-order/).
+
- ## Displaying custom metadata in Taxonomy Terms Templates
++### Taxonomy methods
+
+A Taxonomy is a `map[string]WeightedPages`.
+
+.Get(term)
+: Returns the WeightedPages for a term.
+
+.Count(term)
+: The number of pieces of content assigned to this term.
+
+.Alphabetical
+: Returns an OrderedTaxonomy (slice) ordered by Term.
+
+.ByCount
+: Returns an OrderedTaxonomy (slice) ordered by number of entries.
+
+.Reverse
+: Returns an OrderedTaxonomy (slice) in reverse order. Must be used with an OrderedTaxonomy.
+
+### OrderedTaxonomy
+
+Since Maps are unordered, an OrderedTaxonomy is a special structure that has a defined order.
+
+```go
+[]struct {
+ Name string
+ WeightedPages WeightedPages
+}
+```
+
+Each element of the slice has:
+
+.Term
+: The Term used.
+
+.WeightedPages
+: A slice of Weighted Pages.
+
+.Count
+: The number of pieces of content assigned to this term.
+
+.Pages
+: All Pages assigned to this term. All [list methods][renderlists] are available to this.
+
+## WeightedPages
+
+WeightedPages is simply a slice of WeightedPage.
+
+```go
+type WeightedPages []WeightedPage
+```
+
+.Count(term)
+: The number of pieces of content assigned to this term.
+
+.Pages
+: Returns a slice of pages, which then can be ordered using any of the [list methods][renderlists].
+
- {{ range .Pages }}
- <li>
- <a href="{{ .Permalink }}">{{ .Title }}</a>
- {{ .Params.wikipedia }}
- </li>
- {{ end }}
++## Displaying custom metadata in taxonomy terms templates
+
+If you need to display custom metadata for each taxonomy term, you will need to create a page for that term at `/content/<TAXONOMY>/<TERM>/_index.md` and add your metadata in its front matter, [as explained in the taxonomies documentation](/content-management/taxonomies/#add-custom-metadata-to-a-taxonomy-or-term). Based on the Actors taxonomy example shown there, within your taxonomy terms template, you may access your custom fields by iterating through the variable `.Pages` as such:
+
+```go-html-template
+<ul>
- ## Order Taxonomies
++ {{ range .Pages }}
++ <li>
++ <a href="{{ .Permalink }}">{{ .Title }}</a>
++ {{ .Params.wikipedia }}
++ </li>
++ {{ end }}
+</ul>
+```
+
+<!-- Begin /taxonomies/ordering/ -->
+
- ### Order Alphabetically Example
++## Order taxonomies
+
+Taxonomies can be ordered by either alphabetical key or by the number of content pieces assigned to that key.
+
- {{ range .Data.Terms.Alphabetical }}
- <li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> {{ .Count }}</li>
- {{ end }}
++### Order alphabetically example
+
+```go-html-template
+<ul>
- ## Order Content within Taxonomies
++ {{ range .Data.Terms.Alphabetical }}
++ <li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> {{ .Count }}</li>
++ {{ end }}
+</ul>
+```
+
+<!-- [See Also Taxonomy Lists](/templates/list/) -->
+
- ### Assign Weight
++## Order content within taxonomies
+
+Hugo uses both `date` and `weight` to order content within taxonomies.
+
+Each piece of content in Hugo can optionally be assigned a date. It can also be assigned a weight for each taxonomy it is assigned to.
+
+When iterating over content within taxonomies, the default sort is the same as that used for section and list pages: first by weight, then by date. This means that if the weights for two pieces of content are the same, then the more recent content will be displayed first.
+
+The default weight for any piece of content is 0. Zero means "does not have a weight", not "has a weight of numerical value zero".
+
+Weights of zero are thus treated specially: if two pages have unequal weights, and one of them is zero, then the zero-weighted page will always appear after the other one, regardless of the other's weight. Zero weights should thus be used with care: for example, if both positive and negative weights are used to extend a sequence in both directions, a zero-weighted page will appear not in the middle of the list, but at the end.
+
-
++### Assign weight
+
+Content can be assigned weight for each taxonomy that it's assigned to.
+
- ## Display a Single Piece of Content's Taxonomies
-
- Within your content templates, you may wish to display the taxonomies that piece of content is assigned to.
+{{< code-toggle file="content/example.md" fm=true copy=false >}}
+tags = [ "a", "b", "c" ]
+tags_weight = 22
+categories = ["d"]
+title = "Example"
+categories_weight = 44
+{{< /code-toggle >}}
+
+The convention is `taxonomyname_weight`.
+
+In the above example, this piece of content has a weight of 22 which applies to the sorting when rendering the pages assigned to the "a", "b" and "c" values of the 'tag' taxonomy.
+
+It has also been assigned the weight of 44 when rendering the 'd' category.
+
+With this the same piece of content can appear in different positions in different taxonomies.
+
+Currently taxonomies only support the default ordering of content which is weight -> date.
+
+<!-- Begin /taxonomies/templates/ -->
+
+There are two different templates that the use of taxonomies will require you to provide.
+
+Both templates are covered in detail in the templates section.
+
+A [list template](/templates/lists/) is any template that will be used to render multiple pieces of content in a single html page. This template will be used to generate all the automatically created taxonomy pages.
+
+A [taxonomy template](/templates/taxonomy-templates/) is a template used to
+generate the list of terms for a given template.
+
+<!-- Begin /taxonomies/displaying/ -->
+
+There are four common ways you can display the data in your
+taxonomies in addition to the automatic taxonomy pages created by hugo
+using the [list templates](/templates/lists/):
+
+1. For a given piece of content, you can list the terms attached
+2. For a given piece of content, you can list other content with the same
+ term
+3. You can list all terms for a taxonomy
+4. You can list all taxonomies (with their terms)
+
- Because we are leveraging the front matter system to define taxonomies for content, the taxonomies assigned to each content piece are located in the usual place (i.e., `.Params.<TAXONOMYPLURAL>`).
++## List terms assigned to a page
+
- ### Example: List Tags in a Single Page Template
++List the terms assigned to a page using the `.Page.GetTerms` method.
+
- <ul>
- {{ range (.GetTerms "tags") }}
- <li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
++To render an unordered list:
+
+```go-html-template
- </ul>
++{{ $taxonomy := "tags" }}
++{{ with .GetTerms $taxonomy }}
++ <p>{{ (site.GetPage $taxonomy).LinkTitle }}:</p>
++ <ul>
++ {{ range . }}
++ <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
+ {{ end }}
- If you want to list taxonomies inline, you will have to take care of optional plural endings in the title (if multiple taxonomies), as well as commas. Let's say we have a taxonomy "directors" such as `directors: [ "Joel Coen", "Ethan Coen" ]` in the TOML-format front matter.
-
- To list such taxonomies, use the following:
-
- ### Example: Comma-delimit Tags in a Single Page Template
++ </ul>
++{{ end }}
+```
+
- {{ $taxo := "directors" }} <!-- Use the plural form here -->
- {{ with .Param $taxo }}
- <strong>Director{{ if gt (len .) 1 }}s{{ end }}:</strong>
- {{ range $index, $director := . }}
- {{- if gt $index 0 }}, {{ end -}}
- {{ with $.Site.GetPage (printf "/%s/%s" $taxo $director) -}}
- <a href="{{ .Permalink }}">{{ $director }}</a>
- {{- end -}}
- {{- end -}}
++To render a comma-delimited list:
+
+```go-html-template
- Alternatively, you may use the [delimit template function][delimit] as a shortcut if the taxonomies should just be listed with a separator. See {{< gh 2143 >}} on GitHub for discussion.
-
- ## List Content with the Same Taxonomy Term
++{{ $taxonomy := "tags" }}
++{{ with .GetTerms $taxonomy }}
++ <p>
++ {{ (site.GetPage $taxonomy).LinkTitle }}:
++ {{ range $k, $_ := . -}}
++ {{ if $k }}, {{ end }}
++ <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
++ {{- end }}
++ </p>
+{{ end }}
+```
+
- ### Example: Showing Content in Same Series
++## List content with the same taxonomy term
+
+If you are using a taxonomy for something like a series of posts, you can list individual pages associated with the same taxonomy. This is also a quick and dirty method for showing related content:
+
- {{ range .Site.Taxonomies.series.golang }}
- <li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a></li>
- {{ end }}
++### Example: showing content in same series
+
+```go-html-template
+<ul>
- ## List All content in a Given taxonomy
++ {{ range .Site.Taxonomies.series.golang }}
++ <li><a href="{{ .Page.RelPermalink }}">{{ .Page.Title }}</a></li>
++ {{ end }}
+</ul>
+```
+
- ### Example: Grouping "Featured" Content
++## List all content in a given taxonomy
+
+This would be very useful in a sidebar as “featured content”. You could even have different sections of “featured content” by assigning different terms to the content.
+
- <ul>
- {{ range $key, $taxonomy := .Site.Taxonomies.featured }}
- <li>{{ $key }}</li>
- <ul>
- {{ range $taxonomy.Pages }}
- <li hugo-nav="{{ .RelPermalink }}"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
- {{ end }}
- </ul>
++### Example: grouping "featured" content
+
+```go-html-template
+<section id="menu">
- </ul>
++ <ul>
++ {{ range $key, $taxonomy := .Site.Taxonomies.featured }}
++ <li>{{ $key }}</li>
++ <ul>
++ {{ range $taxonomy.Pages }}
++ <li hugo-nav="{{ .RelPermalink }}"><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
+ {{ end }}
- ## Render a Site's Taxonomies
++ </ul>
++ {{ end }}
++ </ul>
+</section>
+```
+
- ### Example: List All Site Tags {#example-list-all-site-tags}
++## Render a site's taxonomies
+
+If you wish to display the list of all keys for your site's taxonomy, you can retrieve them from the [`.Site` variable][sitevars] available on every page.
+
+This may take the form of a tag cloud, a menu, or simply a list.
+
+The following example displays all terms in a site's tags taxonomy:
+
- {{ range .Site.Taxonomies.tags }}
- <li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> {{ .Count }}</li>
- {{ end }}
++### Example: list all site tags
+
+```go-html-template
+<ul>
- ### Example: List All Taxonomies, Terms, and Assigned Content
++ {{ range .Site.Taxonomies.tags }}
++ <li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> {{ .Count }}</li>
++ {{ end }}
+</ul>
+```
+
- <section>
- <ul id="all-taxonomies">
- {{ range $taxonomy_term, $taxonomy := .Site.Taxonomies }}
- {{ with $.Site.GetPage (printf "/%s" $taxonomy_term) }}
- <li><a href="{{ .Permalink }}">{{ $taxonomy_term }}</a>
- <ul>
- {{ range $key, $value := $taxonomy }}
- <li>{{ $key }}</li>
- <ul>
- {{ range $value.Pages }}
- <li hugo-nav="{{ .RelPermalink }}">
- <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
- </li>
- {{ end }}
- </ul>
- {{ end }}
- </ul>
- </li>
- {{ end }}
++### Example: list all taxonomies, terms, and assigned content
+
+This example will list all taxonomies and their terms, as well as all the content assigned to each of the terms.
+
+{{< code file="layouts/partials/all-taxonomies.html" >}}
- </ul>
- </section>
++<ul>
++ {{ range $taxonomy, $terms := site.Taxonomies }}
++ <li>
++ {{ with site.GetPage $taxonomy }}
++ <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
++ {{ end }}
++ <ul>
++ {{ range $term, $weightedPages := $terms }}
++ <li>
++ <a href="{{ .Page.RelPermalink }}">{{ .Page.LinkTitle }}</a>
++ <ul>
++ {{ range $weightedPages }}
++ <li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
++ {{ end }}
++ </ul>
++ </li>
+ {{ end }}
- ## `.Site.GetPage` for Taxonomies
++ </ul>
++ </li>
++ {{ end }}
++</ul>
+{{< /code >}}
+
- {{ with ($.Site.GetPage (printf "/%s" $taxo)) }}
- {{ range .Pages }}
- <li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
- {{ end }}
++## `.Site.GetPage` for taxonomies
+
+Because taxonomies are lists, the [`.GetPage` function][getpage] can be used to get all the pages associated with a particular taxonomy term using a terse syntax. The following ranges over the full list of tags on your site and links to each of the individual taxonomy pages for each term without having to use the more fragile URL construction of the ["List All Site Tags" example above](#example-list-all-site-tags):
+
+{{< code file="links-to-all-tags.html" >}}
+{{ $taxo := "tags" }}
+<ul class="{{ $taxo }}">
++ {{ with ($.Site.GetPage (printf "/%s" $taxo)) }}
++ {{ range .Pages }}
++ <li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
+ {{ end }}
++ {{ end }}
+</ul>
+{{< /code >}}
+
+<!-- TODO: ### `.Site.GetPage` Taxonomy List Example -->
+
+<!-- TODO: ### `.Site.GetPage` Taxonomy Terms Example -->
+
+
+[delimit]: /functions/delimit/
+[getpage]: /functions/getpage/
+[lists]: /templates/lists/
+[renderlists]: /templates/lists/
+[single page template]: /templates/single-page-templates/
+[sitevars]: /variables/site/
--- /dev/null
- title: Template Debugging
+---
- weight: 180
- weight: 180
++title: Template debugging
+description: You can use Go templates' `printf` function to debug your Hugo templates. These snippets provide a quick and easy visualization of the variables available to you in different contexts.
+categories: [templates]
+keywords: [debugging,troubleshooting]
+menu:
+ docs:
+ parent: templates
- ## What Variables are Available in this Context?
++ weight: 240
++weight: 240
+---
+
+Here are some snippets you can add to your template to answer some common questions.
+
+These snippets use the `printf` function available in all Go templates. This function is an alias to the Go function, [fmt.Printf](https://pkg.go.dev/fmt).
+
- ## Why Am I Showing No Defined Variables?
++## What variables are available in this context?
+
+You can use the template syntax, `$.`, to get the top-level template context from anywhere in your template. This will print out all the values under, `.Site`.
+
+```go-html-template
+{{ printf "%#v" $.Site }}
+```
+
+This will print out the value of `.Permalink`:
+
+```go-html-template
+{{ printf "%#v" .Permalink }}
+```
+
+This will print out a list of all the variables scoped to the current context
+(`.`, aka ["the dot"][tempintro]).
+
+```go-html-template
+{{ printf "%#v" . }}
+```
+
+When developing a [homepage], what does one of the pages you're looping through look like?
+
+```go-html-template
+{{ range .Pages }}
+ {{/* The context, ".", is now each one of the pages as it goes through the loop */}}
+ {{ printf "%#v" . }}
+{{ end }}
+```
+
++In some cases it might be more helpful to use the following snippet on the current context to get a pretty printed view of what you're able to work with:
++
++```go-html-template
++<pre>{{ . | jsonify (dict "indent" " ") }}</pre>
++```
++
++Note that Hugo will throw an error if you attempt to use this construct to display context that includes a page collection (e.g., the context passed to home, section, taxonomy, and term templates).
++
++## Why am I showing no defined variables?
+
+Check that you are passing variables in the `partial` function:
+
+```go-html-template
+{{ partial "header.html" }}
+```
+
+This example will render the header partial, but the header partial will not have access to any contextual variables. You need to pass variables explicitly. For example, note the addition of ["the dot"][tempintro].
+
+```go-html-template
+{{ partial "header.html" . }}
+```
+
+The dot (`.`) is considered fundamental to understanding Hugo templating. For more information, see [Introduction to Hugo Templating][tempintro].
+
+[homepage]: /templates/homepage/
+[tempintro]: /templates/introduction/
--- /dev/null
- title: Content View Templates
- description: Hugo can render alternative views of your content, which is especially useful in list and summary views.
+---
- weight: 70
- weight: 70
++title: Content view templates
++description: Hugo can render alternative views of your content, useful in list and summary views.
+categories: [templates]
+keywords: [views]
+menu:
+ docs:
+ parent: templates
- ## Create a Content View
++ weight: 110
++weight: 110
+toc: true
+---
+
+These alternative **content views** are especially useful in [list templates][lists].
+
+The following are common use cases for content views:
+
+* You want content of every type to be shown on the homepage but only with limited [summary views][summaries].
+* You only want a bulleted list of your content on a [taxonomy list page][taxonomylists]. Views make this very straightforward by delegating the rendering of each different type of content to the content itself.
+
- ## Which Template Will be Rendered?
++## Create a content view
+
+To create a new view, create a template in each of your different content type directories with the view name. The following example contains an "li" view and a "summary" view for the `posts` and `project` content types. As you can see, these sit next to the [single content view][single] template, `single.html`. You can even provide a specific view for a given type and continue to use the `_default/single.html` for the primary view.
+
+```txt
+ ▾ layouts/
+ ▾ posts/
+ li.html
+ single.html
+ summary.html
+ ▾ project/
+ li.html
+ single.html
+ summary.html
+```
+
+Hugo also has support for a default content template to be used in the event that a specific content view template has not been provided for that type. Content views can also be defined in the `_default` directory and will work the same as list and single templates who eventually trickle down to the `_default` directory as a matter of the lookup order.
+
+
+```txt
+▾ layouts/
+ ▾ _default/
+ li.html
+ single.html
+ summary.html
+```
+
- ## Example: Content View Inside a List
++## Which template will be rendered?
+
+The following is the [lookup order][lookup] for content views:
+
+1. `/layouts/<TYPE>/<VIEW>.html`
+2. `/layouts/_default/<VIEW>.html`
+3. `/themes/<THEME>/layouts/<TYPE>/<VIEW>.html`
+4. `/themes/<THEME>/layouts/_default/<VIEW>.html`
+
++## Example: content view inside a list
+
+The following example demonstrates how to use content views inside your [list templates][lists].
+
+### `list.html`
+
+In this example, `.Render` is passed into the template to call the [render function][render]. `.Render` is a special function that instructs content to render itself with the view template provided as the first argument. In this case, the template is going to render the `summary.html` view that follows:
+
+{{< code file="layouts/_default/list.html" >}}
+<main id="main">
+ <div>
+ <h1 id="title">{{ .Title }}</h1>
+ {{ range .Pages }}
+ {{ .Render "summary" }}
+ {{ end }}
+ </div>
+</main>
+{{< /code >}}
+
+### `summary.html`
+
+Hugo will pass the entire page object to the following `summary.html` view template. (See [Page Variables][pagevars] for a complete list.)
+
+{{< code file="layouts/_default/summary.html" >}}
+<article class="post">
+ <header>
+ <h2><a href='{{ .Permalink }}'> {{ .Title }}</a> </h2>
+ <div class="post-meta">{{ .Date.Format "Mon, Jan 2, 2006" }} - {{ .FuzzyWordCount }} Words </div>
+ </header>
+ {{ .Summary }}
+ <footer>
+ <a href='{{ .Permalink }}'><nobr>Read more →</nobr></a>
+ </footer>
+</article>
+{{< /code >}}
+
+### `li.html`
+
+Continuing on the previous example, we can change our render function to use a smaller `li.html` view by changing the argument in the call to the `.Render` function (i.e., `{{ .Render "li" }}`).
+
+{{< code file="layouts/_default/li.html" >}}
+<li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ <div class="meta">{{ .Date.Format "Mon, Jan 2, 2006" }}</div>
+</li>
+{{< /code >}}
+
+[lists]: /templates/lists/
+[lookup]: /templates/lookup-order/
+[pagevars]: /variables/page/
+[render]: /functions/render/
+[single]: /templates/single-page-templates/
+[spf]: https://spf13.com
+[spfsourceli]: https://github.com/spf13/spf13.com/blob/master/layouts/_default/li.html
+[spfsourcesection]: https://github.com/spf13/spf13.com/blob/master/layouts/_default/section.html
+[spfsourcesummary]: https://github.com/spf13/spf13.com/blob/master/layouts/_default/summary.html
+[summaries]: /content-management/summaries/
+[taxonomylists]: /templates/taxonomy-templates/
--- /dev/null
- title: Developer Tools
- linktitle: Developer Tools Overview
+---
- parent: tools
- weight: 01
- weight: 01
++title: Developer tools
++linkTitle: Overview
+description: In addition to Hugo's powerful CLI, there is a large number of community-developed tool chains for Hugo developers.
+categories: [developer tools]
+keywords: []
+menu:
+ docs:
++ identifier: developer-tools-overview
++ parent: developer-tools
++ weight: 10
++weight: 10
+---
+
+One of Hugo's greatest strengths is its passionate---and always evolving---developer community. With the exception of the `highlight` shortcode mentioned in [Syntax Highlighting][syntax], the tools and other projects featured in this section are offerings from both commercial services and open-source projects, many of which are developed by Hugo developers just like you.
+
+[See the popularity of Hugo compared with other static site generators.][staticgen]
+
+[staticgen]: https://staticgen.com
+[syntax]: /content-management/syntax-highlighting/
--- /dev/null
- title: Editor Plug-ins for Hugo
- linktitle: Editor Plug-ins
+---
- parent: tools
- weight: 50
- weight: 50
++title: Editor plugins for Hugo
++linkTitle: Editor plugins
+description: The Hugo community uses a wide range of preferred tools and has developed plug-ins for some of the most popular text editors to help automate parts of your workflow.
+categories: [developer tools]
+keywords: [editor, plug-ins]
+menu:
+ docs:
- ## Atom
-
- * [Hugofy](https://atom.io/packages/hugofy). A Hugo Static Website Generator package for Atom.
- * [language-hugo](https://atom.io/packages/language-hugo). Adds syntax highlighting to Hugo files.
-
++ parent: developer-tools
++ weight: 20
++weight: 20
+---
+
+The Hugo community uses a wide range of preferred tools and has developed plug-ins for some of the most popular text editors to help automate parts of your workflow.
+
+## Sublime Text
+
+* [Hugofy](https://github.com/akmittal/Hugofy). Hugofy is a plugin for Sublime Text 3 to make life easier to use Hugo static site generator.
+* [Hugo Snippets](https://packagecontrol.io/packages/Hugo%20Snippets). Hugo Snippets is a useful plugin for adding automatic snippets to Sublime Text 3.
+
+## Visual Studio Code
+
+* [Hugofy](https://marketplace.visualstudio.com/items?itemName=akmittal.hugofy). Hugofy is a plugin for Visual Studio Code to "make life easier" when developing with Hugo. The source code can be found [here](https://github.com/akmittal/hugofy-vscode).
+* [Hugo Helper](https://marketplace.visualstudio.com/items?itemName=rusnasonov.vscode-hugo). Hugo Helper is a plugin for Visual Studio Code that has some useful commands for Hugo. The source code can be found [here](https://github.com/rusnasonov/vscode-hugo).
+* [Hugo Language and Syntax Support](https://marketplace.visualstudio.com/items?itemName=budparr.language-hugo-vscode). Hugo Language and Syntax Support is a Visual Studio Code plugin for Hugo syntax highlighting and snippets. The source code can be found [here](https://github.com/budparr/language-hugo-vscode).
+* [Hugo Themer](https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-hugo-themer). Hugo Themer is an extension to help you while developing themes. It allows you to easily navigate through your theme files.
+* [Front Matter](https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-front-matter). Once you go for a static site, you need to think about how you are going to manage your articles. Front matter is a tool that helps you maintain the metadata/front matter of your articles like: creation date, modified date, slug, tile, SEO check, and many more...
+* [Syntax Highlighting for Hugo Shortcodes](https://marketplace.visualstudio.com/items?itemName=kaellarkin.hugo-shortcode-syntax). This extension add some syntax highlighting for Shortcodes, making visual identification of individual pieces easier.
+
+## Emacs
+
+* [emacs-easy-hugo](https://github.com/masasam/emacs-easy-hugo). Emacs major mode for managing hugo blogs. Note that Hugo also supports [Org-mode][formats].
+* [ox-hugo.el](https://ox-hugo.scripter.co). Native Org-mode exporter that exports to Blackfriday Markdown with Hugo front-matter. `ox-hugo` supports two common Org blogging flows --- exporting multiple Org subtrees in a single file to multiple Hugo posts, and exporting a single Org file to a single Hugo post. It also leverages the Org tag and property inheritance features. See [*Why ox-hugo?*](https://ox-hugo.scripter.co/doc/why-ox-hugo/) for more.
+
+## Vim
+
+* [Vim Hugo Helper](https://github.com/robertbasic/vim-hugo-helper). A small Vim plugin to help me with writing posts with Hugo.
+* [vim-hugo](https://github.com/phelipetls/vim-hugo). A Vim plugin with syntax highlighting for templates and a few other features.
+
+[formats]: /content-management/formats/
--- /dev/null
- title: Frontend Interfaces with Hugo
- linktitle: Frontends
+---
- parent: tools
- weight: 40
- weight: 40
++title: Frontend interfaces with Hugo
++linkTitle: Frontends
+description: Do you prefer a graphical user interface over a text editor? Give these frontends a try.
+categories: [developer tools]
+keywords: [frontend, gui]
+menu:
+ docs:
- - [Netlify CMS](https://netlifycms.org). Netlify CMS is an open source, serverless solution for managing Git based content in static sites, and it works on any platform that can host static sites. A [Hugo/Netlify CMS starter](https://github.com/netlify-templates/one-click-hugo-cms) is available to get new projects running quickly.
++ parent: developer-tools
++ weight: 30
++weight: 30
+---
+
+- [enwrite](https://github.com/zzamboni/enwrite). Enwrite enables evernote-powered, statically generated blogs and websites. Now posting to your blog or updating your website is as easy as writing a new note in Evernote!
+- [Lipi](https://github.com/SohanChy/Lipi). Lipi is a native GUI frontend written in Java to manage your Hugo websites.
- ## Commercial Services
++- [Decap CMS (formerly Netlify CMS)](https://decapcms.org/). Decap CMS is an open source, serverless solution for managing Git based content in static sites, and it works on any platform that can host static sites. A [Hugo/Decap CMS starter](https://github.com/decaporg/one-click-hugo-cms) is available to get new projects running quickly.
+- [Hokus CMS](https://github.com/julianoappelklein/hokus). Hokus CMS is an open source, multi-platform, easy to use, desktop application for Hugo. Build from simple to complex user interfaces for Hugo websites by choosing from a dozen ready-to-use components — all for free, with no vendor lock-in.
+
++## Commercial services
+
+- [DATOCMS](https://www.datocms.com) DatoCMS is a fully customizable administrative area for your static websites. Use your favorite website generator, let your clients publish new content independently, and the host the site anywhere you like.
+- [CloudCannon](https://cloudcannon.com/hugo-cms/). The intuitive Git-based CMS for your Hugo website. CloudCannon syncs changes from your Git repository and pushes content changes back, so your development and content teams are always in sync. Edit all of your content on the page with visual editing, build entire pages with reusable custom components and then publish confidently.
--- /dev/null
- linktitle: Migrations
+---
+title: Migrate to Hugo
- parent: tools
- weight: 10
- weight: 10
++linkTitle: Migrations
+description: A list of community-developed tools for migrating from your existing static site generator or content management system to Hugo.
+keywords: [migrations, jekyll, wordpress, drupal, ghost, contentful]
+menu:
+ docs:
- - [medium2md](https://github.com/gautamdhameja/medium-2-md) - A simple Medium to Hugo exporter able to import stories in one command, including Front Matter.
++ parent: developer-tools
++ weight: 50
++weight: 50
+aliases: [/developer-tools/migrations/, /developer-tools/migrated/]
+toc: true
+---
+
+This section highlights some projects around Hugo that are independently developed. These tools try to extend the functionality of our static site generator or help you to get started.
+
+{{% note %}}
+Do you know or maintain a similar project around Hugo? Feel free to open a [pull request](https://github.com/gohugoio/hugoDocs/pulls) on GitHub if you think it should be added.
+{{% /note %}}
+
+Take a look at this list of migration tools if you currently use other blogging tools like Jekyll or WordPress but intend to switch to Hugo instead. They'll take care to export your content into Hugo-friendly formats.
+
+## Jekyll
+
+Alternatively, you can use the new [Jekyll import command](/commands/hugo_import_jekyll/).
+
+- [JekyllToHugo](https://github.com/fredrikloch/JekyllToHugo) - A Small script for converting Jekyll blog posts to a Hugo site.
+- [ConvertToHugo](https://github.com/coderzh/ConvertToHugo) - Convert your blog from Jekyll to Hugo.
+
+## Ghost
+
+- [ghostToHugo](https://github.com/jbarone/ghostToHugo) - Convert Ghost blog posts and export them to Hugo.
+
+## Octopress
+
+- [octohug](https://github.com/codebrane/octohug) - Octopress to Hugo migrator.
+
+## DokuWiki
+
+- [dokuwiki-to-hugo](https://github.com/wgroeneveld/dokuwiki-to-hugo) - Migrates your DokuWiki source pages from [DokuWiki syntax](https://www.dokuwiki.org/wiki:syntax) to Hugo Markdown syntax. Includes extra's like the TODO plugin. Written with extensibility in mind using python 3. Also generates a TOML header for each page. Designed to copypaste the wiki directory into your /content directory.
+
+## WordPress
+
+- [wordpress-to-hugo-exporter](https://github.com/SchumacherFM/wordpress-to-hugo-exporter) - A one-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Hugo. (Note: If you have trouble using this plugin, you can [export your site for Jekyll](https://wordpress.org/plugins/jekyll-exporter/) and use Hugo's built in Jekyll converter listed above.)
+- [blog2md](https://github.com/palaniraja/blog2md) - Works with [exported xml](https://en.support.wordpress.com/export/) file of your free YOUR-TLD.wordpress.com website. It also saves approved comments to `YOUR-POST-NAME-comments.md` file along with posts.
+- [wordhugopress](https://github.com/nantipov/wordhugopress) - A small utility written in Java, exports the entire WordPress site from the database and resource (e.g. images) files stored locally or remotely. Therefore, migration from the backup files is possible. Supports merging of the multiple WordPress sites into a single Hugo one.
+
+## Medium
+
++- [medium2md](https://github.com/gautamdhameja/medium-2-md) - A simple Medium to Hugo exporter able to import stories in one command, including front matter.
+- [medium-to-hugo](https://github.com/bgadrian/medium-to-hugo) - CLI tool written in Go to export medium posts into a Hugo compatible Markdown format. Tags and images are included. All images will be downloaded locally and linked appropriately.
+
+## Tumblr
+
+- [tumblr-importr](https://github.com/carlmjohnson/tumblr-importr) - An importer that uses the Tumblr API to create a Hugo static site.
+- [tumblr2hugomarkdown](https://github.com/Wysie/tumblr2hugomarkdown) - Export all your Tumblr content to Hugo Markdown files with preserved original formatting.
+- [Tumblr to Hugo](https://github.com/jipiboily/tumblr-to-hugo) - A migration tool that converts each of your Tumblr posts to a content file with a proper title and path. Furthermore, "Tumblr to Hugo" creates a CSV file with the original URL and the new path on Hugo, to help you setup the redirections.
+
+## Drupal
+
+- [drupal2hugo](https://github.com/danapsimer/drupal2hugo) - Convert a Drupal site to Hugo.
+
+## Joomla
+
+- [hugojoomla](https://github.com/davetcc/hugojoomla) - This utility written in Java takes a Joomla database and converts all the content into Markdown files. It changes any URLs that are in Joomla's internal format and converts them to a suitable form.
+
+## Blogger
+
+- [blogimport](https://github.com/natefinch/blogimport) - A tool to import from Blogger posts to Hugo.
+- [blogger-to-hugo](https://pypi.org/project/blogger-to-hugo/) - Another tool to import Blogger posts to Hugo. It also downloads embedded images so they will be stored locally.
+- [blog2md](https://github.com/palaniraja/blog2md) - Works with [exported xml](https://support.google.com/blogger/answer/41387?hl=en) file of your YOUR-TLD.blogspot.com website. It also saves comments to `YOUR-POST-NAME-comments.md` file along with posts.
+- [BloggerToHugo](https://github.com/huanlin/blogger-to-hugo) - Yet another tool to import Blogger posts to Hugo. For Windows platform only, and .NET Framework 4.5 is required. See README.md before using this tool.
+
+## Contentful
+
+- [contentful-hugo](https://github.com/ModiiMedia/contentful-hugo) - A tool to create content-files for Hugo from content on [Contentful](https://www.contentful.com/).
+
+## BlogML
+
+- [BlogML2Hugo](https://github.com/jijiechen/BlogML2Hugo) - A tool that helps you convert BlogML xml file to Hugo Markdown files. Users need to take care of links to attachments and images by themselves. This helps the blogs that export BlogML files (e.g. BlogEngine.NET) transform to hugo sites easily.
--- /dev/null
- title: Other Hugo Community Projects
- linktitle: Other Projects
+---
- parent: tools
- weight: 70
- weight: 70
++title: Other community projects
++linkTitle: Other projects
+description: Some interesting projects developed by the Hugo community that don't quite fit into our other developer tool categories.
+categories: [developer tools]
+keywords: [frontend, gui]
+menu:
+ docs:
++ parent: developer-tools
++ weight: 60
++weight: 60
+---
+
+And for all the other small things around Hugo:
+
+- [hugo-gallery](https://github.com/icecreammatt/hugo-gallery) lets you create an image gallery for Hugo sites.
+- [flickr-hugo-embed](https://github.com/nikhilm/flickr-hugo-embed) prints shortcodes to embed a set of images from an album on Flickr into Hugo.
+- [hugo-openapispec-shortcode](https://github.com/tenfourty/hugo-openapispec-shortcode) A shortcode that allows you to include [Open API Spec](https://openapis.org) (formerly known as Swagger Spec) in a page.
+- [HugoPhotoSwipe](https://github.com/GjjvdBurg/HugoPhotoSwipe) makes it easy to create image galleries using PhotoSwipe.
+- [Hugo SFTP Upload](https://github.com/thomasmey/HugoSftpUpload) Syncs the local build of your Hugo website with your remote webserver via SFTP.
+- [Emacs Easy Hugo](https://github.com/masasam/emacs-easy-hugo) Emacs package for writing blog posts in markdown or org-mode and building your site with Hugo.
+- [JAMStack Themes](https://jamstackthemes.dev/ssg/hugo/). JAMStack themes is a collection of site themes filterable by static site generator and supported CMS to help build CMS-connected sites using Hugo (linking to Hugo-specific themes).
+- [plausible-hugo](https://github.com/divinerites/plausible-hugo). Easy Hugo integration for Plausible Analytics, a simple, open-source, lightweight and privacy-friendly web analytics alternative to Google Analytics.
--- /dev/null
- title: Search for your Hugo Website
- linktitle: Search
+---
- parent: tools
- weight: 60
- weight: 60
++title: Search for your Hugo website
++linkTitle: Search
+description: See some of the open-source and commercial search options for your newly created Hugo website.
+menu:
+ docs:
- ## Commercial Search Services
++ parent: developer-tools
++ weight: 40
++weight: 40
+toc: true
+---
+
+A static website with a dynamic search function? Yes, Hugo provides an alternative to embeddable scripts from Google or other search engines for static websites. Hugo allows you to provide your visitors with a custom search function by indexing your content files directly.
+
+* [GitHub Gist for Hugo Workflow](https://gist.github.com/sebz/efddfc8fdcb6b480f567). This gist contains a simple workflow to create a search index for your static website. It uses a simple Grunt script to index all your content files and [lunr.js](https://lunrjs.com/) to serve the search results.
+
+* [hugo-lunr](https://www.npmjs.com/package/hugo-lunr). A simple way to add site search to your static Hugo site using [lunr.js](https://lunrjs.com/). Hugo-lunr will create an index file of any HTML and Markdown documents in your Hugo project.
+* [hugo-lunr-zh](https://www.npmjs.com/package/hugo-lunr-zh). A bit like Hugo-lunr, but Hugo-lunr-zh can help you separate the Chinese keywords.
+* [GitHub Gist for Fuse.js integration](https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1cb41ae). This gist demonstrates how to leverage Hugo's existing build time processing to generate a searchable JSON index used by [Fuse.js](https://fusejs.io/) on the client-side. Although this gist uses Fuse.js for fuzzy matching, any client-side search tool capable of reading JSON indexes will work. Does not require npm, grunt or other build-time tools except Hugo!
+* [hugo-search-index](https://www.npmjs.com/package/hugo-search-index). A library containing Gulp tasks and a prebuilt browser script that implements search. Gulp generates a search index from project markdown files.
+* [hugofastsearch](https://gist.github.com/cmod/5410eae147e4318164258742dd053993). A usability and speed update to "GitHub Gist for Fuse.js integration" — global, keyboard-optimized search.
+* [JS & Fuse.js tutorial](https://makewithhugo.com/add-search-to-a-hugo-site/) A simple client-side search solution, using FuseJS (does not require jQuery).
+* [Pagefind](https://github.com/cloudcannon/pagefind). A fully static search library that aims to perform well on large sites, while using as little of your users' bandwidth as possible.
+* [Hugo Lyra](https://github.com/paolomainardi/hugo-lyra). Hugo-Lyra is a JavaScript module to integrate [Lyra](https://github.com/LyraSearch/lyra) into a Hugo website. It contains the server-side part to generate the index and the client-side library (optional) to bootstrap the search engine easily.
+
++## Commercial search services
+
+* [Algolia](https://www.algolia.com/)'s Search API makes it easy to deliver a great search experience in your apps and websites. Algolia Search provides hosted full-text, numerical, faceted, and geolocalized search.
+* [Bonsai](https://www.bonsai.io) is a fully-managed hosted Elasticsearch service that is fast, reliable, and simple to set up. Easily ingest your docs from Hugo into Elasticsearch following [this guide from the docs](https://docs.bonsai.io/hc/en-us/articles/13929190788756-Hugo).
+* [ExpertRec](https://www.expertrec.com/) is a hosted search-as-a-service solution that is fast and scalable. Set-up and integration is extremely easy and takes only a few minutes. The search settings can be modified without coding using a dashboard.
--- /dev/null
- weight: 1
- weight: 1
+---
+title: Troubleshoot
++linkTitle: Overview
+description: Frequently asked questions and known issues pulled from the Hugo Discuss forum.
+menu:
+ docs:
++ identifier: troubleshooting-overview
+ parent: troubleshooting
++ weight: 10
++weight: 10
+aliases: [/troubleshooting/faqs/,/faqs/]
+---
+
+The Troubleshooting section includes known issues, recent workarounds, and FAQs pulled from the [Hugo Discussion Forum][forum].
+
+[forum]: https://discourse.gohugo.io
--- /dev/null
- title: Build Performance
+---
- weight: 3
++title: Build performance
+description: An overview of features used for diagnosing and improving performance issues in site builds.
+menu:
+ docs:
+ parent: troubleshooting
- ## Template Metrics
++ weight: 30
++weight: 30
+toc: true
+---
+
- **A Note About Parallelism**
++## Template metrics
+
+Hugo is a very fast static site generator, but it is possible to write
+inefficient templates. Hugo's _template metrics_ feature is extremely helpful
+in pinpointing which templates are executed most often and how long those
+executions take **in terms of CPU time**.
+
+| Metric Name | Description |
+| ------------------- | -------------------------------------------------------------- |
+| cumulative duration | The cumulative time spent executing a given template. |
+| average duration | The average time spent executing a given template. |
+| maximum duration | The maximum time a single execution took for a given template. |
+| count | The number of times a template was executed. |
+| template | The template name. |
+
+```txt
+▶ hugo --templateMetrics
+Started building sites ...
+
+Built site for language en:
+0 draft content
+0 future content
+0 expired content
+2 regular pages created
+22 other pages created
+0 non-page files copied
+0 paginator pages created
+4 tags created
+3 categories created
+total in 18 ms
+
+Template Metrics:
+
+ cumulative average maximum
+ duration duration duration count template
+ ---------- -------- -------- ----- --------
+ 6.419663ms 583.605µs 994.374µs 11 _internal/_default/rss.xml
+ 4.718511ms 1.572837ms 3.880742ms 3 indexes/category.html
+ 4.642666ms 2.321333ms 3.282842ms 2 posts/single.html
+ 4.364445ms 396.767µs 2.451372ms 11 partials/header.html
+ 2.346069ms 586.517µs 903.343µs 4 indexes/tag.html
+ 2.330919ms 211.901µs 2.281342ms 11 partials/header.includes.html
+ 1.238976ms 103.248µs 446.084µs 12 posts/li.html
+ 972.16µs 972.16µs 972.16µs 1 _internal/_default/sitemap.xml
+ 953.597µs 953.597µs 953.597µs 1 index.html
+ 822.263µs 822.263µs 822.263µs 1 indexes/post.html
+ 567.498µs 51.59µs 112.205µs 11 partials/navbar.html
+ 348.22µs 31.656µs 88.249µs 11 partials/meta.html
+ 346.782µs 173.391µs 276.176µs 2 posts/summary.html
+ 235.184µs 21.38µs 124.383µs 11 partials/footer.copyright.html
+ 132.003µs 12µs 117.999µs 11 partials/menu.html
+ 72.547µs 6.595µs 63.764µs 11 partials/footer.html
+```
+
+{{% note %}}
- ## Cached Partials
++**A note about parallelism**
+
+Hugo builds pages in parallel where multiple pages are generated
+simultaneously. Because of this parallelism, the sum of "cumulative duration"
+values is usually greater than the actual time it takes to build a site.
+{{% /note %}}
+
++## Cached partials
+
+Some `partial` templates such as sidebars or menus are executed many times
+during a site build. Depending on the content within the `partial` template and
+the desired output, the template may benefit from caching to reduce the number
+of executions. The [`partialCached`][partialcached] template function provides
+caching capabilities for `partial` templates.
+
+{{% note %}}
+Note that you can create cached variants of each `partial` by passing additional
+parameters to `partialCached` beyond the initial context. See the
+`partialCached` documentation for more details.
+{{% /note %}}
+
+[partialCached]: /functions/partialcached
--- /dev/null
- title: Frequently Asked Questions
- linktitle: FAQ
+---
- weight: 2
++title: Frequently asked questions
++linkTitle: Frequently asked questions
+description: Solutions to some common Hugo problems.
+categories: [troubleshooting]
+menu:
+ docs:
+ parent: troubleshooting
++ weight: 20
++weight: 20
+keywords: [faqs]
- Is your Markdown file [in draft mode](https://gohugo.io/content-management/front-matter/#front-matter-variables)? When testing, run `hugo server` with the `-D` or `--buildDrafts` [switch](https://gohugo.io/getting-started/usage/#draft-future-and-expired-content).
+toc: true
+aliases: [/faq/]
+---
+
+{{% note %}}
+**Note:** The answers/solutions presented below are short, and may not be enough to solve your problem. Visit [Hugo Discourse](https://discourse.gohugo.io/) and use the search. It that does not help, start a new topic and ask your questions.
+{{% /note %}}
+
+## I can't see my content!
+
- 1. Set `publishDate` in the page [Front Matter](/content-management/front-matter/) to a datetime in the future. If you want the creation and publication datetime to be the same, it's also sufficient to only set `date`[^date-hierarchy].
++Is your Markdown file [in draft mode](/content-management/front-matter/#front-matter-variables)? When testing, run `hugo server` with the `-D` or `--buildDrafts` [switch](/getting-started/usage/#draft-future-and-expired-content).
+
+Is your Markdown file part of a [leaf bundle](/content-management/page-bundles/)? If there is an `index.md` file in the same or any parent directory then other Markdown files will not be rendered as individual pages.
+
+## Can I set configuration variables via OS environment?
+
+Yes you can! See [Configure with Environment Variables](/getting-started/configuration/#configure-with-environment-variables).
+
+## How do I schedule posts?
+
- [^date-hierarchy]: See [Configure Dates](https://gohugo.io/getting-started/configuration/#configure-dates) for the order in which the different date variables are complemented by each other when not explicitly set.
++1. Set `publishDate` in the page [front matter](/content-management/front-matter/) to a datetime in the future. If you want the creation and publication datetime to be the same, it's also sufficient to only set `date`[^date-hierarchy].
+2. Build and publish at intervals.
+
+How to automate the "publish at intervals" part depends on your situation:
+
+* If you deploy from your own PC/server, you can automate with [Cron](https://en.wikipedia.org/wiki/Cron) or similar.
+* If your site is hosted on a service similar to [Netlify](https://www.netlify.com/) you can:
+ * Use a service such as [ifttt](https://ifttt.com/date_and_time) to schedule the updates
+ * Set up a deploy hook which you can run with a cron service to deploy your site at intervals, such as [cron-job.org](https://cron-job.org/) (both Netlify and Cloudflare Pages support deploy hooks)
+
+Also see this Twitter thread:
+
+{{< tweet user="ChrisShort" id="962380712027590657" >}}
+
++[^date-hierarchy]: See [Configure Dates](/getting-started/configuration/#configure-dates) for the order in which the different date variables are complemented by each other when not explicitly set.
+
+## Can I use the latest Hugo version on Netlify?
+
+Yes you can! Read [this](/hosting-and-deployment/hosting-on-netlify/#configure-hugo-version-in-netlify).
+
+## I get "... this feature is not available in your current Hugo version"
+
+If you process `SCSS` or `Sass` to `CSS` in your Hugo project with `libsass` as the transpiler or if you convert images to the `webp` format, you need the Hugo `extended` version, or else you may see an error message similar to the below:
+
+```bash
+error: failed to transform resource: TOCSS: failed to transform "scss/main.scss" (text/x-scss): this feature is not available in your current Hugo version
+```
+
+We release two set of binaries for technical reasons. The extended version is not what you get by default for some installation methods. On the [release page](https://github.com/gohugoio/hugo/releases), look for archives with `extended` in the name. To build `hugo-extended`, use `go install --tags extended`
+
+To confirm, run `hugo version` and look for the word `extended`.
--- /dev/null
- title: Variables and Params
- linktitle: Variables Overview
+---
- categories: [variables and params]
++title: Variables and parameters
++linkTitle: Overview
+description: Page-, file-, taxonomy-, and site-level variables and parameters available in templates.
- weight: 01
++categories: [variables and parameters]
+keywords: [variables,params,values,globals]
+menu:
+ docs:
++ identifier: variables-overview
+ parent: variables
+ weight: 1
++weight: 1
+aliases: [/templates/variables/]
+---
+
+Hugo's templates are context aware and make a large number of values available to you as you're creating views for your website.
+
+[Go templates]: /templates/introduction/ "Understand context in Go templates by learning the language's fundamental templating functions."
--- /dev/null
- title: File Variables
+---
- categories: [variables and params]
++title: File variables
+description: "Use File variables to access file-related values for each page that is backed by a file."
++categories: [variables and parameters]
+keywords: [files]
+menu:
+ docs:
+ parent: variables
+ weight: 40
+toc: true
+weight: 40
+aliases: [/variables/file-variables/]
+---
+## Variables
+
+{{% note %}}
+The path separators (slash or backslash) in `.File.Path`, `.File.Dir`, and `.File.Filename` depend on the operating system.
+{{% /note %}}
+
+.File.Path
+: (`string`) The file path, relative to the `content` directory.
+
+.File.Dir
+: (`string`) The file path, excluding the file name, relative to the `content` directory.
+
+.File.LogicalName
+: (`string`) The file name.
+
+.File.BaseFileName
+: (`string`) The file name, excluding the extension.
+
+.File.TranslationBaseName
+: (`string`) The file name, excluding the extension and language identifier.
+
+.File.Ext
+: (`string`) The file extension.
+
+.File.Lang
+: (`string`) The language associated with the given file.
+
+
+.File.ContentBaseName
+: (`string`) If the page is a branch or leaf bundle, the name of the containing directory, else the `.TranslationBaseName`.
+
+.File.Filename
+: (`string`) The absolute file path.
+
+.File.UniqueID
+: (`string`) The MD5 hash of `.File.Path`.
+
+## Examples
+
+```text
+content/
+├── news/
+│ ├── b/
+│ │ ├── index.de.md <-- leaf bundle
+│ │ └── index.en.md <-- leaf bundle
+│ ├── a.de.md <-- regular content
+│ ├── a.en.md <-- regular content
+│ ├── _index.de.md <-- branch bundle
+│ └── _index.en.md <-- branch bundle
+├── _index.de.md
+└── _index.en.md
+```
+
+With the content structure above, the `.File` objects for the English pages contain the following properties:
+
+ |regular content|leaf bundle|branch bundle
+:--|:--|:--|:--
+Path|news/a.en.md|news/b/index.en.md|news/_index.en.md
+Dir|news/|news/b/|news/
+LogicalName|a.en.md|index.en.md|_index.en.md
+BaseFileName|a.en|index.en|_index.en
+TranslationBaseName|a|index|_index
+Ext|md|md|md
+Lang|en|en|en
+ContentBaseName|a|b|news
+Filename|/home/user/...|/home/user/...|/home/user/...
+UniqueID|15be14b...|186868f...|7d9159d...
+
+## Defensive coding
+
+Some of the pages on a site may not be backed by a file. For example:
+
+- Top level section pages
+- Taxonomy pages
+- Term pages
+
+Without a backing file, Hugo will throw a warning if you attempt to access a `.File` property. For example:
+
+```text
+WARN .File.ContentBaseName on zero object. Wrap it in if or with...
+```
+
+To code defensively:
+
+```go-html-template
+{{ with .File }}
+ {{ .ContentBaseName }}
+{{ end }}
+```
--- /dev/null
- title: Git Info Variables
- linktitle: Git Variables
+---
- categories: [variables and params]
++title: Git variables
++linkTitle: Git variables
+description: Get the last Git revision information for every content file.
- ## `.GitInfo` Prerequisites
++categories: [variables and parameters]
+keywords: [git]
+menu:
+ docs:
+ parent: variables
+ weight: 70
+weight: 70
+aliases: [/extras/gitinfo/]
+---
+
+{{% note %}}
+Hugo's Git integrations should be fairly performant but *can* increase your build time. This will depend on the size of your Git history.
+{{% /note %}}
+
- ## The `.GitInfo` Object
++## `.GitInfo` prerequisites
+
+1. The Hugo site must be in a Git-enabled directory.
+2. The Git executable must be installed and in your system `PATH`.
+3. The `.GitInfo` feature must be enabled in your Hugo project by passing `--enableGitInfo` flag on the command line or by setting `enableGitInfo` to `true` in your [site's configuration file][configuration].
+
++## The `.GitInfo` object
+
+The `GitInfo` object contains the following fields:
+
+.AbbreviatedHash
+: the abbreviated commit hash (e.g., `866cbcc`)
+
+.AuthorName
+: the author's name, respecting [`.mailmap`](https://git-scm.com/docs/gitmailmap)
+
+.AuthorEmail
+: the author's email address, respecting [`.mailmap`](https://git-scm.com/docs/gitmailmap)
+
+.AuthorDate
+: the author date
+
+.Hash
+: the commit hash (e.g., `866cbccdab588b9908887ffd3b4f2667e94090c3`)
+
+.Subject
+: commit message subject (e.g., `tpl: Add custom index function`)
+
+## `.Lastmod`
+
+If the `.GitInfo` feature is enabled, `.Lastmod` (on `Page`) is fetched from Git i.e. `.GitInfo.AuthorDate`. This behavior can be changed by adding your own [front matter configuration for dates](/getting-started/configuration/#configure-front-matter).
+
+[configuration]: /getting-started/configuration/
--- /dev/null
- title: Menu Variables
+---
- categories: [variables and params]
++title: Menu variables
+description: Use these variables and methods in your menu templates.
++categories: [variables and parameters]
+keywords: [menus]
+menu:
+ docs:
+ parent: variables
+ weight: 50
+weight: 50
+aliases: [/variables/menu/]
+---
+
+## Variables
+
+After [defining menu entries], access their properties in [menu templates] with these variables.
+
+.Children
+: (`menu`) A collection of child menu entries, if any, under the current menu entry.
+
+.Identifier
+: (`string`) The `identifier` property of the menu entry. If you define the menu entry [automatically], the page's `.Section`.
+
+.KeyName
+: (`string`) The `identifier` property of the menu entry, else the `name` property.
+
+.Menu
+: (`string`) The identifier of the menu that contains the menu entry.
+
+.Name
+: (`string`) The `name` property of the menu entry.
+
+- If you define the menu entry [automatically], the page's `.LinkTitle`, else the page's `.Title`.
+- If you define the menu [in front matter] or [in site configuration], falls back to the page's `.LinkTitle`, then to the page's `.Title`.
+
+.Page
+: (`page`) A reference to the page associated with the menu entry.
+
+<!-- This provides no value when rendering menu. Omitting to avoid confusion.
+.PageRef
+: (`string`) The `pageRef` property of the menu entry.
+-->
+
+.Params
+: (`map`) The `params` property of the menu entry.
+
+.Parent
+: (`string`) The `parent` property of the menu entry.
+
+.Post
+: (`template.HTML`) The `post` property of the menu entry.
+
+.Pre
+: (`template.HTML`) The `pre` property of the menu entry.
+
+.Title
+: (`string`) The `title` property of the menu entry.
+
+- If you define the menu entry [automatically], the page's `.LinkTitle`, else the page's `.Title`.
+- If you define the menu [in front matter] or [in site configuration], falls back to the page's `.LinkTitle`, then to the page's `.Title`.
+
+.URL
+: (`string`) The `.RelPermalink` of the page associated with the menu entry. For menu entries pointing to external resources, the `url` property of the menu entry.
+
+.Weight
+: (`int`) The `weight` property of the menu entry.
+
+- If you define the menu entry [automatically], the page's `.Weight`.
+- If you define the menu [in front matter] or [in site configuration], falls back to the page's `.Weight`.
+
+## Methods
+
+.HasChildren
+: (`bool`) Returns `true` if `.Children` is non-nil.
+
+.IsEqual
+: (`bool`) Returns `true` if the compared menu entries represent the same menu entry.
+
+.IsSameResource
+: (`bool`) Returns `true` if the compared menu entries point to the same resource.
+
+.Page.HasMenuCurrent
+: (`bool`) Use this method to determine ancestors of the active menu entry. See [details](/functions/hasmenucurrent/).
+
+.Page.IsMenuCurrent
+: (`bool`) Use this method to determine the active menu entry. See [details](/functions/ismenucurrent/).
+
+[automatically]: /content-management/menus/#define-automatically
+[defining menu entries]: /content-management/menus/#overview
+[in front matter]: /content-management/menus/#define-in-front-matter
+[in site configuration]: /content-management/menus/#define-in-site-configuration
+[menu templates]: /templates/menu-templates/
--- /dev/null
- title: Page Variables
+---
- categories: [variables and params]
++title: Page variables
+description: Page-level variables are defined in a content file's front matter, derived from the content's file location, or extracted from the content body itself.
- ## Page Variables
++categories: [variables and parameters]
+keywords: [pages]
+menu:
+ docs:
+ parent: variables
+ weight: 20
+weight: 20
+toc: true
+---
+
+The following is a list of page-level variables. Many of these will be defined in the front matter, derived from file location, or extracted from the content itself.
+
- ## Writable Page-scoped Variables
++## Page variables
+
+.AlternativeOutputFormats
+: contains all alternative formats for a given page; this variable is especially useful `link rel` list in your site's `<head>`. (See [Output Formats](/templates/output-formats/).)
+
+.Aliases
+: aliases of this page
+
+.Ancestors
+: get the ancestors of each page, simplify [breadcrumb navigation](/content-management/sections#example-breadcrumb-navigation) implementation complexity
+
+.BundleType
+: the [bundle] type: `leaf`, `branch`, or an empty string if the page is not a bundle.
+
+.Content
+: the content itself, defined below the front matter.
+
+.Data
+: the data specific to this type of page.
+
+.Date
+: the date associated with the page; `.Date` pulls from the `date` field in a content's front matter. See also `.ExpiryDate`, `.PublishDate`, and `.Lastmod`.
+
+.Description
+: the description for the page.
+
+.Draft
+: a boolean, `true` if the content is marked as a draft in the front matter.
+
+.ExpiryDate
+: the date on which the content is scheduled to expire; `.ExpiryDate` pulls from the `expirydate` field in a content's front matter. See also `.PublishDate`, `.Date`, and `.Lastmod`.
+
+.File
+: filesystem-related data for this content file. See also [File Variables].
+
+.Fragments
+: Fragments returns the fragments for this page. See [Page Fragments](#page-fragments).
+
+.FuzzyWordCount
+: the approximate number of words in the content.
+
+.IsHome
+: `true` in the context of the [homepage](/templates/homepage/).
+
+.IsNode
+: always `false` for regular content pages.
+
+.IsPage
+: always `true` for regular content pages.
+
+.IsSection
+: `true` if [`.Kind`](/templates/section-templates/#page-kinds) is `section`.
+
+.IsTranslated
+: `true` if there are translations to display.
+
+.Keywords
+: the meta keywords for the content.
+
+.Kind
+: the page's *kind*. Possible return values are `page`, `home`, `section`, `taxonomy`, or `term`. Note that there are also `RSS`, `sitemap`, `robotsTXT`, and `404` kinds, but these are only available during the rendering of each of these respective page's kind and therefore *not* available in any of the `Pages` collections.
+
+.Language
+: a language object that points to the language's definition in the site configuration. `.Language.Lang` gives you the language code.
+
+.Lastmod
+: the date the content was last modified. `.Lastmod` pulls from the `lastmod` field in a content's front matter.
+
+ - If `lastmod` is not set, and `.GitInfo` feature is disabled, the front matter `date` field will be used.
+ - If `lastmod` is not set, and `.GitInfo` feature is enabled, `.GitInfo.AuthorDate` will be used instead.
+
+See also `.ExpiryDate`, `.Date`, `.PublishDate`, and [`.GitInfo`][gitinfo].
+
+.LinkTitle
+: access when creating links to the content. If set, Hugo will use the `linktitle` from the front matter before `title`.
+
+.Next
+: Points up to the next [regular page](/variables/site/#site-pages) (sorted by Hugo's [default sort](/templates/lists#default-weight--date--linktitle--filepath)). Example: `{{ with .Next }}{{ .Permalink }}{{ end }}`. Calling `.Next` from the first page returns `nil`.
+
+.NextInSection
+: Points up to the next [regular page](/variables/site/#site-pages) below the same top level section (e.g. in `/blog`)). Pages are sorted by Hugo's [default sort](/templates/lists#default-weight--date--linktitle--filepath). Example: `{{ with .NextInSection }}{{ .Permalink }}{{ end }}`. Calling `.NextInSection` from the first page returns `nil`.
+
+.OutputFormats
+: contains all formats, including the current format, for a given page. Can be combined the with [`.Get` function](/functions/get/) to grab a specific format. (See [Output Formats](/templates/output-formats/).)
+
+.Pages
+: a collection of associated pages. This value will be `nil` within
+ the context of regular content pages. See [`.Pages`](#pages).
+
+.Permalink
+: the Permanent link for this page; see [Permalinks](/content-management/urls/)
+
+.Plain
+: the Page content stripped of HTML tags and presented as a string. You may need to pipe the result through the [`htmlUnescape`](/functions/htmlunescape/) function when rendering this value with the HTML [output format](/templates/output-formats#output-format-definitions).
+
+.PlainWords
+: the slice of strings that results from splitting .Plain into words, as defined in Go's [strings.Fields](https://pkg.go.dev/strings#Fields).
+
+.Prev
+: Points down to the previous [regular page](/variables/site/#site-pages) (sorted by Hugo's [default sort](/templates/lists#default-weight--date--linktitle--filepath)). Example: `{{ if .Prev }}{{ .Prev.Permalink }}{{ end }}`. Calling `.Prev` from the last page returns `nil`.
+
+.PrevInSection
+: Points down to the previous [regular page](/variables/site/#site-pages) below the same top level section (e.g. `/blog`). Pages are sorted by Hugo's [default sort](/templates/lists#default-weight--date--linktitle--filepath). Example: `{{ if .PrevInSection }}{{ .PrevInSection.Permalink }}{{ end }}`. Calling `.PrevInSection` from the last page returns `nil`.
+
+.PublishDate
+: the date on which the content was or will be published; `.Publishdate` pulls from the `publishdate` field in a content's front matter. See also `.ExpiryDate`, `.Date`, and `.Lastmod`.
+
+.RawContent
+: raw markdown content without the front matter. Useful with [remarkjs.com](
+https://remarkjs.com)
+
+.ReadingTime
+: the estimated time, in minutes, it takes to read the content.
+
+.Resources
+: resources such as images and CSS that are associated with this page
+
+.Ref
+: returns the permalink for a given reference (e.g., `.Ref "sample.md"`). `.Ref` does *not* handle in-page fragments correctly. See [Cross References](/content-management/cross-references/).
+
+.RelPermalink
+: the relative permanent link for this page.
+
+.RelRef
+: returns the relative permalink for a given reference (e.g., `RelRef
+"sample.md"`). `.RelRef` does *not* handle in-page fragments correctly. See [Cross References](/content-management/cross-references/).
+
+.Site
+: see [Site Variables](/variables/site/).
+
+.Sites
+: returns all sites (languages). A typical use case would be to link back to the main language: `<a href="{{ .Sites.First.Home.RelPermalink }}">...</a>`.
+
+.Sites.First
+: returns the site for the first language. If this is not a multilingual setup, it will return itself.
+
+.Summary
+: a generated summary of the content for easily showing a snippet in a summary view. The breakpoint can be set manually by inserting <code><!--more--></code> at the appropriate place in the content page, or the summary can be written independent of the page text. See [Content Summaries](/content-management/summaries/) for more details.
+
+.TableOfContents
+: the rendered [table of contents](/content-management/toc/) for the page.
+
+.Title
+: the title for this page.
+
+.Translations
+: a list of translated versions of the current page. See [Multilingual Mode](/content-management/multilingual/) for more information.
+
+.TranslationKey
+: the key used to map language translations of the current page. See [Multilingual Mode](/content-management/multilingual/) for more information.
+
+.Truncated
+: a boolean, `true` if the `.Summary` is truncated. Useful for showing a "Read more..." link only when necessary. See [Summaries](/content-management/summaries/) for more information.
+
+.Type
+: the [content type](/content-management/types/) of the content (e.g., `posts`).
+
+.Weight
+: assigned weight (in the front matter) to this content, used in sorting.
+
+.WordCount
+: the number of words in the content.
+
- ## Section Variables and Methods
++## Writable page-scoped variables
+
+[.Scratch][scratch]
+: returns a Scratch to store and manipulate data. In contrast to the [`.Store`][store] method, this scratch is reset on server rebuilds.
+
+[.Store][store]
+: returns a Scratch to store and manipulate data. In contrast to the [`.Scratch`][scratch] method, this scratch is not reset on server rebuilds.
+
- ## The `.Pages` Variable {#pages}
++## Section variables and methods
+
+Also see [Sections](/content-management/sections/).
+
+{{< readfile file="/content/en/readfiles/sectionvars.md" markdown="true" >}}
+
- ## Page Fragments
++## The `.Pages` variable {#pages}
+
+`.Pages` is an alias to `.Data.Pages`. It is conventional to use the
+aliased form `.Pages`.
+
+### `.Pages` compared to `.Site.Pages`
+
+{{< getcontent path="readfiles/pages-vs-site-pages.md" >}}
+
- ## Page-level Params
++## Page fragments
+
+{{< new-in "0.111.0" >}}
+
+The `.Fragments` method returns a list of fragments for the current page.
+
+.Headings
+: A recursive list of headings for the current page. Can be used to generate a table of contents.
+
+{{< todo >}}add .Headings toc example{{< /todo >}}
+
+.Identifiers
+: A sorted list of identifiers for the current page. Can be used to check if a page contains a specific identifier or if a page contains duplicate identifiers:
+
+```go-html-template
+{{ if .Fragments.Identifiers.Contains "my-identifier" }}
+ <p>Page contains identifier "my-identifier"</p>
+{{ end }}
+
+{{ if gt (.Fragments.Identifiers.Count "my-identifier") 1 }}
+ <p>Page contains duplicate "my-identifier" fragments</p>
+{{ end }}
+```
+
+.HeadingsMap
+: Holds a map of headings for the current page. Can be used to start the table of contents from a specific heading.
+
+Also see the [Go Doc](https://pkg.go.dev/github.com/gohugoio/hugo@v0.111.0/markup/tableofcontents#Fragments) for the return type.
+
+### Fragments in hooks and shortcodes
+
+`.Fragments` are safe to call from render hooks, even on the page you're on (`.Page.Fragments`). For shortcodes we recommend that all `.Fragments` usage is nested inside the `{{</**/>}}` shortcode delimiter (`{{%/**/%}}` takes part in the ToC creation so it's easy to end up in a situation where you bite yourself in the tail).
+
+
+## The global page function
+
+{{< new-in "0.111.1" >}}
+
+Hugo almost always passes a `Page` as the data context into the top level template (e.g. `single.html`) (the one exception is the multihost sitemap template). This means that you can access the current page with the `.` variable in the template.
+
+But when you're deeply nested inside `.Render`, partial etc., accessing that `Page` object isn't always practical or possible.
+
+For this reason, Hugo provides a global `page` function that you can use to access the current page from anywhere in any template.
+
+```go-html-template
+{{ page.Title }}
+```
+
+There are one caveat with this, and this isn't new, but it's worth mentioning here: There are situations in Hugo where you may see a cached value, e.g. when using `partialCached` or in a shortcode.
+
- ### The `.Param` Method
++## Page-level params
+
+Any other value defined in the front matter in a content file, including taxonomies, will be made available as part of the `.Params` variable.
+
+{{< code-toggle file="content/example.md" fm=true copy=false >}}
+title: Example
+categories: [one]
+tags: [two,three,four]
+{{< /code-toggle >}}
+
+With the above front matter, the `tags` and `categories` taxonomies are accessible via the following:
+
+* `.Params.tags`
+* `.Params.categories`
+
+The `.Params` variable is particularly useful for the introduction of user-defined front matter fields in content files. For example, a Hugo website on book reviews could have the following front matter:
+
+{{< code-toggle file="content/example.md" fm=true copy=false >}}
+title: Example
+affiliatelink: "http://www.my-book-link.here"
+recommendedby: "My Mother"
+{{< /code-toggle >}}
+
+These fields would then be accessible to via `.Params.affiliatelink` and `.Params.recommendedby`.
+
+```go-html-template
+<h3><a href="{{ .Params.affiliatelink }}">Buy this book</a></h3>
+<p>It was recommended by {{ .Params.recommendedby }}.</p>
+```
+
+This template would render as follows:
+
+```html
+<h3><a href="http://www.my-book-link.here">Buy this book</a></h3>
+<p>It was recommended by my Mother.</p>
+```
+
+{{% note %}}
+See [Archetypes](/content-management/archetypes/) for consistency of `Params` across pieces of content.
+{{% /note %}}
+
- In Hugo, you can declare params in individual pages and globally for your entire website. A common use case is to have a general value for the site param and a more specific value for some of the pages (i.e., a header image):
++### The `.Param` method
+
- ### Access Nested Fields in Front Matter
++In Hugo, you can declare parameters in individual pages and globally for your entire website. A common use case is to have a general value for the site parameter and a more specific value for some of the pages (i.e., a header image):
+
+```go-html-template
+{{ $.Param "header_image" }}
+```
+
+The `.Param` method provides a way to resolve a single value according to it's definition in a page parameter (i.e. in the content's front matter) or a site parameter (i.e., in your site configuration).
+
++### Access nested fields in front matter
+
+When front matter contains nested fields like the following:
+
+{{< code-toggle file="content/example.md" fm=true copy=false >}}
+title: Example
+author:
+ given_name: John
+ family_name: Feminella
+ display_name: John Feminella
+{{< /code-toggle >}}
+
+`.Param` can access these fields by concatenating the field names together with a dot:
+
+```go-html-template
+{{ $.Param "author.display_name" }}
+```
+
+[gitinfo]: /variables/git/
+[File Variables]: /variables/files/
+[bundle]: /content-management/page-bundles
+[scratch]: /functions/scratch
+[store]: /functions/store
--- /dev/null
- title: Pages Methods
+---
- categories: [variables and params]
++title: Pages methods
+description: Pages is the core page collection in Hugo and has many useful methods.
++categories: [variables and parameters]
+keywords: [pages]
+menu:
+ docs:
+ parent: variables
+ weight: 21
+weight: 21
+aliases: [/pages]
+toc: true
+---
+
+Also see [List templates](/templates/lists) for an overview of sort methods.
+
+## .Next PAGE
+
+`.Next` and `.Prev` on `Pages` work similar to the methods with the same names on `.Page`, but are more flexible (and slightly slower) as they can be used on any page collection.
+
+`.Next` points **up** to the next page relative to the page sent in as the argument. Example: `{{ with .Site.RegularPages.Next . }}{{ .RelPermalink }}{{ end }}`. Calling `.Next` with the first page in the collection returns `nil`.
+
+## .Prev PAGE
+
+`.Prev` points **down** to the previous page relative to the page sent in as the argument. Example: `{{ with .Site.RegularPages.Prev . }}{{ .RelPermalink }}{{ end }}`. Calling `.Prev` with the last page in the collection returns `nil`.
--- /dev/null
- title: Shortcode Variables
+---
- categories: [variables and params]
++title: Shortcode variables
+description: Shortcodes can access page variables and also have their own specific built-in variables.
- : Contains [filename and position](https://godoc.org/github.com/gohugoio/hugo/common/text#Position) for the shortcode in a page. Note that this can be relatively expensive to calculate, and is meant for error reporting. See [Error Handling in Shortcodes](/templates/shortcode-templates/#error-handling-in-shortcodes).
++categories: [variables and parameters]
+keywords: [shortcodes]
+menu:
+ docs:
+ parent: variables
+ weight: 20
+weight: 20
+---
+
+[Shortcodes][shortcodes] have access to parameters delimited in the shortcode declaration via [`.Get`][getfunction], page- and site-level variables, and also the following shortcode-specific fields:
+
+.Name
+: Shortcode name.
+
+.Ordinal
+: Zero-based ordinal in relation to its parent. If the parent is the page itself, this ordinal will represent the position of this shortcode in the page content.
+
+.Page
+: The owning ´Page`.
+
+.Parent
+: provides access to the parent shortcode context in nested shortcodes. This can be very useful for inheritance of common shortcode parameters from the root.
+
+.Position
++: Contains [file name and position](https://godoc.org/github.com/gohugoio/hugo/common/text#Position) for the shortcode in a page. Note that this can be relatively expensive to calculate, and is meant for error reporting. See [Error Handling in Shortcodes](/templates/shortcode-templates/#error-handling-in-shortcodes).
+
+.IsNamedParams
+: boolean that returns `true` when the shortcode in question uses [named rather than positional parameters][shortcodes]
+
+.Inner
+: represents the content between the opening and closing shortcode tags when a [closing shortcode][markdownshortcode] is used
+
+.Scratch
+: returns a writable [`Scratch`][scratch] to store and manipulate data which will be attached to the shortcode context. This scratch is reset on server rebuilds.
+
+.InnerDeindent {{< new-in "0.100.0" >}}
+: Gets the `.Inner` with any indentation removed. This is what's used in the built-in `{{</* highlight */>}}` shortcode.
+
+[getfunction]: /functions/get/
+[markdownshortcode]: /content-management/shortcodes/#shortcodes-with-markdown
+[shortcodes]: /templates/shortcode-templates/
+[scratch]: /functions/scratch
--- /dev/null
- title: Site Variables
+---
- categories: [variables and params]
++title: Site variables
+description: Many, but not all, site-wide variables are defined in your site's configuration. However, Hugo provides a number of built-in variables for convenient access to global values in your templates.
- ## Get the Site object from a partial
++categories: [variables and parameters]
+keywords: [global,site]
+menu:
+ docs:
+ parent: variables
+ weight: 10
+weight: 10
+aliases: [/variables/site-variables/]
+toc: true
+---
+
+The following is a list of site-level (aka "global") variables. Many of these variables are defined in your site's [configuration file][config], whereas others are built into Hugo's core for convenient usage in your templates.
+
- ## Site Variables List
++## Get the site object from a partial
+
+All the methods below, e.g. `.Site.RegularPages` can also be reached via the global [`site`](/functions/site/) function, e.g. `site.RegularPages`, which can be handy in partials where the `Page` object isn't easily available.
+
- : reference to the homepage's [page object](https://gohugo.io/variables/page/)
++## Site variables list
+
+.Site.AllPages
+: array of all pages, regardless of their translation.
+
+.Site.BaseURL
+: the base URL for the site as defined in the site configuration.
+
+.Site.BuildDrafts
+: a boolean (default: `false`) to indicate whether to build drafts as defined in the site configuration.
+
+.Site.Copyright
+: a string representing the copyright of your website as defined in the site configuration.
+
+.Site.Data
+: custom data, see [Data Templates](/templates/data-templates/).
+
+.Site.DisqusShortname
+: a string representing the shortname of the Disqus shortcode as defined in the site configuration.
+
+.Site.GoogleAnalytics
+: a string representing your tracking code for Google Analytics as defined in the site configuration.
+
+.Site.Home
- ## The `.Site.Params` Variable
++: reference to the homepage's [page object](/variables/page/)
+
+.Site.IsMultiLingual
+: whether there are more than one language in this site. See [Multilingual](/content-management/multilingual/) for more information.
+
+.Site.IsServer
+: a boolean to indicate if the site is being served with Hugo's built-in server. See [`hugo server`](/commands/hugo_server/) for more information.
+
+.Site.Language.Lang
+: the language code of the current locale (e.g., `en`).
+
+.Site.Language.LanguageName
+: the full language name (e.g. `English`).
+
+.Site.Language.Weight
+: the weight that defines the order in the `.Site.Languages` list.
+
+.Site.Language
+: indicates the language currently being used to render the website. This object's attributes are set in site configurations' language definition.
+
+.Site.LanguageCode
+: a string representing the language tag as defined in the site configuration.
+
+.Site.LanguagePrefix
+: this can be used to prefix URLs to point to the correct language. It will even work when only one defined language. See also the functions [absLangURL](/functions/abslangurl/) and [relLangURL](/functions/rellangurl).
+
+.Site.Languages
+: an ordered list (ordered by defined weight) of languages.
+
+.Site.LastChange
+: a string representing the date/time of the most recent change to your site. This string is based on the [`date` variable in the front matter](/content-management/front-matter) of your content pages.
+
+.Site.Menus
+: all the menus in the site.
+
+.Site.Pages
+: array of all content ordered by Date with the newest first. This array contains only the pages in the current language. See [`.Site.Pages`](#site-pages).
+
+.Site.RegularPages
+: a shortcut to the *regular* page collection. `.Site.RegularPages` is equivalent to `where .Site.Pages "Kind" "page"`. See [`.Site.Pages`](#site-pages).
+
+.Site.Sections
+: top-level directories of the site.
+
+.Site.Taxonomies
+: the [taxonomies](/content-management/taxonomies/) for the entire site. Also see section [Access taxonomy data from any template](/variables/taxonomy/#access-taxonomy-data-from-any-template).
+
+.Site.Title
+: a string representing the title of the site.
+
- The following `config.[yaml|toml|json]` defines a site-wide param for `description`:
++## The `.Site.Params` variable
+
+`.Site.Params` is a container holding the values from the `params` section of your site configuration.
+
+### Example: `.Site.Params`
+
- ## The `.Site.Pages` Variable {#site-pages}
++The following `config.[yaml|toml|json]` defines a site-wide parameter for `description`:
+
+{{< code-toggle file="hugo" >}}
+baseURL = "https://yoursite.example.com/"
+
+[params]
+ description = "Tesla's Awesome Hugo Site"
+ author = "Nikola Tesla"
+{{</ code-toggle >}}
+
+You can use `.Site.Params` in a [partial template](/templates/partials/) to call the default site description:
+
+{{< code file="layouts/partials/head.html" >}}
+<meta name="description" content="{{ if .IsHome }}{{ $.Site.Params.description }}{{ else }}{{ .Description }}{{ end }}" />
+{{< /code >}}
+
++## The `.Site.Pages` variable {#site-pages}
+
+### `.Site.Pages` compared to `.Pages`
+
+{{< getcontent path="readfiles/pages-vs-site-pages.md" >}}
+
+[config]: /getting-started/configuration/
--- /dev/null
- title: Sitemap Variables
- linktitle: Sitemap Variables
+---
- categories: [variables and params]
++title: Sitemap variables
+description:
- : the sitemap filename
++categories: [variables and parameters]
+keywords: [sitemap]
+menu:
+ docs:
+ parent: variables
+ weight: 80
+weight: 80
+---
+
+A sitemap is a `Page` and therefore has all the [page variables][pagevars] available to use sitemap templates. They also have the following sitemap-specific variables available to them:
+
+.Sitemap.ChangeFreq
+: the page change frequency
+
+.Sitemap.Priority
+: the priority of the page
+
+.Sitemap.Filename
++: the sitemap file name
+
+[pagevars]: /variables/page/
--- /dev/null
- title: Taxonomy Variables
+---
- categories: [variables and params]
++title: Taxonomy variables
+description: Hugo's taxonomy system exposes variables to taxonomy and term templates.
++categories: [variables and parameters]
+keywords: [taxonomy,term]
+menu:
+ docs:
+ parent: variables
+ weight: 30
+toc: true
+weight: 30
+---
+
+## Taxonomy templates
+
+Pages rendered by taxonomy templates have `.Kind` set to `taxonomy` and `.Type` set to the taxonomy name.
+
+In taxonomy templates you may access `.Site`, `.Page`. `.Section`, and `.File` variables, as well as the following _taxonomy_ variables:
+
+.Data.Singular
+: The singular name of the taxonomy (e.g., `tags => tag`).
+
+.Data.Plural
+: The plural name of the taxonomy (e.g., `tags => tags`).
+
+.Data.Pages
+: The collection of term pages related to this taxonomy. Aliased by `.Pages`.
+
+.Data.Terms
+: A map of terms and weighted pages related to this taxonomy.
+
+.Data.Terms.Alphabetical
+: A map of terms and weighted pages related to this taxonomy, sorted alphabetically in ascending order. Reverse the sort order with`.Data.Terms.Alphabetical.Reverse`.
+
+.Data.Terms.ByCount
+: A map of terms and weighted pages related to this taxonomy, sorted by count in ascending order. Reverse the sort order with`.Data.Terms.ByCount.Reverse`.
+
+## Term templates
+
+Pages rendered by term templates have `.Kind` set to `term` and `.Type` set to the taxonomy name.
+
+In term templates you may access `.Site`, `.Page`. `.Section`, and `.File` variables, as well as the following _term_ variables:
+
+.Data.Singular
+: The singular name of the taxonomy (e.g., `tags => tag`).
+
+.Data.Plural
+: The plural name of the taxonomy (e.g., `tags => tags`).
+
+.Data.Pages
+: The collection of content pages related to this taxonomy. Aliased by `.Pages`.
+
+.Data.Term
+: The term itself (e.g., `tag-one`).
+
+## Access taxonomy data from any template
+
+Access the entire taxonomy data structure from any template with `site.Taxonomies`. This returns a map of taxonomies, terms, and a collection of weighted content pages related to each term. For example:
+
+```json
+{
+ "categories": {
+ "news": [
+ {
+ "Weight": 0,
+ "Page": {
+ "Title": "Post 1",
+ "Date": "2022-12-18T15:13:35-08:00"
+ ...
+ }
+ },
+ {
+ "Weight": 0,
+ "Page": {
+ "Title": "Post 2",
+ "Date": "2022-12-18T15:13:46-08:00",
+ ...
+ }
+ }
+ ]
+ },
+ "tags": {
+ "international": [
+ {
+ "Weight": 0,
+ "Page": {
+ "Title": "Post 1",
+ "Date": "2021-01-01T00:00:00Z"
+ ...
+ }
+ }
+ ]
+ }
+}
+```
+
+Access a subset of the taxonomy data structure by chaining one or more identifiers, or by using the [`index`] function with one or more keys. For example, to access the collection of weighted content pages related to the news category, use either of the following:
+
+[`index`]: /functions/index-function/
+
+```go-html-template
+{{ $pages := site.Taxonomies.categories.news }}
+{{ $pages := index site.Taxonomies "categories" "news" }}
+```
+
+For example, to render the entire taxonomy data structure as a nested unordered list:
+
+```go-html-template
+<ul>
+ {{ range $taxonomy, $terms := site.Taxonomies }}
+ <li>
+ {{ with site.GetPage $taxonomy }}
+ <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
+ {{ end }}
+ <ul>
+ {{ range $term, $weightedPages := $terms }}
+ <li>
+ {{ with site.GetPage (path.Join $taxonomy $term) }}
+ <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
+ {{ end }}
+ </li>
+ <ul>
+ {{ range $weightedPages }}
+ <li>
+ <a href="{{ .RelPermalink }}"> {{ .LinkTitle }}</a>
+ </li>
+ {{ end }}
+ </ul>
+ {{ end }}
+ </ul>
+ </li>
+ {{ end }}
+</ul>
+```
+
+See [Taxonomy Templates] for more examples.
+
+[Taxonomy Templates]: /templates/taxonomy-templates/
--- /dev/null
- require github.com/gohugoio/gohugoioTheme v0.0.0-20230527124826-78bc315d7b8a // indirect
+module github.com/gohugoio/hugoDocs
+
+go 1.16
+
++require github.com/gohugoio/gohugoioTheme v0.0.0-20230630055807-9874cd863bc5 // indirect
--- /dev/null
+github.com/gohugoio/gohugoioTheme v0.0.0-20190808163145-07b3c0f73b02/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20191014144142-1f3a01deed7b h1:PWNjl46fvtz54PKO0BdiXOF6/4L/uCP0F3gtcCxGrJs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20191014144142-1f3a01deed7b/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20191021162625-2e7250ca437d h1:D3DcaYkuJbotdWNNAQpQl37txX4HQ6R5uMHoxVmTw0w=
+github.com/gohugoio/gohugoioTheme v0.0.0-20191021162625-2e7250ca437d/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123151337-9475fd449324 h1:UZwHDYtGY0uOKIvcm2LWd+xfFxD3X5L222LIJdI5RE4=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123151337-9475fd449324/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123204146-589b4c309025 h1:ScYFARz+bHX1rEr1donVknhRdxGY/cwqK1hHvWEfrlc=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123204146-589b4c309025/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123205007-5d6620a0db26 h1:acXfduibbWxji9tW0WkLHbjcXFsnd5uIwXe0WfwOazg=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200123205007-5d6620a0db26/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200128164921-1d0bc5482051 h1:cS14MnUGS6xwWYfPNshimm8HdMCZiYBxWkCD0VnvgVw=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200128164921-1d0bc5482051/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200327225449-368f4cbef8d7 h1:cZ+ahAjSetbFv3aDJ9ipDbKyqaVlmkbSZ5cULgBTh+w=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200327225449-368f4cbef8d7/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200327231942-7f80b3d02bfa h1:kG+O/wT9UXomzp5eQiUuFVZ0l7YylAW6EVPLyjMxi/c=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200327231942-7f80b3d02bfa/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200328100657-2bfd5f8c6aee h1:PJZhCwnuVLyafDWNPSHk9iJvk6gEIvPRnycy7Pq3peA=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200328100657-2bfd5f8c6aee/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200518164958-62cbad03c40f h1:Ge3JACszSUyJW2Az9cJzWdo4PUqdijJA1RxoQSVMBSI=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200518164958-62cbad03c40f/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200518165806-0095b7b902a7 h1:Sy0hlWyZmFtdSY0Cobvw1ZYm3G1aR5+4DuFNRbMkh48=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200518165806-0095b7b902a7/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200711112515-b0dfe471654f h1:BWJyycs4HD7tUbaU8RIGeMay84bIBWRVVLE3yajPas4=
+github.com/gohugoio/gohugoioTheme v0.0.0-20200711112515-b0dfe471654f/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20210301124928-2c15837dfec3 h1:ShqzOFeeg54FPSuS6q8HSeTVgj2xNZRe/YS0jNbi21g=
+github.com/gohugoio/gohugoioTheme v0.0.0-20210301124928-2c15837dfec3/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20210409065807-6383d8cbaf65 h1:EJzierSWKqwsrUXU6MaFe0J97c0e5pzl5dBNRRrV2Nc=
+github.com/gohugoio/gohugoioTheme v0.0.0-20210409065807-6383d8cbaf65/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20210409071416-c88da48134b7 h1:uRCgPslaBgLYy4ANXBoPbBQVM8aNiHoxIZTKUXpkuUA=
+github.com/gohugoio/gohugoioTheme v0.0.0-20210409071416-c88da48134b7/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20211211125852-b85e21c1f3d6 h1:lAgdWrn8VEg0PrNCPX4DflCg2msDKpSYV6E8RTNV3N0=
+github.com/gohugoio/gohugoioTheme v0.0.0-20211211125852-b85e21c1f3d6/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20220228085601-7cfbda06d135 h1:6hVzfE9YhSsZP5t6jWjvVp7MoPm7Y5fEhH/ls4ahhKk=
+github.com/gohugoio/gohugoioTheme v0.0.0-20220228085601-7cfbda06d135/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20220905093719-cb8b64046950 h1:Ovlh3nuy/aNptYZHmIra2MP+ZUEqiihY0HxvhdaMqGg=
+github.com/gohugoio/gohugoioTheme v0.0.0-20220905093719-cb8b64046950/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20220912070954-88dcaf003b4d h1:UYJL6RmEepprvlgHvDnFCWtPOvjmqzFCQ90cRDRBO7U=
+github.com/gohugoio/gohugoioTheme v0.0.0-20220912070954-88dcaf003b4d/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20220914071648-0ef1c51685bf h1:A8Ksnvp8reNt2Ap0mUK7gFkJkCjt9R60yopGsezcOBA=
+github.com/gohugoio/gohugoioTheme v0.0.0-20220914071648-0ef1c51685bf/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221116211530-5ae8dcdd68d6 h1:eG53kL1LkQuKmrDdzbvvx6d60qM07zp2Wjo/tYxkDOY=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221116211530-5ae8dcdd68d6/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221118083537-967e29e21382 h1:e30rl1dxWkYOcgdl0omeOK0HBzgDLI/b9MfYHrINjzU=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221118083537-967e29e21382/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221124154621-1451a01f406b h1:TRrIisSY7ckt9FVHOOQtmKG4jsnORCYn72UMvMu+IQ0=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221124154621-1451a01f406b/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221206093948-1408550ab675 h1:wjpYa1cTELeceWndBDV7IG2vRxRWICBBO79HObOfTtk=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221206093948-1408550ab675/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221217122332-1c1752ad8f14 h1:K6tPFpi7W0zb89QIf+lNdgdTXfDFemU6NKk46MlX9lQ=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221217122332-1c1752ad8f14/go.mod h1:kpw3SS48xZvLQGEXKu8u5XHgXkPvL8DX3oGa07+z8Bs=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221220160735-8ffa1ef883b6 h1:yEoQecRBoLGfc7yTybMD3Mhm03bTScZFYPvwe0p75vA=
+github.com/gohugoio/gohugoioTheme v0.0.0-20221220160735-8ffa1ef883b6/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230109120406-12694c4a9456 h1:RSLItaapVjWkqSdQhumAmJkodFDbWMGNZmkVW/AFx0c=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230109120406-12694c4a9456/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230119103504-3bcd960d6f1b h1:i/iaEOOuR1mKRR0qUOET587ooVhG8c2tllpA5HsrWNU=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230119103504-3bcd960d6f1b/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230120185049-2c3c4d0ba232 h1:bEojKgKInbsLkID5Arh95vP4+0xydtn/+ayT6I8vkiU=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230120185049-2c3c4d0ba232/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230124135550-462d5fe4a87f h1:8wI3zOTWQG15aKkbAZQaoGnUQff46hO95opQndBHRE4=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230124135550-462d5fe4a87f/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230330081257-7a8c9614432c h1:TyHgmowfiMyxKrqTdRxm/yWIFeN7XRh7Hm6/dOG6yDA=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230330081257-7a8c9614432c/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230418063032-99f9185b8e11 h1:mDcricMewd66x8QjKqNun7Div7iYVLtl8s1dVs9VnB8=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230418063032-99f9185b8e11/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230527124826-78bc315d7b8a h1:ruyA3QZ4Ym0fBLhTW2eoUSvHUaj2xWqaPHIbaI+tbZo=
+github.com/gohugoio/gohugoioTheme v0.0.0-20230527124826-78bc315d7b8a/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
++github.com/gohugoio/gohugoioTheme v0.0.0-20230615111426-c3725d921127 h1:LaOUdx1uo/Pr8Vr9KbqTwioia9OhNSiZDOHQGNHZiOs=
++github.com/gohugoio/gohugoioTheme v0.0.0-20230615111426-c3725d921127/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
++github.com/gohugoio/gohugoioTheme v0.0.0-20230615131407-b3235557d2e6 h1:x/1M3CJRXCNfThsT+EeWrC2B1qFQZSCeOgA44RJJ5ds=
++github.com/gohugoio/gohugoioTheme v0.0.0-20230615131407-b3235557d2e6/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
++github.com/gohugoio/gohugoioTheme v0.0.0-20230624091215-084560177ddc h1:BX7s0bvHFjx5Dll+9CBEiphSjWCDmZ1S+vOrB2wjpOg=
++github.com/gohugoio/gohugoioTheme v0.0.0-20230624091215-084560177ddc/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
++github.com/gohugoio/gohugoioTheme v0.0.0-20230630055807-9874cd863bc5 h1:5QDXCq7G6Ak13EKF69QIJtH2YhidilBetNDgdoBYsWM=
++github.com/gohugoio/gohugoioTheme v0.0.0-20230630055807-9874cd863bc5/go.mod h1:GOYeAPQJ/ok8z7oz1cjfcSlsFpXrmx6VkzQ5RpnyhZM=
--- /dev/null
- Also see [Module Mounts Config](/hugo-modules/configuration/#module-config-mounts) for an alternative way to configure this directory (from Hugo 0.56).
++Also see [Module Mounts Config](/hugo-modules/configuration/#module-configuration-mounts) for an alternative way to configure this directory (from Hugo 0.56).
--- /dev/null
- HUGO_VERSION = "0.113.0"
+[build]
+publish = "public"
+command = "hugo --gc --minify"
+
+[context.production.environment]
- HUGO_VERSION = "0.113.0"
++HUGO_VERSION = "0.115.4"
+HUGO_ENV = "production"
+HUGO_ENABLEGITINFO = "true"
+
+[context.split1]
+command = "hugo --gc --minify --enableGitInfo"
+
+[context.split1.environment]
- HUGO_VERSION = "0.113.0"
++HUGO_VERSION = "0.115.4"
+HUGO_ENV = "production"
+
+[context.deploy-preview]
+command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
+
+[context.deploy-preview.environment]
- HUGO_VERSION = "0.113.0"
++HUGO_VERSION = "0.115.4"
+
+[context.branch-deploy]
+command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
+
+[context.branch-deploy.environment]
++HUGO_VERSION = "0.115.4"
+
+[context.next.environment]
+HUGO_ENABLEGITINFO = "true"
+
+[[redirects]]
+from = "/npmjs/*"
+to = "/npmjs/"
+status = 200