Coder Social home page Coder Social logo

Comments (15)

adzeitor avatar adzeitor commented on May 3, 2024

But root directive sets current dir for serving content, not for running external apps... Maybe @mholt give us a hint.

from filebrowser.

mholt avatar mholt commented on May 3, 2024

No, that makes sense. If the site is at /home/toor/www, the hugo commands probably need to be run from that directory (or somewhere around there).

from filebrowser.

hacdias avatar hacdias commented on May 3, 2024

Caddyfile should be placed where the Hugo files are placed. The root is the content served and content is what's probably causing the main problem. This directive is used to know which folder contains the main content, the markdown files. It will only affect the links, nothing else.

from filebrowser.

hacdias avatar hacdias commented on May 3, 2024

It's not that clear in the docs, sorry. I'll change it as soon as I can. Let me know if this was the misunderstanding or if it's something else.

from filebrowser.

adzeitor avatar adzeitor commented on May 3, 2024

Currently there is no way to have more than one cms with one caddy file, because users from each cms can modify files of other:

0.0.0.0:8001 {
  root ./blog1/public
  cms {
   content blog1/public
   command hugo
   args -s blog1/
  }
}

0.0.0.0:8002 {
  root ./blog2/public
  cms {
   content blog2/public
   command hugo
   args -s blog2/
  }
}

from filebrowser.

hacdias avatar hacdias commented on May 3, 2024

Oh... I see. What do you want is to have a a directive where you put the path of the "static-generator-content-things" and it runs there, isn't it? I could (or even you!) create that, it could be optional. You do you think?

from filebrowser.

adzeitor avatar adzeitor commented on May 3, 2024

Oh... I see. What do you want is to have a a directive where you put the path of the "static-generator-content-things" and it runs there, isn't it?

maybe, but this makes things complicated: root, workdir, content (not very useful) ...

search plugin use search [directory] endpoint { ... }

directory is a path within the site (can be a regular expression) that should be indexed. Default is site root.

git plugin also use similar thing. Anyway current dir for executing could be root or user defined, but not a caddy running directory.

from filebrowser.

hacdias avatar hacdias commented on May 3, 2024

@adzeitor it can't be root because those are the served files. What do you suggest?

from filebrowser.

hacdias avatar hacdias commented on May 3, 2024

Oh... I figured out that content is always the same as root. So, I can remove content variable and add workdir or something like that.

from filebrowser.

adzeitor avatar adzeitor commented on May 3, 2024

It can be root with rewrite 😄

I think it is better root than caddy workdir (if root is defined).

What do you suggest?

This syntax inspired by git and search plugin for consistency:

root /home/toor/blog1/public
cms /home/toor/blog1/ {
  command ...
}

from filebrowser.

hacdias avatar hacdias commented on May 3, 2024

So:

root [path/to/public/folder]
cms [path/to/execute/things] {
    styles  file
    command cmd
    args    args...
}

I'm thinking about merging command and args too. What do you think?

from filebrowser.

adzeitor avatar adzeitor commented on May 3, 2024

I like it.

merging command and args too

Good because it works in the same way as startup directive.

from filebrowser.

hacdias avatar hacdias commented on May 3, 2024

I'm making the changes and I found out that there's a mistake here. content =/= public. Content is the folder where are the content files like pages and posts. Public is the generated HTML. So the content directive should be used.

from filebrowser.

hacdias avatar hacdias commented on May 3, 2024

I'll update the docs to make that clearer.

from filebrowser.

hacdias avatar hacdias commented on May 3, 2024

Try executing from source to see if is good!

from filebrowser.

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.