Comments (6)
Just to report back: Custom aliases are working perfectly ! :)
Thanks for your efforts on kirbyup, it's flawless to use.
from kirbyup.
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.
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.
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.
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.
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)
- Feature request: kirbyup `--mode` CLI option HOT 2
- How to compile Sass HOT 5
- kirbyup fails silently HOT 3
- Kirby, Kirbyup & Tailwind class order issue HOT 2
- [vite:css] Cannot read properties of undefined (reading 'config') HOT 9
- Bump to v1.0.0 HOT 1
- Support dev server mode w/ HMR HOT 8
- Extremely slow starts if kirbyup.config exists HOT 3
- Use PostCSS plugins for RTL language support HOT 1
- Asset strategy HOT 1
- Invalid Url Error when using kirbyup serve HOT 4
- Vue is not defined (dev + build) HOT 6
- kirbyup exits on build error in watch mode HOT 3
- Adding external librairies HOT 1
- `--out-dir` option not working HOT 2
- npx "Repository not found" error HOT 3
- Show list size when running `build` HOT 3
- Issue when switching build process: Vue is not defined HOT 4
- kirbyup.config.js kills the process without any output HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kirbyup.