lektor / lektor-tags

For each tag on your site, build a list of pages with that tag. This can be used for standard tag-based blog navigation.
MIT License
27 stars 6 forks source link

Can't get lektor-tags to work properly #21

Closed dzc0d3r closed 3 years ago

dzc0d3r commented 3 years ago

So basically i am following the steps described in the docs as well in the README file here is what i've done so far :

  1. Installation

    lektor plugins add lektor-tags
  2. Created configs/tags.ini with this config :

    parent = /
    url_path = {{ this.parent.url_path }}{{ tag }}
    tags_field = tags
    ignore_missing = true
    template = tags.html
  3. Createted templates/tags.html with the following content :

        {% extends "layout.html" %}
        {% block title %}{{ this.title }}{% endblock %}
        {% block body %}
    
        <div class="container mt-3">
            <b>Tag: {{ this.tag }}</b>
            <b>Items:</b>
            <ul>
                  {% for i in this.items %}
                  <li><a href="{{ i|url }}">{{ i._id }}</a></li>
                  {% else %}
                  <li><em>No items.</em></li>
                  {% endfor %}
            </ul>
        </div> 
        {% endblock %}
    1. edited models/blog-post.ini and added :

      [fields.tags]
      type = strings
  4. In templates/blog-post.html i added the following to show links to the page that contain a list of all posts with the specific tag:

        {% if this.tags %}
        <ul>
             {% for t in this.tags -%}
             <li>
                  <a href="{{ ('/' ~ t.lower())|url }}">
                  All posts tagged {{ t }}
                  </a>
             </li>
             {% endfor %}
        </ul>
        {% endif %}
  5. Finally i updated a post to contain some tags from the admin and made sure it's there in content.lr of that post. so i stopped the lektor dev server and run it again lektor servor with no errors to be present.

when i try to visit localhost:5000/{the_tag_name} say like localhost:5000/python i always get 404 Not found The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. i have tried everything that i thought of. if you think i did something wrong then kindly tell me Also can you please work on the documentation in order to make it more friendly explanatory and straightforward, as well on the plugin to add more improvements ..this look abandoned since 2018

dzc0d3r commented 3 years ago

it was me not paying attention and focusing, sorry for the noise.