diff --git a/README.md b/README.md index 44453d1..007079a 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Route paths are configuration, not files. The layer's page components live in `a - **Post list** (`journal-index`): paginated with `?page=N`. A non-numeric page or a page past the last one answers 404. - **Post** (`journal-post`): title, date, reading time, categories, author, featured image, body, previous and next links, and related posts. When the API returns no related posts (a post without a category), the latest posts are shown instead. - **Category** (`journal-category`): name, description and the category's rich HTML content above its posts. Categories are always requested with `include_empty=1`, so a category without posts still has a page. An unknown category answers 404, which makes the route safe as a root-level catch-all such as `/:category`. -- **Tag** (`journal-tag`) and **author** (`journal-author`) pages. An author resolves by author slug, or by login once the author has a published post; a login URL sets the canonical to the slug URL. +- **Tag** (`journal-tag`) and **author** (`journal-author`) pages. An author resolves by author slug, or by login once the author has a published post; a login URL sets the canonical to the slug URL. Post meta links to the author by `author.slug` (sm-journal-plugin v0.3.1+), falling back to the login on older APIs. - **Search** (`journal-search`, opt-in): a results page for `?q=` and the `JournalSearchBox` header component with suggestions as the visitor types. Off until the app sets `journal.routes.search`. See [Search](#search). - **RSS**: `/rss.xml` proxies the API feed, and list and post pages link it in the head. - **SEO**: per-page title and description, Open Graph tags (`og:image` from the featured image, article times), canonical URLs that keep `?page=N`, robots and `sitemap.xml` through `@nuxtjs/seo`. diff --git a/app/components/Journal/PostMeta.vue b/app/components/Journal/PostMeta.vue index 1cf7f3c..75362ae 100644 --- a/app/components/Journal/PostMeta.vue +++ b/app/components/Journal/PostMeta.vue @@ -11,9 +11,15 @@ const links = useJournalLinks() const date = computed(() => formatJournalDate(props.post.published_at, localeProperties.value.language ?? 'en')) const authorName = computed(() => { const a = props.post.author - return a ? `${a.first_name} ${a.last_name}`.trim() || a.login : '' + return a ? `${a.first_name} ${a.last_name}`.trim() || a.slug || a.login : '' +}) +// By slug, so the link does not carry the login (often an email address). +// An API before sm-journal-plugin v0.3.1 sends no slug; the login still +// resolves there. +const authorHref = computed(() => { + const a = props.post.author + return a ? links.authorLink(a.slug || a.login) : null }) -const authorHref = computed(() => (props.post.author ? links.authorLink(props.post.author.login) : null))