Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:53
    emmapeel2 edited #12
  • Mar 29 20:47
    Travis lektor/lektor-website (master) still failing (1343)
  • Mar 29 19:39
    runfalk commented #12
  • Mar 29 14:16
    paternal synchronize #19
  • Mar 29 14:05
    paternal synchronize #19
  • Mar 29 10:10
    emmapeel2 commented #11
  • Mar 29 10:08
    emmapeel2 opened #12
  • Mar 28 22:57
    FranklinYu commented #25
  • Mar 28 20:46
    Travis lektor/lektor-website (master) still failing (1342)
  • Mar 28 18:41
    yagebu synchronize #746
  • Mar 28 18:14
    yagebu opened #746
  • Mar 28 13:11
    runfalk commented #739
  • Mar 28 13:11

    runfalk on master

    Upgrade react-router (#739) * … (compare)

  • Mar 28 13:11
    runfalk closed #739
  • Mar 28 13:08
    lsrdg commented #745
  • Mar 28 13:07
    lsrdg commented #745
  • Mar 28 12:44
    runfalk commented #744
  • Mar 28 11:42
    runfalk commented #745
  • Mar 28 10:29
    lsrdg opened #745
  • Mar 27 23:48
    barser edited #744
Florian Merges
@fmerges
@ostudalidstva your problem is that 'this' is undefined. The 'alt' is available in a template context for a record object. Can you paste some lines of code?
ostudalidstva
@ostudalidstva

Hello, this is my macro
{% macro render_blog_post(post, from_index=false) %}

<li><div class="nazory"> <img src="{{ post.img }}"><div class="blog-post">
<h1>{{ post.title }}</h1>
{{ post.description }}
<div class="morelink">
<a href="{{ post | url }}">{{ bag('articles', this.alt, 'showmore') }}</a>
</div>
</div>
</div>
</li>
{% endmacro %}

Florian Merges
@fmerges
@ostudalidstva have you tried to change this.alt to post.alt?
Diogo Duarte
@dduarte-odoogap
does anybody know where i can find a good example for a jinja filter plugin? Seen the Shout and Slugify but none of them access the relative path
Andreas Petersell
@petersell

Hello, me as a simple Technical Writer have Python 3.8 installed. Now I want to switch to Asciidoc but get following error:

File "C:\Users\anwender\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 854, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\anwender\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden

Any help appreciated.

Sergey Grigorchuk
@madsaylor
@fmerges thanks a lot
btw I decided to go with Hugo in the end
Andreas Petersell
@petersell
It looks as if the lektor-asciidoc plugin does not work under Python3. That´s a pitty.
Florian Merges
@fmerges
@petersell Make sure you installed 'asciidoc' and it is in your PATH. It's an external dependency that the plugins calls via subprocess.Popen
@madsaylor You are welcome. Just out of curiosity, what made you go with Hugo at the end?
Andreas Petersell
@petersell
Thank you @fmerges - to be honest: I am too stupid to install asciidoc on my windows machine. I have extracted it and were able to build the docs in html format. I have added following PATH variable: "C\Asciidoc" (there the asciidoc.py is located). Same error again. How do I install a .py-module on Windows?
Boris Tomic
@kodmasin_gitlab
image.png
I am having problem installing lektor on windows 10 WLS (Ubuntu 18.4). I am getting error: can't open file './src/virtualenv.py': [Errno 2] No such file or directory(see above screenshot). If someone have solution to this problem please share.
Florian Merges
@fmerges
@petersell the module tries to execute asciidoc and not asciidoc.py. Modify the PATHEXT variable to include Python scripts. E.g: PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY
Florian Merges
@fmerges
@kodmasin_gitlab might it be that the installation procedure has problems with the WLS part? Haven't tried it so I dunno.
Andreas Petersell
@petersell
Thank you for your prompt support, @fmerges. I´ve added the new file extension but same error again. BUT: I switched successfully to lektor-asciidoctor plugin 0.1 - There everything works fine.
Franklin Yu
@FranklinYu
Hi everyone. Is there anyway to install a plugin from Git? The documentation page only mentions “published plugins”.
Franklin Yu
@FranklinYu
If we install it in the venv, should lector automatically pick it up?
Gonzalo Peña-Castellanos
@goanpeca
You can embed a plugin if you add it inside the packages script
So you could use a git submodule?
Or something like this
Where you write your pugin directly within that repo inside the packages folder
Franklin Yu
@FranklinYu
I though that there is something better… Like pip, which supports dependency over Git. Guess I’ll get back to git submodule then.
Franklin Yu
@FranklinYu
@goanpeca By the way do you have access (privilege to merge PR) in https://github.com/nixjdm/lektor-atom? I see that some issues are assigned to you.
Franklin Yu
@FranklinYu
To be specific, I was talking about nixjdm/lektor-atom#25. I was going to maintain my fork with this fix, so it would be really nice to have this included in a new release.
Florian Merges
@fmerges
@FranklinYu nothing stops you of packaging your own plugins and simply adding them to the [packages] section handling the installation yourself be it using a requirements.txt with pip or an installation script
@FranklinYu meaning you don't have to use git submodules for it
Andreas Petersell
@petersell
Inside my blog.html template I like to paste a "read more..."-Link. But both in the "lektor-read-full-post" and in the "lektor-markdown-excerpt" I get following error: E blog/index.html (AttributeError: 'HTML' object has no attribute 'source'). I am a bit disappointed because it is a feature I expect to be a part of the core blogging engine. Means it is held up to date etc. What can I do? Thank you in advance.
Gonzalo Peña-Castellanos
@goanpeca
Do you have a link to your repository? And the example page?
Florian Merges
@fmerges
@petersell Its difficult to help based on your description. I understand you are trying these two plugins out. Did you follow the instructions listed on the plugin repository?
leonid-dubov
@leonid-dubov
Hello, trying to reinstall lektor on MacOs 10.15.3, there is some problem with Python version
This script will install Lektor on your computer.

   Lektor seems to be installed already.
   Continuing will delete:
   /usr/local/lib/lektor
   and remove this symlink:
   /usr/local/bin/lektor

Continue? [Yn] y

Installing at:
  bin: /usr/local/bin
  app: /usr/local/lib/lektor

Continue? [Yn] y
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file './src/virtualenv.py': [Errno 2] No such file or directory
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file './virtualenv.py': [Errno 2] No such file or directory
Traceback (most recent call last):
  File "<stdin>", line 151, in <module>
  File "<stdin>", line 146, in main
  File "<stdin>", line 110, in install
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
leonid-dubov
@leonid-dubov
@kodmasin_gitlab @fmerges Looks like like same problem on the MacOs 10.15, I'm not sure there is a problem with WLS
I installed via the pip, but if I run lektor server
./lektor --project /Volumes/My\ Book/Documents/Code/leonid.dubov.name/lektor_prj server
 * Project path: /Volumes/My Book/Documents/Code/leonid.dubov.name/lektor_prj/leonid.dubov.name.lektorproject
 * Output path: /Users/dubov/Library/Caches/Lektor/builds/3df288b4625c2b2b421e4daaf7aa6489
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
Traceback (most recent call last):
  File "/Users/dubov/Library/Python/2.7/lib/python/site-packages/lektor/devserver.py", line 44, in build
    extra_flags=self.extra_flags)
  File "/Users/dubov/Library/Python/2.7/lib/python/site-packages/lektor/builder.py", line 980, in __init__
    con = self.connect_to_database()
  File "/Users/dubov/Library/Python/2.7/lib/python/site-packages/lektor/builder.py", line 1015, in connect_to_database
    cur.execute('pragma journal_mode=WAL')
  File "/Users/dubov/Library/Python/2.7/lib/python/site-packages/lektor/builder.py", line 1013, in <lambda>
    con.text_factory = lambda x: x.decode(system_encoding, 'ignore')
TypeError: decode() argument 1 must be string, not None
looks like it completly broken on macos 10.15
leonid-dubov
@leonid-dubov
Same installation problem on Ubuntu 19.04
Boris Tomic
@kodmasin_gitlab
@leonid-dubov @fmerges I have same problem on VirtualBox Mint 19.3, so seems to me this is problem with installation script and virtualenv version 20+
Fahd609
@Ffahd609_twitter
f
@leonid-dubov
Taro Sato
@okomestudio
Hello. I have a question about pagination. Is it possible to create a template with the pagination over pages that are not direct children of the model represented by that template?

For example, if you content is structured like this:

content/
  blog/
    article1/
    article2/
    contents.lr
  contents.lr

Is it possible to create a page corresponding to content/contents.lr which actually paginate over content/blog/article*?

Ionuț Ciocîrlan
@xlotlu
@okomestudio you can either replace the children with the blog's children (and lose access to the first-level items), or get a reference to the blog record, and iterate over that thing's pagination. I haven't tested any of them but I think both should work.
The second approach means doing the usual pagination set-up on blog, and iterating on site.get('/blog').pagination.items instead.
Ionuț Ciocîrlan
@xlotlu
aand, there is also [pagination] -- items in the model, I guess you'd set that to site.get('/blog').children and preserve this.children while having access to this.pagination
Taro Sato
@okomestudio
Thank you very much, Ionuț. These helped me get going.
I wish there is a layer in Lektor that allows us to more easily decouple the URL path mapping from the structure of the content directory.
Ionuț Ciocîrlan
@xlotlu

I wish there is a layer in Lektor that allows us to more easily decouple the URL path mapping from the structure of the content directory.

Well, that would go against lektor's core design. But it would be really, really nice to have a text-based relational database that could be plugged into Django, or SQLAlchemy. :) And a plugin that generates a static website and can generate a smart dependency tree that takes into account both the db and the templates.... :)

One can dream. There is frozen-flask that does this, I'm not sure if it can do smart dependency tracking though.