Hyperlinks in Toml File

Hi, I’m trying to create a toml file for my website using the Hugo-Nix Theme. I am trying to add hyperlinks to the about section of the page however whenever I try to add the links and configure, it appears as just plain text. Is there any suggestions for how to fix this?

baseurl = "https://example-page.github.io/"
title = "Example Page"
theme = "hugo-theme-nix"
languageCode = "en-us"
draft = "false"

  Name = "John Doe"
  HeaderUsername = "jdoe"
  HeaderHostname = "pols.edu"
  About = "Howdy! I am John Doe, a first year PhD student in the [Department of Political Science](https://google.com) in Neptune, New Jersey. My research interests are primarily in American political behavior maximum likelihood estimation. I earned my B.A. in [Political Science](https://pols.osu.edu/) from the Ohio State University."
  ProfilePicture = "IMG_20220.jpg"
    name = "Research"
    weight = 1
    url = "/research"
    name = "CV"
    weight = 2
    url = "/cv"
    name = "Teaching"
    weight = 3
    url = "/teaching"``

You need to pass value through .RenderString method on .Page.

{{ site.Params.foo | .RenderString }}

Hi! Where exactly in my code do i put that?

First, don’t edit the theme files—override them.

cp themes/hugo-theme-nix/layouts/index.html layouts/

Then edit layouts/index.html.

Change line 33 to:

<p>{{ . | $.RenderString }}</p>

Hi, I was able to change the index code to

<p>{{ . | $.RenderString }}</p>

Unfortunately it is still not loading the hyperlinks. Is there any other reason this would happen?

If works perfectly for me.

Please post a link to the public repository for your project.

See Requesting Help.

Let us see your code

Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.

If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

Hi, this is the github repository: GitHub - reshi-rajan/blog

I don’t see the changes that I suggested:

Apologies, I forgot to commit the changes made to the repository.

Hi, I’m not sure exactly what happened but once I edited the code directly in Github the changes were made, thank you for all your help!

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