kezabelle / django-jackfrost Goto Github PK
View Code? Open in Web Editor NEWA static page generator for Django, vaguely akin to django-medusa.
License: Other
A static page generator for Django, vaguely akin to django-medusa.
License: Other
If the class has get_paths
and generate
, it's a medusa class. Wrap it so that a class implementing __call__
calls self.renderer.paths
internally.
It ought to be possible to wrap standard Django Feed classes and iterate over their items, calling the link method for each ..
Looking at the output of ./demo_project.py collectstaticsite
, it doesn't look like I'm handling URLs without trailing slashes correctly.
Not sure what to do about them, if they don't have a file extension that a server could use to hint at the content-type to return, but they certainly shouldn't end up with a /index.html
If a class has a __get
attribute (and maybe get_urls
?) assume it's a Sitemap class. Wrap it with another class which has __call__
and enumerates over the paginator and calls get_urls
per-page.
If I can get #6 done, I won't want to be writing the 401/403/404/500 templates (if they exist) to whatever storage backend is chosen multiple times (once per process).
Splitting the URLBuilder into a URLBuilder and an Errorbuilder, and calling the Errorbuilder once as part of the build process would circumvent that, at the expense of more complexity.
Having all these tests is all well and good, but I need to shove in an example project to demonstrate for myself, if nothing else, that it works.
Invoking the management command with --processes=N
or whatever (look to medusa, haystack etc to see if there's a convention) ought to split the URLCollector
's results over N URLBuilder
s. This might wreak havoc with self.stdout
though, if my recollection of haystack is anything to go by.
probably 2 tasks:
one task which collects all URLs from renderers
one task which, given a single URL, will build the page for that (probably calling utilsbuild_page_for_obj
)
the collector task can spin out a single URL task for each thing it finds ...
Could potentially add this as a CLI option for the management command?
URLReader should fetch all the responses, and shove them into an OrderedDict where the key is the target output filename and the value is the response content itself.
URLWriter should take the data from URLReader and write it to the storage backend defined.
This'll end up taking up more memory, especially if files are returned (eg PDFs, streaming responses etc) but does mean it'd be easier to hash the file contents and keep a store of that, and avoid writing unchanged files to the backend at all. This would be most useful in non-local-filesystem backends, I suspect, where the latency wouldn't be worth worrying about.
When writing a file, and the app is in INSTALLED_APPS
, log it.
Also figure out testing that output.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.