Advance your skills

Adding content

This page tells you how to use the theme to add and structure your site content.

Content root directory

You add content for your site under the content root directory of your Hugo site project. The files in your content root directory are typically grouped in subdirectories corresponding to your site’s sections.

We’ll look at in the following chapter.

Content sections

With docport, Each content page composes the site and navigation structure, they shape the structure of your website.

Create a folder for each section and their sub sections, and a _index.md in each folder which will act as the section’s content.

You can add any other page.md in section folder, they will be treated as “subpages

To link pages to each other, place them in a folders hierarchy.

	content
	└── section-one/			
	    β”œβ”€β”€ _index.md
	    └── section-one-two/ 	
	        β”œβ”€β”€ _index.md 		
	        β”œβ”€β”€ section-one-two-three-A/	
	        β”‚   β”œβ”€β”€ _index.md
	        └── section-one-two-three-B/ 	
	            β”œβ”€β”€ _index.md 	<-- section's page 
	            β”œβ”€β”€ pageA.md  <-- "subpages"
	            └── pageB.md  <-- "subpages"

Subpages

Subpages are contents which belong to the section, and are displayed bellow section’s title in the page.
Subpages are not displayed in left menu.

If you look at the current page title, you will see 3 links which reference its 3 subpages.

Page frontmatter

Each page file in a Hugo site has metadata frontmatter that tells Hugo about the page. You specify page frontmatter in TOML, YAML, or JSON.
Use the frontmatter to specify the page title, description, creation date, link title, template, menu weighting, and even any resources such as images used by the page. You can see a complete list of possible page frontmatter in Front Matter.

On top of the existing ones, DocPort comes with additional params to control what and how to display your content, their entry in left menu or behaviour.

+++
	title="Adding content"

	# order sections
	weight=10 

	# Hide some page components
	hide= header, nav, breadcrumb, toc, footer, nextpage

	# subpage
	subpage = false # usefull when you want to force a sub section to be considered as a subpage

	# Redirect to another content
	# Set a full URL or a .md path
	# examples : 
	#  redirect = "https://github.com/vjeantet" 
	#  redirect = "folder" 
	#  redirect = "folder/_index.md" 
	redirect = "folder/_index.md"

+++