Build Websites with Hugo

Book description

Database-driven sites bring complexity you might not need, but building a site by hand is too much work. Hugo is a static site generator and web development framework that creates content sites quickly without the overhead or dependencies of a dyanmic web framework. With Hugo, you use HTML templates and Markdown to build static sites you can host anywhere, letting you use the skills you already have.

Develop your own theme using standard HTML and CSS, using Hugo’s powerful templating features to organize your site’s components. Create your site’s content with HTML or Markdown and use Hugo’s content templating features to build new content quickly. Build a fully-featured blog with archive pages, tagging, and pagination, and integrate an external commenting system to provide interactivity. Use data from front-matter, site-wide configuration, and external JSON sources to add content, and generate JSON others can use. Integrate JavaScript with your site to create a search engine. Get Hugo working with Webpack so you can leverage the wider web development ecosystem, and explore ways to publish your site to various services. Finally, learn how you can move your existing content site to Hugo.

Dive in and build your next site with Hugo!

Publisher resources

View/Submit Errata

Table of contents

  1.  Acknowledgments
  2.  Preface
    1. What’s in This Book
    2. What You Need
    3. Conventions
    4. Online Resources
  3. 1. Kicking the Tires
    1. Installing Hugo
    2. Creating Your Site
    3. Building the Home Page
    4. Creating Content Using Archetypes
    5. Building and Exploring Hugo’s Output
    6. Your Turn
    7. Wrapping Up
  4. 2. Building a Basic Theme
    1. Generating the Theme
    2. Using Content Blocks and Partials
    3. Styling the Theme with CSS
    4. Your Turn
    5. Wrapping Up
  5. 3. Adding Content Sections
    1. Creating a Project Archetype
    2. Creating the List Layout
    3. Creating More Specific Layouts
    4. Adding Content to List Pages
    5. Customizing the Project List
    6. Your Turn
    7. Wrapping Up
  6. 4. Working with Data
    1. Using Site Configuration Data in Your Theme
    2. Populating Page Content Using Data in Front Matter
    3. Conditionally Displaying Data
    4. Using Local Data Files
    5. Pulling Data from Remote Sources
    6. Syndicating Content with RSS
    7. Rendering Content as JSON
    8. Your Turn
    9. Wrapping Up
  7. 5. Adding a Blog
    1. Creating the Post’s Layout
    2. Organizing Content with Taxonomies
    3. Customizing the URL for Posts
    4. Customizing Blog List Pages
    5. Adding Pagination
    6. Adding Comments to Posts Using Disqus
    7. Displaying Related Content
    8. Your Turn
    9. Wrapping Up
  8. 6. Adding Search to Your Site
    1. Creating the Document Collection
    2. Creating the Search Interface
    3. Improving the Search
    4. Your Turn
    5. Wrapping Up
  9. 7. Managing Assets with Pipes
    1. Managing Stylesheets
    2. Managing Images
    3. Bundling JavaScript Files
    4. Using Webpack and npm with Hugo
    5. Your Turn
    6. Wrapping Up
  10. 8. Deploying the Site
    1. Deploying to Netlify
    2. Deploying to Cloud Storage with Hugo
    3. Deploying to a Traditional Web Server
    4. Your Turn
    5. Wrapping Up
  11. A1. Migrating to Hugo
    1. Understanding What You Have
    2. Transferring the Content
    3. Replicating the Theme
    4. Making the Switch
    5. Wrapping Up
  12.  Bibliography

Product information

  • Title: Build Websites with Hugo
  • Author(s): Brian P. Hogan
  • Release date: May 2020
  • Publisher(s): Pragmatic Bookshelf
  • ISBN: 9781680507263