Skip to content

Latest commit

 

History

History
66 lines (56 loc) · 1.48 KB

add-sidebar-and-collaborate-buttons.adoc

File metadata and controls

66 lines (56 loc) · 1.48 KB

Add sidebar and collaborate buttons

Add sidebar to base layout

_layouts/base.html.haml
  #content.row
    .large-9.columns
      =content
    .large-3.columns
      - if page.source_path.end_with? '.adoc'
        - rel_path = page.relative_source_path
        %h4 Collaborate!
        %ul.button-group
          %li
            %a.small.button(href="#{site.edit_base_url}#{rel_path}")
              Edit
          %li
            %a.small.secondary.button(href="#{site.raw_base_url}#{rel_path}")
              Raw
          %li
            %a.small.secondary.button(href="#{site.log_base_url}#{rel_path}")
              Log
      %h4 Topics
      %ul.square
        - site.posts_tags.each do |tag|
          %li
            %a(href="#{site.ctx_path}#{tag.primary_page.url}")=tag

Define collaborate URLs in site configuration

_config/site.yml
edit_base_url: https://github.com/%USERNAME%/writeadapt-%USERNAME%/edit/master
raw_base_url: https://github.com/%USERNAME%/writeadapt-%USERNAME%/raw/master
log_base_url: https://github.com/%USERNAME%/writeadapt-%USERNAME%/commits/master

!

{title-off}