Coder Social home page Coder Social logo

Compiling to given directory about phrozn HOT 9 CLOSED

pawka avatar pawka commented on July 30, 2024
Compiling to given directory

from phrozn.

Comments (9)

farazdagi avatar farazdagi commented on July 30, 2024

Agreed on both fronts. Will see if I can push it into hotfix release (0.2.1) next week.

Thanks!

from phrozn.

tobiassjosten avatar tobiassjosten commented on July 30, 2024

Awesome! I'll see if I can free up some time to try and help you out with some actual code, unless you beat me to it.

from phrozn.

alexgieg avatar alexgieg commented on July 30, 2024

Hi. I'm experiencing this problem in 0.5.3 beta. phr up src dest appends "/.." to dest, generating files in src/../. The workaround is to use something like phr up src dest/discarded_word.

Edit: Moved --regen issue to #76.

from phrozn.

wdalmut avatar wdalmut commented on July 30, 2024

Hi @alexgieg,

can you explain more what you are doing? In my env static generation works fine,

$ mkdir src dest
$ phr init src
$ ls -las src/
4 drwxrwxr-x 3 walter walter 4096 Feb  5 19:08 .
4 drwxrwxr-x 3 walter walter 4096 Feb  5 19:08 ..
4 drwxrwxr-x 9 walter walter 4096 Feb  5 19:08 .phrozn

$ phr up src dest
Phrozn 0.5.3DEV by Victor Farazdagi

Starting static site compilation.

  [OK]      Source directory located: /home/walter/git/test/src/.phrozn/
  [OK]      Destination directory located: /home/walter/git/test/dest/
  [OK]      ./src/.phrozn/entries/demos/tabs.twig parsed
  [OK]      ./dest/demos/tabs.html written
  [OK]      ./src/.phrozn/entries/demos/modal.twig parsed
  [OK]      ./dest/demos/modal.html written
  [OK]      ./src/.phrozn/entries/demos/twipsy.twig parsed
  [OK]      ./dest/demos/twipsy.html written
  [OK]      ./src/.phrozn/entries/demos/popup.twig parsed
  [OK]      ./dest/demos/popup.html written
  [OK]      ./src/.phrozn/entries/about.twig parsed
  [OK]      ./dest/about/index.html written
  [OK]      ./src/.phrozn/styles/bootstrap.less parsed
  [OK]      ./dest/styles/bootstrap.css written
  [OK]      ./src/.phrozn/styles/default.less parsed
  [OK]      ./dest/styles/default.css written
  [OK]      ./src/.phrozn/scripts/default.js parsed
  [OK]      ./dest/scripts/default.js written
  [OK]      ./dest/media/README copied
  [OK]      ./dest/media/img/phrozn.png copied
  [OK]      ./dest/media/img/README copied

Phrozn is extremely flexible static site generator for PHP.
For additional information, see http://phrozn.info


$ ls -l dest/
total 32
drwxrwxr-x 2 walter walter  4096 Feb  5 19:09 about
drwxrwxr-x 2 walter walter  4096 Feb  5 19:09 demos
-rw-rw-r-- 1 walter walter 10328 Feb  5 19:09 index.html
drwxrwxr-x 3 walter walter  4096 Feb  5 19:09 media
drwxrwxr-x 2 walter walter  4096 Feb  5 19:09 scripts
drwxrwxr-x 2 walter walter  4096 Feb  5 19:09 styles

Effectively --regen seems not working properly.

from phrozn.

wdalmut avatar wdalmut commented on July 30, 2024

This could be related to #75

from phrozn.

alexgieg avatar alexgieg commented on July 30, 2024

Ah! I got what was wrong. Instead of using src, my script was referring to src/.phrozn:

With a relative destination path:

$ mkdir src dst
$ phr init src
$ phr up src/.phrozn dst
Phrozn 0.5.3 by Victor Farazdagi

Starting static site compilation.

  [OK]      Source directory located: /home/private/a/src/.phrozn/
  [OK]      Destination directory located: /../
  [OK]      ./src/.phrozn/entries/index.twig parsed
  [OK]      /../index.html written
  [OK]      ./src/.phrozn/entries/demos/tabs.twig parsed
  [OK]      /../demos/tabs.html written
  [OK]      ./src/.phrozn/entries/demos/twipsy.twig parsed
  [OK]      /../demos/twipsy.html written
  [OK]      ./src/.phrozn/entries/demos/modal.twig parsed
  [OK]      /../demos/modal.html written
  [OK]      ./src/.phrozn/entries/demos/popup.twig parsed
  [OK]      /../demos/popup.html written
  [OK]      ./src/.phrozn/entries/about.twig parsed
  [OK]      /../about/index.html written
  [OK]      ./src/.phrozn/styles/bootstrap.less parsed
  [OK]      /../styles/bootstrap.css written
  [OK]      ./src/.phrozn/styles/default.less parsed
  [OK]      /../styles/default.css written
  [OK]      ./src/.phrozn/scripts/default.js parsed
  [OK]      /../scripts/default.js written
  [FAIL]    /home/private/a/src/.phrozn/media/README: Failed transfering "/home/private/a/src/.phrozn/media/README" from media folder
  [FAIL]    /home/private/a/src/.phrozn/media/img/README: Failed transfering "/home/private/a/src/.phrozn/media/img/README" from media folder
  [FAIL]    /home/private/a/src/.phrozn/media/img/phrozn.png: Failed transfering "/home/private/a/src/.phrozn/media/img/phrozn.png" from media folder

(Followed by several error messages due to the root filesystem being read-only.)

With an absolute destination path:

$ mkdir src dst
$ ls
dst/ src/
$ phr init src
$ phr up src/.phrozn ~/a/dst
Phrozn 0.5.3 by Victor Farazdagi

Starting static site compilation.

  [OK]      Source directory located: /home/private/a/src/.phrozn/
  [OK]      Destination directory located: /home/private/a/dst/../
  [OK]      ./src/.phrozn/entries/about.twig parsed
  [OK]      ./dst/../about/index.html written
  [OK]      ./src/.phrozn/entries/demos/popup.twig parsed
  [OK]      ./dst/../demos/popup.html written
  [OK]      ./src/.phrozn/entries/demos/tabs.twig parsed
  [OK]      ./dst/../demos/tabs.html written
  [OK]      ./src/.phrozn/entries/demos/twipsy.twig parsed
  [OK]      ./dst/../demos/twipsy.html written
  [OK]      ./src/.phrozn/entries/demos/modal.twig parsed
  [OK]      ./dst/../demos/modal.html written
  [OK]      ./src/.phrozn/entries/index.twig parsed
  [OK]      ./dst/../index.html written
  [OK]      ./src/.phrozn/styles/default.less parsed
  [OK]      ./dst/../styles/default.css written
  [OK]      ./src/.phrozn/styles/bootstrap.less parsed
  [OK]      ./dst/../styles/bootstrap.css written
  [OK]      ./src/.phrozn/scripts/default.js parsed
  [OK]      ./dst/../scripts/default.js written
  [OK]      ./media/img/phrozn.png copied
  [OK]      ./media/img/README copied
  [OK]      ./media/README copied

$ ls dst
(empty)
$ ls
about/      demos/      dst/        index.html  media/      scripts/    src/        styles/

I guess a sanity check with an error message would solve this nicely, but it'd be more interesting if the src folder could actually be a direct folder rather than a hidden .phrozn subfolder within an otherwise empty folder. It'd make editing and moving things around easier for the case when one has the source in one place and the generated content elsewhere. Perhaps something like a phr init --bare src command resulting in this:

$ mkdir src
$ phr init --bare src
$ ls src
archive/    config.yml  entries/    layouts/    media/      plugins/    scripts/    styles/

With a corresponding phr up --bare src dst, or even a self-detecting phr up that'd show an error message and require an explicit dst when a bare src was detected. It'd certainly help my workflow. What do you think? :)

Edit: Moved --regen issue to #76.

from phrozn.

wdalmut avatar wdalmut commented on July 30, 2024

I think that this issue is absolutelly related to PR #75 that should simplify the project generation.

The regenerate option not working I think that we need to open a dedicated issue for this problem in order to simplify issues management.

from phrozn.

alexgieg avatar alexgieg commented on July 30, 2024

Hi! Sorry for the delay. True enough, I'm opening a new issue about the regen not working: #76.

from phrozn.

farazdagi avatar farazdagi commented on July 30, 2024

Compiling into custom directory is now implemented. And since -R/--regen issue got its own ticket, closing this one.

from phrozn.

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.