GithubHelp home page GithubHelp logo

Comments (3)

skx avatar skx commented on September 26, 2024

Biggest blocker here is that the plugins do not have access to the Templer::Site object. They have access to the Templer::Global and the Templer::Site::Page.

Two options here:

  • Store the site object in the global config (quick-fix).
  • Pass the site to the plugin(s) too.

Otherwise adding the pages should be simple if they can be mock-objects:

  #!/usr/bin/perl -w
  use strict;
  use warnings;

  my @pages = qw! one two three!;
  my $updated = 0;

  foreach my $page ( @pages )
  {
      print "Page: $page\n";
      push( @pages, qw! four five six seven ! ) unless( $updated) ;
      $updated += 1;
  }

This sample demonstrates how I expect the main loop of Templer::Site could be enhanced - just at the foot of each iteration look for the addition of a new hash-ref via Templer::Site::addPage, or similar.

from templer.

skx avatar skx commented on September 26, 2024

I've not forgotten about this, and the changes to #11 mean that now we do pass round a Templer::Site object.

This means we should be able to do everything we need.

from templer.

skx avatar skx commented on September 26, 2024

This has been resolved for some time now, but I'll leave it open until #31 is resolved.

That will give us the ability to create a plugin with two methods:

  • init
    • Save away the Templer::Site object.
  • cleanup
    • Use the site-object we saved, to generate extra/random output pages.

As it happens this is used exactly to generate my site-map file for https://steve.fi/.

from templer.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.