SEO work and resources page
This commit is contained in:
parent
0c26817c02
commit
08aecce225
1
Gemfile
1
Gemfile
@ -29,6 +29,7 @@ gem 'paper_trail'
|
|||||||
gem 'font-awesome-rails'
|
gem 'font-awesome-rails'
|
||||||
gem 'wysiwyg-rails'
|
gem 'wysiwyg-rails'
|
||||||
gem 'rails-assets-cdn'
|
gem 'rails-assets-cdn'
|
||||||
|
gem 'sitemap_generator'
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test do
|
||||||
gem 'rspec'
|
gem 'rspec'
|
||||||
|
@ -279,6 +279,8 @@ GEM
|
|||||||
multi_json
|
multi_json
|
||||||
simplecov-html (~> 0.8.0)
|
simplecov-html (~> 0.8.0)
|
||||||
simplecov-html (0.8.0)
|
simplecov-html (0.8.0)
|
||||||
|
sitemap_generator (5.0.4)
|
||||||
|
builder
|
||||||
slop (3.5.0)
|
slop (3.5.0)
|
||||||
sorcery (0.8.6)
|
sorcery (0.8.6)
|
||||||
bcrypt (~> 3.1)
|
bcrypt (~> 3.1)
|
||||||
@ -366,6 +368,7 @@ DEPENDENCIES
|
|||||||
sass-rails (~> 4.0.0)
|
sass-rails (~> 4.0.0)
|
||||||
selenium-webdriver
|
selenium-webdriver
|
||||||
simplecov
|
simplecov
|
||||||
|
sitemap_generator
|
||||||
sorcery (>= 0.8.1)
|
sorcery (>= 0.8.1)
|
||||||
uglifier (>= 1.3.0)
|
uglifier (>= 1.3.0)
|
||||||
wdm (>= 0.1.0)
|
wdm (>= 0.1.0)
|
||||||
|
@ -5,11 +5,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
html {
|
html {
|
||||||
background-color: $white
|
background-color: $primary-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
height: auto;
|
height: auto;
|
||||||
|
background-color: $white
|
||||||
}
|
}
|
||||||
|
|
||||||
#main-nav {
|
#main-nav {
|
||||||
|
@ -187,9 +187,6 @@ class ConferencesController < ApplicationController
|
|||||||
if current_user
|
if current_user
|
||||||
@host_privledge = :admin
|
@host_privledge = :admin
|
||||||
end
|
end
|
||||||
#if !@conference
|
|
||||||
# raise ActionController::RoutingError.new('Not Found')
|
|
||||||
#end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_conference_registration
|
def set_conference_registration
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
|
|
||||||
class PagesController < ApplicationController
|
class PagesController < ApplicationController
|
||||||
#skip_before_filter :verify_authenticity_token, only: [:translate]
|
#skip_before_filter :verify_authenticity_token, only: [:translate]
|
||||||
|
|
||||||
def home
|
def home
|
||||||
@conferences = Conference.all
|
@conferences = Conference.all
|
||||||
@conference = Conference.find(:first, :order => "start_date DESC")
|
@conference = Conference.find(:first, :order => "start_date DESC")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def resources
|
||||||
|
end
|
||||||
|
|
||||||
def translate
|
def translate
|
||||||
key = params[:translationkey]
|
key = params[:translationkey]
|
||||||
value = params[:translationvalue]
|
value = params[:translationvalue]
|
||||||
@ -51,12 +54,18 @@ class PagesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def translations
|
def translations
|
||||||
|
if !current_user
|
||||||
|
raise ActiveRecord::PremissionDenied
|
||||||
|
end
|
||||||
@lang = params[:lang]
|
@lang = params[:lang]
|
||||||
@translations = I18n.backend.get_translation_info
|
@translations = I18n.backend.get_translation_info
|
||||||
I18n.config.enforce_available_locales = false
|
I18n.config.enforce_available_locales = false
|
||||||
end
|
end
|
||||||
|
|
||||||
def translation_list
|
def translation_list
|
||||||
|
if !current_user
|
||||||
|
raise ActiveRecord::PremissionDenied
|
||||||
|
end
|
||||||
total = 0
|
total = 0
|
||||||
complete = 0
|
complete = 0
|
||||||
@completeness = Hash.new
|
@completeness = Hash.new
|
||||||
@ -78,6 +87,11 @@ class PagesController < ApplicationController
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def robots
|
||||||
|
robot = is_production? && !is_test_server? ? 'live' : 'dev'
|
||||||
|
render :text => File.read("config/robots-#{robot}.txt"), :content_type => 'text/plain'
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def store_translations(locale, data, options = {})
|
def store_translations(locale, data, options = {})
|
||||||
escape = options.fetch(:escape, true)
|
escape = options.fetch(:escape, true)
|
||||||
|
@ -41,6 +41,10 @@ module ApplicationHelper
|
|||||||
content_for(:title) { page_title.to_s }
|
content_for(:title) { page_title.to_s }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def description(page_description)
|
||||||
|
content_for(:description) { page_description.to_s }
|
||||||
|
end
|
||||||
|
|
||||||
def banner_image(banner_image, name: nil, id: nil, user_id: nil, src: nil)
|
def banner_image(banner_image, name: nil, id: nil, user_id: nil, src: nil)
|
||||||
@@no_banner = false
|
@@no_banner = false
|
||||||
@@banner_image = banner_image
|
@@banner_image = banner_image
|
||||||
@ -459,6 +463,18 @@ module ApplicationHelper
|
|||||||
(Rails.application.config.action_controller.asset_host || '') + file
|
(Rails.application.config.action_controller.asset_host || '') + file
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def is_production?
|
||||||
|
Rails.env == 'production'
|
||||||
|
end
|
||||||
|
|
||||||
|
def subdomain
|
||||||
|
request.env['SERVER_NAME'].gsub(/^(\w+)\..*$/, '\1')
|
||||||
|
end
|
||||||
|
|
||||||
|
def is_test_server?
|
||||||
|
subdomain == 'test'
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def _form_field(type, name, value, options)
|
def _form_field(type, name, value, options)
|
||||||
if type == 'check_box'
|
if type == 'check_box'
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
- title _'page.Conferences'
|
- page_name = 'All '+(@conference_type ? @conference_type.title+' ' : '')+' Conferences'
|
||||||
|
- title page_name
|
||||||
- banner_image '/assets/conference.jpg'
|
- banner_image '/assets/conference.jpg'
|
||||||
- page_style :list
|
- page_style :list
|
||||||
- content_for :banner do
|
- content_for :banner do
|
||||||
@ -6,7 +7,7 @@
|
|||||||
.columns
|
.columns
|
||||||
%h1=_'page.Conferences'
|
%h1=_'page.Conferences'
|
||||||
|
|
||||||
%h2='All '+(@conference_type ? @conference_type.title+' ' : '')+' Conferences'
|
%h2=page_name
|
||||||
|
|
||||||
%ul.small-block-grid-1.medium-block-grid-2.large-block-grid-3.conference-list.preview-list
|
%ul.small-block-grid-1.medium-block-grid-2.large-block-grid-3.conference-list.preview-list
|
||||||
- @conferences.each do |conference|
|
- @conferences.each do |conference|
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
- title 'Bike!Bike!'
|
- title @conference.title
|
||||||
= render 'header'
|
= render 'header'
|
||||||
|
|
||||||
.row
|
%article.row
|
||||||
%h1
|
.columns.large-10
|
||||||
=_'error.title.Permission_Denied'
|
%h1=_'error.title.Permission_Denied'
|
||||||
%p
|
%p=_'error.desc.permission_denied', :p
|
||||||
=_'error.desc.permission_denied', :p
|
|
||||||
|
- content_for :side_bar do
|
||||||
|
%h5= @conference.title+' is hosted by:'
|
||||||
|
%ul.preview-list.org-list.small-block-grid-2.large-block-grid-1
|
||||||
|
- @conference.organizations.each do |organization|
|
||||||
|
%li=render 'organizations/preview', :organization => organization
|
@ -1,4 +1,8 @@
|
|||||||
- title 'Bike!Bike!'
|
- location = @conference.organizations.first.locations.first
|
||||||
|
- location_name = location.city + ', ' + (location.territory ? Carmen::Country.coded(location.country).subregions.coded(location.territory).name : location.country)
|
||||||
|
|
||||||
|
- title @conference.title
|
||||||
|
- description "#{@conference.title} conference in #{location_name} for DIY bicycle collectives, co-ops, and advocacy groups"
|
||||||
= render 'header'
|
= render 'header'
|
||||||
|
|
||||||
= tabs!
|
= tabs!
|
||||||
|
@ -3,17 +3,15 @@
|
|||||||
%head
|
%head
|
||||||
%meta{ charset: 'utf-8' }
|
%meta{ charset: 'utf-8' }
|
||||||
%meta{ name: 'viewport', content: 'width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0' }
|
%meta{ name: 'viewport', content: 'width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0' }
|
||||||
%title= yield_or_default :title, controller.action_name.titlecase
|
%title= (yield :title) + (content_for?(:title) ? ' | ' : '') + 'Bike!Bike!'
|
||||||
%meta{ name: 'description', content: (yield_or_default :description, 'Bike!Bike! is an international annual gathering organized by and for community bicycle projects') }
|
%meta{ name: 'description', content: (yield_or_default :description, 'Bike!Bike! conferences for DIY bicycle collectives, co-ops, and advocacy groups') }
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
= yield :head
|
= yield :head
|
||||||
/ Le HTML5 shim, for IE6-8 support of HTML elements
|
|
||||||
/[if lt IE 9]
|
/[if lt IE 9]
|
||||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
|
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
|
||||||
|
|
||||||
= stylesheet_link_tag '//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,400italic,700italic', 'application', media: 'all'
|
= stylesheet_link_tag '//fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,400italic,700italic', 'application', media: 'all'
|
||||||
|
|
||||||
/ Touch icons
|
|
||||||
%link{ href: asset_path('favicon.ico'), rel: 'shortcut icon', type: 'image/x-icon' }
|
%link{ href: asset_path('favicon.ico'), rel: 'shortcut icon', type: 'image/x-icon' }
|
||||||
%link{ href: asset_path('favicon.ico'), rel: 'icon', type: 'image/x-icon' }
|
%link{ href: asset_path('favicon.ico'), rel: 'icon', type: 'image/x-icon' }
|
||||||
%link{ href: asset_path('apple-touch-icon.png'), rel: 'apple-touch-icon' }
|
%link{ href: asset_path('apple-touch-icon.png'), rel: 'apple-touch-icon' }
|
||||||
@ -21,10 +19,6 @@
|
|||||||
%link{ href: asset_path('apple-touch-icon-114x114.png'), rel: 'apple-touch-icon', sizes: '114x114' }
|
%link{ href: asset_path('apple-touch-icon-114x114.png'), rel: 'apple-touch-icon', sizes: '114x114' }
|
||||||
%link{ href: asset_path('apple-touch-icon-144x144.png'), rel: 'apple-touch-icon', sizes: '144x144' }
|
%link{ href: asset_path('apple-touch-icon-144x144.png'), rel: 'apple-touch-icon', sizes: '144x144' }
|
||||||
|
|
||||||
/
|
|
||||||
Le javascript
|
|
||||||
\==================================================
|
|
||||||
/ Placed at the top of the document 'cause of turbolinks
|
|
||||||
=# javascript_include_tag '//use.typekit.net/iqv7hcg.js'
|
=# javascript_include_tag '//use.typekit.net/iqv7hcg.js'
|
||||||
=# javascript_include_tag 'application'
|
=# javascript_include_tag 'application'
|
||||||
=# javascript_include_tag 'nested_form'
|
=# javascript_include_tag 'nested_form'
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
- title _'page.Organizations'
|
- title _'page.Organizations'
|
||||||
|
- description 'Bike!Bike! list of DIY bicycle collectives, co-ops, coops, community bike projects, advocacy by country, state, provice, and city'
|
||||||
- banner_image '/assets/orgs.jpg'
|
- banner_image '/assets/orgs.jpg'
|
||||||
- page_style :list
|
- page_style :list
|
||||||
- content_for :banner do
|
- content_for :banner do
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
- territory = Carmen::Country.coded(@organization.locations[0].country).subregions.coded(@organization.locations[0].territory)
|
||||||
|
- location_name = @organization.locations[0].city + (territory ? ' ' + territory.name : '') + ', ' + Carmen::Country.coded(@organization.locations[0].country).name
|
||||||
|
|
||||||
|
- title @organization.name + ' (' + location_name + ')'
|
||||||
|
- description "#{@organization.name} is a bicycle collective, co-op, community bike project, or advocacy group in #{location_name}"
|
||||||
- banner_image @organization.cover_url, id: @organization.cover_attribution_id, name: @organization.cover_attribution_name, user_id: @organization.cover_attribution_user_id, src: @organization.cover_attribution_src
|
- banner_image @organization.cover_url, id: @organization.cover_attribution_id, name: @organization.cover_attribution_name, user_id: @organization.cover_attribution_user_id, src: @organization.cover_attribution_src
|
||||||
- page_style 'article'
|
- page_style 'article'
|
||||||
- content_for :banner do
|
- content_for :banner do
|
||||||
@ -8,7 +13,7 @@
|
|||||||
.columns.info{:class => (@organization.avatar.is_landscape? ? nil : ['medium-6', 'medium-pull-6'])}
|
.columns.info{:class => (@organization.avatar.is_landscape? ? nil : ['medium-6', 'medium-pull-6'])}
|
||||||
%h1=@organization.name
|
%h1=@organization.name
|
||||||
- territory = Carmen::Country.coded(@organization.locations[0].country).subregions.coded(@organization.locations[0].territory)
|
- territory = Carmen::Country.coded(@organization.locations[0].country).subregions.coded(@organization.locations[0].territory)
|
||||||
%h2=@organization.locations[0].city + (territory ? ' ' + territory.name : '') + ', ' + Carmen::Country.coded(@organization.locations[0].country).name
|
%h2=location_name
|
||||||
|
|
||||||
%p#notice= notice
|
%p#notice= notice
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
- title 'Bike!Bike!'
|
|
||||||
- has_no_content
|
- has_no_content
|
||||||
- this_is_the_front_page
|
- this_is_the_front_page
|
||||||
- if @conference
|
- if @conference
|
||||||
|
9
app/views/pages/permission_denied.html.haml
Normal file
9
app/views/pages/permission_denied.html.haml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
- page_title = _'error.title.Permission_Denied'
|
||||||
|
- title page_title
|
||||||
|
- banner_title page_title
|
||||||
|
|
||||||
|
.row
|
||||||
|
%h1
|
||||||
|
='This page is inaccessible to you'
|
||||||
|
%p
|
||||||
|
=_'error.desc.permission_denied', :p
|
25
app/views/pages/resources.html.haml
Normal file
25
app/views/pages/resources.html.haml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
- page_title = 'Bike!Bike! Reources'
|
||||||
|
- title page_title
|
||||||
|
- banner_title page_title
|
||||||
|
- description 'Bike!Bike! list of resources - Bike Collective Wiki, ThinkTank, Bike!Bike! photos and documents'
|
||||||
|
|
||||||
|
.row
|
||||||
|
.columns
|
||||||
|
%p
|
||||||
|
Here is a list of online resources available to commmunity bike projects. The bike collective wiki in particlular has great start up kits and many helpful articles about how community bike shops operate. The think tank is a list serve with over 600 contributors. When you join the list, you can talk to community bike shops from all over the world about how to better organize and operate a shop.
|
||||||
|
%ul
|
||||||
|
%li
|
||||||
|
%a{href: 'http://www.bikecollectives.org/wiki/index.php?title=Main_Page', target: '_blank'}
|
||||||
|
Bike Collective Wiki
|
||||||
|
%li
|
||||||
|
%a{href: 'http://lists.bikecollectives.org/listinfo.cgi/thethinktank-bikecollectives.org', target: '_blank'}
|
||||||
|
Think tank sign up
|
||||||
|
%li
|
||||||
|
%a{href: 'http://www.flickr.com/photos/93412361@N07/with/8494632542/', target: '_blank'}
|
||||||
|
flickr bikebike!
|
||||||
|
%li
|
||||||
|
%a{href: 'https://www.dropbox.com/sh/4phyl9lft18whzi/SXQ6XUklKB', target: '_blank'}
|
||||||
|
Drop box for bikebike2012 (shared public box)
|
||||||
|
|
||||||
|
%p
|
||||||
|
If you have more resources you think should be listed here, please post them to the <a href="http://tqa.bikebike.org/project/issues/website" rel="external">issue tracker for the bikebike! website.</a></div></div>
|
@ -1,4 +1,6 @@
|
|||||||
- banner_title 'Translations'
|
- page_title = 'Translations'
|
||||||
|
- title page_title
|
||||||
|
- banner_title page_title
|
||||||
|
|
||||||
.row
|
.row
|
||||||
%h1
|
%h1
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
- banner_title (_ 'language_translations', vars: {:language => (_ ('languages.' + @lang))})
|
- page_title = (_ 'language_translations', vars: {:language => (_ ('languages.' + @lang))})
|
||||||
|
- title page_title
|
||||||
|
- banner_title page_title
|
||||||
- page_style :form
|
- page_style :form
|
||||||
|
|
||||||
.row
|
.row
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
%i
|
%i
|
||||||
%a{href: '/conferences/'}='Organizations'
|
%a{href: '/conferences/'}='Organizations'
|
||||||
%i
|
%i
|
||||||
%a{href: '/conferences/'}='Zine'
|
%a{href: '/resources/'}='Resources'
|
||||||
.columns.medium-3.large-3.text-right
|
.columns.medium-3.large-3.text-right
|
||||||
©2014 Bike!Bike!
|
©2014 Bike!Bike!
|
||||||
|
|
||||||
|
@ -7,4 +7,4 @@
|
|||||||
.buttons
|
.buttons
|
||||||
= link_to (_'Conferences'), :conferences, {:class => ['button', 'conference']}
|
= link_to (_'Conferences'), :conferences, {:class => ['button', 'conference']}
|
||||||
= link_to (_'Organizations'), {:controller => :organizations}, {:class => ['button', 'organization']}
|
= link_to (_'Organizations'), {:controller => :organizations}, {:class => ['button', 'organization']}
|
||||||
= link_to (_'Zine'), 'http://zinezine.bikebike.org', :class => ['button', 'article']
|
= link_to (_'Resources'), '/resources/', :class => ['button', 'article']
|
||||||
|
21
config/Xsitemap.rb
Normal file
21
config/Xsitemap.rb
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
SitemapGenerator::Sitemap.default_host = "http://hackingoff.com"
|
||||||
|
|
||||||
|
SitemapGenerator::Sitemap.create do
|
||||||
|
routes = Rails.application.routes.routes.map do |route|
|
||||||
|
{alias: route.name, path: route.path.spec.to_s, controller: route.defaults[:controller], action: route.defaults[:action]}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Set a list of controllers you don't want to generate routes for.
|
||||||
|
# /rails/info in particular maps to something inaccessible.
|
||||||
|
# redirects have a nil controller. This prevents duplicate content penalties.
|
||||||
|
banned_controllers = ["rails/info", nil]
|
||||||
|
routes.reject! {|route| banned_controllers.include?(route[:controller])}
|
||||||
|
|
||||||
|
# sitemap_generator includes root by default; prevent duplication
|
||||||
|
routes.reject! {|route| route[:path] == '/'}
|
||||||
|
|
||||||
|
routes.each {|route| add route[:path][0..-11]} # Strips off '(.:format)
|
||||||
|
|
||||||
|
# Notice the below if you're hosting Jekyll/Octopress in a subdirectory
|
||||||
|
# or otherwise want to index content outside of Rails' routes.
|
||||||
|
# add_to_index '/path/sitemap.xml'
|
2
config/robots-dev.txt
Normal file
2
config/robots-dev.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow: /
|
3
config/robots-live.txt
Normal file
3
config/robots-live.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow: /translations/
|
||||||
|
Disallow: /login/
|
@ -60,6 +60,9 @@ BikeBike::Application.routes.draw do
|
|||||||
get "oauth/callback" => "oauths#callback"
|
get "oauth/callback" => "oauths#callback"
|
||||||
get "oauth/:provider" => "oauths#oauth", :as => :auth_at_provider
|
get "oauth/:provider" => "oauths#oauth", :as => :auth_at_provider
|
||||||
|
|
||||||
|
get 'robots.txt' => 'pages#robots'
|
||||||
|
get 'resources' => 'pages#resources'
|
||||||
|
|
||||||
root 'pages#home'
|
root 'pages#home'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
27
config/sitemap.rb
Normal file
27
config/sitemap.rb
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Set the host name for URL creation
|
||||||
|
SitemapGenerator::Sitemap.default_host = "http://bikebike.org"
|
||||||
|
|
||||||
|
SitemapGenerator::Sitemap.create do
|
||||||
|
# Put links creation logic here.
|
||||||
|
#
|
||||||
|
# The root path '/' and sitemap index file are added automatically for you.
|
||||||
|
# Links are added to the Sitemap in the order they are specified.
|
||||||
|
#
|
||||||
|
# Usage: add(path, options={})
|
||||||
|
# (default options are used if you don't specify)
|
||||||
|
#
|
||||||
|
# Defaults: :priority => 0.5, :changefreq => 'weekly',
|
||||||
|
# :lastmod => Time.now, :host => default_host
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
#
|
||||||
|
# Add '/articles'
|
||||||
|
#
|
||||||
|
# add articles_path, :priority => 0.7, :changefreq => 'daily'
|
||||||
|
#
|
||||||
|
# Add all articles:
|
||||||
|
#
|
||||||
|
# Article.find_each do |article|
|
||||||
|
# add article_path(article), :lastmod => article.updated_at
|
||||||
|
# end
|
||||||
|
end
|
BIN
public/maps/Thumbs.db
Normal file
BIN
public/maps/Thumbs.db
Normal file
Binary file not shown.
BIN
public/sitemap.xml.gz
Normal file
BIN
public/sitemap.xml.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user