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
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 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
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
%header{ style: "background-image: url(../../images/comparison/title_image.png)" }
.inner-header-content.clearfix
.pull-left
%h1
GitLab vs. GitHub
%h1= comparison_data.title
%h2
GitLab compared to other tools
%img.pull-right{ src: "../../images/wordmark.png", width: 150 }
......@@ -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.
.blog-entry.clearfix
.comparison-page-content.clearfix
= partial "../gitlab-ce-ee-vs-bitbucket-server"
:javascript
var split = [];
var grid = [];
var compareContent = document.querySelector('.comparison-page-content');
var els = compareContent.querySelectorAll('h3');
var clearfix = document.createElement('div');
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);
}
- compare_data = comparison_data.features
- half = (compare_data.size / 2.0).round
- compare_data.each_slice(half).to_a.each do |group|
.compare-col
- group.each do |compare|
%h3= compare.title
%p= compare.description
......@@ -64,6 +64,7 @@ header {
h3 {
padding-top: 0;
margin-top: 0;
margin-bottom: 0;
color: $color-primary;
font-size: 16px;
......@@ -71,11 +72,8 @@ header {
}
p {
margin-bottom: 15px;
font-size: 14px;
&:not(:last-child) {
margin-bottom: 5px;
}
}
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