Giter VIP home page Giter VIP logo

Comments (3)

mythmon avatar mythmon commented on August 19, 2024

Interesting. I thought I fixed this by providing seperate __repr__ and __unicode__ methods. I will have to take a closer look at this.

from wok.

mythmon avatar mythmon commented on August 19, 2024

Aha! The problem here is that page.author is being returned as a list of authors, instead of a single author. Because of this, the repr() method is getting called, which is not helpful at all. page.author shouldn't be a list, so that is the real problem.

from wok.

mythmon avatar mythmon commented on August 19, 2024

Well, that was easy. This makes page.author work the way I intended, but not the way it works in your fork. Now saying page.author in a template will output something like "Bob Smith &lt;[email protected]&gt;", which will render to "Bob Smith <[email protected]>". You can recreate what I see on your site by putting [{{ author.name }}] in your templates.

--- a/wok/page.py
+++ b/wok/page.py
@@ -197,7 +197,7 @@ class Page(object):
                            .format(self.meta['slug']), authors.type)

         if self.meta['authors']:
-            self.meta['author'] = self.meta['authors']
+            self.meta['author'] = self.meta['authors'][0]
         else:
             self.meta['author'] = Author()

from wok.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.