hugoplate Documentation

repository·main·Indexed 23 days ago

https://github.com/zeon-studio/hugoplate

A Hugo and Tailwind CSS v4.0 starter template featuring pre-designed pages, dark mode, search, and multi-author support. Includes guides on installation, site configuration via hugo.toml and params.toml, and usage of built-in shortcodes for buttons, notices, tabs, accordions, galleries, and video embeds. Supports deployment to Netlify, Vercel, GitHub Actions, GitLab CI, and AWS Amplify.

Tokens
3.5K
Snippets
15
Records
18
Agent score
82%

What's inside hugoplate

  1. Install and Setup Hugoplate

    main

    To start a new project with Hugoplate, follow these steps in order:

    1. Clone or download the repository.
    2. Run Project Setup: This custom script creates a new Hugo theme folder, clones the Hugoplate theme into it, and moves the exampleSite folder to the root so you can start the server immediately.
    3. Install Dependencies: Install the necessary Node.js packages.
    4. Start Development: Run the local development server.

    Prerequisites

    Ensure your machine has the following installed:

    • Hugo Extended v0.144+
    • Node.js v22+
    • Go v1.24+
  2. Build and Deploy Hugoplate

    main

    Local Build

    To generate a static version of your site locally, run:

    npm run build

    This creates a public folder containing your static assets.

    Deployment

    • Pre-configured Platforms: The template includes configurations for Netlify, Vercel, GitHub Actions, GitLab CI, and AWS Amplify.
    • Manual Hosting: You can copy the contents of the public folder to any hosting provider.

    CRITICAL: You must update the baseURL in your hugo.toml file before deploying, otherwise the site will not function correctly.

  3. Customize Site Configuration and Parameters

    main

    Hugoplate provides several files for easy customization without modifying core logic:

    • Site Config: Edit hugo.toml to change the site title, base URL, language, theme, and plugins.
    • Site Params: Edit config/_default/params.toml to customize the logo, favicon, search settings, and SEO metadata.
    • Colors and Fonts: Edit data/theme.json to change the primary/secondary colors, font family, and font size.
    • Social Links: Edit data/social.json to add social media links which will automatically appear on the site.
  4. Create a blog post using Front Matter

    main

    Blog posts in hugoplate are created as Markdown files within the content directory (e.g., content/english/blog/). To configure post metadata such as titles, dates, and categories, use a YAML Front Matter block at the top of the file.

    Supported Front Matter keys include:

    • title: The display title of the post.
    • meta_title: An optional SEO meta title.
    • description: A meta description for search engines.
    • date: The publication date in ISO 8601 format.
    • image: Path to the featured image (relative to the public folder).
    • categories: An array of category strings.
    • author: The name of the post author.
    • tags: An array of tag strings.
    • draft: A boolean to indicate if the post should be excluded from production builds.
    ---
    title: "How to build an Application with modern Technology"
    meta_title: ""
    description: "this is meta description"
    date: 2022-04-04T05:00:00Z
    image: "/images/image-placeholder.png"
    categories: ["Application", "Data"]
    author: "John Doe"
    tags: ["nextjs", "tailwind"]
    draft: false
    ---
    
    ## Creative Design
    
    Nam ut rutrum ex, venenatis sollicitudin urna...
  5. Configure the Testimonial section

    main

    The Testimonial section is a content-driven component in Hugoplate. You can enable or disable it and populate it with user testimonials using Front Matter in a Markdown file.

    To use this section, create or edit a Markdown file (typically within content/.../sections/) and configure the following keys:

    • enable: Set to true to display the section.
    • title: The heading for the testimonial section.
    • description: A sub-heading or descriptive text for the section.
    • testimonials: A list of testimonial objects, each containing:
      • name: The name of the person providing the testimonial.
      • designation: The person's job title or role.
      • avatar: The path to the person's profile image.
      • content: The actual testimonial text.
    • build.render: Set to "never" if you want to use this file strictly as a data source for a section without generating a standalone webpage for it.
    ---
    enable: true
    title: "What Users Are Saying About Hugoplate"
    description: "Don't just take our word for it..."
    
    testimonials:
      - name: "Marvin McKinney"
        designation: "Web Designer"
        avatar: "/images/avatar-sm.png"
        content: "Lorem ipsum dolor sit amet..."
    
    build:
      render: "never"
    ---
  6. Configure page Front Matter for the 'about' layout

    main

    When creating an 'About' page in hugoplate, use the following Front Matter keys in your Markdown file to control SEO, imagery, and the specific page layout.

    • title: The main heading displayed on the page.
    • meta_title: The title used for SEO/browser tabs.
    • description: The meta description for search engines.
    • image: Path to the featured image (e.g., /images/image-placeholder.png).
    • layout: Set this to "about" to use the specific About page template.
    • draft: Set to false to ensure the page is published.
    ---
    title: "Hey, I am John Doe!"
    meta_title: "About"
    description: "this is meta description"
    image: "/images/image-placeholder.png"
    layout: "about"
    draft: false
    ---
    
    ### This is a title
    
    * Lorem ipsum, dolor sit amet
    * Enim voluptatem dicta expedita veritatis
  7. Configure the Call-to-Action (CTA) section

    main

    The Call-to-Action section is a content block that can be enabled or disabled via its front matter. When enabled, it displays a title, an image, a description, and an optional button.

    To prevent Hugo from generating a standalone page for this content file, set build.render to "never". This ensures the section is treated as a reusable component rather than a discrete page in the site hierarchy.

    enable: true
    title: "Ready to build your next project with Hugo?"
    image: "/images/call-to-action.png"
    description: "Experience the future of web development with Hugoplate and Hugo."
    button:
      enable: true
      label: "Fork Deploy and Edit Online 🚀"
      link: "https://example.com"
    
    # prevents the creation of a separate page
    build:
      render: "never"
  8. Use the slider shortcode

    main

    Display images in a slider format using the {{< slider >}} shortcode.

    Parameters:

    • dir: The directory containing the images.
    • class: CSS classes.
    • height: Slider height.
    • width: Slider width.
    • webp: Boolean to enable WebP.
    • command: Image processing command (e.g., Fit).
    • option: Image processing option.
    • zoomable: Boolean to enable zooming.
    {{< slider dir="images/gallery" class="max-w-[600px] ml-0" height="400" width="400" webp="true" command="Fit" option="" zoomable="true" >}}
  9. Embed custom videos

    main

    Embed a video from a direct URL using the {{< video >}} shortcode.

    Parameters:

    • src: The video URL.
    • width: Video width.
    • height: Video height.
    • autoplay: Boolean.
    • loop: Boolean.
    • muted: Boolean.
    • controls: Boolean.
    • class: CSS classes.
    {{< video src="https://www.w3schools.com/html/mov_bbb.mp4" width="100%" height="auto" autoplay="false" loop="false" muted="false" controls="true" class="rounded-lg" >}}
  10. Use the gallery shortcode

    main

    Display a collection of images in a gallery using the {{< gallery >}} shortcode.

    Parameters:

    • dir: The directory containing the images.
    • class: CSS classes.
    • height: Gallery height.
    • width: Gallery width.
    • webp: Boolean to enable WebP.
    • command: Image processing command (e.g., Fit).
    • option: Image processing option.
    • zoomable: Boolean to enable zooming.
    {{< gallery dir="images/gallery" class="" height="400" width="400" webp="true" command="Fit" option="" zoomable="true" >}}