HUGO

Section not loading in Eddie Webb Resume theme

Other sections are visible, but I can not see the projects and publications section. I have set the value to true in the config file. What could be the reason for it?
This code should load it on the webpage, but it doesn’t:

{{ if .Site.Params.showProjects }}
{{ with .Site.GetPage "section" "projects/creations" }}
{{ .Scratch.Set "sectionId" "projects" }}
{{ partial "sectionSummary" . }}
{{ end }}
{{ end }}

**All the sections with code like this are visible, :**
{{ if .Site.Params.showEducation }}
{{ partial "portfolio/education.html" . }}
{{ end }}

but sections (projects and publications) having code like this are not:

{{ if .Site.Params.showProjects }}
{{ with .Site.GetPage "section" "projects/creations" }}
{{ .Scratch.Set "sectionId" "projects" }}
{{ partial "sectionSummary" . }}
{{ end }}
{{ end }}

What should I do? Also is there any tutorial for this theme or any article? That would be of great help!
Thank You.

Have a look at the GetPage documentation (there are examples) and override the theme’s templates.

Basically: .Site.GetPage "section" "projects/creations" is not correct, you only need to enter the page PATH, "section" is redundant.

P.S. To override a theme’s template replicate its PATH in <project-root>/layouts/-path-to-template, copy its contents and amend as necessary.

I removed the section which was redundant but it still does not solves the problem. I still can’t see the project and publication section!! I am attaching the folder structure for reference.

This is the code in the index.html file screenshot: Here other sections such as education, experience, and skills are visible but projects and publications are not!

{{ define "main" }}
   {{ partial "about.html" .}}
   
   <!-- Research -->
   {{ if .Site.Params.showPublications }}
      {{ with .Site.GetPage "section" "publications" }}
         {{ .Scratch.Set "sectionId" (default "Publications" .Site.Params.publicationsAlternateName) }}
         {{ partial "sectionSummary" . }}
      {{ end }}
   {{ end }}

   <!-- Education -->
   {{ if .Site.Params.showEducation }}
       {{ partial "portfolio/education.html" . }}
   {{ end }}

   <!-- Experience -->
   {{ if .Site.Params.showExperience }}
       {{ partial "portfolio/experience.html" . }}
   {{ end }}


   <!-- Projects -->
   {{ if .Site.Params.showProjects }}
      {{ with .Site.GetPage "/projects/creations" }}
         {{ .Scratch.Set "sectionId" "projects" }}
         {{ partial "sectionSummary" . }}
      {{ end }}
   {{ end }}

   <!-- Research -->
   {{ if .Site.Params.showPublications }}
      {{ with .Site.GetPage "/publications" }}
         {{ .Scratch.Set "sectionId" (default "Publications" .Site.Params.publicationsAlternateName) }}
         {{ partial "sectionSummary" . }}
      {{ end }}
   {{ end }}

   <!-- Skills -->
   {{ if .Site.Params.showSkills }}
       {{ partial "portfolio/skills.html" . }}
   {{ end }}

   <!-- {{ if .Site.Params.showBlog }}
      {{ with .Site.GetPage "section" "blog" }}
         {{ .Scratch.Set "sectionId" "blog" }}
         {{ partial "sectionSummary" . }}
      {{ end }}
   {{ end }} -->
{{ end }}

Also, although other sections are visible, no content (education.json) is visible. Here is the screenshot of the education file: This does not load the contents in Education, but just the title Education itself:

You need to share the source code of your project as per the Requesting Help guidelines for people in this forum to see what is going on first hand.

A note that I did not read in any of the answers (or the not posted frontmatter samples): There is a frontmatter parameter draft which in many default-cases is set to true. Which makes Hugo ignore that file. Which can make a whole section disappear.

Hi, here is the source code link: GitHub - shusingh/portfolio-website

I am sorry but where(file) should I find this and set it to false?

Where is your content directory?

Here is a screenshot of directory structure:

The repository that you shared does not match your screen shot. Please update the repository.

Here is the content in the repo:


I uploaded the same folder!

You need to have a content directory in the root of your project. You are showing me the contents of the themes/hugo-resume/exampleSite/ directory.

If you want to build the exampleSite, see https://themes.gohugo.io/hugo-resume/#setup--use

If you want to build your own site, starting with the exampleSite content:

cp -r themes/hugo-resume/exampleSite/* .

@jmooring , Thank you sir for this. This helped me. I did not know that I was working on the example site. As this is the first time I am working with HUGO. Copy pasting the command you wrote worked like a charm and now I can edit the json files to make my website! Thank you so much.
Can you point me towards a good tutorial on creating websites from hugo templates? I looked through the official docs but couldn’t find any help. I am a noob.
Thank you

https://gohugo.io/getting-started/quick-start/
https://zwbetz.com/make-a-hugo-blog-from-scratch/
https://www.youtube.com/playlist?list=PLLAZ4kZ9dFpOnyRlyS-liKL5ReHDcj4G3

Thank You!!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.