GithubHelp home page GithubHelp logo

Deploy to relative path about wintersmith HOT 6 CLOSED

jnordberg avatar jnordberg commented on August 10, 2024
Deploy to relative path

from wintersmith.

Comments (6)

jnordberg avatar jnordberg commented on August 10, 2024

Yes, you can pass a base url to all content plugins. content.getUrl(base)

I would suggest doing something like setting basePath: '/mypath' in the config locals and then use that when resolving content urls. e.g. somepage.getUrl(locals.basePath)

That way you can set the basePath to '/' when developing since the preview server runs from the webservers root

from wintersmith.

 avatar commented on August 10, 2024

This way would definetly works but adds a level of complexity : one should not forget to add locals.basePath in front of every links for his site to work everywhere.

I suggest that basePath can be used by default for every local links. So calling mypage.url or /css/main.css would return in fact /mypath/css/main.

Maybe it's better that I write a plugin for it ?

from wintersmith.

jnordberg avatar jnordberg commented on August 10, 2024

I see your point, but doing it that way would introduce a level of complexity in the plugin structure instead. I'll keep it in mind for future releases

You could write a plugin, have a look at src/contents.coffee and src/plugins/page.coffee.

from wintersmith.

00dani avatar 00dani commented on August 10, 2024

The lack of relative path support seems to me a rather big issue with this generator. It doesn't reflect well on the system's ability if the result of a simple wintersmith build doesn't work without being uploaded to a server.

In addition, the features page suggests:

Or why not publish directly to your dropbox.

This would be a great feature, but there is a reason not to do it: It won't work at all, due to the lack of relative-path output.

from wintersmith.

ericanderson avatar ericanderson commented on August 10, 2024

No action on this?

from wintersmith.

ericanderson avatar ericanderson commented on August 10, 2024

FYI, you can get this as a helper plugin now:

https://github.com/ericanderson/wintersmith-makerelative

from wintersmith.

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.