Closed jehoshua7 closed 3 years ago
The cp
command is not necessary. The installation section shows how to create a site from scratch. If you already have a site, all you have to do is that add a git submodule and then modify your configuration.
git submodule add https://github.com/razonyang/hugo-theme-bootstrap themes/hugo-theme-bootstrap
.
As the 2nd question, the example site uses a configuration directory instead of a single configuration file.
As the configuration path shows, _default
means the default settings which will be merged into the target environment(production, development...).
Default environments are development with
hugo server
and production withhugo
.
In order to modify baseURL
, it depends on how do you configure your site:
/mysite/config.toml
./mysite/config/production/config.toml
.@razonyang - Thanks for your replies. It is obvious the directory structure for this theme is slightly different to the other themes I am testing. The theme runs fine locally, although the other themes run locally are of the nature http://localhost:1313 , yet for this theme I have to use http://localhost:1313/hugo/hugo-theme-bootstrap/
Further testing of the deployment process still doesn't work for me. It seems to be simply related to the URL's and relative URL's.
I would post a link to the website I'm using for testing, however I do not want that picked up with search engines, etc. Possibly I can send you the link in a PM ?
Are there any specific instructions for deployment of this theme please ? Also, is there a single language (english) version of the theme please ? Thanks for your help.
Applying this theme to an existing site(myblog
):
Add a git submodule
cd myblog
git submodule add https://github.com/razonyang/hugo-theme-bootstrap themes/hugo-theme-bootstrap
Copy configuration
mkdir config
cp -a themes/hugo-theme-bootstrap/exampleSite/config/* ./config
Rename the single config file
mv config.toml config.toml.orig
This step prevents the single configuration file from conflicting with the configuration directory.
Btw, you can also generate a single configuration file(config.toml
). Take params.toml
as an example, copy and paste the content under the [params]
table of config.toml
.
baseURL = "http://example.org/"
title = "My Blog"
[params]
# paste params.toml content here
[social]
# paste social.toml content here
# ...
Additional steps
Remove other language's configurations.
rm config/_default/*.zh-*.toml
And then remove needless language items from languages.toml
.
You can reach me via email.
@razonyang - Thanks for your reply, that is awesome. It now works fine on the website.
This step prevents the single configuration file from conflicting with the configuration directory.
That must have been what fixed it, thank you. I haven't dome the language modifications or the config file modifications yet, just wanted to get the theme going on the website. Thanks :)
You can reach me via email.
Thanks for your help. Have decided to use this theme on the website. Have emailed you.
I have sent you an email, as I did a re-installation, deploy and upload, and now it isn't working (404 msg). Obviously I have done something wrong with the config file/s ??
@razonyang - Thanks for your reply to my email, the website works again now. As per your instructions I had to modify /~/Hugo/mysite/themes/hugo-theme-bootstrap/exampleSite/config/production/config.toml
I have installed the theme as per the instructions at https://github.com/razonyang/hugo-theme-bootstrap , and then run it locally as http://localhost:1313/en/ , and it all runs okay.
I have been able to deploy other themes and run them on a website, however I'm not able to deploy the 'hugo-theme-bootstrap' theme successfully.
Some questions please:
cp -a themes/hugo-theme-bootstrap/exampleSite/* .
Obviously I am doing something wrong with the deploy ?? It is simply
~/Hugo/mysite/themes/hugo-theme-bootstrap/exampleSite$ hugo -D --themesDir ../..