Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mobile-nixos/mobile-nixos
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f480573cf78c
Choose a base ref
...
head repository: mobile-nixos/mobile-nixos
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 485ec7fad331
Choose a head ref
  • 1 commit
  • 5 files changed
  • 1 contributor

Commits on Dec 3, 2019

  1. doc: Makes articles pipeline more aware of image alignment

    This is technically a *content* based style, which is why it's fine to
    do there, instead of semantically in the page.
    
    The background-image basically acts an a "transparent" `<img />`.
    samueldr committed Dec 3, 2019
    Copy the full SHA
    485ec7f View commit details
6 changes: 6 additions & 0 deletions doc/_support/converter/lib/processor/article.rb
Original file line number Diff line number Diff line change
@@ -21,6 +21,12 @@ def output()
image = @doc.attributes["image"]
title = @doc.doctitle
url = @relative_filename
header_styles =
if @doc.attributes["header_prefers"] then
" background-position: #{@doc.attributes["header_prefers"]} center;"
else
""
end

template = ERB.new(File.read(File.join($options["root"], "_support/news_article.erb")))
template.result(binding)
6 changes: 6 additions & 0 deletions doc/_support/converter/lib/processor/page.rb
Original file line number Diff line number Diff line change
@@ -128,6 +128,12 @@ def handle_special_news()
template = ERB.new(File.read(File.join($options["root"], "_support/news_article_header.erb")))

image = @doc.attributes["image"]
header_styles =
if @doc.attributes["header_prefers"] then
" background-position: #{@doc.attributes["header_prefers"]} center;"
else
""
end
header = template.result(binding)

pos = @output.index('<div id="content"')
2 changes: 1 addition & 1 deletion doc/_support/news_article.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<article>
<header style="background-image: url('<%= image %>')">
<header style="background-image: url('<%= image %>');<%= header_styles %>">
<div class="details">
<h3><a href="<%= url %>"><%= title %></a></h3>
<% if date %><div class="date"><%= date %></div><% end %>
2 changes: 1 addition & 1 deletion doc/_support/news_article_header.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<% if image %>
<div class="article-header" style="background-image: url('<%= image %>')"></div>
<div class="article-header" style="background-image: url('<%= image %>');<%= header_styles %>"></div>
<% end %>
2 changes: 1 addition & 1 deletion doc/_support/styles/news.less
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ section.news article > header:first-child {

box-shadow: inset 0px 20px 20px -20px rgba(0, 0, 140, 0.4);
background-size: cover;
background-position: left center;
background-position: center center;
background-color: darken(desaturate(@color-blue-light, 50%), 35%);
margin-left: -@gutter;
margin-right: -@gutter;