Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hugo based website in a hugo based website

I have a hugo theme based website that I am hosting from gitlab at myusername.gitlab.io, and then I have another smaller website based on hugo themes at myusername.gitlab.io/repoA, that I would like to add from my previous website, at a url like myusername.gitlab.io/repoA

Now, here is my question ( I have not done this a whole lot, so please forgive my ignorance.)

  1. Would it be easier for me to do a url, like username.gitlab.io/secondwebUrl ? (Do I need to still do custom domains, generate new certs and add them to gitlab ?)
  2. Would it be easier for me to just create a sub-domain ( just to clarify, I am hosting using google domains and SSL via cloudflare) ?
like image 395
MithunS Avatar asked Oct 06 '18 05:10

MithunS


People also ask

What is a Hugo website?

Hugo is a general-purpose website framework. Technically speaking, Hugo is a static site generator. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content.

Is Hugo good for website?

Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again.

What are examples of static websites?

Common examples of static websites include resume websites, portfolio websites, brochure websites, one-off landing pages, and other informational or read-only sites. These websites are small (three to four pages or fewer), limited in content, and don't require personalized content or frequent updates.


1 Answers

Analyse build-output of themes

You have to analyze the output files, your individual themes produce. For example:

Theme A produces:
   -- index_1.html
   -- style_1.css
Theme B produces:
   -- index_2.html
   -- style_2.css

Write a simple script

Hugo does not support post-run scripts, so the simplest way to stack two sites into one another is to write a small shell script like:

 cd /path/to/themeA
 hugo themeA --destination=/deploy/location/

 cd /path/to/themeB
 hugo themeB --destination=/deploy/location/about/

This will result in a layout looking like this:

 /deploy/location
    -- index_1.html
    -- style_1.html
    -- about/
       -- index_1.html
       -- index_2.html

This resulting directory can be deployed to your hoster by whatever method you have to use.

Repair potentially broken links

Now you can simply look at the resulting page, making it easy to identify broken links and change them in the html of your local hugo template.

Do not use a subdomain

Using a subdomain for this seems highly unnecessary. Certificates are only needed for new (sub-)domains.

like image 69
Sheppy Avatar answered Sep 19 '22 17:09

Sheppy