Giter Club home page Giter Club logo

Comments (6)

Daandelange avatar Daandelange commented on May 30, 2024 1

Just to report back: Custom aliases are working perfectly ! :)
Thanks for your efforts on kirbyup, it's flawless to use.

from kirbyup.

johannschopplich avatar johannschopplich commented on May 30, 2024

Hi there, good idea in general.

Quick question, tho: How should kirbyup know, which base path @ should resolve to? A simple alias to ~ wouldn't do. It would have to guess something like kirby/panel/src in the path, which then if someone uses just panel/src could possibly not be related to Kirby's Panel source at all. I can't think of a clean way to provide this functionality yet.

from kirbyup.

Daandelange avatar Daandelange commented on May 30, 2024

I could think of executing kirby()->roots('kirby') to get the kirby root, but that would mean relying on php... possible ? We still need to find kirby for this though.

Parsing kirby's config files might be a bit excessive and unreliable; otherwise recursively searching folders for the kirby dir (brute force), but that might break on some very specific setups...

And/Or assume we're in a classic installation (project/kirby and project/kirby/site/plugins/plugindir) and let users change their kirby root via a preferences file ?

from kirbyup.

johannschopplich avatar johannschopplich commented on May 30, 2024

Executing PHP for the Kirby root is unfortunately neither a semantic, nor practical way.

I honestly don't want to include an assumption-based logic. Many plugins written aren't part of an installation, but rather outsourced into their respective repo.

For your (edge?) case, I recommend just copying Kirby's panel folder to the same level as your plugin's JS entry. We could then add @ as an alias to ~, which would make Kirby's internal paths work.

from kirbyup.

Daandelange avatar Daandelange commented on May 30, 2024

Thanks, didn't think about that option, even better, creating a symlink to kirby files instead of copying them.
What about making @ point to plugin/kirby, kirby being an optional folder or alias one can use to point to Kirby.
Meanwhile I'm curious what the kirby team's position is about extending core components.

from kirbyup.

johannschopplich avatar johannschopplich commented on May 30, 2024

Symlink sounds great. I'm not a fan of some custom subfolder, since @/ is common as a root directory name alias (just like ~/). Thus, I don't intend to break an expected behavior. Symlinking panel will work just as well.

Added a secondary alias in d4c479c, available in kirbyup 0.20.0+.

Please open a separate issue over at the Kirby repo for your question on Panel source reusability within Panel plugins. Thanks!

Edit: I intend to add support for a custom kirbyup.config.js, but that will have to wait a bit.

from kirbyup.

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.