Commit d4361aa7 authored by Phil Hughes's avatar Phil Hughes

Changed how the pages are generated

parent a6ceb6b0
wkhtmltopdf --footer-html public/comparison/pdfs/footer_html.html --margin-left 0 --margin-right 0 --margin-top 0 public/comparison/pdfs/gitlab-ce-ee-vs-bitbucket-server.html test.pdf #!/bin/bash
for filename in public/comparison/pdfs/*.html; do
pdffilename=${filename/.html/.pdf}
echo "👉 Generating PDF for $filename..."
wkhtmltopdf --margin-left 0 --margin-right 0 --margin-top 0 --zoom 3 $filename $pdffilename
# remove the HTML file
# rm $filename
echo "✅ PDF for $filename generated!"
done
...@@ -153,6 +153,12 @@ end ...@@ -153,6 +153,12 @@ end
org_chart = OrgChart.new org_chart = OrgChart.new
proxy "/team/structure/index.html", "/team/structure/template.html", locals: { team_data_tree: org_chart.team_data_tree }, ignore: true proxy "/team/structure/index.html", "/team/structure/template.html", locals: { team_data_tree: org_chart.team_data_tree }, ignore: true
# Proxy comparison PDF pages
data.comparisons.each do |key, comparison|
file_name = key.dup.gsub(/_/, '-')
proxy "/comparison/pdfs/#{file_name}.html", "/comparison/pdfs/template.html", locals: { comparison_data: comparison }, ignore: true
end
page '/404.html', directory_index: false page '/404.html', directory_index: false
ignore '/direction/template.html' ignore '/direction/template.html'
......
---
layout: false
---
%html
%head
%body
%table{ width: "100%" }
%tr
%td{ align: "left" }
about.gitlab.com/features
%td{ align: "right" }
© GitLab inc. All Rights Reserved.
...@@ -11,8 +11,7 @@ layout: false ...@@ -11,8 +11,7 @@ layout: false
%header{ style: "background-image: url(../../images/comparison/title_image.png)" } %header{ style: "background-image: url(../../images/comparison/title_image.png)" }
.inner-header-content.clearfix .inner-header-content.clearfix
.pull-left .pull-left
%h1 %h1= comparison_data.title
GitLab vs. GitHub
%h2 %h2
GitLab compared to other tools GitLab compared to other tools
%img.pull-right{ src: "../../images/wordmark.png", width: 150 } %img.pull-right{ src: "../../images/wordmark.png", width: 150 }
...@@ -27,49 +26,10 @@ layout: false ...@@ -27,49 +26,10 @@ layout: false
So no matter what line of business you're in, GitLab gives you the edge to compete, innovate, and win. So no matter what line of business you're in, GitLab gives you the edge to compete, innovate, and win.
.blog-entry.clearfix .blog-entry.clearfix
.comparison-page-content.clearfix .comparison-page-content.clearfix
= partial "../gitlab-ce-ee-vs-bitbucket-server" - compare_data = comparison_data.features
:javascript - half = (compare_data.size / 2.0).round
var split = []; - compare_data.each_slice(half).to_a.each do |group|
var grid = []; .compare-col
var compareContent = document.querySelector('.comparison-page-content'); - group.each do |compare|
var els = compareContent.querySelectorAll('h3'); %h3= compare.title
var clearfix = document.createElement('div'); %p= compare.description
for (var i = 0; i < els.length; i++) {
var el = els[i];
var nextChild = el.nextSibling;
var innerGrid = [el];
while (nextChild !== null && nextChild.tagName !== 'H3') {
if (nextChild !== null) {
innerGrid.push(nextChild);
}
nextChild = nextChild.nextSibling;
}
grid.push(innerGrid);
}
compareContent.innerHTML = '';
split.push(grid.slice(0, Math.floor(grid.length / 2)));
split.push(grid.slice(Math.floor(grid.length / 2)));
for (var i = 0; i < split.length; i++) {
var col = split[i];
var colDiv = document.createElement('div');
colDiv.className = 'compare-col';
for (var a = 0; a < col.length; a++) {
var grid = col[a];
var div = document.createElement('div');
for (var b = 0; b < grid.length; b++) {
div.appendChild(grid[b]);
}
colDiv.appendChild(div);
}
compareContent.appendChild(colDiv);
}
...@@ -64,6 +64,7 @@ header { ...@@ -64,6 +64,7 @@ header {
h3 { h3 {
padding-top: 0; padding-top: 0;
margin-top: 0;
margin-bottom: 0; margin-bottom: 0;
color: $color-primary; color: $color-primary;
font-size: 16px; font-size: 16px;
...@@ -71,11 +72,8 @@ header { ...@@ -71,11 +72,8 @@ header {
} }
p { p {
margin-bottom: 15px;
font-size: 14px; font-size: 14px;
&:not(:last-child) {
margin-bottom: 5px;
}
} }
a { a {
......
File deleted
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment