How to define page url with ".Params.permalink"?

I’m migrating a big project from jekyll to hugo and here I have .md files where in front matter section is defined the permalink parameter
I know that in hugo I can use url parameter, and this works when I simply rename permalink to url, but there are 2 problems:

  1. page can accessed with the default URL (like, /content_path/filename)
  2. there are too many files, and even automated replacement will be a pain, because client has external API to get data for mobile app and add this data with the other custom dashboard.

What does this mean? Do you want the page to be accessible at two URLs, or are you saying that Hugo publishes the page twice?

What do you want?

This is not the case. The page will only be accessible on the set url.

A batch search and replace over even many thousand of pages takes mere seconds.

Also take a look at URL management | Hugo to see if you can not set up this globaly instead of on each page.

1 Like

so, I’m asking how to define page url with .Params.permalink?

thanks, this was my fail, I should refresh public folder running hugo server
so, the 1st point is not an issue anymore

this is more related to my case
may be there is a way to use .Params.url as a new Token?

No.

What is stopping you from doing a batch search and replace?

May I suggest ro take one step back:

You want to migrate your jekyll sources to hugo

On the long run you will have less problems if you do not try to tweak hugo to deal with jekyll layout

Identify constraints what you cannot change and then:

  1. identify each gap in functionality
  2. check out how it’s done with hugo
  3. migrate a small example and test
  4. when successful migrate the rest
  5. proceed with the next gap

I’m pretty sure the experts here can assist with 2 and 3 if you provide your code

1 Like

client has external API to get data for mobile app and add this data with the other custom dashboard and there are other types of content, where .Params.permalink presents, but I use slug filename to build permalinks, but URL from front matter will

override the entire path

(URL management | Hugo)

so yeah, basically I’ve just to check if this still can’t be changed or may be I have miss this (I’m building gohugo sites for about 4 years, but not often checking changelog or discourse)

so, now I know this must be changed in my content
thanks all!

1 Like

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