feat: Show Table of Contents in the article sidebar (#7085)

This commit is contained in:
Pranav Raj S
2023-05-15 18:43:16 -07:00
committed by GitHub
parent 0f776a173c
commit a3547c5a1f
11 changed files with 204 additions and 56 deletions

View File

@@ -35,9 +35,9 @@
<div class="flex flex-col items-start justify-between w-full md:flex-row md:items-center pt-2">
<div class="flex items-center space-x-2">
<% if @article.author&.avatar_url&.present? %>
<img src="<%= @article.author.avatar_url %>" alt="<%= @article.author.display_name %>" class="w-12 h-12 border rounded-full">
<img src="<%= @article.author.avatar_url %>" alt="<%= @article.author.display_name %>" class="w-12 h-12 border rounded-full pr-1">
<% end %>
<div class="pl-1">
<div>
<h5 class="text-base font-medium text-slate-900 mb-2"><%= @article.author.available_name %></h5>
<p class="text-sm font-normal text-slate-700">
<%= I18n.t('public_portal.common.last_updated_on', last_updated_on: @article.updated_at.strftime("%b %d, %Y")) %>
@@ -46,10 +46,9 @@
</div>
</div>
</div>
<div class="max-w-6xl flex-grow w-full px-8 py-8 mx-auto space-y-12">
<article class="space-y-8">
<div class="text-slate-800 text-lg max-w-3xl prose break-words">
<p><%= @parsed_content %></p>
</div>
<div class="flex max-w-6xl w-full px-8 mx-auto">
<article id="cw-article-content" class="flex-grow flex-2 py-12 mx-auto text-slate-800 text-lg max-w-3xl prose break-words">
<%= @parsed_content %>
</article>
<div class="flex-1" id="cw-hc-toc"></div>
</div>