Skip to content

Refactor page specific template variables. - #921

Merged
waylan merged 1 commit into
mkdocs:masterfrom
waylan:tvars-refactor
May 2, 2016
Merged

waylan merged 1 commit into
mkdocs:masterfrom
waylan:tvars-refactor

Conversation

@waylan

@waylan waylan commented May 1, 2016

Copy link
Copy Markdown
Contributor

A deprecation warning is issued for all old variables and all new
page specific variables are attributes of the 'page' object.

Global variables are uneffected, except page_description.

See the changes described in the release notes for details.

Fixes #874.


No global variables were altered except `page_description`. Previously
its value was altered programicaly based on whether the current
page was the homepage. Now it simply maps to `config['site_description']`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do the same thing with the config. We pass the config to the templates and a bunch of values from the config. So like you did with the others copyright would become config.copyright etc. Then we can just deprecate page_description and have people use config.site_description.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Just trying to do this one piece at a time.

@d0ugal

d0ugal commented May 1, 2016

Copy link
Copy Markdown
Contributor

This looks great, I really like this approach.

@waylan

waylan commented May 1, 2016

Copy link
Copy Markdown
Contributor Author

It was late and I was tired when I pushed this last night. I'll address the errors later today when I have some time.

@d0ugal

d0ugal commented May 1, 2016

Copy link
Copy Markdown
Contributor

Sounds good. No rush. I'm happy for the config variables to be handled in a follow up (or here, I don't mind).

@d0ugal d0ugal added this to the 0.16 milestone May 1, 2016
@codecov-io

codecov-io commented May 1, 2016 •

Copy link
Copy Markdown

Current coverage is 93.29%

Merging #921 into master will increase coverage by +<.01%

@@             master       #921   diff @@
==========================================
  Files            34         34          
  Lines          2577       2593    +16   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           2404       2419    +15   
- Misses          173        174     +1   
  Partials          0          0          

Powered by Codecov. Last updated by f57199d...5bcd79f

@waylan
waylan force-pushed the tvars-refactor branch from 5bcd79f to d6f00ab Compare May 1, 2016 23:36
A deprecation warning is issued for all old variables and all new
page specific variables are attributes of the 'page' object.

Global variables are uneffected, except page_description.

See the changes described in the release notes for details.

Fixes mkdocs#874.
@waylan
waylan force-pushed the tvars-refactor branch from d6f00ab to f8a0ac6 Compare May 1, 2016 23:40
@d0ugal

d0ugal commented May 2, 2016

Copy link
Copy Markdown
Contributor

Looks good. I'm happy for this to land, but I'll let you do it as I'm not totally sure you didn't have any extra changes planned.

@waylan
waylan merged commit f951626 into mkdocs:master May 2, 2016
@waylan
waylan deleted the tvars-refactor branch May 2, 2016 19:50
This was referenced Aug 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants