Giter VIP home page Giter VIP logo

Comments (8)

laktek avatar laktek commented on August 17, 2024

Hi Laneallen,

Thanks for trying out Punch.

Actually, goal of Punch is to act as both a static generator and a server. If you look into most web projects, they mainly consist of static pages (that doesn't require to be updated on each request) and also few pieces of dynamic content (most of the time that can be embedded into the static pages). Punch as a framework want to ease the development of this kind of projects. So you serve most of the request as directly using static pages and hit the server only when you need to fetch some dynamic content.

I'm working on more concrete examples to make this concept clear. Do let me know if you got any further questions or concerns.

from punch.

jtrain avatar jtrain commented on August 17, 2024

Hi Lakshan,

Reading what you've written, It sounds like you might have support for dynamically regenerating the next static page?

The way I use punch right now is to call punch p when I need my company website to change - which is quite infrequent, maybe once per week!

from punch.

laktek avatar laktek commented on August 17, 2024

@jtrain That's how Punch works when you run it locally with punch s, which allows you to preview the changes in the browser. Running the command punch p will generate all pages of the site and publish it to the specified location.

Technically it's possible to run Punch also on a remote server by using punch s. Then it would regenerate the page for each request. It would be useful for some sites which needs certain pages to be rendered per request. I'm working on an update to make this option more easier and stable.

from punch.

naholyr avatar naholyr commented on August 17, 2024

There are currently important drawbacks when using punch s:

  • generator hooks are not called
  • contents from non-default places may not refresh correctly (for this one, we may only use shared.json but it could seem a bit overkill sometimes)

It's really really useful while developing, but I'm not sure using it for production is a realistic option. And I'm not even sure this worth the effort, as we use static generators for performance, and some nginx will always dramatically outperform Node's embedded http server ;)

from punch.

laktek avatar laktek commented on August 17, 2024

@naholyr Can you open a separate ticket with an example for the issue of contents from non-default places not refreshing correctly?

In the current state, there's not much of an incentive in choosing to run Punch as server on production. But there will be some future updates, that will make it more sensible.

from punch.

naholyr avatar naholyr commented on August 17, 2024

@laktek I have two cases: blog content handler which returns a 404 on first access (I suppose it's a conception issue), and my own handler which formats date and I strangely don't get the same results when I update a template or content (I didn't exactly check out when it occurs). I'll dig a bit further to provide details and open a ticket, right ;)

from punch.

laneallen avatar laneallen commented on August 17, 2024

Here's an issue of running Punch on the server, tying in something like forever (https://github.com/nodejitsu/forever) running a purely node stack. I guess I could run node-static (https://github.com/cloudhead/node-static) and point it at the public directory.

Something to consider, let's say a group wants to maintain a site and are considering Punch. They want to maintain the site through git, pushing to the server, but also maintain templates (especially since images reside in the templates directory), content, posts with multiple people. Currently, if someone pushes posts using git, they would have to generate the site with the workaround above using forever and node-static.

Or am I missing another option?

from punch.

 avatar commented on August 17, 2024

You can run Punch as a HTTP server within your site's directory, but I
have no clue as to how well Punch's HTTP implementation handles traffic
compared to Apache and friends. The command is punch s, but Laktek's
documentation suggests the server mode is mainly for preview prior to
uploading.

On Wed, Feb 13, 2013 at 8:32 PM, laneallen [email protected] wrote:

Here's an issue of running Punch on the server, tying in something like
forever (https://github.com/nodejitsu/forever) running a purely node
stack. I guess I could run node-static (
https://github.com/cloudhead/node-static) and point it at the public
directory.

Something to consider, let's say a group wants to maintain a site and are
considering Punch. They want to maintain the site through git, pushing to
the server, but also maintain templates (especially since images reside in
the templates directory), content, posts with multiple people. Currently,
if someone pushes posts using git, they would have to generate the site
with the workaround above using forever and node-static.

Or am I missing another option?


Reply to this email directly or view it on GitHubhttps://github.com//issues/37#issuecomment-13528776.

Matthew Graybosch
"Still you wait for a hero, a brave and noble Adversary to stand as your
liberator."
--from Without Bloodshed, coming soon from Curiosity Quills Press

from punch.

Related Issues (20)

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.