Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Bart Van Loon
@bbbart
what is the recommended way to set this up?
The others are not tech savvy, so synchronizing our setups with git seems unwieldy, but what about running lektor on a server behind an nginx proxy which adds htpasswd protection?
any experience with that setup here?
Joseph Nix
@nixjdm
@bbbart There isn't really a single recommended solution for that. You're right that you can put Lektor behind any sort of proxy if you like. A possibly simpler alternative is to use some simple syncing tool besides git. For instance, you could have the git repo inside Dropbox, and you can commit when you like, while the other content writers never have to worry about it (or even see the .git hidden dir). It all greatly depends on what they're really able / willing to do, and how much work you want to do. Another person on Freenode was talking about writing a custom plugin to auto-commit on after_build_all. That discussion brought #655. Lots of options here.
Joseph Nix
@nixjdm
@davidferguson It looks like we missed the target, but your PR looks so close to being done. If we get it in, I won't wait very long to make a new release. :)
Paul Führing
@Paulef_twitter
hi, anyone out there currently?
I want to host the lektor cms on a webpage and will then deploy to a second one which is being used by normal users. question: how can I protect the admin webpage using the build in lektor server?
Michael Vartanyan
@mvartanyan
@Paulef_twitter last time I checked there was no authentication mechanism inside Lektor. This is in line with its idea. What you want to do is simple to achieve by putting lektor behind a reverse proxy. We used a one-liner nginx config to add basic http auth.
Paul Führing
@Paulef_twitter
ok, still trying to figure out how that would work in my environment
next question: deployment with rsync to a different host, could someone post an example with credentials? where to specify the --xyz options?
https://www.getlektor.com/docs/deployment/rsync/
Paul Führing
@Paulef_twitter
maybe addtl question to my first issue, what's the name/type of the build in server?
Joseph Nix
@nixjdm
Thanks @jtraub91 for the collapsible flow blocks!
Joseph Nix
@nixjdm

@Paulef_twitter The arguments passed to rsync basically set. They start as -rclzv, and have other things appended to account for speciying targets, credentials, and such. So it isn't easy to specify -a for instance.

As for the credentials, an example you can mostly see is getlektor.com itself. It has lektor deploy production in the .travis.yml file, and the target specified in the project file. The bit you don't see is that in travis-ci.org we also have the environment variable LEKTOR_DEPLOY_KEY set, which is automatically looked for and used. Like https://www.getlektor.com/docs/deployment/rsync/#credentials says though, there's a few ways of getting a key recognized. Hope that helps!

Joseph Nix
@nixjdm
Alright @goanpeca, I've started adding templates https://github.com/lektor/lektor/tree/master/.github :thumbsup:
Paul Führing
@Paulef_twitter
@nixjdm I still find the documentation very confusing, the rsync example on the website is not specifying how the parameters can be used but simply states "you need to use --key-file". Anyhow, somewhat I managed to deploy finally. need to start from scratch again in a new env and note down the individual steps
maybe more a markdown question, but how can I add a target=_blank to URLs pointing to other websites?
Gonzalo Peña-Castellanos
@goanpeca
Thanks @nixjdm !
Joseph Nix
@nixjdm

@Paulef_twitter I agree. I just made lektor/lektor-website#277 for some improvements about this. Please comment on it if you nail down some specific instructions to help inform a better explanation.

About the link thing, markdown doesn't have any fanciness for that, but you can actually just put html inside markdown. So, a cheap way of doing this is to just craft that link manually as html, inside content that is otherwise normal markdown.

That's been a minor annoyance of mine for a while too. Someone should make a plugin that detects links that are external and make them all have target=_blank.

someone...
Paul Führing
@Paulef_twitter
thank you :) there's a plugin with nofollow in a tags, so the manual flagging of target=_blank links could be done by copying that plugin.
Jos Vos
@josvos
Hi, is there a way to see child objects that I do not want to render as html? E.g. having for example blog/foo/contents.lr with _hidden: yes and in blog.html referring to that object. I tried {% set myfoo = this.children.include_hidden(true).filter(F._model == 'foo').first() %} but this does not work. If I omit the _hidden in the contents that part does work, but with an (understandable) TemplateNotFound error for foo.html.
Jos Vos
@josvos
To answer my own question: it seems I have to add include_undiscoverable(true) to the query, in addition to include_hidden(true). Only if both are present, my hidden child is found.
David Ferguson
@davidferguson
@nixjdm Yeah sorry, I've been busy with a couple of other things recently. I'll try and finish the PR up soon.
Peter Bittner
@bittner
Just a heads-up: The Mark Steve Samson showcase on the Lektor website doesn't seem to run on Lektor anymore. Also, the link to its source code results in a 404.
Michael Vartanyan
@mvartanyan
Hi all, we are planning to use Lektor to organise web content management in an organisation that hosts myriads of small websites with loose governance and very thinly distributed work. We plan to integrate Lektor and add capabilities to provision and manage sites, and author content without much understanding of what is under the hood. Keep all content in a VCS and promote it to eventual websites via a CI (basically extend Lektor's philosophy of content==code). Some ideas here https://github.com/sphericalpm/lektorium , we are just starting. Comments welcome (btw, have we missed any product that already does it?), contributors even more welcome!
Sam Smith
@smth
Hi. I was wondering if Lektor has a way of using data from a remote API (at build time)?
Michael Vartanyan
@mvartanyan
@smth via a custom plugin, whatever you can do in Python https://www.getlektor.com/docs/api/plugins/events/
Marty Heyman
@martyheyman
Hello everybody. Just woke up to Lektor. Building a new-venture site.
Joseph Nix
@nixjdm
@smth Yes, anything you can do with Python. For instance, this grabs data from pypi for getlektor.com's plugin pages https://github.com/lektor/lektor-website/blob/master/packages/project-data/lektor_project_data.py
Leonid Dubov
@evilangel_ru_twitter
Hello to everyone. Have a problem with lektor server command. It falls with OSError: [Errno 2] No such file or directory
Mac OS 10.14.4
Could it be a problem with file permissions?
Joseph Nix
@nixjdm
@evilangel_ru_twitter Can you share a pastebin of the larger traceback? If it mentions which file, that would be more telling.
Leonid Dubov
@evilangel_ru_twitter
I don't know what was wrong, but I,ve updated on macOS 10.14.6 and reinstall lektor, now everything is ok. Thanks a lot
ostudalidstva
@ostudalidstva
Hello can i disable primary language posts in the alternative language list , if post has only primary language?
Ionuț Ciocîrlan
@xlotlu
@nixjdm :)
@bittner could you please make a pull request against https://github.com/lektor/lektor-website/ ... or at least file an issue?
Ionuț Ciocîrlan
@xlotlu
@mvartanyan that sounds awesome. The deployment part of your issue has appeared before, but can't remember who came up with it. I do think they managed to do the run server - commit to repo - build - deploy dance.
Ionuț Ciocîrlan
@xlotlu
ah great. @nixjdm this filetype library is only python3-compatible :| .. that's why i liked it so much i guess, 'cause it looked so clean :)
Oliver Epper
@oliverepper
I generate a lot of the assets for my lektor driven website with webpack. All files a generated into <prj>/assets/generated, even the main jinja template that needs to be copied to <prj>/templates before lektor can be run. I don't want <prj> to be the root-dir for webpack because I want to be able to use webpack-clean to clean out all generated files. My first attempt to automate the generation of my site was to move the base template file into place from within the npm start command. That works if I run npm start and then lektor serv. It does not work when I run lektor serv -f webpack. I could write a lektor plugin that moves the required file in place, but I wanted to know if any of you has a better idea. Something nice and elegant. Code: https://github.com/oliverepper/oliver-epper.de
Oliver Epper
@oliverepper
On that matter. Is there a way to run on on_before_build_all but after the webpack plugin?
Joseph Nix
@nixjdm
@oliverepper I made a related ticket to that a while back, and just updated it. #547
Oliver Epper
@oliverepper
@nixjdm Thanks a lot for the pointer. That sounds quite reasonable. For my case I've just finished a plugin that observes the assets directory via watchdog and moves webpack generated templates into place. That actually works really well. I'll setup a little demo and a pr for the plugin.
Oliver Epper
@oliverepper
Oliver Epper
@oliverepper
Can anyone please help me understand under which circumstances reporter.report_generic shows a message on the screen and when the message is suppressed. I'd like to print a message on the screen from a plugins init method. That doesn't work. Printing from the events functions like on_before_build_all does work, though.
Oliver Epper
@oliverepper
Ok. Inside of the init method the reporter is a NullReporter, inside the event method it is a CliReporter.
alexius84
@alexius84
Hello to everyone. How can I sort attached images by name? It seems they are sorted randomly :( Tried this {% set images = this.attachments.images.order_by('name') %} but it didn't work. Thank you for the answer.
Oliver Epper
@oliverepper
@alexius84 In the model file that contains the attachments you can sort them via the _path property:
[attachments]
order_by = _path
alexius84
@alexius84
Thank you. I have found the solution like this: [attachments]
order_by = _id or this works as well: this.attachments.images.order_by('_id')
Ionuț Ciocîrlan
@xlotlu
@nixjdm #680? :)