So for example, creating a multiple files, say under posts we can list the relative urls of these files in list.html and also it creates an html page for each of those links right?
So sometimes I want to link them to an external site rather than generate a new html page. In the sense, I would rather link some project to an external page (say GithHub) instead of using an data such as JSON file to list of the links and keeping the way hugo kinda work but without generating those html pages.
How would you do this, without some kind of manifest? Hugo can automatically generate from something that exists (taxo pages from taxo entries in frontmatter) but, you would have to make some kind of list to tell it to create a structure to redirect certain url paths. The manifest could be a future data-to-pages scheme built into hugo some day, or, a list of redirects in an .htaccess file (possible now), for example.
I don’t think it does what the OP actually wants, which is that generate links from a data file and range over it with local posts thing everyone wants. But it is the fix to the issue they were trying to address in the original post.
My response was to answer the original question, because folks will search for that. The thing you want, to create a list of URLs and include them in a listing, that can be done with data templates. My recommendation: play around with data templates, see if you can get the output you are looking for, and then create a new #support ticket if you hit a wall.
I am hoping to link to an external site (datasheet pdf) from the sidebar of my Hugo site, and I was wondering if you had any tips about creating this externalUrl ‘user-defined variable’. I’ve looked around a bit on the variables page of the Hugo site, and I’m still not entirely sure how to get started.
If you want to only link to a PDF from the sidebar of a single post, for instance, you’d use front matter to define your URL, as documented at Front Matter | Hugo. Then, you render that in your sidebar template, referencing the front matter param you define value, as documented at Introduction to Hugo Templating | Hugo.
If on the other hand you want to configure it to always be in your sidebar, you might define the PDF URL in your site params, as documented at Site Variables | Hugo. That is basically done the same way, you then editing your sidebar template to add the HTML link based on your .Site.Params. In fact, that’s how many themes work, they have theme-specific site params for links such as social media, and then they use those params to create a footer menu of links, for example.