How to create a custom HTML page in a Hugo website? - html

I want to add a custom HTML page to my Hugo website here, with its github repo here.
I do not want the Hugo theme to be used in this custom html page, all the needed css/javascript and some html is already in the custom_page.html.
I already found a useful questions/answer, here, but it does not work for me. I do not know why... maybe I don't understand the link I have to use to point to this custom page.
Here is what I have tried :
I have a custom_page.html in the content folder (also tried in the static folder) and I add in a post blog/_index.Rmd the link to what I think could work with the following :
[link](\content\custom_page.html) (when the file is in the static folder I used : [link](\static\custom_page.html) )
I always end up with a 404 page not found
Any advice on how to proceed ?

Related

How to convert my HTML static site into an editable Github template?

I have my code with the following structure, where I only have a style.css, favicon.png, logo.png, and an external Javascript file in their respective folders.
index.html
assets
CSS
img
I'm looking to convert it to a template on GitHub, where a user can use it and change only the <title> of the head, the main <h1> and <h2> of the body, the logo.png (next to the <h1>) and the favicon.
I have no idea how to do it, as an example, I put this Github project, where using the template just edit .upptimerc.yml to configure your site, and Github Actions makes the deploy in Github Pages every time you modify it. While the source code is in another repository.
If someone could give me something to guide me or give me an example even with a "Hello world" HTML I would appreciate it. I couldn't find anything on the internet beyond the basics.

Is it possible to add a single custom HTML page to an existing Hugo theme like Academic?

What do you want exactly?
I have a website in Hugo. However I have a peculiar situation.
Scientists and Electrical Engineers and others may have specific needs. For Eg: Having a single page that shows a simulation. Or in my case using webbluetooth and webusb that I have written from scratch in HTML, CSS and JS. Moreover these pages may be generated by custom scripts. So you can have git submodules inside your hugo site that specifically cater to generating these custom, single page html that you just want to add to your website.
So all I want is to have a menu item or sidebar whatever the existing theme supports, but instead of showing the default html, it should show my custom, hard-coded, already ready and prepared html file - which may as well be an index.html file in a folder with all the necessary contents ready and cooked - something like the _site folder that jekyll creates.
What do you mean by custom html?
I mean it doesn't take the formatting of the hugo theme. It has its own formatting, but because its just a single page in the whole website its not fruitful to have its own layout written in Hugo or maybe its just worth the effort to do that cause you already have it working using some other technology.
What have you done so far and what works?
I am actually coming from a Jekyll background where it's as simple as changing the layout frontmatter and making it nil or even something that doesn't exist at all and jekyll does a great job of showing custom HTML in an existing theme. Tried the same with Hugo but that didn't work.
What are you testing on?
hugo-coder and(or) hugo-academic
Any specific requests?
Ideally I would like to have submodules in my hugo site folder where those submodules generate custom html in known folders and then somehow make a corresponding markdown file in Hugo that is responsible for showing the custom html.
I want to avoid writing the whole html in the markdown itself. But if no other solution is possible then I guess I don't have a choice.
Do let me know if its possible and worthwhile to pursue this and any references that might help.
So I don't know if this is the perfect solution but it somehow works for the moment. I will not accept it as its not perfect and I am waiting for some of the more experienced folks to answer.
I got something working by doing the following -
I had a page built using Jekyll. Jekyll builds the site in a folder called _site.
I copied the _site folder into static folder of Hugo and renamed it correspondingly to CustomHTML OR you could use the flag -d <destination folder> or declare it in the _config.yml file : destination: <destination folder>
Since I am testing it on hugo-acdemic theme, for that I added the following to the config.toml file to show it in the menu -
[[menu.main]]
name = "CustomHTML"
url = "CustomHTML/index.html"
weight = 50
hugo serve And it worked.
Cool thing is that I didn't have to bother about CSS and anything else. Hugo rendered the index.html in _site properly.
EDIT
Looks like the Hugo folks also suggest doing the same way.

put page-$slug.php template inside a subdirectory not working

I have a page-again.php template, It is working when I put this template under my theme directory (/minim/page-again.php). I want to create an subdirectory page-templates(/minim/page-templates/page-again.php) and it's not working. I read a lot of thread and followed what they said. like this one http://nacin.com/2012/03/29/page-templates-in-subdirectories-new-in-wordpress-3-4/
anyone can help?
I found the answer.
The template folder doesn't support specialized page templates. but it works for the custom page template.

failed to load resource hexo.js

I'm using HexoJS to create a blog. I was able to generate the static files using hexo generate. Even though there are css files and JS files generated, they are not properly linked to the index.html.
So, I have to open each html page and correct each page links given in href and src attributes one by one. I believe that this is not very practical. Can anyone help ?
The localhost is used for preview the website. When we publish our blog, it should be on a server, then the path will be interpreted correctly, we don't need to change any thing. What we saw on http://localhost:4000 will be same when you published your website.
So, we don't have to worry about the broken paths in the public folder.

github pages ruhoh theme not working

I'm using ruhoh (a static site generator) to set up a github pages site. Ruhoh has generated a index.html file associated with its default theme, but github is insisting that the file does not exist. You can see the code here: https://github.com/madCode/madcode.github.io/blob/master/index.html
and the url here: http://madcode.github.io/index.html
As you can see I'm getting a 404 file not found error. I'm not sure what I'm doing wrong. Maybe it has something to do with the generated html?