HUGO: Content Links not working properly in deployed site - html

I am a beginner in Hugo. I generated a static site, added a theme, added some content. It works in my local. All the links behave as they are supposed to. Then I do "Hugo" to generate deployable files in public directoery. Now I placed this public folder in my server. The home page loads properly, but contents are redirecting to net domain site.
(copy site url and check in you your browser) => https://smehetre.xyz/
Config file below:
baseURL: https://smehtre.xyz/
languageCode: en-us
title: hello friend
theme: "PaperMod"
menu:
main:
- identifier: Search
name: Search
url: /search/
weight: 10
- identifier: Archives
name: Archives
url: /archives/
weight: 20
- identifier: Resume
name: Resume
url: /resume/
weight: 30
- identifier: About
name: About
url: /about/
weight: 40
Public folder deployed on my nginx server:
├── 404.html
├── about
│   └── index.html
├── archives
│   └── index.html
├── assets
│   ├── css
│   │   └── stylesheet.min.8e489ec970cd58539487a8f697c827fd0de4aa9f638217b7db51cbc230ff6f95.css
│   └── js
│   ├── highlight.min.2840b7fccd34145847db71a290569594bdbdb00047097f75d6495d162f5d7dff.js
│   └── search.min.994d971a9492abf73721874ff533ba36f8b86300a65b0f03c96111ab1f6f32b2.js
├── categories
│   ├── index.html
│   └── index.xml
├── index.html
├── index.json
├── index.xml
├── page
│   └── 1
│   └── index.html
├── posts
│   ├── index.html
│   ├── index.xml
│   ├── my-first-post
│   │   └── index.html
│   └── page
│   └── 1
│   └── index.html
├── search
│   └── index.html
├── sitemap.xml
└── tags
├── index.html
└── index.xml
Try to click on my first post, or Search or Archives or About page.
It redirects to https://net.domain.name/
Please HELP!!!

This looks like a DNS issue, not a Hugo issue.
According to the WhatsMyDNS Tool your Name Server isn't set at all anywhere (link).
According to ICANN, you've never actually registered your domain. Godaddy shows the same.
You need to actually purchase a domain before you can use it.
If you have purchased your domain, contact your registrar to figure out the issue.
If you haven't purchased it yet, make sure you do that.

Related

Jekyll home page corruption on github

I have a simple Jekyll web site. It works as expected on the local server, but when uploaded to github it displays differently. I am guessing that this is because bundle exec jekyll serve behaves differently on github.
This is the way it looks on the local server (I'm using the theme minima)
and on github
The extra links in the menu-bar all point to pages on the website
index.md
---
layout: home
---
Welcome to the Psionman Set. This is a series of lessons that I wrote to help me get to grips with some new (to me) technology.
(Some were done for my private use, but you can read them).
[Wx Python from scratch]({{ site.baseurl }}{% link wx_python/wxpython_from_scratch.md %})
And the tree on the local server
.
├── 404.html
├── about.markdown
├── _config.yml
├── Gemfile
├── Gemfile.lock
├── index.md
├── _posts
├── _site
│   ├── 404.html
│   ├── about
│   │   └── index.html
│   ├── assets
│   │   ├── main.css
│   │   ├── main.css.map
│   │   └── minima-social-icons.svg
│   ├── feed.xml
│   ├── index.html
│   └── wx_python
│   ├── images
│   │   ├── basic_frame.png
│   │   ├── datepicker.png
│   ├── introduction.html
│   ├── post01.html
│   ├── post02.html
│   ├── post03.html
│   ├── post04.html
│   ├── snippets
│   │   ├── basic_frame.py
│   │   ├── basic_panel.py
│   └── wxpython_from_scratch.html
└── wx_python
├── images
│   ├── basic_frame.png
│   ├── datepicker.png
├── introduction.md
├── post01.md
├── post02.md
├── snippets
│   ├── basic_frame.py
│   ├── basic_panel.py
└── wxpython_from_scratch.md
[EDIT]
It seems that the items in the menu-bar are created form a heading in the md file
## WxPython from Scratch
Github seems to pick up the first heading and place that in the menu-bar
Can someone please show me how to suppress these?
Dumped Jekyll in favour of Sphinx on Netlify

Access JSON values using Chef and test-kitchen

I'm new to Chef and Test-kitchen and I'm trying to use random JSON file as attribute or environment (preferably attribute), but unfortunately I can't access the JSON values from the recipes.
I'm using the following directory structure:
uat
├── attributes
│   ├── dev.json
│   ├── .kitchen
│   │   └── logs
│   │   └── kitchen.log
│   └── prod.json
├── Berksfile
├── Berksfile.lock
├── chefignore
├── environments
│   ├── dev.json
│   └── prod.json
├── Gemfile
├── Gemfile.lock
├── .kitchen
│   ├── default-windows.yml
│   └── logs
│   ├── default-windows.log
│   └── kitchen.log
├── .kitchen.yml
├── metadata.rb
└── recipes
   ├── default.rb
   ├── prep.rb
   └── service_install.rb
This is the .kitchen.yml:
---
driver:
name: machine
username: sample_user
password: sample_pass
hostname: 192.168.1.102
port: 5985
provisioner:
name: chef_zero
json_attributes: true
environments_path: 'environments/dev'
platforms:
- name: windows
suites:
- name: default
run_list:
- recipe[uat::default]
This is the dev.json:
{
"groupID": "Project-name",
"directoryName": "sample_folder",
"environmentType": "UAT",
}
This is the recipe prep.rb :
directory "C:/Users/test/#{node['directoryName']}" do
recursive true
action :create
end
If I create something.rb in attributes folder and with content: default['directoryName'] = 'sample_folder', it works like a charm, but I need to use a JSON file which to store parameters company wide.
Could you please help me find what I'm doing wrong.
So a couple of issues. First, the environments_path points at a folder, not the specific file, so that should just be environments/. Second, it has to be an actual environment object, see https://docs.chef.io/environments.html#json for a description of the schema. Third, you would need to actually apply the environment to the test node:
provisioner:
# Other stuff ...
client_rb:
chef_environment: dev

Using Jekyll's Collection relative_directory for organizing pages/collections

I thought that setting the relative_directory (Jekyll Collection Docs) (github PR) property being set would help me keep my files organized without compromising my desired output, but it seems to be ignored/not used for producing files. I don't want my collections to be in the root directory, because I find it confusing to have ~10 collection folders adjacent to _assets, _data, _includes, _layouts, and others.
Fixes or alternative solutions are welcomed, as long as long as the output is the same, and my pages are in their own directory, without needing to put permalink front-matter on every single page.
_config.yaml
collections:
root:
relative_directory: '_pages/root'
output: true
permalink: /:path.html
root-worthy:
relative_directory: '_pages/root-worthy'
output: true
permalink: /:path.html
docs:
relative_directory: '_pages/docs'
output: true
permalink: /docs/:path.html
Directory Structure:
├── ...
├── _layouts
├── _pages
│   ├── root
│   │ ├── about.html
│   │ └── contact.html
│   ├── root_worthy
│   │ ├── quickstart.html
│   │ └── seo-worthy-page.html
│   └── docs
│   ├── errors.html
│   └── api.html
├── _posts
└── index.html
Desired output:
├── ...
├── _site
│   ├── about.html
│   ├── contact.html
│   ├── quickstart.html
│   ├── seo-worthy-page.html
│   └── docs
│   ├── errors.html
│   └── api.html
└── ...
It seems that the PR you mention is still not merged.
For 3.1.6 and next 3.2, jekyll code is still :
#relative_directory ||= "_#{label}"
But the requester made a plugin that looks like this :
_plugins/collection_relative_directory.rb
module Jekyll
class Collection
def relative_directory
#relative_directory ||= (metadata['relative_directory'] && site.in_source_dir(metadata['relative_directory']) || "_#{label}")
end
end
end

How do I get Lazybones to process sub-templates?

Playing with Lazybones for the first time. I've put together a simple project which attempts to include a single sub-template.
Here is the project structure:
.
├── build.gradle
├── gradlew
├── gradlew.bat
├── README.md
└── templates
├── groovy-lambda
│   ├── build.gradle
│   ├── lazybones.groovy
│   ├── README.md
│   ├── src
│   │   ├── main
│   │   │   ├── groovy
│   │   │   │   └── .retain
│   │   │   └── resources
│   │   │   └── .retain
│   │   └── test
│   │   ├── groovy
│   │   │   └── .retain
│   │   └── resources
│   │   └── .retain
│   └── VERSION
└── subtmpl-groovy-lambda-main-class
├── GroovyLambdaMainClass.groovy
├── lazybones.groovy
└── VERSION
And I'm including the sub-template like so
lazybones {
template "groovy-lambda" includes "groovy-lambda-main-class"
}
The sub-template gets packaged in the main artefact archive:
.
├── build.gradle
├── .lazybones
│   ├── groovy-lambda-main-class-template-1.0-SNAPSHOT.zip
│   └── stored-params.properties
├── README.md
└── src
├── main
│   ├── groovy
│   └── resources
└── test
├── groovy
└── resources
However the sub-template never gets processed at template execution time i.e. the sub-templates lazybones.groovy script doesn't seem to get run.
The whole project is available here on GitHub. To reproduce the issue do:
git#github.com:eddgrant/lazybones-template-aws-groovy-lambda.git
cd lazybones-template-aws-groovy-lambda.git
./gradlew installAllTemplates
cd /tmp
lazybones --verbose create groovy-lambda 1.0-SNAPSHOT groovy-lambda
I'm probably missing something trivial but can't quite figure it out. Most grateful for any pointers.
Everything is working as expected. Sub templates are only used by the lazybones generate command, which in turn works only once you have created a Lazybones-based project.
The classic example is something like a Grails or Rails project in which you would use the generate command to create new controllers or domain classes.

How can I get HTML reports that I host on Github Pages to link to stylesheets in another directory?

I'm trying to create a set of project pages using Github Pages. My main page is a copy of my project's README, which I generated through Github's auto-page generator. Under Project Health Metrics, I link to two HTML reports: one is a CodeNarc report (at health/codenarc/main.html) and the other is a Jacoco report (at health/jacoco/index.html).
The CodeNarc report renders fine, but the Jacoco report doesn't as it's not able to load the stylesheet and other resources kept in another directory. I'm keeping everything on a gh-pages branch with a directory structure that looks like this:
.
├── Gemfile
├── Gemfile.lock
├── _config.yml
├── _site
├── bin
├── build
├── build.gradle
├── config
├── docs
├── gradle.properties
├── health
├── images
├── index.html
├── javascripts
├── params.json
├── src
└── stylesheets
My health directory tree appears like this:
health
├── codenarc
│   ├── integrationTest.html
│   ├── main.html
│   └── test.html
├── html
│   └── projectHealth.html
└── jacoco
├── .resources
│   ├── branchfc.gif
│   ├── branchnc.gif
│   ├── branchpc.gif
│   ├── bundle.gif
│   ├── class.gif
│   ├── down.gif
│   ├── greenbar.gif
│   ├── group.gif
│   ├── method.gif
│   ├── package.gif
│   ├── prettify.css
│   ├── prettify.js
│   ├── redbar.gif
│   ├── report.css
│   ├── report.gif
│   ├── session.gif
│   ├── sort.gif
│   ├── sort.js
│   ├── source.gif
│   └── up.gif
├── .sessions.html
├── com.github.tagc.semver
│   ├── SemVerPlugin$_apply_closure1.html
│   ├── SemVerPlugin.groovy.html
│   ├── SemVerPlugin.html
│   ├── SemVerPluginExtension.groovy.html
│   ├── SemVerPluginExtension.html
│   ├── Version$Builder.html
│   ├── Version$Category.html
│   ├── Version$Parser.html
│   ├── Version.groovy.html
│   ├── Version.html
│   ├── index.html
│   └── index.source.html
└── index.html
If it helps, you can explore the tree and check out all the files from my Github repository.
I would like the Jacoco report to be able to access the resources in the .resources folder under health/jacoco, but it doesn't seem able to and I'm not quite sure why. I've tried playing around with this a lot on a private instance running on localhost through Jekyll.
Problem solved, thanks to help from some people in IRC and a lot of playing around.
Jekyll ignores any folders that are hidden (e.g. prepended with a dot or underscore), so it wasn't processing health/jacoco/.resources.
I got around this issue by including include: ['.resources'] in _config.yml. Don't forget to push this file to the remote gh-pages branch on Github, as Github uses this to determine what it processes as well.
The Jacoco report now renders properly because it can access the stylesheets and other resources it depends on.