Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Document the <base> relative link strategy #17

Closed
fvsch opened this issue Jun 27, 2016 · 2 comments
Closed

Document the <base> relative link strategy #17

fvsch opened this issue Jun 27, 2016 · 2 comments
Assignees

Comments

@fvsch
Copy link
Owner

fvsch commented Jun 27, 2016

Current doc:
https://github.com/fvsch/kirby-staticbuilder/blob/master/doc/options.md#html-pages-outside-of-a-web-site

I’m not really happy with how poorly it explains how to prepare for a fully static site that may not be served with HTTP or hosted at the root of a domain.

Anyway, document the other option, which is:

// config.localhost.php
c::set([
    'plugin.staticbuilder.enabled'  => true,
    'plugin.staticbuilder.baseurl'  => '',
    'plugin.staticbuilder.uglyurls' => true
]);

// snippets/header.php
<head>
<?php
  $base = './';
  $max = $page->isHomePage() ? 0 : $page->depth();
  for($i=1; $i < $max; $i++) { $base .= '../'; }
  echo "<base url=\"$base\">";
?>
@fvsch
Copy link
Owner Author

fvsch commented Mar 1, 2017

I'm tempted to remove the relative URLs feature, only keeping the <base url="..."> strategy.

This means:

@fvsch
Copy link
Owner Author

fvsch commented Nov 11, 2017

Nope, I’ll keep the relative URLs feature and make it the default in 3.0.
It seems to work well in simple settings, and if it's broken for some things it should be fixed.

@fvsch fvsch closed this as completed Nov 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant