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

Migrate front-matter to nesting #69

Closed
stp-ip opened this issue Mar 22, 2018 · 6 comments · Fixed by #105
Closed

Migrate front-matter to nesting #69

stp-ip opened this issue Mar 22, 2018 · 6 comments · Fixed by #105
Milestone

Comments

@stp-ip
Copy link
Member

stp-ip commented Mar 22, 2018

Is this a BUG REPORT or FEATURE REQUEST?:
feature

What happened:
Currently we haven't defined the front-matter convention to use.

What you expected to happen:
Either use nested or use flat variables in front-matter.

Anything else we need to know?:
For almost all fragments we use nesting. So that seems to be the one we should go with.

Examples
Flat:

sidebar_heading = ""
sidebar_content = ""

Nested:

[sidebar]
  heading = ""
  content = ""
@stp-ip
Copy link
Member Author

stp-ip commented Mar 23, 2018

A few examples:

link_title = "Link Title"
logo_title = "Logo Title"
logo = "logo.svg"
logo_text = "Logo Subtext"
->
[menu]
  title = "Link Title"

[logo]
  image = "logo.svg"
  title = "Logo Title"
  subtext ="Logo Subtext"
logo = "logo.svg"
logo_width = "500px" # optional - will default to image width
logo_height = "150px" # optional - will default to image height
-->
[logo]
  image = "logo.svg"
  width ="500px"
  height = "150px"
sidebar_title = "Sidebar"
sidebar = """
So much information  
Phone numbers  
Details  
"""
-->
[sidebar]
  title = "Sidebar"
  content = """
So much information  
Phone numbers  
Details  
"""

As we are using nesting already for buttons and more complicated variables, we should default to nesting.

@stp-ip stp-ip added this to the v0.11.0 milestone Mar 25, 2018
@stp-ip
Copy link
Member Author

stp-ip commented Apr 18, 2018

Still needs input from @lauragift21 and @mpourismaiel

@stp-ip
Copy link
Member Author

stp-ip commented Apr 18, 2018

Would be good, if we can pin down the user facing format aka content files, static file usage etc. Then we can already document and users don't have to migrate between changes. Also gives us the ability to refactor internally without affecting the user.

@stp-ip stp-ip changed the title Decide on general front-matter convention for nested vs flat Front-matter convention for nested vs flat Apr 18, 2018
@mpourismaiel
Copy link
Member

I like nested format a lot more. It's more readable and much more manageable.

@stp-ip
Copy link
Member Author

stp-ip commented Apr 18, 2018

Yeah I think I agree. Looks cleaner and we make everything more consistent. So if @lauragift21 agrees, that means:
nested > flat

@lauragift21
Copy link
Contributor

Sure i agree with the nested convention it looks better.

@stp-ip stp-ip changed the title Front-matter convention for nested vs flat Migrate front-matter to nesting Apr 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants