Blog Page

Zdoc Blog Page

Make blog step by step

  1. Make a blog folder in your content root folder. In my case, it’s root/content/en/blog

  2. Make a _index.md file in the blog folder.

    1
    2
    3
    4
    5
    
    ---
    title: Blog
    description: My awesome blog
    ...
    ---
    
  3. Add a blog menu to the navigation bar. You can add it in the menus.en.toml file.

    1
    2
    3
    4
    5
    6
    
    ...
    [[main]]
      identifier = "Blog"
      name = "Blog"
      url = "blog"
      weight = 3
    
  4. Now, you can make some contents in the blog folder. Make a markdown file in this format. For the tocLevels Front-Matter, refer this guide. There are no taxonomies other than tags.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    
    ---
    title: "My First Post"
    date: 2020-10-20T15:12:15+09:00
    draft: false
    weight: 1
    enableToc: true
    enableBlogBreadcrumb: false
    tocLevels: ["h2", "h3", "h4"]
    tags:
    - web
    - hugo
    ---
    

Blog Header

There are two types of blog header. The images folder should be in the static folder. (/root/static/images/…)

  • text
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    
    ---
    ...
    blogHeaderType: text
    header:
      - type: text
        height: 200
        paddingX: 50
        align: center
        title:
          - Blog
        subtitle: 
          - 
          - 
        titleColor: 
        titleFontSize: 44
        subtitleColor: 
        subtitleFontSize: 20
        spaceBetweenTitleSubtitle: 16
    ...
    ---
    
  • img
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    
    ---
    ...
    blogHeaderType: img
    header:
      - type: img
        imageSrc: images/header/background.jpg
        imageSize: cover
        imageRepeat: no-repeat
        imagePosition: center
        height: 370
        paddingX: 50
        paddingY: 0
        align: center
        title:
          - Zzo blog
        subtitle:
          - 
        titleColor: 
        titleShadow: true
        titleFontSize: 44
        subtitleColor:
        subtitleFontSize: 16
        spaceBetweenTitleSubtitle: 20
    ...
    ---