3. Add Pages

Customize the homepage, add a blog post, and add a documentation page.

On this page

Customize the homepage

Open ./layouts/index.html in your code editor.

Sections

The homepage consists of three sections:

Landing page layout

In index.html:

  1. {{ define "main" }}
  2. ..
  3. {{ end }}
  4. {{ define "sidebar-prefooter" }}
  5. ..
  6. {{ end }}
  7. {{ define "sidebar-footer" }}
  8. ..
  9. {{ end }}

Per section, you can customize the layout:

  1. optionally, add a section element
  2. add a container
  3. add a grid

Components

Within a grid, you can use components like buttons, forms, or cards. See the Bootstrap documentation for all available components.

Example

  1. {{ define "sidebar-prefooter" }}
  2. <section class="section section-sm">
  3. <div class="container">
  4. <div class="row justify-content-center text-center mt-lg-3">
  5. <div class="col-lg-5">
  6. <h2 class="h4">Full text search</h2>
  7. <p>Search your Doks site with FlexSearch. Easily customize index settings and search options to your liking.</p>
  8. </div>
  9. <div class="col-lg-5">
  10. <h2 class="h4">Page layouts</h2>
  11. <p>Build pages with a landing page, blog, or documentation layout. Add custom sections and components to suit your needs.</p>
  12. </div>
  13. <div class="col-lg-5">
  14. <h2 class="h4">Dark mode</h2>
  15. <p>Switch to a low-light UI with the click of a button. Change colors with variables to match your branding.</p>
  16. </div>
  17. </div>
  18. </div>
  19. </section>
  20. {{ end }}

Add a blog post

Add a blog post using the npm run create command.

Example

  1. npm run create blog/say-hello-to-doks/index.md

index.md

  1. ---
  2. title: "Say hello to Doks 👋"
  3. description: "Introducing Doks, a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default."
  4. lead: "Introducing Doks, a Hyas theme build by the creator of Hyas. Doks helps you build modern documentation websites that are secure, fast, and SEO-ready — by default."
  5. date: 2020-11-04T09:19:42+01:00
  6. lastmod: 2020-11-04T09:19:42+01:00
  7. draft: false
  8. weight: 50
  9. images: ["say-hello-to-doks.png"]
  10. contributors: ["Henk Verlinde"]
  11. ---
  12. ## Solid as a rock
  13. Some website projects require a solid starting point. With a great developer experience and a sound user experience. Sometimes you just dont want to start from scratch. Thats why I created Hyas 💚

Result

Say hello to Doks

Add a documentation page

Add a documentation page using the npm run create command.

Example

  1. npm run create docs/prologue/introduction/index.md

index.md

  1. ---
  2. title: "Introduction"
  3. description: "Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default."
  4. lead: "Doks is a Hugo theme helping you build modern documentation websites that are secure, fast, and SEO-ready — by default."
  5. date: 2020-10-06T08:48:57+00:00
  6. lastmod: 2020-10-06T08:48:57+00:00
  7. draft: false
  8. images: []
  9. menu:
  10. docs:
  11. parent: "prologue"
  12. weight: 010
  13. toc: true
  14. ---
  15. ## Get started
  16. There are two main ways to get started with Doks:
  17. ..

Result

Add documentation page