lektor / lektor-website Goto Github PK
View Code? Open in Web Editor NEWThe main lektor website.
Home Page: https://www.getlektor.com/
License: Other
The main lektor website.
Home Page: https://www.getlektor.com/
License: Other
I'd like for the Lektor installer to allow setting a custom directory to install (only when explicitly called with that option).
For example:
I started lektor server inside lektor-website (venv activated)
Web site looks great.
After switced to admin (http://localhost:5000/admin/root/edit), nothing in admin, so i looked the page source and found:
<!doctype html>
<title>Lektor Admin</title>
<link rel=stylesheet type=text/css href="/admin/static/gen/styles.css">
<div id=dash>
<div class=loadbox>
<p>Loading Interface ...</p>
<noscript>You must enable JavaScript to use the editing interface.</noscript>
</div>
</div>
<script type=text/javascript>
var $LEKTOR_CONFIG = {
admin_root: "/admin",
site_root: "",
lang: "en"
};
</script>
<script type=text/javascript src="/admin/static/gen/vendor.js"></script>
<script type=text/javascript src="/admin/static/gen/app.js"></script>
Ubuntu 16
Python 2.7.13
node: v4.2.6
npm: 3.5.2
$ git clone https://github.com/lektor/lektor
$ cd lektor
$ virtualenv venv
$ . venv/bin/activate
$ pip install --editable .
$ make build-js
$ make install-git-hooks
$ export LEKTOR_DEV=1
I wanted to install on Windows 10. Thinking that ImageMagick might be a pain to install I tried installation under WSL. When I do this I find that install.sh resolves some odd installation directories:
brianly@Aotearoa:~$ curl -sf https://www.getlektor.com/install.sh | sh
()
Welcome to Lektor
()
This script will install Lektor on your computer.
()
Installing at:
bin: /mnt/c/Go/bin
app: /mnt/c/Go/lib/lektor
()
Continue? [Yn]
I have Go installed under Windows and it seems to want to install there. If I look at my $PATH variable under WSL it looks like it includes values from Linux and Windows:
brianly@Aotearoa:~$ $PATH
-bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Program: No such file or directory
Running the find_user_paths() function independently under WSL I get:
>>> def find_user_paths():
... rv = []
... for item in os.environ['PATH'].split(':'):
... if os.access(item, os.W_OK) \
... and item not in rv \
... and '/sbin' not in item:
... rv.append(item)
... return rv
...
>>> find_user_paths()
['/mnt/c/Users/brian/AppData/Local/Microsoft/WindowsApps', '/mnt/c/Go/bin', '/mnt/d/Sysinternals', '/mnt/c/Users/brian/AppData/Roaming/npm', '/mnt/d/SFBin/windows/docker']
I haven't done enough research to understand the expected behaviour with paths, but I see similar behavior on another computer running WSL under Windows 10.
Hi all,
Are there any release notes or document pointing out the differences between Lektor 2 vs 3? We'd like to move a large web site from v. 2 to 3 but it's not clear what are the differences and if there are major changes we need to handle manually. Is it a transparent operation, so we can just rebuild the site with V3 and expect everything to work (plugins included)? Thank you.
As I'm refactoring the plugin page I notice that lektor-asciidoc is not published on pypi. I think that makes it hard enough to use that we should remove it from the list until that's changed. I want to make that a policy change - GitHub isn't enough to be listed on this site.
As a related note, the refactoring relies on information pulled from the Warehouse's JSON API. I don't want to support other python repositories since that's so rare. And for the above reason, I'm also don't want to support effectively unlisted plugins.
I got an exception when install lektor by the install script
$ curl -sf https://www.getlektor.com/install.sh | sh
...
Traceback (most recent call last):
File "<stdin>", line 142, in <module>
File "<stdin>", line 130, in main
File "/usr/lib/python3.5/json/__init__.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
I'm using
$ python --version
Python 3.5.2
Reproduce with traceback of exception
$ python installer.py # extracted from the SH script
Welcome to Lektor
This script will install Lektor on your computer.
Installing at:
bin: /home/hvn/py35env/bin
app: /home/hvn/.local/lib/lektor
Continue? [Yn] y
Traceback (most recent call last):
File "installer.py", line 140, in <module>
main()
File "installer.py", line 128, in main
for url in json.load(urlopen(VENV_URL))['urls']:
File "/usr/lib/python3.5/json/__init__.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
A quick workaround to make it work on Python 3
$ diff installer.py orig.py
128c128
< for url in json.loads(urlopen(VENV_URL).read().decode())['urls']:
---
> for url in json.load(urlopen(VENV_URL))['urls']:
EDIT: this seems related but only fixed in 3.6 http://bugs.python.org/issue10976
JSON databags have a weird behaviour and there should be an example of a simple JSON databag to show the correct structure of the file
The page https://www.getlektor.com/docs/api/db/obj/
links to https://www.getlektor.com/docs/api/db/asset/
- but that subpage is missing.
The documentation lists datetime in the builtin field types doc but it doesn't appear that this will be available until the 2.0 milestone.
Shouldn't the docs match what's part of the public install?
In the meantime, attempts to use it yields:
Traceback (most recent call last):
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lektor/admin/modules/serve.py", line 127, in serve_artifact
pad = li.get_pad()
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lektor/admin/webui.py", line 23, in get_pad
return Database(self.env).new_pad()
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lektor/db.py", line 880, in __init__
self.datamodels = load_datamodels(env)
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lektor/datamodel.py", line 583, in load_datamodels
get_model(model_id)
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lektor/datamodel.py", line 567, in get_model
return create_model(model_id)
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lektor/datamodel.py", line 579, in create_model
rv[model_id] = mod = datamodel_from_data(env, model_data, parent)
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lektor/datamodel.py", line 488, in datamodel_from_data
parent and parent.fields or None)
File "/Applications/Lektor.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lektor/datamodel.py", line 459, in fields_from_data
ty = env.types[options.get('type', 'string')]
KeyError: u'datetime'
Hello Armin, thanks for releasing Lektor :)
A quick feedback: the slideshow on the homepage looks too fast to me and I'm not sure where to fix it. I guess it's in slideshow.ini
?
Adding another way for users to navigate blogs, see tags
From this website url :https://www.getlektor.com/docs/api/db/obj/ the link "Assets" at the beginning of the second bullet point leads to this dead link : https://www.getlektor.com/docs/api/db/asset/
Post #194
The project_data plugin that grabs information from pypi, github, etc currently makes one request per project per relevant template query. This means there are redundant requests being made. This adds build time. The requests actually make up most of the build time for the site. This can be cut back significantly if we cache the results of the first time a project's data is queried for, and then check for that cache and reread it instead o making the same query again.
Ideally I think, the data would be cached on first use, and reread from the cache until the build dir is cleaned. So then if you wanted to force a refresh, you'd just run lektor clean
, otherwise, you'd just not worry about it.
While the PR providing Python 3 support has been merged in lektor, the docs still say that Python 2 is required … is this due to the current large release gap, or just an oversight?
It was reported that some distros are no longer shipping with Python 3 ,and also we apparently were relying on Python 2 in our install scripts. We ought to handle both!
/content/test.xml/contents.lr
_template: test.html
---
_model: none
/models/none.ini
template/test.html
hello world
Webpack build finished
U index.html
U feed.xml
E feed.xml (RuntimeError: Body field not found: 'body')
U page/2/index.html
U feed.xml
E feed.xml (RuntimeError: Body field not found: 'body')
U page/3/index.html
U feed.xml
E feed.xml (RuntimeError: Body field not found: 'body')
U page/4/index.html
U feed.xml
E feed.xml (RuntimeError: Body field not found: 'body')
U 2015-12-21/Hello_Website/index.html
U feed.xml
E feed.xml (RuntimeError: Body field not found: 'body')
U 2015-12-21/Hello_Website1/index.html
U feed.xml
E feed.xml (RuntimeError: Body field not found: 'body')
U 2015-12-21/Hello_Website3/index.html
U feed.xml
E feed.xml (RuntimeError: Body field not found: 'body')
U temp-test.xml
cause (RuntimeError: Body field not found: 'body')
With #194 there is a page per plugin tag, but not a page that lists all tags, which I really want. I could not find an easy way of doing this with lektor-tags. Perhaps the easiest way is to update that plugin. It would be really nice to see a list of all tags and have them all be hyperlinked.
@Vesuvium, @odeckmyn, @BarnabyShearer, @pietroalbini, @kwellman, @fschulze, @ajdavis, @spenczar, @humrochagf, @marksteve, @bancek, @sterin, @skorokithakis, @mesbahamin, @gagoman, @Andrew-Shay
Thank you for making your plugins! I want to tell you all that I invited you to the plugin-developers team for the Lektor organization. My intention is to offer that as a place where people who have made plugins can hear of any important news related to plugins. I'll offer an invite to future plugin devs as well.
This comes because of a significant change coming to getlektor.com regarding plugins, that I plan on pulling early next week #194. In short, I request that you check your setup.py
and update it to include at least a url
to your plugin's GitHub page and a long_description
that PyPI understands (getlektor will too). So you're aware, I plan on making the website build at least nightly going forward, so any changes you make in the future will take effect overnight at the latest. Other setup.py
keys you might want to set can be seen here. I will go and update my own and the official plugins.
I also suggest you check my work regarding your plugin(s) specifically, and file an issue or pull request to fix anything. I made tags for your plugins, that you can add or subtract from, for instance.
I will close this issue when #194 is pulled.
Thank you for your work! I appreciate your contributions!
It works, but is not ideal with the extra slash: https://github.com/lektor/lektor-website/tree/master/content//contents.lr
Post #194, The tag page for an event links to the docs, but not vise versa. We should add this in. There's a small enough number of events this could be done manually, but an automated way would be nice.
Hi,
It seems there is no favicon provided for the website. I guess the logo would make a perfect one ;-)
I added this example for how to add a "datetime" type with a plugin:
https://www.getlektor.com/docs/plugins/howto/#adding-new-field-types
This will be obsolete once lektor/lektor#22 is finished.
There is overlapping documentation here:
https://www.getlektor.com/docs/api/db/type/
Let's make one good guide for adding a type with a plugin.
Could you move lektor_atom_feed_support to its own repository and publish to PyPI? I could use this for my site.
I do not think #194 needs to wait on this, but we should tell all of the plugin devs that this change has been made. They may want to edit their category or tags that I chose for them. Many of them also do not use all of the fields we pull from PyPI, so they can update their plugins.
The menu tree on the left side needs to be expandable for searching for a specific page.
Example need case:
I am hunting for the attachments page that's nested in the Data Modelling menu tree, but I can't see it unless I click on the Data Modeling page from the menu tree.
It's not a huge annoyance at the moment because most stuff seems to only be nested only once under a parent page. However, as Lektor grows and more features, depth, and complexity blooms, no doubt so will that menu tree. At some point it will become difficult for new curious people who want to try Lektor, because the documentation will become to time consuming trying to comb through the nested menu for the specific feature they are struggling with.
I'm not sure if we should add a section for themes in the showcase or elsewhere though.
It's better practice, especially for SEO, to open new tabs for external links. Currently they just change your page in the current tab.
Open source projects often include a code of conduct got the project's community. Providing one for lektor cms can make the project more approachable to new contributors. See http://pybee.org/community/behavior/code-of-conduct/ or
http://railsgirlssummerofcode.org/about/code-of-conduct/
I'd be happy to add the CoC! 😃
The documentation needs a search bar for combing through all the pages, so someone can quickly find any references or examples to the feature or syntax they are struggling with. Its overly time consuming (and frustrating) looking for explanations to small problems.
Example need case:
Everything that someone new is struggling with and needs docs support to overcome.
config
has some values. we can know by print {{ config.__dict__ }}
but we can not know each key's purpose.
I suggest document about config
value. I think there is some useful values such as config.base_url
.
See lektor/lektor#391.
This is a new feature that should be addressed in a few words in the documentation.
When trying to install on a Windows Machine using both 2.7 and 3.6 I cannot get lektor to install and run a server.
I get a message about unicode errors.
Post #194
We can also add project_urls
to the left-hand margin. We still need to require url
to definitively know where the repo link is, but we could also display links to people's personal / company websites, related projects, etc.
This is currently not possible, being blocked by pypi/warehouse#3831. But after that, it should be no problem.
There are a few software packages that are required for the install script to work that are not mentioned.
Post #194
The plugin details page lists github stats, which are grabbed via JS that queries for them. GitHub places are fairly small rate limit on these queries per IP address though, so if someone is browsing many plugins, or going back and forth between a few for a while, the stats will stop appearing until enough time passes that they're under the rate limit again.
These JS queries are grabbing current values, so I don't think I want to get rid of them, but I think we should gracefully fall back to values that we query for ourselves during build time. I haven't done the styling for this, but the project_data plugin already is capable of downloading the data. The templates just need to start using it, and we need some styling so that the user can't tell the difference when the rate limiting kicks in. This should probably come after #206 though, because without the project data being cached this will cause a jump in build time.
Multilingual
We can speak multiple languages and allows you to easily create localized websites.
Re: https://github.com/lektor/lektor-website/blob/master/content/docs/content/contents.lr#L89
On my standard Chrome setup on a Mac, it renders like this:
Sure would be nice if those four dashes could be wrapped in <nobr>
... can either embed the tags right in the md, or style the code tags:
code { white-space: nowrap; }
This may have unintended consequences elsewhere in the docs though, so before I do a PR, I thought I'd just bring it up. :-)
getlektor.com is not using the guidelines found in https://www.linkedin.com/help/linkedin/answer/46687/making-your-website-shareable-on-linkedin?lang=en
A result of this is that there is no good thumbnail for linkedin to use.
Makes it hard to open the link to respond to a comment.
In preparation for making a top-level Plugins page, I thought about redirecting https://www.getlektor.com/docs/plugins/list/ to https://www.getlektor.com/plugins. I think knowing how to make a redirect is a worthwhile thing to make a guide page for.
There is an issue for making redirects easier in Lektor, but in lieu of that, a guide can still be made for at least the general case, if not specific manual steps for setting this up, for example, with Apache. After that issue Lektor #107, this guide page could be amended.
This is kind of a silly issue, but there are several paragraphs on how extensively versatile these two features are, at this link. Then there is a small example of how it might look in the .ini and .html files here.
However, I had to actually guess at how to link the pages together when I input the file path for root from the CMS.
model.ini code snippet:
[fields.link]
label = URL or File Link
type = url
model.html code snippet:
<a href="{{ this.link }}">
Then in the CMS I finally just put a "/" in the input box, after trying (and failing) to find an example of how to link home. I'm probably just not good at understanding those complex paragraphs of explanation, but the examples of code used to teach a feature are worth a thousand words.
Just tried to implement the tags feature documented here: https://www.getlektor.com/docs/api/db/query/distinct/ but got a traceback. After a bit of research, I figured that the feature is not released yet. Would appreciate if you could state in the documentation for which version it is. Thanks!
The unofficial list should be categorized so that people can more easily discover plugins they are interested in. Possibly, we can combine the official and unofficial lists so the official ones are categorized too. We can mark the official ones as such in a different method.
The list is getting a bit long, and it's becoming more unreasonable to actually read through them all to determine which plugins you'd want, if any. Not to mention some are similar, yet not right next to each other (looking at you htmlmin and minify).
Related to #182
We could change the layout of the Plugins List to link to individual getlektor.com pages for each Plugin. People could then read more about a plugin right on getlektor.com. To be clear I still want links to the repos. Some of the current descriptions on getlektor are a bit lacking. We could also add the tags plugin to getlektor.com and allow tagging of plugins so that they're easier to discover.
If they all get their own page, they need some content. So then what would the content be? We could simply have a Markdown field and encourage / make better descriptions, or we could use a little JS to grab a project's pre-rendered README (or other file).
@lektor/developers thoughts?
There are several available markdown related events not listed on https://www.getlektor.com/docs/api/plugins/events/ that should be documented.
And in not yet released master, markdown-lexer-config
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.