Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: render author pages #1972

Merged
merged 35 commits into from Aug 31, 2015
Merged

WIP: render author pages #1972

merged 35 commits into from Aug 31, 2015

Conversation

@jjconti
Copy link
Contributor

jjconti commented Aug 24, 2015

Based on tags.py

Requires this configs:

AUTHOR_PATH = 'author'
AUTHOR_PAGES_ARE_INDEXES = True

and this messages:

"Authors": "Autores",
"Posts by %s": "Posts de %s"
Juanjo Conti
@Kwpolska Kwpolska added this to the v7.6.5 milestone Aug 24, 2015
@Kwpolska
Copy link
Member

Kwpolska commented Aug 24, 2015

Great idea!

  • style fixes needed: https://travis-ci.org/getnikola/nikola/jobs/76990366#L171
  • tests fail. Add your new settings to conf.py.in and nikola.py, and messages to messages_en.py (we need some more work to get it to Transifex, we will handle that)
  • Would you mind implementing the title/description customization parts from tags?
@da2x
Copy link
Contributor

da2x commented Aug 24, 2015

Enhancement idea: Most CMS include short author bios and portrait images on these kind of pages. Maybe duplicate whats available in TAG_PAGES_DESCRIPTIONS as AUTHOR_PAGES_BIOS with the same format? and then the same for AUTHOR_PORTRAITS, I believe would work well.

“Guest authors” usually want a link back to their homepage from these kind of pages too … AUTHOR_HOMEPAGES? Or just make AUTHOR_PAGES_BIOS accept HTML blobs (TAG_PAGE_DESCRIPTIONS are just one paragraph of text).

@da2x da2x added the PR exists label Aug 24, 2015
@jjconti
Copy link
Contributor Author

jjconti commented Aug 24, 2015

@Aeyoun interesting ideas, but with what I've implemented so far my requirements and available time are covered.

@ralsina
Copy link
Member

ralsina commented Aug 24, 2015

@Aeyoun can you file those as a enhancement issue with a checklist? Once this is polished and merged we can tackle that as needed.

Juanjo Conti added 3 commits Aug 24, 2015
Juanjo Conti
Juanjo Conti
# output / TRANSLATION[lang] / AUTHOR_PATH / index.html (list of tags)
# output / TRANSLATION[lang] / AUTHOR_PATH / author.html (list of posts for a tag)
# output / TRANSLATION[lang] / AUTHOR_PATH / author.xml (RSS feed for a tag)
# TAG_PATH = "authors"

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Aug 24, 2015

Member

AUTHOR_PATH*

@@ -36,4 +36,6 @@
"Write your post here.": "Write your post here.",
"old posts, page %d": "old posts, page %d",
"page %d": "page %d",
"Authors": "Authors",
"Posts by %s": "Posts by %s"

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Aug 24, 2015

Member

(we’ll need to copy that over to the .po file)

Juanjo Conti
Fix
@jjconti
Copy link
Contributor Author

jjconti commented Aug 24, 2015

For the docs:

You can link an author's page form you template adding this:

<a href="${_link('author', post.author())}">${post.author()}</a>
@jjconti
Copy link
Contributor Author

jjconti commented Aug 24, 2015

A working example of this at: http://lugcos.github.io/

@jjconti jjconti changed the title WIP: render authors pages WIP: render author pages Aug 24, 2015
@da2x
Copy link
Contributor

da2x commented Aug 24, 2015

Issues #1973, #1974, and #1975.

@@ -43,7 +43,8 @@
%if posts:
<ul class="postlist">
% for post in posts:
<li><a href="${post.permalink()}" class="listtitle">${post.title()|h}</a> <time class="listdate" datetime="${post.formatted_date('webiso')}" title="${post.formatted_date(date_format)}">${post.formatted_date(date_format)}</time></li>
<li>

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Aug 25, 2015

Member

what changed here and why?

This comment has been minimized.

Copy link
@jjconti

jjconti Aug 25, 2015

Author Contributor

I improved the item visualization in the base tamplate. It was show as:
Title Date --- (dash)
The dash is added by the date style. I changed it to be
Date --- Title
as in other templates I saw. I used the same pattern in author.tmpl. Maybe there is an extra new line.

<a href="${_link(kind + "_rss", author, language)}" hreflang="${language}" type="application/rss+xml">${messages('RSS feed', language)} (${language})</a>&nbsp;
</p>
%endfor
%elif generate_rss:

This comment has been minimized.

Copy link
@da2x

da2x Aug 25, 2015

Contributor

Should be an generate_atom variant too here.

This comment has been minimized.

Copy link
@jjconti

jjconti Aug 29, 2015

Author Contributor

I didn't add it because tag.tmpl does not (no atom reference). tagindex.tmpl does and authorindex.tmpl does too.

@da2x
Copy link
Contributor

da2x commented Aug 25, 2015

Line 34 in data/themes/base/templates/post_header.tmpl should link to the author’s page if it is being generated. The enclosing span element can be replaced with an a element retaining the span’s microformats and adding rel="author me".

@jjconti
Copy link
Contributor Author

jjconti commented Aug 31, 2015

I'll do it tonight when adding a final change. Thanks.

@jjconti
Copy link
Contributor Author

jjconti commented Aug 31, 2015

I'm done. This can be merged (do I do it? am I getting commit access or something like that?).

NOTE: author*tmpl files are missing for base-jinja theme. I can add them after this is merged.

@Kwpolska
Copy link
Member

Kwpolska commented Aug 31, 2015

  1. I’ll merge it. If you want commit rights, just ask.
  2. It can be generated with scripts/jinjify.py. I’ll handle that.

Thanks for your contribution!

Kwpolska added a commit that referenced this pull request Aug 31, 2015
WIP: render author pages
@Kwpolska Kwpolska merged commit d3b0263 into getnikola:master Aug 31, 2015
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor AppVeyor build succeeded
Details
@jjconti
Copy link
Contributor Author

jjconti commented Aug 31, 2015

You're welcome. Thanks for the software. I'll continue using it so I'll probably be doing more contributions.

Do we need to update CHANGELOG? Something in doc/? AUTHORS.txt?

@Kwpolska
Copy link
Member

Kwpolska commented Aug 31, 2015

  1. So, do you want commit rights or not?
  2. CHANGES.txt, AUTHORS.txt and docs/manual.txt could use an update. Will you do it?
@jjconti
Copy link
Contributor Author

jjconti commented Aug 31, 2015

Ok! I'll do it! :D I wasn't sure because of what Uncle Ben said[1] but, let's do it!

[1]Uncle Ben: Remember, with great power. comes great responsibility.

jjconti added a commit that referenced this pull request Aug 31, 2015
@jjconti
Copy link
Contributor Author

jjconti commented Aug 31, 2015

Done.

Kwpolska added a commit that referenced this pull request Aug 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.