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

Page sections method should allow indexes #490

Closed
preaction opened this issue Apr 26, 2016 · 0 comments
Closed

Page sections method should allow indexes #490

preaction opened this issue Apr 26, 2016 · 0 comments
Labels
Milestone

Comments

@preaction
Copy link
Owner

We should be able to pass in the index of the section we want and get only that section, or multiple sections. This makes it easier to split up the blog sections. In scalar context, should return the number of sections.

Where right now we must:

% my @sections = $page->section;
% for my $i ( 0..$#sections ) {
    <section id="section-<%= $i %>">
        <%= $sections[ $i ] %>
    </section>
% }

With this change we can:

% for my $i ( 0 .. $page->sections ) {
    <section id="section-<%= $i %>">
        <%= $page->sections( $i ) %>
    </section>
% }

This is helpful when making links to sections, and seems easier to understand to me.

@preaction preaction added this to the v1.000 milestone Apr 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant