Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Shea <connor.james.shea@gmail.com>2016-11-24 01:35:11 +0300
committerConnor Shea <connor.james.shea@gmail.com>2016-11-24 05:03:49 +0300
commite18711f7dd7753247ca77dbf90ae1eace699f052 (patch)
tree724222b094fc3a8192a9c98970e823c3649a633c
parentb518ad7cf9a853e0aa529d43c415231b1480f1cb (diff)
Improve the anchor icon.
-rw-r--r--.scss-lint.yml4
-rw-r--r--Rules1
-rw-r--r--content/assets/images/icon_anchor.svg1
-rw-r--r--content/assets/stylesheets/stylesheet.scss7
-rw-r--r--lib/helpers_.rb2
5 files changed, 11 insertions, 4 deletions
diff --git a/.scss-lint.yml b/.scss-lint.yml
index 140bbbba..07bd0b07 100644
--- a/.scss-lint.yml
+++ b/.scss-lint.yml
@@ -4,8 +4,8 @@ exclude:
- "./content/assets/stylesheets/highlight.scss"
# Remove the first three lines so the frontmatter doesn't
-# cause SCSS Lint to throw errors.
-preprocess_command: "sed '1,3d'"
+# cause SCSS Lint to throw errors. Also remove ERB code.
+preprocess_command: "sed -E '1,3d;s/<%= .* %>//g'"
linters:
BorderZero:
diff --git a/Rules b/Rules
index 3fd89e78..989e14c4 100644
--- a/Rules
+++ b/Rules
@@ -59,6 +59,7 @@ compile '/**/*.md' do
end
compile '/**/*.scss' do
+ filter :erb
filter :sass,
syntax: :scss,
style: :compressed
diff --git a/content/assets/images/icon_anchor.svg b/content/assets/images/icon_anchor.svg
new file mode 100644
index 00000000..7e242586
--- /dev/null
+++ b/content/assets/images/icon_anchor.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="#333" fill-rule="evenodd" d="M9.683 6.676l-.047-.048C8.27 5.26 6.07 5.243 4.726 6.588l-2.29 2.29c-1.344 1.344-1.328 3.544.04 4.91 1.366 1.368 3.564 1.385 4.908.04l1.753-1.752c-.695.074-1.457-.078-2.176-.444L5.934 12.66c-.634.634-1.67.625-2.312-.017-.642-.643-.65-1.677-.017-2.312L6.035 7.9c.634-.634 1.67-.625 2.312.017.024.024.048.05.07.075l.003-.002c.36.36.943.366 1.3.01.355-.356.35-.938-.01-1.3l-.027-.024zM6.58 9.586l.048.05c1.367 1.366 3.565 1.384 4.91.04l2.29-2.292c1.344-1.343 1.328-3.542-.04-4.91-1.366-1.366-3.564-1.384-4.908-.04L7.127 4.187c.695-.074 1.457.078 2.176.444l1.028-1.027c.635-.634 1.67-.624 2.313.017.643.644.652 1.678.018 2.312l-2.43 2.432c-.635.634-1.67.624-2.313-.018-.024-.024-.048-.05-.07-.075l-.003.004c-.36-.362-.943-.367-1.3-.01-.355.355-.35.937.01 1.3.01.007.018.015.027.023z"/></svg> \ No newline at end of file
diff --git a/content/assets/stylesheets/stylesheet.scss b/content/assets/stylesheets/stylesheet.scss
index 40754976..8464a235 100644
--- a/content/assets/stylesheets/stylesheet.scss
+++ b/content/assets/stylesheets/stylesheet.scss
@@ -284,7 +284,12 @@ h1, h2, h3, h4, h5, h6 {
// Permalinks on header elements.
.anchor {
- margin-left: 5px;
+ display: inline-block;
+ width: 1em;
+ height: 1em;
+ max-height: 25px;
+ vertical-align: middle;
+ background: url("<%= @items['/assets/images/icon_anchor.svg'].path %>") center center / contain no-repeat;
&:hover {
text-decoration: none;
diff --git a/lib/helpers_.rb b/lib/helpers_.rb
index f4364f13..19b77dfc 100644
--- a/lib/helpers_.rb
+++ b/lib/helpers_.rb
@@ -19,7 +19,7 @@ class HTML < Redcarpet::Render::HTML
anchor.gsub!(/[^a-z0-9\-_]+/i, '-')
anchor.squeeze!('-') # replace multiple dashes with one
- %(<h#{header_level} id='#{anchor}'>#{text} <a class='anchor' href='##{anchor}' title='Permalink'>&para;</a></h#{header_level}>)
+ %(<h#{header_level} id='#{anchor}'>#{text} <a class='anchor' href='##{anchor}' title='Permalink'></a></h#{header_level}>)
end
def image(link, title, alt_text)