lektor-website/blog/2016/3/road-to-lektor-2/index.html

211 lines
8.4 KiB
HTML
Raw Normal View History

2022-02-20 15:15:38 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
2022-12-17 10:12:40 +01:00
<link rel="stylesheet" href="../../../../static/styles.css?h=dff0aaad">
2022-02-20 15:15:38 +01:00
<link rel="stylesheet" href="../../../../static/pygments.css">
<link rel="shortcut icon" href="../../../../static/favicon.png?h=fa09bedd">
<title>Road to Lektor 2.0 | The Transcript | Lektor Static Content Management System</title>
</head>
<body class="default">
<nav class="navbar navbar-inverse navbar-static-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed"
data-toggle="collapse" data-target="#navbar"
aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../../../../">Lektor</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../../../../downloads/">Download</a></li>
<li><a href="../../../../docs/">Documentation</a></li>
<li><a href="../../../../showcase/">Showcase</a></li>
<li><a href="../../../../plugins/">Plugins</a></li>
<li><a href="../../../../community/">Community</a></li>
<li class="active"><a href="../../../">Blog</a></li>
</ul>
</div>
</div>
</nav>
<div class="body-wrapper">
<div class="blog-post">
<div class="page-banner page-banner-500" style="background-image: url(header.jpg)"></div>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="meta-bar">
<h1>Road to Lektor 2.0</h1>
<p class="meta">
by
<a href="https://twitter.com/mitsuhiko">Armin Ronacher</a>
on Thursday, March 10, 2016
</p>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="text-block text-block-default">
<p>It's great to see what people have been building with Lektor so far. It also
shows us what still needs to be built. For a lot of things we improved for
Lektor 2.0 which is going to release very soon indeed. To give you some ideas
what's going to change here is a current brief look into the changelog and
what has been changed so far.</p>
<h2 id="page-discovery">Page Discovery</h2><p>One of the biggest frustrations users have voiced is the inability to control
discoverability of pages. In Lektor 1.0 you can only hide pages entirely in
which case the build process skips over them but there was no way to hide them
by default from queries. While you could always hide pages by changing the
query, this did not work for pagination and it also required you to be quite
careful with the queries you are writing in templates.</p>
<p>In Lektor 2.0 we introduced the system <code>_discoverable</code> attribute which allows
you to easily hide pages from any query. Queries can explicitly include
undiscoverable pages but you do not need to take care of this yourself. This
makes it possible to automatically hide drafts from blogs for instance. Lektor
will still build it but without knowing the URL you cannot see it on the
overview.</p>
<h2 id="virtual-paths">Virtual Paths</h2><p>The biggest change in Lektor 2.0 is the introduction of virtual paths and
sources. This is somewhat of an under the hood change but it has big
implications on what is possible with Lektor plugins. Each page can have
virtual resources below it that can be provided by plugins. These virtual
resources are separated from the page through what is called a virtual path
which is indicated by the at-sign (<code>@</code>). For instance this blog here uses
a plugin which provides a blog archive available at <code>/blog@blog-archive</code> and
the year 2015 is available at <code>/blog@blog-archive/2015</code> etc.</p>
<h2 id="next/previous-page">Next / Previous Page</h2><p>Lektor 2.0 implements sibling support through it's virtual path system which
allows you to refer to the next or previous record easily. This is for
instance used by this blog here to link between blog posts.</p>
<h2 id="improved-alternative-support">Improved Alternative Support</h2><p>Alternatives were heavily improved. Individual fields that are absent in
content files now fall back to the primary content file. In addition it is
now possible to ask Lektor about which alternatives exist for a given source
or in total. This simplifies handling of internationalized pages greatly
but more work will be done in that field.</p>
<h2 id="improved-plugin-support">Improved Plugin Support</h2><p>Plugins now have the ability to do a few more things they could not do before:</p>
<ul>
<li>custom field types (want to render reStructuredText? You can now build a plugin)</li>
<li>custom build programs: because of the virtual source and path support you can
now build custom build programs that build things that do not exist in the
source tree. For instance you can build feeds, blog archives etc.</li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="nav-prev">
<a href="../../../2015/12/travis-and-ghpages/">Previous: Lektor Loves Travis-CI and GitHub Pages</a>
</div>
<div class="nav-next">
<a href="../lektor-at-rails-girls-summer-of-code/">Next: Lektor at Rails Girls Summer of Code 2016</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="bottomsummary">
<div class="container">
</div>
</div>
<footer>
<div class="container">
<div class="row">
<div class="col-sm-4 icon-bar">
<a href="https://github.com/lektor/lektor/" title="Lektor on GitHub"
><i class="fa fa-github"></i></a>
<a href="https://github.com/lektor/lektor/issues/" title="Report Issues for Lektor"
><i class="fa fa-bug"></i></a>
<a href="https://twitter.com/getlektor" title="Find Lektor on Twitter"
><i class="fa fa-twitter"></i></a>
<a href="https://gitter.im/lektor/lektor" title="Chat on Gitter"
><i class="fa fa-comment"></i></a>
<a href="https://github.com/lektor/lektor-website/tree/master/content/blog/road-to-lektor-2/contents.lr" title="View source for this page"><i class="fa fa-code"></i></a>
</div>
<div class="col-sm-8">
<a href="../../../../license/">License & Copyright</a>
<a href="../../../../contact/">Contact</a>
Made with <i class="fa fa-fw fa-heart" title="Heart"><span hidden>Heart</span></i> in Carinthia
</div>
</div>
</div>
</footer>
2022-12-20 07:58:42 +01:00
<script type=text/javascript src="../../../../static/app.js?h=396519c0" charset="utf-8"></script>
2022-02-20 15:15:38 +01:00
<script>
((window.gitter = {}).chat = {}).options = {
room: 'lektor/lektor',
activationElement: null
};
document.write('<button class="js-gitter-toggle-chat-button">Toggle Chat</button>');
var dnt = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
if (dnt != "1" && dnt != "yes") {
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-70822533-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
} else {
console.debug("Respecting Do-Not-Track, not running analytics.");
}
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<script src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer></script>
</body>
</html>