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.
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:
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.
@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