Commit 46c905c2 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

feat: enable page edit link

parent 3da84b3a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ site_url: !ENV [SITE_URL, CI_PAGES_URL, 'https://to-be-continuous.gitlab.io/doc'
site_author: Pierre Smeyers
repo_url: !ENV [REPO_URL, CI_PROJECT_URL, 'https://gitlab.com/to-be-continuous/doc']
repo_name: !ENV [REPO_NAME, CI_PROJECT_PATH, 'to-be-continuous/doc']
edit_uri: blob/master/docs/
site_description: an opinionated framework for GitLab CI
site_dir: public
# edit_uri: doc/edit/master/docs/
@@ -17,6 +18,8 @@ theme:
    accent: 'deep orange'
  features:
    - content.code.copy
    - content.action.edit
    # - content.action.view
    - navigation.tabs
    - navigation.tabs.sticky
    # - navigation.sections
+19 −0
Original line number Diff line number Diff line
{#-
  This file was automatically generated - do not edit
-#}
{% if page.edit_url %}
  {% set edit_url = page.meta.repo_url ~ "/blob/" ~ page.meta.default_branch ~ "/" ~ page.meta.doc_path if (page.meta and page.meta.doc_path) else page.edit_url %}
  {% if "content.action.edit" in features %}
  <a href="{{ edit_url }}" title="{{ lang.t('action.edit') }}" class="md-content__button md-icon" rel="edit">
    {% set icon = config.theme.icon.edit or "material/file-edit-outline" %}
    {% include ".icons/" ~ icon ~ ".svg" %}
  </a>
  {% endif %}
  {% if "content.action.view" in features %}
    {% set view_url = edit_url | replace('/blob/', '/raw/') | replace('/edit/', '/raw/') %}
    <a href="{{ view_url }}" title="{{ lang.t('action.view') }}" class="md-content__button md-icon">
      {% set icon = config.theme.icon.view or "material/file-eye-outline" %}
      {% include ".icons/" ~ icon ~ ".svg" %}
    </a>
  {% endif %}
{% endif %}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ function maybe_process_template() {
      curl -sS -H "$AUTH_HEADER" --output "$DOC_OUT/ref/$project_name.md" "$API_URL/projects/$project_id/repository/files/README.md/raw?ref=$project_default_branch"

      # add frontmatter
      sed -i "1i---\nrepo_name: $project_path\ndescription: $template_desc\nrepo_url: $web_url\nimage_width: 256\nimage_height: 256\nimage_url: $avatar_url\n---\n" "$DOC_OUT/ref/$project_name.md"
      sed -i "1i---\nrepo_name: $project_path\ndescription: $template_desc\nrepo_url: $web_url\ndefault_branch: $project_default_branch\ndoc_path: README.md\nimage_width: 256\nimage_height: 256\nimage_url: $avatar_url\n---\n" "$DOC_OUT/ref/$project_name.md"

      # write template card
      {