Skip to content

Is it possible to use the profile.htmlof homepage.layout in the other menu? #8

Answered by jpanther
Sevichecc asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the question. While it's not possible to link directly to a partial in Hugo, you can create your own layout for an about page that will include the profile. There's a couple of ways you could achieve this but you'll need to do something like the following:

  1. Make an about page in your content folder: content/about/_index.md
---
title: About
---
  1. In your layouts folder (which you may need to create), create a custom layout for the about page that includes the profile partial: layouts/about/list.html
{{ define "main" }}
  {{ partial "partials/home/profile.html" . }}
{{ end }}
  1. Update your menu to pageRef = "about"
  2. Rebuild the Hugo site

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Sevichecc
Comment options

@jpanther
Comment options

@rootbeerdan
Comment options

Answer selected by Sevichecc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants