Skip to content

Commit

Permalink
Merge pull request sass#409 from sass/blog
Browse files Browse the repository at this point in the history
Move the blog onto sass-lang.com
  • Loading branch information
Israel-4Ever committed Dec 18, 2019
2 parents 851d036 + 9fa5780 commit da07f17
Show file tree
Hide file tree
Showing 44 changed files with 3,038 additions and 20 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ source "https://rubygems.org"
ruby "2.5.3"

gem "builder", "~> 3.2.2"
gem "html-proofer", "~> 3.10"
gem "html-proofer", "~> 3.13"
gem "middleman", "~> 3.4.1"
gem "middleman-autoprefixer", "~> 2.6.2"
gem "middleman-blog", "~> 3.5.3"
gem "middleman-livereload", "~> 3.4.5"
gem "middleman-minify-html", "~> 3.4.1"
gem "middleman-syntax", "~> 2.0.0"
Expand Down
28 changes: 15 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.3.8)
autoprefixer-rails (6.2.3)
execjs
json
Expand All @@ -23,7 +22,6 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
colorize (0.8.1)
compass (1.0.3)
chunky_png (~> 1.2)
compass-core (~> 1.0.2)
Expand All @@ -40,7 +38,7 @@ GEM
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
erubis (2.7.0)
ethon (0.11.0)
ethon (0.12.0)
ffi (>= 1.3.0)
eventmachine (1.2.7)
execjs (2.7.0)
Expand All @@ -51,13 +49,12 @@ GEM
hike (1.2.3)
hooks (0.4.1)
uber (~> 0.0.14)
html-proofer (3.10.0)
activesupport (>= 4.2, < 6.0)
html-proofer (3.13.0)
addressable (~> 2.3)
colorize (~> 0.8)
mercenary (~> 0.3.2)
nokogiri (~> 1.9)
mercenary (~> 0.3)
nokogiri (~> 1.10)
parallel (~> 1.3)
rainbow (~> 3.0)
typhoeus (~> 1.3)
yell (~> 2.0)
htmlcompressor (0.2.0)
Expand All @@ -84,6 +81,10 @@ GEM
middleman-autoprefixer (2.6.3)
autoprefixer-rails (~> 6.2.1)
middleman-core (>= 3.3.3)
middleman-blog (3.5.3)
addressable (~> 2.3.5)
middleman-core (~> 3.2)
tzinfo (>= 0.3.0)
middleman-core (3.4.1)
activesupport (~> 4.1)
bundler (~> 1.1)
Expand Down Expand Up @@ -127,8 +128,7 @@ GEM
tilt (>= 1.4.1, < 3)
padrino-support (0.12.9)
activesupport (>= 3.1)
parallel (1.12.1)
public_suffix (3.0.3)
parallel (1.18.0)
puma (3.12.0)
rack (1.6.11)
rack-conditional (0.3.1)
Expand All @@ -142,6 +142,7 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rainbow (3.0.0)
rake (12.3.2)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
Expand Down Expand Up @@ -181,16 +182,17 @@ GEM
json (>= 1.8.0)
xpath (2.1.0)
nokogiri (~> 1.3)
yell (2.0.7)
yell (2.2.0)

PLATFORMS
ruby

DEPENDENCIES
builder (~> 3.2.2)
html-proofer (~> 3.10)
html-proofer (~> 3.13)
middleman (~> 3.4.1)
middleman-autoprefixer (~> 2.6.2)
middleman-blog (~> 3.5.3)
middleman-livereload (~> 3.4.5)
middleman-minify-html (~> 3.4.1)
middleman-syntax (~> 2.0.0)
Expand Down
9 changes: 7 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ task :test_without_rebuild do
HTMLProofer.check_directory("build",
url_ignore: [
"https://www.drupal.org/dcoc", # This doesn't allow automated requests.
"http://sass.logdown.com/posts/7081811", # This times out occasionally.
# These are linked to from older blog posts. They redirect to updated
# pages.
%r{/documentation/file.SASS_REFERENCE.html(#.*)?},
%r{/documentation/file.SASS_CHANGELOG.html(#.*)?},
%r{/documentation/Sass/Script/Functions.html(#.*)?},
"#",
],
url_swap: {%r{^/blog/} => "http://sass.logdown.com/"},
assume_extension: true,
# These have the same links as blog posts
file_ignore: ["blog.html", %r{blog/page/.*}],
# Lots of external URLs fail flakily on Travis, so we just don't check them
# there.
disable_external: ENV["TRAVIS"] == "true"
Expand Down
11 changes: 11 additions & 0 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,19 @@
activate :livereload
activate :syntax

activate :blog do |blog|
blog.prefix = "blog"
blog.default_extension = ".md"
blog.sources = "{id}-{title}.html"
blog.permalink = "/{title}.html"
blog.paginate = true
blog.summary_length = 1000
end

set :markdown, fenced_code_blocks: true,
autolink: true,
smartypants: true,
footnotes: true,
with_toc_data: true
Haml::Filters::Markdown.options.merge! fenced_code_blocks: true,
autolink: true
Expand All @@ -38,6 +48,7 @@
page '/libsass.html', :layout => :has_both_sidebars
page '/styleguide/*', :layout => :section_styleguide
page '/documentation/*', :layout => :section_reference
page '/blog/*', :layout => :blog

configure :development do
config[:host] = 'http://localhost:4567'
Expand Down
11 changes: 10 additions & 1 deletion config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ use Rack::Rewrite do
r301 %r{/(.+)/$}, '/$1'
r301 %r{/(.+)/index\.html$}, '/$1'

r301 %r{/blog/(.*)}, 'http://sass.logdown.com/$1'
# We used to redirect Logdown URLs to the sass.logdown.com, but now we
# redirect them to the local site's corresponding blog URLs.
r301 %r{/blog/posts/\d+-(.*)}, '/blog/$1'

# Some blog posts didn't have slugs in Logdown.
r301 %r{/blog/posts/560719}, '/blog/dropping-support-for-old-ruby-versions'
r301 %r{/blog/posts/1305238}, '/blog/dart-sass-is-on-chocolatey'
r301 %r{/blog/posts/1404451}, '/blog/sass-and-browser-compatibility'
r301 %r{/blog/posts/1909151}, '/blog/dart-sass-is-in-beta'
r301 %r{/blog/posts/7081811}, '/blog/ruby-sass-is-deprecated'

# Provide short links for breaking changes so that they can be tersely
# referenced from warning and errors.
Expand Down
4 changes: 4 additions & 0 deletions helpers/sass_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def pages_for_group(group_name)
pages.flatten
end

def without_html(page)
url_for(page).sub(/\.html$/, '')
end

def documentation_toc
_toc_level(nil, data.documentation.toc)
end
Expand Down
10 changes: 10 additions & 0 deletions source/assets/css/components/_attribution.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.sl-c-attribution {
font-weight: $sl-font-weight--light;
font-size: $sl-font-size--small;

&:first-child {
text-align: center;
margin-top: -3em;
margin-bottom: 2em;
}
}
1 change: 1 addition & 0 deletions source/assets/css/sass.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'layout/sections',

'components/alerts',
'components/attribution',
'components/buttons',
'components/callouts',
'components/navigation',
Expand Down
Binary file added source/assets/img/blog/006-sass-visitors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/img/blog/020-goodbye.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/img/blog/021-function-docs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/img/blog/021-functions-math.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/img/blog/021-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/assets/img/blog/021-syntax-switcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions source/blog.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Sass Blog
pageable: true
per_page: 5
---

- if paginate && num_pages > 1
%p Page #{page_number} of #{num_pages}
%p= link_to 'Previous page', without_html(prev_page) if prev_page

- page_articles.each_with_index do |article, i|
%h2= link_to article.title, without_html(article)
= partial 'layouts/components/attribution', locals: {page: article}
= article.summary

- if paginate
%p= link_to 'Next page', without_html(next_page) if next_page
Loading

0 comments on commit da07f17

Please sign in to comment.