Skip to content
Snippets Groups Projects
Commit 1dd646f1 authored by Robert Speicher's avatar Robert Speicher
Browse files

Blow up the old site :boom:

parent 0f1b0f4a
No related branches found
No related tags found
No related merge requests found
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://EditorConfig.org
root = true
; Use 2 spaces for indentation in all Ruby files
[*.rb]
indent_style = space
indent_size = 2
[Rakefile]
indent_style = space
indent_size = 2
[Gemfile*]
indent_style = space
indent_size = 2
[config.ru]
indent_style = space
indent_size = 2
* text=auto
*.md text eol=lf
.bundle
.DS_Store
.sass-cache
.gist-cache
.pygments-cache
.preview-mode
recurly/config.yml
_deploy
public
sass.old
source.old
source/_stash
source/stylesheets/screen.css
vendor
node_modules
.idea
*~
test:
script:
- pwd
- git rev-parse HEAD
- export LC_ALL=en_US.UTF-8
- ''
- bundle install --path ~/bundle
- ''
- bundle exec yaml-lint source/_data/*.yml
- ''
- "# build without deploying, so that we know if a MR is horribly broken"
- bundle exec rake build
tags:
except:
- tags
deploy:
script:
- pwd
- export LC_ALL=en_US.UTF-8
- ''
- bundle install --path ~/bundle
- bundle exec rake build
- rsync -r --delete-after public/ ~/public/
type: deploy
tags:
only:
- master
except:
- tags
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ] ; then
source "$rvm_path/scripts/rvm"
source ".rvmrc"
fi
\ No newline at end of file
plugins
sass
source
language: ruby
rvm:
- 2.0.0
- 1.9.3
script: bundle exec rake install; bundle exec rake generate
# Octopress Changelog
## 2.0
- Now based on [mojombo/jekyll](http://github.com/mojombo/jekyll)
- Sports a semantic HTML5 template
- Easy theming with Compass and Sass
- A Mobile friendly responsive (320 and up) layout
- Built in 3rd party support for Twitter, Google Plus One, Disqus Comments, Pinboard, Delicious, and Google Analytics
- Deploy to Github pages or use Rsync
- Built in support for POW and Rack servers
- Beautiful [Solarized](http://ethanschoonover.com/solarized) syntax highlighting
- Super easy setup and configuration
**New Plugins, Filters, & Generators**
- **Gist Tag** for easily embedding gists in your posts
- **Pygments Cache** makes subsequent compiling much faster
- **Include Code Tag** lets you embed external code snippets from your file system and adds a download link
- **Pullquote Tag** Generate beautiful semantic pullquotes (no double data) based on Maykel Loomans's [technique](http://miekd.com/articles/pull-quotes-with-html5-and-css/)
- **Blockquote Tag** makes it easy to semantically format blockquotes
- **Category Generator** gives you archive pages for each category
- **Sitemap.xml Generator** for search engines
## 1.0
- **No longer supported.**
- Jekyll Matured, but Henrik's Jekyll fork did not.
- Thanks for all your pull requests, I learned a lot.
You can help to improve the [about.gitlab.com](https://about.gitlab.com/) website by sending merge requests to this repository.
Thank you for your interest and help!
We don't mind people inside and outside the company making suggestions to change significant things.
Feel free to make a proposal, we can discuss anything and if we don't agree we'll feel free not to merge it and thank you for caring about it.
By submitting code as an individual you agree to the [individual contributor license agreement](doc/legal/individual_contributor_license_agreement.md).
By submitting code as an entity you agree to the [corporate contributor license agreement](doc/legal/corporate_contributor_license_agreement.md).
source "https://rubygems.org"
group :development do
gem 'rake', '~> 10.0'
gem 'jekyll', '2.4'
gem 'octopress-hooks', '~> 2.2'
gem 'octopress-date-format', '~> 2.0'
gem 'jekyll-sitemap'
gem 'rdiscount', '~> 2.0'
gem 'RedCloth', '~> 4.2.9'
gem 'haml', '~> 4.0'
gem 'compass', '~> 1.0.1'
gem 'sass-globbing', '~> 1.0.0'
gem 'rb-fsevent', '~> 0.9'
gem 'stringex', '~> 1.4.0'
end
group :test do
gem 'html-proofer'
gem 'yaml-lint'
end
gem 'sinatra', '~> 1.4.2'
gem 'yui-compressor', '~> 0.12.0'
gem 'html_compressor', '~> 0.0.3'
gem "sinatra-contrib", "~> 1.4.2"
gem 'redcarpet'
gem 'recurly', '~> 2.2.1'
gem "daemons", "~> 1.1.9"
gem 'therubyracer'
gem 'oga'
gem 'httparty'
GEM
remote: https://rubygems.org/
specs:
POpen4 (0.1.4)
Platform (>= 0.4.0)
open4
Platform (0.4.0)
RedCloth (4.2.9)
addressable (2.3.8)
ansi (1.5.0)
ast (2.2.0)
backports (3.6.4)
blankslate (2.1.2.4)
celluloid (0.16.0)
timers (~> 4.0.0)
chunky_png (1.3.4)
classifier-reborn (2.0.3)
fast-stemmer (~> 1.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.9.1.1)
colorator (0.1)
colored (1.2)
compass (1.0.3)
chunky_png (~> 1.2)
compass-core (~> 1.0.2)
compass-import-once (~> 1.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
sass (>= 3.3.13, < 3.5)
compass-core (1.0.3)
multi_json (~> 1.0)
sass (>= 3.3.0, < 3.5)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
daemons (1.1.9)
ethon (0.7.3)
ffi (>= 1.3.0)
execjs (2.5.2)
fast-stemmer (1.0.2)
ffi (1.9.8)
haml (4.0.6)
tilt
hitimes (1.2.2)
html-proofer (2.2.0)
addressable (~> 2.3)
colored (~> 1.2)
mercenary (~> 0.3.2)
nokogiri (~> 1.5)
parallel (~> 1.3)
typhoeus (~> 0.7)
yell (~> 2.0)
html_compressor (0.0.3)
POpen4 (>= 0.1.4)
httparty (0.13.7)
json (~> 1.8)
multi_xml (>= 0.5.2)
jekyll (2.4.0)
classifier-reborn (~> 2.0)
colorator (~> 0.1)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 2.6.1)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-gist (1.2.1)
jekyll-paginate (1.1.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-sitemap (0.8.1)
jekyll-watch (1.2.1)
listen (~> 2.7)
json (1.8.3)
kramdown (1.7.0)
libv8 (3.16.14.11)
liquid (2.6.2)
listen (2.10.0)
celluloid (~> 0.16.0)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mercenary (0.3.5)
mini_portile (0.6.2)
multi_json (1.11.0)
multi_xml (0.5.5)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
octopress-date-format (2.0.2)
jekyll (~> 2.0)
octopress-hooks (~> 2.0)
octopress-hooks (2.6.1)
jekyll (>= 2.0)
oga (2.0.0)
ast
ruby-ll (~> 2.1)
open4 (1.3.4)
parallel (1.6.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.11)
pygments.rb (0.6.3)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.2.0)
rack (1.6.1)
rack-protection (1.5.3)
rack
rack-test (0.6.3)
rack (>= 1.0)
rake (10.4.2)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rdiscount (2.1.8)
recurly (2.2.3)
redcarpet (3.2.3)
ref (1.0.5)
ruby-ll (2.1.2)
ansi
ast
safe_yaml (1.0.4)
sass (3.4.14)
sass-globbing (1.0.0)
sass (>= 3.1)
sinatra (1.4.6)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (>= 1.3, < 3)
sinatra-contrib (1.4.2)
backports (>= 2.0)
multi_json
rack-protection
rack-test
sinatra (~> 1.4.0)
tilt (~> 1.3)
stringex (1.4.0)
therubyracer (0.12.2)
libv8 (~> 3.16.14.0)
ref
tilt (1.4.1)
timers (4.0.1)
hitimes
toml (0.1.2)
parslet (~> 1.5.0)
typhoeus (0.7.1)
ethon (>= 0.7.1)
yajl-ruby (1.2.1)
yaml-lint (0.0.7)
yell (2.0.5)
yui-compressor (0.12.0)
PLATFORMS
ruby
DEPENDENCIES
RedCloth (~> 4.2.9)
compass (~> 1.0.1)
daemons (~> 1.1.9)
haml (~> 4.0)
html-proofer
html_compressor (~> 0.0.3)
httparty
jekyll (= 2.4)
jekyll-sitemap
octopress-date-format (~> 2.0)
octopress-hooks (~> 2.2)
oga
rake (~> 10.0)
rb-fsevent (~> 0.9)
rdiscount (~> 2.0)
recurly (~> 2.2.1)
redcarpet
sass-globbing (~> 1.0.0)
sinatra (~> 1.4.2)
sinatra-contrib (~> 1.4.2)
stringex (~> 1.4.0)
therubyracer
yaml-lint
yui-compressor (~> 0.12.0)
BUNDLED WITH
1.11.2
Copyright (c) GitLab B.V.
[![build status](https://ci.gitlab.com/projects/1873/status.png?ref=master)](https://ci.gitlab.com/projects/1873?ref=master)
# Contributing
Please see [CONTRIBUTING.md](CONTRIBUTING.md)
# Deploying
It is sufficient to merge or push to master and site will be automatically deployed.
Manual:
```
git remote add deploy deploy@blue-moon.gitlap.com:~/www-gitlab-com.git
git push deploy master
```
Make sure you have a right system locale otherwise you can get [error](https://gitlab.com/snippets/2327). Output of `locale` should be like:
```
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
```
# Development
Serve a local build on http://localhost:4000 using:
```
bundle exec rake preview
```
or use the following to also launch Google Chrome
```
bin/view
```
# Deployment setup
Set up a build server with a bare repository and the hook in `_support/hooks`.
Install site and PDF build dependencies `sudo apt-get install texlive-latex-recommended ruby1.9.1-dev ruby1.9.1`
Unfortunately, the pandoc version that ships with Ubuntu 12.04 is too old, so we have to build from source.
```
sudo apt-get install haskell-platform
sudo su - deploy # become the user who performs the build
cabal update
cabal install pandoc # takes a while
```
Copy `_support/user/bash_profile` to `~deploy/.bash_profile` to make sure the build script picks up the pandoc executable.
# In blog posts
Use the following tag after the opening paragraph to make it an acceptable size for the index listing of all articles:
<!-- more -->
Add your post's image to the 'images' file in this project. You'll need to do it through your local repository.
Add the following to the top of a blog post (between the --- markers) and it will format it as a full bleed image.
image_title: '/images/unspash/hardware.jpg'
When you add information about features or changes in GitLab CE, EE or CI, make it clear on which one users will be able to find these features or changes.
# Image Guidelines
When adding images to the site, please avoid using largely sized images, as they drastically increase load on the server and make the experience poor for the user.
Also make sure to compress the images as much as possible (use online resource, Photoshop, however you'd like)
You can find images at unsplash.com and then compress them at tinypng.com.
You can link to the authors twitter account with:
author_twitter: sytses
# Other documentation
* [Autodeploy](doc/autodeploy.md)
* [Recurly](doc/recurly.md)
* [Redirects](doc/redirect_blogposts_org_to_com.md)
* [Add a team member to GitLab's website's step by step](add_member_to_team_page.md)
* [Create a new markdown page](md_page.md)
## Create release blog post
Begin a new release blog post using template from docs.
```
bundle exec rake new_release_post["7.3"]
```
## Create blog post
Create blank blog post based on title
```
bundle exec rake new_post["Feature highlight: Groups"]
```
This diff is collapsed.
# ----------------------- #
# Main Configs #
# ----------------------- #
url: https://about.gitlab.com
title: GitLab
subtitle: Open source software to collaborate on code
author: Marin Jankovski
simple_search: http://google.com/search
description:
# Default date format is "ordinal" (resulting in "July 22nd 2007")
# You can customize the format as defined in
# http://www.ruby-doc.org/core-1.9.2/Time.html#method-i-strftime
# Additionally, %o will give you the ordinal representation of the day
date_format: "ordinal"
# RSS / Email (optional) subscription links (change if using something like Feedburner)
subscribe_rss: /atom.xml
subscribe_email:
# RSS feeds can list your email address if you like
email:
# ----------------------- #
# Jekyll & Plugins #
# ----------------------- #
# If publishing to a subdirectory as in http://site.com/project set 'root: /project'
root: /
permalink: /:year/:month/:day/:title/
source: source
destination: public
plugins: plugins
code_dir: downloads/code
category_dir: blog/categories
markdown: rdiscount
rdiscount:
extensions:
- autolink
- footnotes
- smart
highlighter: pygments # default python pygments have been replaced by pygments.rb
paginate: 3 # Posts per page on the blog index
paginate_path: "blog/:num" # Directory base for pagination URLs eg. /posts/2/
recent_posts: 5 # Posts in the sidebar Recent Posts section
excerpt_link: "Read on &rarr;" # "Continue reading" link text at the bottom of excerpted articles
excerpt_separator: "<!--more-->"
titlecase: true # Converts page and post titles to titlecase
# list each of the sidebar modules you want to include, in the order you want them to appear.
# To add custom asides, create files in /source/_includes/custom/asides/ and add them to the list like 'custom/asides/custom_aside_name.html'
default_asides: [asides/recent_posts.html, asides/github.html, asides/delicious.html, asides/pinboard.html, asides/googleplus.html]
# Each layout uses the default asides, but they can have their own asides instead. Simply uncomment the lines below
# and add an array with the asides you want to use.
# blog_index_asides:
# post_asides:
# page_asides:
# ----------------------- #
# 3rd Party Settings #
# ----------------------- #
# Github repositories
github_user:
github_repo_count: 0
github_show_profile_link: true
github_skip_forks: true
# Twitter
twitter_user:
twitter_tweet_button: true
# Google +1
google_plus_one: false
google_plus_one_size: medium
# Google Plus Profile
# Hidden: No visible button, just add author information to search results
googleplus_user:
googleplus_hidden: false
# Pinboard
pinboard_user:
pinboard_count: 3
# Delicious
delicious_user:
delicious_count: 3
# Disqus Comments
disqus_short_name:
disqus_show_comment_count: false
# Google Analytics
google_analytics_tracking_id:
# Facebook Like
facebook_like: false
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$]{$documentclass$}
% fix for pandoc 1.14
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{fancyhdr}
\usepackage{booktabs}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[utf8]{inputenc}
$if(euro)$
\usepackage{eurosym}
$endif$
\else % if luatex or xelatex
\usepackage{fontspec}
\ifxetex
\usepackage{xltxtra,xunicode}
\fi
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\newcommand{\euro}{}
$if(mainfont)$
\setmainfont{$mainfont$}
$endif$
$if(sansfont)$
\setsansfont{$sansfont$}
$endif$
$if(monofont)$
\setmonofont{$monofont$}
$endif$
$if(mathfont)$
\setmathfont{$mathfont$}
$endif$
\fi
% use microtype if available
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
$if(geometry)$
\usepackage[$for(geometry)$$geometry$$sep$,$endfor$]{geometry}
$endif$
$if(natbib)$
\usepackage{natbib}
\bibliographystyle{plainnat}
$endif$
$if(biblatex)$
\usepackage{biblatex}
$if(biblio-files)$
\bibliography{$biblio-files$}
$endif$
$endif$
$if(listings)$
\usepackage{listings}
$endif$
$if(lhs)$
\lstnewenvironment{code}{\lstset{language=Haskell,basicstyle=\small\ttfamily}}{}
$endif$
$if(highlighting-macros)$
$highlighting-macros$
$endif$
$if(verbatim-in-note)$
\usepackage{fancyvrb}
$endif$
$if(tables)$
\usepackage{longtable}
$endif$
$if(graphics)$
\usepackage{graphicx}
% We will generate all images so they have a width \maxwidth. This means
% that they will get their normal width if they fit onto the page, but
% are scaled down if they would overflow the margins.
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
\else\Gin@nat@width\fi}
\makeatother
\let\Oldincludegraphics\includegraphics
\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}
$endif$
\ifxetex
\usepackage[setpagesize=false, % page size defined by xetex
unicode=false, % unicode breaks when used with xetex
xetex]{hyperref}
\else
\usepackage[unicode=true]{hyperref}
\fi
\hypersetup{breaklinks=true,
bookmarks=true,
pdfauthor={$author-meta$},
pdftitle={$title-meta$},
colorlinks=true,
urlcolor=$if(urlcolor)$$urlcolor$$else$blue$endif$,
linkcolor=$if(linkcolor)$$linkcolor$$else$magenta$endif$,
pdfborder={0 0 0}}
\urlstyle{same} % don't use monospace font for urls
$if(links-as-notes)$
% Make links footnotes instead of hotlinks:
\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
$endif$
$if(strikeout)$
\usepackage[normalem]{ulem}
% avoid problems with \sout in headers with hyperref:
\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
$endif$
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em} % prevent overfull lines
$if(numbersections)$
\setcounter{secnumdepth}{5}
$else$
\setcounter{secnumdepth}{0}
$endif$
$if(verbatim-in-note)$
\VerbatimFootnotes % allows verbatim text in footnotes
$endif$
$if(lang)$
\ifxetex
\usepackage{polyglossia}
\setmainlanguage{$mainlang$}
\else
\usepackage[$lang$]{babel}
\fi
$endif$
$for(header-includes)$
$header-includes$
$endfor$
$if(title)$
\title{$title$}
$endif$
\author{$for(author)$$author$$sep$ \and $endfor$}
\date{$date$}
\pagestyle{fancy}
\lhead{}
\cfoot{Page \thepage \ of \pageref*{LastPage}; PDF generated on $date$}
\begin{document}
$for(include-before)$
$include-before$
$endfor$
$if(toc)$
{
\hypersetup{linkcolor=black}
\setcounter{tocdepth}{$toc-depth$}
\tableofcontents
}
$endif$
$body$
$if(natbib)$
$if(biblio-files)$
$if(biblio-title)$
$if(book-class)$
\renewcommand\bibname{$biblio-title$}
$else$
\renewcommand\refname{$biblio-title$}
$endif$
$endif$
\bibliography{$biblio-files$}
$endif$
$endif$
$if(biblatex)$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
$endif$
$for(include-after)$
$include-after$
$endfor$
\label{LastPage}
\end{document}
# How to add yourself to GitLab’s team page
Welcome to GitLab! We are happy to have you join our company and to include
you in our [team page](https://about.gitlab.com/team/). The following are
the steps to add yourself to the team page. Please follow the links that will guide you to full guides about every step.
1. Create an account in [GitLab.com](https://gitlab.com/) and take notes of
your username and password, because you will need them throughout these steps.
2. Ask your manager to grant you access to the [www-gitlab-com
project](https://gitlab.com/gitlab-com/www-gitlab-com).
3. Download Git, following the [start using git
documentation](http://doc.gitlab.com/ce/gitlab-basics/start-using-git.html)
. Don't forget to add your Git username and to set your email.
4. Follow the steps to create and add your [SSH
keys](http://doc.gitlab.com/ce/gitlab-basics/create-your-ssh-keys.html).
Note: in some of these steps, your
[shell](http://doc.gitlab.com/ce/gitlab-basics/start-using-git.html) will
require you to add your GitLab.com username and password.
4. Clone the www-gitlab-com project through your shell, following the [command
line commands
documentation](http://doc.gitlab.com/ce/gitlab-basics/command-line-commands.html).
5. Find the picture that you’d like to add to
our [team page](https://about.gitlab.com/team/), change the picture's name to
the following format: `yourname.jpg` or `yourname.png` and then follow the
"[how
to add an image](http://doc.gitlab.com/ce/gitlab-basics/add-image.html)"
steps.
Note: Any picture that you provide will be made black-and-white
automatically after you add it, but it must be square. Note that your team
page picture should be added to
www-gitlab-com/source/images/team/NAME-OF-PERSON-IN-LOWERCASE.jpg.
6. [Create a Merge Request](http://doc.gitlab.com/ce/gitlab-basics/add-merge-request.html) in [GitLab.com](https://gitlab.com/) with the branch that you created with your picture.
7. In [GitLab.com](https://gitlab.com/), on the left side of your screen, click on "Files".
8. Find the dropdown menu at the top of your screen and find the branch
that you previously created to add your picture (they are in alphabetical
order). If you don't have a branch yet, follow the steps to [create a new
branch](http://doc.gitlab.com/ce/gitlab-basics/create-branch.html).
![dropdown menu](source/images/dropdown-branch-teampage.jpg)
9. Information displayed on [Team page](https://about.gitlab.com/team/) is
pulled from a data file. You can find it by clicking on each of the following items: `source/` `_data/``
`team.yml`.
10. When you are in “team.yml”, click on “edit” on the top right side of
your screen.
11. Your information should be added after the last person on the team page.
You need to copy and paste the following format and fill in your own
information:
```
- name: Linus Torvalds
role: developer
picture: picture_linus.jpg
twitter: Linus_Torvalds
gitlab: linustorvalds
story: |
Linus was the principal force behind the development of the Linux
kernel that became the most popular kernel for operating systems.
He later became the chief architect of the Linux kernel and now
acts as the project's coordinator. He also created the
distributed revision control system git. He joined when it was
created.
```
Don't forget to use other team members' information as a reference and to
respect the spaces between lines. Please don't use "tab" because it will brake the page format.
12. After you added your information, add a comment to your commit and click
on “Commit Changes”.
13. Go to the Merge
Request that you previously created with the branch that you are using and
assign it to your manager for review.
#!/bin/sh
bundle exec rake preview &
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome http://localhost:4000/
require 'sass-globbing'
# Require any additional compass plugins here.
project_type = :stand_alone
# Publishing paths
http_path = "/"
http_images_path = "/images"
http_generated_images_path = "/images"
http_fonts_path = "/fonts"
css_dir = "public/stylesheets"
# Local development paths
sass_dir = "sass"
images_dir = "source/images"
fonts_dir = "source/fonts"
line_comments = false
output_style = :compressed
require 'bundler/setup'
require 'sinatra/base'
# The project root directory
$root = ::File.dirname(__FILE__)
class SinatraStaticServer < Sinatra::Base
get(/.+/) do
send_sinatra_file(request.path) {404}
end
not_found do
send_file(File.join(File.dirname(__FILE__), 'public', '404.html'), {:status => 404})
end
def send_sinatra_file(path, &missing_file_block)
file_path = File.join(File.dirname(__FILE__), 'public', path)
file_path = File.join(file_path, 'index.html') unless file_path =~ /\.[a-z]+$/i
File.exist?(file_path) ? send_file(file_path) : missing_file_block.call
end
end
run SinatraStaticServer
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment