Open lheberlie opened 7 years ago
@lheberlie Since browsersync doesn't support an option like this https://www.browsersync.io/docs/options and I'm not really sure why they would, I've implimented this in the following way:
acetate@2.0.0-rc.2
, acetate.load(pattern)
now accepts an additional options object, acetate.load(pattern, options)
.basePath
which will be prepend to all page url
and dest
properties.So:
acetate.load('**/*.+(html|md)', {
basePath: 'javascript/latest' // no leading or trailing slashes
})
would now mean that all files matching **/*.+(html|md)
will now be output to build/javascript/latest
and their URLs will be served accordingly so the dev server will serve the site under /javascript/latest/
.
This does have implications for relativeUrl
thought. Since relativeUrl
is the relative path back to the root of the build folder if you use { basePath: 'javascript/latest' }
your relative URL from index.html
will now be ../../
instead of ``. To me this is expected behavior but it would be easily worked around with a transformer.
This is part of acetate@2.0.0-rc.2
which we are currently testing on the developers site but I hope to have a stable release soon.
we've had success with the basePath
option developing https://esri.github.io/arcgis-rest-js/
Hey Pat,
Request:
It would be helpful to allow for configuration while running acetate in server/watch mode to have a pathname in addition to
host
andport
.Description:
When normally running acetate in server/watch mode the dev server will launch with
http://localhost:3000/
where content is served from thebuild output
folder configuration.It would be helpful to have a configuration option where the
build output
folder configuration is served fromhttp://localhost:3000/foo/bar
and all page metadata would remain available.Justification
This will help with content creators who are not familiar with the acetate build system to author relative links correctly in markdown (
md
) pages. Often content creators will go up too far in the relative directory tree[foo](../../../folder/index.html)
which works fine when hosted fromhttp://localhost:3000
but after deployment the link is broken.Contact me if this does not accurately describe the issue.
--Lloyd
cc: @bsvensson