Fix the 404 not found error when submetting contact form and when click the article link in the publication section

Hello,
I deployed on Netlify using github, a website created on R using Hugo blogdown. The site is published without any problem but I have a problem with the publications. The external link that takes me to the articles doesn’t work. "Error 404 not found ". Althought all works fine locally. Also I have a problem with the "contact me " form in the end of my site when users send me a message I receive nothing.
You can find my code here : GitHub - BOUGHANMIChaima/hel_oua_ws
The problems are in folder publication and contact.
How can I fix this please?
Thank you in advance

@BOUGHANMIChaima What’s the link to your Netlify site?

@nathanmartin my Netlify site is : helaouaili.netlify.app

Where’s the 404? The site and a random post that I tried appears to work.

@hrishikesh the site works fine but try to click on Source document of any Publication you will get 404 not found like in the photo below :point_down:

Also when you try to send a message and you click on “send” in the contact section you get an error messsage too !

Help Please !
Thanks in advance

@BOUGHANMIChaima If you “view source” on your page, you’ll see that the href for those links is malformed:

<a class="btn btn-outline-primary btn-page-header btn-sm" href="/https:/www.academia.edu/16796397/Th%C3%A9orie_des_Sondages_chap3_Formalisation_du_Mod%C3%A8le_de_th%C3%A9orie_des_Sondages" target="_blank" rel="noopener">
  Source Document
</a>

In the case of that link you have:

/https:/www.academia.edu/16796397/Th%C3%A9orie_des_Sondages_chap3_Formalisation_du_Mod%C3%A8le_de_th%C3%A9orie_des_Sondages

Malformed Link

But you want:

https://www.academia.edu/16796397/Th%C3%A9orie_des_Sondages_chap3_Formalisation_du_Mod%C3%A8le_de_th%C3%A9orie_des_Sondages

Correct Link

You can click the links I’ve added above to see the difference.

Having the link begin with a / is causing the browser to interpret it as a “Root Relative URL” and thus to look for the document on the same site that the link is on.

Hello @nathanmartin , thank you for your answer.
Where did you find this please, in other words, in which file do I have to change the link format so that it works properly?
Because in the .md files where I put my links (one .md file per publication, so each link in a file) it was fine without / at first, (please see the line url_source : )
Here’s the complete code of the .md file of this publication for example : :point_down:

---
title: "Théorie des sondages : Formalisation des sondages probabilistes"
authors:
- admin
date: "2019-05-07T00:00:00Z"
doi: ""

# Schedule page publish date (NOT publication's date).
publishDate: "2019-05-07T00:00:00Z"

# Publication type.
# Accepts a single type but formatted as a YAML list (for Hugo requirements).
# Enter a publication type from the CSL standard.
publication_types: ["teaching paper"]

# Publication name and optional abbreviated publication name.
publication: ""
publication_short: ""

abstract: Cours que j'ai enseigné aux élèves ingénieurs statisticiens.

tags:
- Survey Sampling
- Sampling (Mathematical Statistics)
- Sampling Theory
featured: false

links:
url_source: 'https://www.academia.edu/16796397/Th%C3%A9orie_des_Sondages_chap3_Formalisation_du_Mod%C3%A8le_de_th%C3%A9orie_des_Sondages'


# Featured image
# To use, add an image named `featured.jpg/png` to your page's folder. 
image:
  caption: 'aperçu cours: [Academia](https://www.academia.edu/16796397/Th%C3%A9orie_des_Sondages_chap3_Formalisation_du_Mod%C3%A8le_de_th%C3%A9orie_des_Sondages)'
  focal_point: ""
  preview_only: false

# Associated Projects (optional).
#   Associate this publication with one or more of your projects.
#   Simply enter your project's folder or file name without extension.
#   E.g. `internal-project` references `content/project/internal-project/index.md`.
#   Otherwise, set `projects: []`.
projects:
- internal-project

# Slides (optional).
#   Associate this publication with Markdown slides.
#   Simply enter your slide deck's filename without extension.
#   E.g. `slides: "example"` references `content/slides/example/index.md`.
#   Otherwise, set `slides: ""`.
#slides: example
---

Thank you in advance

@BOUGHANMIChaima It’s visible in the output of your build, so a standard “view source” on the Netlify site.

It can also be seen in the build output that you have in your repository:

I’d noticed that your link was specified correctly in your markdown source file, but unfortunately I cannot advise you on precisely what you need to adjust with your build to fix it as I’m not a Hugo user.

Since it’s also an issue specific to your project it’s beyond the Scope of Support.

That said, I was able to pinpoint that all the relevant code is in your theme.

In particular, there are different types of link specified here:

You can see that you’re using url_source:

The url_source type link is output by this code in the theme:

You could read the code or documentation for the theme and see if a different type of link gives you the behaviour you want, or alternativley you could seek assistance from the Hugo community:

thank you @nathanmartin for all this information I will try to solve the problem.
Do you have any idea how to fix the problem with the contact menu? I’ve done a test: when I write a message and send it by pressing the “send” button, I get “404 not found” too, i.e. users don’t get a success message saying that their message has been sent.
Thank you again !

@BOUGHANMIChaima The Form’s Support Guide is here:

It runs through all the usual causes of issues and fixes.