Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken menu #5

Open
MortenHofft opened this issue Aug 30, 2021 · 3 comments
Open

Broken menu #5

MortenHofft opened this issue Aug 30, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@MortenHofft
Copy link
Member

Hi @SnymanE and @FatimaParkerAllie this issue is in response to your email.

Why things do not work

I can see that the navigation bar isn't really working. The menu looks/behaves odd and the links points to "page not found". There are 3 issues.

  1. The navigation bar is wrongly configured
  2. The urls doesn't match the page location
  3. the page is invalid

The navigation bar
The current version can be seen here
https://github.com/gbif/hp-sanbi/blob/65ae94fef7f12dcac7e811a917d801965614c9bf/_data/navigation.yml

And I have copied the code below and left a comments for the first lines

# this is a list of menu items. each item in the list starts with a `-`. 
- text: About # First item has a name, but no link/href so it does nothing
- menu: # Second item states that it is a dropdown, but has no text. So only the arrow is shown in the interface
  - text: About Us # this is correctly indented so it is a list of items in the dropdown menu. It has the text "About Us"
    href: /About Us/About Us/ # this is the URL pointing to the home page. It needs to start with `/` just as you do. It is unusual to have spaces and capital letters in a url. You should use lower case and `-` instead of spaces. So for example `/about-us/about-us`. My first thought is that simply `/about-us` might be a better url, but that is a preference I suppose.
  - text: Network Partners
    href: /About Us/Network Partners
- text: Data Mobilisation
- menu:
  - text: GBIF SA Data Portal
    href: /Data Mobilisation/GBIF SA Data Portal
  - text: Data Publishing-SANBI-GBIF IPT
    href: /Data Mobilisation/Data Publishing-SANBI-GBIF IPT
  - text: Data-Science-Policy/Data Use and Impact
    href: /Data Mobilisation/Data-Science-Policy and Data Use and impact
- text: HCD
- menu:
  - text: Elearning
    href: /HCD/Elearning
- text: Regional Engagement
  href: /Regional Engagement
- text: News/Events
  href: /News/Events
- text: Resources and useful links
  href: /Resources and useful links

Why does the URL /About us/About us not show anything
Because there is no such page. You probably meant it to point to the page hp-sanbi/About/About Us.md

Per default files get their url based on the folder and file name. So that file will per default get the url /About/About%20Us/

You can overwrite the location by adding a permalink in the frontmatter of the file permalink: /about-us-some-name-i-made-up and the that will be the url no matter what directory and file name it has been given.

But it doesn't show on /About/About%20Us/ either
From reading above we see that the file should show as /About/About%20Us/, but it doesn't. That is because the content of the file doesn't follow the rules.
It should ALWAYS start with the frontmatter and then followed by markdown. But there is no frontmatter in the file
Because it doesn't follow that rule it is just copied to the site as a plain text file

Background reading
https://jekyllrb.com/docs/pages/
https://jekyllrb.com/docs/front-matter/
https://jekyllrb.com/docs/permalinks/

@MortenHofft MortenHofft added the bug Something isn't working label Aug 30, 2021
@SnymanE
Copy link
Collaborator

SnymanE commented Aug 30, 2021 via email

@SnymanE
Copy link
Collaborator

SnymanE commented Aug 30, 2021 via email

@MortenHofft
Copy link
Member Author

Good afternoon Please advise on how to justify images and text in markdown. Also, how to put in columns (by not using a table). Thanks

I'm not sure you can do that in markdown without writing custom css yourself (this require general knowledge about css and html though)

Can you describe in a bit more details what you are striving to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants