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

Make home page sections dynamic and configurable #14

Merged
merged 6 commits into from
Jun 29, 2020

Conversation

hossainemruz
Copy link
Member

@hossainemruz hossainemruz commented Jun 28, 2020

Why?

  • Give the control to the user over which section he want to show.
  • Give the control to the user over the order of the sections.
  • Give the control to the user over which menu he want to show on the top bar.
  • Make it easy to add a new section.
  • Don't show any unnecessary section when the user hasn't configured it yet.

Warning: This PR will break the existing sites. See the comments for new configurations format.

cc: @jbleduigou @Trepix @blueyetisoftware

@hossainemruz
Copy link
Member Author

The sites config.yaml file should now follow the following format:

baseURL: https://toha.netlify.app

languageCode: en-us
title: "Toha"
theme: "toha"

# Allow raw html in markdown file
markup:
  goldmark:
    renderer:
      unsafe: true

# Enable Google Analytics
googleAnalytics: UA-122321624-2

# Enable Disqus forum
disqusShortname: toha-example-site

# Enable global emoji support
enableEmoji: true

# Custom parameters
params:
  # background image of the landing page
  background: "images/background.jpg"

  # GitHub repo URL of your site
  gitRepo: https://github.com/hossainemruz/toha-example-site

  # specify whether you want to write blog post or not
  enableBlogPost: true

  # specify the list of custom menus that you want to show in the top navbar.
  # they will be separated by a divider from the main menus.
  customMenus:
  - name: Notes
    url: https://hossainnotes.netlify.app/docs/example/

  # some information about you
  author:
    name: "Jane Doe"
    image: "images/avatar.png"
    # give your some contact information. they will be used in the footer
    contactInfo:
      email: "[email protected]"
      phone: "+0123456789"
    # a summary of what you do
    summary:
    - I am a Developer
    - I work with Go
    - I love to work with some fun projects

@hossainemruz
Copy link
Member Author

The configuration data files now has been moved from data directory to data/sections directory. The site.yaml file has been removed and respective data now should be provided in sites config.yaml file.

The new section's configuration file should follow the following format.

section:
  name: Achievements
  enable: true
  weight: 6
  showOnNavbar: true

# Your achievements achievements
achievements:
- title: Best Presenter
  image: images/achievements/presenter.jpg
  summary: Best presenter in the 2020 XYZ conference.
- title: Champion
  image: images/achievements/sport.jpg
  summary: Champion in cycling inter-city cycling championship 2020.
- title: Graduation
  image: images/achievements/graduation-cap.jpg
  summary: Received Bachelor of Science (B.Sc.) in Computer Science and Engineer from XYZ University.
- title: Award Winner
  image: images/achievements/woman-winner.jpg
  summary: Lorem ipsum dolor sit amet consectetur adipisicing elit. Possimus architecto minus facere vero?

Notice the new section section. This makes the sections dynamic and gives necessary controls to the user.

@blueyetisoftware-jason
Copy link
Contributor

blueyetisoftware-jason commented Jun 28, 2020

I like these changes. The only other item I would add is to be able to specify the url fragment as well for each section or have it match the lower-case name. For example, I would like to change the Projects section to Portfolio and Experiences to Experience

@jbleduigou
Copy link
Contributor

Hi,
Thanks for including me in the PR!
I have been busy in the last few days, so I didn’t get a chance to review changes.
I think it is great to offer more flexibility to the people using the theme.

@hossainemruz hossainemruz deleted the refactor-sections-logic branch March 13, 2021 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants