Comments (8)
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.
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.
@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.
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.
@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.
@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.
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.
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)
- TypeError: Cannot call method 'getTime' of null HOT 5
- Ability to add self-contained widgets (css, js, template) HOT 2
- Issues displaying {{date}} HOT 2
- style failed to compile HOT 2
- Cannot start server Connect has no method 'logger' HOT 1
- Can't get this working in a docker container
- Pulling bundle assets from outside local directory
- Punch Plugin: How to find the file path to the "templates" directory? HOT 2
- S3 gzip support
- Failed to read the configurations. HOT 1
- Copy command fails with paths that contain spaces HOT 1
- Failing basic setup HOT 2
- Trouble Implementing Autoprefixer compiler/minifier
- is this still happening? HOT 1
- Themes?
- What is the best practice for i18n?
- Creating intro.markdown in contents/_index during tutorial doesn't render the HTML HOT 1
- Custom compiler works only on generate HOT 4
- Javascript does not bundle HOT 1
- Mime.extension and Mime.lookup is not a function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from punch.