I host hugo site via github pages. When I create a markdown with internal links on it. It points to the wrong URL which gives a 404 error. External links working correctly.
When I remove the Renderhook external links are working. Internal links are pointing to the wrong page giving 404.
Example :
Internal link pointing to Wrong Link : https://optionsmaddy.github.io/post/2023-05-monthly-pnl-+3.6-profit-may/2023-05-24%20Good%20Day%20Closed%20All%20Positions%20Realized%20Profit%20+7,983.md
It should point to Correct Link : https://optionsmaddy.github.io/post/2023-05-24-good-day-closed-all-positions-realized-profit-+7983/
How do I make both my Internal & External link work?
Found your repo and your markdown links are not done correctly.
Normal Markdown links like this will work:
- Internal Link (Last Week May) : [2023-05-24 Good Day Closed All Positions Realized Profit +7,983](/post/2023-05-24-good-day-closed-all-positions-realized-profit-+7983/)
- Internal Link (Last Position May) : [2023-06-01 Tricky Executions Expiry Profit Realized +7,727](/post/2023-06-01-tricky-executions-expiry-profit-realized-+7727/)
If you for some reason prefer to use the file name of the post instead of the URL you can use the built in “relref” shortcode like this.
- Internal Link (Last Week May) : [2023-05-24 Good Day Closed All Positions Realized Profit +7,983]({{< relref "post/2023-05-24 Good Day Closed All Positions Realized Profit +7,983.md" >}})
- Internal Link (Last Position May) : [2023-06-01 Tricky Executions Expiry Profit Realized +7,727]({{< relref "post/2023-06-01 Tricky Executions Expiry Profit Realized +7,727.md" >}})
function convertInput(input) {
// Extract the text between the brackets
const text = input.replace(/\[\[(.*?)\]\]/, '$1');
// Remove any whitespace and replace spaces with hyphens
const slug = text.replace(/\s/g, '-').toLowerCase();
// Create the desired output format
const output = `[${text}](/post/${slug})`;
return output;
}
// Prompt the user to enter the input
const userInput = prompt("Enter the WikiLink to Convert:");
// Call the function with user input
const result = convertInput(userInput);
// Display the result in a dialog box
alert(result);