Git Product home page Git Product logo

Comments (5)

ludovicchabant avatar ludovicchabant commented on August 22, 2024 1

Ah shit, thanks! Should be fixed on master now -- I'll publish a new version on PyPi tomorrow. Cheers!

from piecrust2.

kpouget avatar kpouget commented on August 22, 2024

if I did everything right ... I got this error now :

chef --debug publish test

[piecrust.main] Using cache key: default
[piecrust.app] Creating site configuration...
[piecrust.appconfig] Loading configuration from cache...
[piecrust.cache] Reading cache: /home/kevin/travail/Documents/mcgdb_website/_cache/c21f969b5f03d33d43e04f8f136e7682/app/config.json
[piecrust.commands.builtin.scaffolding] Skipping source 'theme_pages' because it's a theme source.
[piecrust.main] init() takes 3 positional arguments but 4 were given
Traceback (most recent call last):
File "/home/kevin/travail/tools/PieCrust2/piecrust/main.py", line 70, in main
exit_code = _run_chef(pre_args, argv)
File "/home/kevin/travail/tools/PieCrust2/piecrust/main.py", line 269, in _run_chef
c.setupParser(p, app)
File "/home/kevin/travail/tools/PieCrust2/piecrust/commands/builtin/publishing.py", line 30, in setupParser
for pub in app.publishers:
File "/usr/lib/python3.5/site-packages/werkzeug/utils.py", line 71, in get
value = self.func(obj)
File "/home/kevin/travail/tools/PieCrust2/piecrust/app.py", line 195, in publishers
tgt = cls(self, n, t)
TypeError: init() takes 3 positional arguments but 4 were given

(with last git commit)

from piecrust2.

kpouget avatar kpouget commented on August 22, 2024

another nit while I'm at it :)

diff --git a/foodtruck/scm/git.py b/foodtruck/scm/git.py

index 84350cb..871cc2e 100644
--- a/foodtruck/scm/git.py
+++ b/foodtruck/scm/git.py
@@ -31,7 +31,7 @@ class GitSourceControl(SourceControl):
                 else:
                     res.new_files.append(path)
             elif line.startswith(' M '):
-                res.edited_files.append(path[3:])
+                res.edited_files.append(line[3:])
         print(res.__dict__)
         return res

and by the way, I can't get the foodtruck to work (well), in particular the static pages are not accessible, in particular http://localhost:8090/static/css/foodtruck.min.css is 404, http://localhost:8090/static/img/foodtruck.png as well ... and I can't find where you hook to treat static content differently from dynamic pages ... !

from piecrust2.

kpouget avatar kpouget commented on August 22, 2024

still playing around, I share my 'fixes' for just information, the first part of the diff tell you where are the problems :

diff --git a/foodtruck/web.py b/foodtruck/web.py
index 22f7113..376e300 100644
--- a/foodtruck/web.py
+++ b/foodtruck/web.py
@@ -34,7 +34,8 @@ if (app.config.get('FOODTRUCK_CMDLINE_MODE', False) and
 # Add a special route for the `.well-known` directory.
 app.wsgi_app = SharedDataMiddleware(
         app.wsgi_app,
-        {'/.well-known': os.path.join(admin_root, '.well-known')})
+        {'/.well-known': os.path.join(admin_root, '.well-known'),
+         '/static': "/path/to/PieCrust2/foodtruck/assets"})

 if os.path.isfile(config_path):
     app.config.from_pyfile(config_path)

get https://github.com/twbs/bootstrap-sass and useruby scss to build foodtruck.css


diff --git a/foodtruck/views/create.py b/foodtruck/views/create.py
index 841d192..4adf46b 100644
--- a/foodtruck/views/create.py
+++ b/foodtruck/views/create.py
@@ -45,8 +45,7 @@ def write_page(source_name):
                 fp.write('')
             flash("%s was created." % os.path.relpath(fac.path, site.root_dir))

-            route = site.getRoute(source.name, fac.metadata,
-                                  skip_taxonomies=True)
+            route = site.getSourceRoute(source.name, fac.metadata)
             if route is None:
                 logger.error("Can't find route for page: %s" % fac.path)
                 abort(500)

and

diff --git a/foodtruck/views/dashboard.py b/foodtruck/views/dashboard.py
index e4f1b1c..1409323 100644
--- a/foodtruck/views/dashboard.py
+++ b/foodtruck/views/dashboard.py
@@ -79,8 +79,9 @@ def _getWipData(path, site, fs_endpoints):
         return None

     fac = source.buildPageFactory(os.path.join(site.root_dir, path))
-    route = site.piecrust_app.getRoute(
-            source.name, fac.metadata, skip_taxonomies=True)
+    
+    route = site.piecrust_app.getSourceRoute(
+            source.name, fac.metadata)
     if not route:
         return None

--> naming problem?

from piecrust2.

ludovicchabant avatar ludovicchabant commented on August 22, 2024

Hey, sorry for the trouble... I didn't do a very good job with the test coverage on these parts of PieCrust :(

Anyway, first, I failed to document properly how to use FoodTruck with a source version of PieCrust. The problems you have with missing FoodTruck assets is that you have to run bower install and gulp (notice the Bower and Gulp files at the root of the PieCrust repo). This should make sure the FoodTruck assets are compiled into the static directory (and therefore you shouldn't have to edit the SharedDataMiddleware code).

Second, the Git support for FoodTruck is fairly experimental (I don't personally use Git), and I actually thought it wasn't included in the source! (i.e. I thought I kept it local). Oh well.

The other bugs should be fixed -- some I had fixes for already but it wasn't pushed yet (it is now). I'm refactoring things to make it possible to run automated tests on FoodTruck so it should get better. Sorry again!

from piecrust2.

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.