Create Website


Use this guide to turn your source material into a live-ready site with a single command. You will inspect the available aigne web generate flags, approve the AI-generated sitemap, and understand where the finished pages land on disk.

If you need a quick reference to every flag and alias, run aigne web -h; the sample output below is what you should see.

Output of aigne web -h, showing available flags and aliases

Creation Workflow#

The aigne web generate command initiates the entire website creation process. It reads your configuration, analyzes your source materials, plans the website's structure, generates content for each page, and assembles the final files.

Usage#

To run the generation process, execute the following command in your terminal:

Create Website

aigne web generate

You can also use the aliases gen or g:

Create Website

aigne web gen

What Happens During Generate#

When you run the generate command, WebSmith performs the following sequence of operations:

  1. Load Configuration: It first looks for and loads the config.yaml file to understand your high-level requirements. If this file doesn't exist, it will automatically initiate a guided setup to create one.
  2. Analyze Sources: The AI scans the documents, markdown files, and other materials specified in the sourcesPath of your configuration to understand the subject matter.
  3. Plan Website Structure: Based on the purpose, audience, and source content, the AI proposes a logical sitemap for your website, outlining all the pages and their hierarchy. You will be prompted to review and approve this structure before content generation begins.

Reviewing the proposed site structure before approving generation

  1. Generate Page Content: For each page in the approved structure, the AI generates detailed content, including titles, descriptions, and sections composed of professional components like hero banners, feature lists, and FAQs.
  2. Save Website Files: The final, structured content for each page is saved as YAML files in the directory specified by pagesDir in your configuration. These files are now ready for publishing.

Generation run summary showing successful output and next steps

Parameters#

The generate command accepts several optional parameters to customize its behavior.

glossary
string

Specifies the path to a glossary file (e.g., @glossary.md). This ensures that project-specific terms are used consistently throughout the generated content.

forceRegenerate
boolean

If set to true, the command will regenerate all pages from scratch, overwriting any previously generated files. This is useful after making significant changes to the config.yaml file or your source documents.

Example with parameters:

Regenerate Website

# Regenerate the entire website using a glossary file
aigne web generate --forceRegenerate --glossary "@glossary.md"

The Configuration File (config.yaml)#

The config.yaml file is the blueprint for your website. It provides the AI with the necessary context and constraints to build a site that meets your specific needs. This file defines the project, the site's purpose and audience, language settings, and file locations.

Below is a detailed breakdown of the key properties within the config.yaml file.

Configuration Options#

projectName
string
required

The name of your project or website. This is used for metadata and publishing.

projectDesc
string

A brief description of your project.

projectLogo
string

A URL or local path to your project's logo.

pagePurpose
array
required

An array of strings defining the website's primary goals. Examples: landingPage, ecommerce, portfolio, corporate, blog, saas, nonprofit, education, mixedPurpose.

targetAudienceTypes
array
required

An array of strings identifying the primary audience. Examples: customers, businessOwners, marketers, designers, developers, investors, jobSeekers, students, generalPublic.

websiteScale
string
required

Defines the desired size and complexity of the website. Options include singlePage, minimal, standard, comprehensive, and aiDecide.

rules
string

A field for any custom rules or specific instructions for the AI to follow during generation, such as tone of voice, content to exclude, or specific points to emphasize.

locale
string
required
default:en

The primary language for the website content, specified by a language code (e.g., en, zh, es).

translateLanguages
array

A list of language codes to translate the website into. For example, ['zh', 'fr'].

pagesDir
string
required

The local directory path where the generated website page files will be saved.

sourcesPath
array
required

An array of file paths or glob patterns that point to your source content. The AI will analyze these files to generate the website.

Example config.yaml#

Here is an example of a complete config.yaml file with comments explaining each section.

config.yaml

# Project information for page publishing
projectName: AIGNE WebSmith
projectDesc: AI-driven website generation tool
projectLogo: https://www.aigne.io/image-bin/uploads/bc5afab4e6d282cc7f4aa444e9b9f7f4.svg
projectId: aigne-websmith-docs
projectSlug: aigne-websmith

# =============================================================================
# Website Configuration
# =============================================================================

# Purpose: What's the main outcome you want readers to achieve?
# Available options (uncomment and modify as needed):
#   landingPage     - Landing page / Homepage: Convert visitors into users or customers
#   ecommerce       - E-commerce / Online store: Sell products or services online
#   portfolio       - Portfolio / Showcase: Display creative work, projects, or achievements
#   corporate       - Corporate / Business: Professional business website with company information
#   blog            - Blog / Content site: Share articles, news, and regular content updates
#   saas            - SaaS / Software product: Promote and onboard users to software services
#   nonprofit       - Non-profit / Community: Promote causes, accept donations, engage volunteers
#   education       - Educational / Learning: Provide courses, tutorials, or educational content
#   mixedPurpose    - Multi-purpose website: Comprehensive website covering multiple needs
pagePurpose:
  - saas

See all 43 lines

Summary#

By combining the generate command with a well-defined config.yaml file, you can efficiently produce a complete website tailored to your exact specifications. This process automates the heavy lifting of site structure and content creation, allowing you to focus on providing high-quality source material.

After generating your website, the next step is to make it available online.

Further reading: