Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Ama M
@amachefe
Is there a way to convert WordPress template/themes into Lektor templates? Any idea how i can migrate a wordpress site into Lektor themes?
Ionuț Ciocîrlan
@xlotlu
@amachefe no, there's absolutely no way except for understanding lektor as a framework, the theme's html / templates, and porting it manually.
Jon Koenig
@jonmkoenig
Hello, I noticed that after building a Lektor site the <a> tags don't actually seem to direct you to the other pages within content, am I looking at this wrong or have I missed a step?
Sergi
@sponsfreixes
After creating a new project with lektor quickstart, I created a new model and layout (home.ini and home.html). I added _model: home to the root contents.lr, but something is not right. On the admin UI it's still showing the fields of the default model (page.ini). I checked the docs and how the other pages created by the quickstart are set, and I can't see what I am doing wrong. Any tips?
Sergi
@sponsfreixes
nvm, figured it out... I had typed ___ instead of --- as separator on the contents file...
Ionuț Ciocîrlan
@xlotlu
@jonmkoenig you probably did something wrong in the template. Use the url filter: <a href="{{ record|url }}">, or {{ '/hardcoded/path' | url }}
That is, if it's a template issue. If you want to link from content to content in markdown, you'll have to link manually, either using relative or absolute path.
Markus
@derdritte
Hi everyone, I wanted to try to upgrade to 3.2.0 today and I found out after some fiddling that the thumbnail-generation now no longer works via a plugin but is part of lektor. I have a config for that thumbnail generation which essentially pre-generates thumbnails for me to use in content rather than templates. I looked in the documentation but I didn't find any reference to that, is it still possible to blindly generate thumbnails for certain widths/heights?
Ionuț Ciocîrlan
@xlotlu
Thumbnail generation has been part of lektor for a long time in this template-driven form, 3.2 just brought some upgrades
Markus
@derdritte
@xlotlu That is the plugin I was refering to before, unfortunately there appears to be a compatability issue between lektor 3.2.0 and lektor-thumbnail-generator 0.4.0. The issue appears to be that "computed_height" was removed in favour of "compute_dimensions" in lektor (the former of which the plugin in the current version relies upon). Should I create a new issue in the repo for the plugin? The fix should be relatively simple assuming there are no more breaking changes.
Markus
@derdritte
The change can be done in two lines (import and one function call to be edited). While the call has changed further this API-change was already anticipated, but an already merged change was reverted in the last commit (on the plugin) which also introduced an enforced Gaussian blur which is a choice that doesn't really make sense to me.
Markus
@derdritte
I also noticed refreshing the build via the admin-ui only marks the tree as dirty and does not actually trigger a rebuild on it's own.
Markus
@derdritte
Sorry for spamming the channel, I have created a pull-request with the plugin that would solve my personal issues: skorokithakis/lektor-thumbnail-generator#3
Stavros Korokithakis
@skorokithakis
@derdritte I've replied, thanks!
Ionuț Ciocîrlan
@xlotlu

I also noticed refreshing the build via the admin-ui only marks the tree as dirty and does not actually trigger a rebuild on it's own.

@derdritte report a bug?

Markus
@derdritte
@xlotlu I guess I will.
Hanny Goodwin
@hannylicious
Has anyone tried or used a headless CMS like ghost to create the content, then used Lektor to create the static pages from it?
Ionuț Ciocîrlan
@xlotlu
@hannylicious I don't see how that could happen. Lektor comes with its own data backend: the filesystem structure under the content folder. Its core design never considered an external data source.
You could of course write a plugin that generates pages from an external API, using lektor's "virtual source objects" (they're documented, it's the mechanism e.g. lektor-tags uses to publish tag pages). But it's just some very custom code plus duct tape, it wouldn't take advantage of lektor's models.
Ionuț Ciocîrlan
@xlotlu
@hannylicious if you have a clear vision of how this would work, do submit an issue. It would be an interesting direction for lektor to take indeed.
Jorn Vanloofsvelt
@JVanloofsvelt
Hello guys, where and in which repository can I find 'installer.py'?
Jorn Vanloofsvelt
@JVanloofsvelt
@nixjdm Hello Joseph, I created an issue regarding the installer.py. I believe I fixed it, you will find a gist linked in the comments of this issue: lektor/lektor#808
Jorn Vanloofsvelt
@JVanloofsvelt
I found the installer.py file in the lektor-website repository, I made a pull-request there.
Jorn Vanloofsvelt
@JVanloofsvelt
Jorn Vanloofsvelt
@JVanloofsvelt
@goanpeca Hello Gonzalo, do you want to take a look at my pull-request?
Eric Ma
@ericmjl
Hey everybody! I'm using the checkboxes type in a model (let's call it the case_studies model). The field that uses checkboxes is the fields.authors field. I'd like to populate it from another model's entries, i.e. the teammates that have been created. Is this possible? Or might I be thinking a bit too far-fetched here? (No worries if it isn't supported, I just was thinking of minimizing duplication, so we could use one source of truth for "who can author a case study".)
Clint Johnson
@clintmjpy_gitlab
Hello friends, if any one has any resources regarding a Flask / Lektor integration please let me know.
Diogo Duarte
@dduarte-odoogap
@clintmjpy_gitlab i guess that integrating with Flask will be easy, Lektor is just static publishing so just reserve a main route for Flask on NGINX (e.g. "/dynamic"), this way you will be able to use ajax on your static pages
Ghost
@ghost~5f6e0e25d73408ce4fefe628

Hi everyone, I have an issue using the "markdown" type in model. The markdown is rendered outside its parent in the template.
model:

...
text: Lorem ipsum dolor sit amet
...

template:

<p class="card-description">
    {{ this.text }}
</p>

rendered html:

<p class="card-description">
</p>
<p>Lorem ipsum dolor sit amet</p>
<p></p>

Do someone know what can cause this problem?

Дамјан Георгиевски
@gdamjan
is there any documentation how exactly to write the "query" in [pagination] items = … ? I basically want only content that has pub_date to be in the list
I've tried items = "this.children.filter(F.pub_date)" but the list is empty then
Andrea
@andrearicci
Hi, the local server doesn't update the webpage when I save a content, or CSS. I have to reach the browser window and hit refresh. Isn't the server a pushing the changes to the browser?
evilangel-ru
@evilangel-ru

Hello, guys. Could you help me with this issue. I need to put a link to specific version of css file. For example:

<script src="./assets/js/paper-kit.min.js?v=2.3.1" type="text/javascript"></script>

But if I use asseturl filter like that

<script src="{{ '/static/js/plugins/paper-kit.min.js?v=2.3.1'|asseturl}}" type="text/javascript"></script>

there is an empty link in a result page.
How I can solve this?

Mountain/\Ash
@mountainash_twitter
@andrearicci Out of the box there's no server push (to the browser) on change (that I've seen). But there maybe a plugin that does this. Report back if you find one - as I'd also be interested.
@evilangel-ru as it's a static server the version (v) query isn't doing anything functional. You can drop it from the URI and just call paper-kit with {{ '/static/js/plugins/paper-kit.min.js'|asseturl}} and ensure the actual content of the paper-kit.min.js file in your project are from v2.3.1.
Sviatoslav Sydorenko
@webknjaz
Hello, I want to publish a static file in the root of the built site. I know that I can just have a post-step putting it there after the lektor run. But is there any lektor-native way to do it?
Nevermind, I need to learn to read: assets does that. https://www.getlektor.com/docs/project/structure/
Sviatoslav Sydorenko
@webknjaz
Does anybody know how to truncate blog posts? Jinja2 templates expose HTML-highlighted content that's already converted to markdown. So using {{ post.body | string | truncate(leeway=5) }} emits broken HTML (as in <p>...... w/o closing </p>)
1 reply
Fritz Feger
@fritzfeger
What is the easiest way to make the blog list appear on the start page?
Sviatoslav Sydorenko
@webknjaz
@fritzfeger this: webknjaz/.me@d10bb0f
Fritz Feger
@fritzfeger
@webknjaz brilliant. Thank you!
Monette
@Monette5
Hi, I am using Lektor in a site migration. I am having difficulty in creating a dropdown navigation menu for the site. I have been trying to extend the information in the docs but I can't get this to work. Has anyone managed a navigation dropdown?
Mountain/\Ash
@mountainash_twitter
@Monette5 Lektor outputs HTML, it's not responsible for the layout/design of it. There's many, many ways you can design your dropdown navigation. By having Lektor output HTML into a list (as documented here https://www.getlektor.com/docs/templates/navigation/ ) you can then use a combination of CSS (and optionally Javascript) to create a drop-down menu - there's hundreds of example here: https://codepen.io/search/pens?q=dropdown+navigation
Roberto Arista
@roberto-arista
Hey there!
I have a question concerning Alternatives. According to the docs, in order to create some alternative content, I need to duplicate the entire .lr file and this option worry me. Let’s say I want to add a Spanish translation to a website that has English as the main language. If I understood correctly the process, I need to duplicate the .lr files, add the language extension (fe: contents+es.lr) and change the content from English to Spanish. The issue I see with this process is that not everything needs to be translated, for example, images. Some images may have some text that needs to be translated into Spanish, but most of them do not. Is it possible to avoid duplication?
Is there a way to keep the alternative content inside the main .lr file? Any example of a lektor code base with alternatives to look into?
Thanks
Mountain/\Ash
@mountainash_twitter
@roberto-arista The image isn't "embedded" into the .lr file - so you can just reference the same image (it's just a link). May many pages of the site (and "alternatives" can reference the same image - it's not effected by the image)... if fact: lektor has a "problem" - all attachments (inc. images) will always be outputted to the "primary" alternative (so you will have /en/ in the URL to the image, even if it's a "ES" image).
3 replies
Monette
@Monette5
@mountainash_twitter Thank you very much for your advice. I had managed to get it working using a mix of bootstrap and Lektor navigation.
Mountain/\Ash
@mountainash_twitter
Is there a way to reduce Lektor Admin to not show both the "overlaid" and "primary" when using Alternatives? We have 3 languages, but by showing 4 Alternatives it's confusing for Content Producers and content is lost/out-of-sync as some times users update the Primary and sometimes the overlaid.
Mountain/\Ash
@mountainash_twitter
Or is there a way to keep the Lektor Admin preview on the "primary" instead of jumping to the "overlaid" each time a change is saved?
Monette
@Monette5
Is there a way to size an image using markdown - avoiding html?