Commit ebcb1cfd authored by Richard Perry's avatar Richard Perry
Browse files

Merge branch 'revamp' into 'pages'

Moved site over to the new Theme

See merge request !2
parents 6ffb87bc 2300a2e4
Pipeline #6333853 passed with stage
in 4 minutes and 34 seconds
changes
Gemfile.lock
_includes/css/grunt.css
_includes/scripts/grunt.js
_site
_drafts
node_modules
_cache
_gist_cache
_site/
_drafts
_drafts/
node_modules/
_cache
_cache/
_gist_cache
_gist_cache/
.bundle
.bundle/
.sass-cache
.sass-cache/
 
# Windows image file caches
Thumbs.db
......
......@@ -3,9 +3,8 @@ image: ruby:2.3
pages:
stage: deploy
script:
- mkdir -p ./_cache/flickr
- bundle install
- bundle exec jekyll build -d public
- JEKYLL_ENV=production bundle exec jekyll build -d public
artifacts:
paths:
- public
......
travel.perry-online.me.uk
source 'https://rubygems.org'
gem 'jekyll'
# gem 'stringex'
gem 'titleize'
gem 'jekyll-oembed', :require => 'jekyll_oembed'
gem 'jekyll-theme-perry'
gem 'flickraw'
gem 'jemoji'
gem 'execjs'
gem 'therubyracer', :platforms => :ruby
gem 'jekyll-gist'
gem 'jekyll-redirect-from'
gem 'jekyll-paginate'
gem 'jekyll-sitemap'
gem 'jemoji'
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
css: {
src: [
'_includes/css/vendor/normalize.min.css',
'_includes/css/vendor/h5bp.css',
'_includes/css/vendor/colorbox.css',
'_includes/css/main.css',
'_includes/css/gallery.css',
'_includes/css/vendor/slicknav.css',
'_includes/css/media.css',
'_includes/css/print.css',
'_includes/css/vendor/pygment_solarized.css',
],
dest: '_includes/css/grunt.css'
},
js : {
src : [
'_includes/scripts/vendor/jquery.slicknav.js',
'_includes/scripts/vendor/jquery.colorbox-min.js',
'_includes/scripts/plugins.js',
'_includes/scripts/main.js'
],
dest : '_includes/scripts/grunt.js'
}
},
cssmin : {
css:{
src: '_includes/css/grunt.css',
dest: 'assets/css/main.min.css'
}
},
uglify : {
js: {
files: {
'assets/scripts/main.min.js' : [ '_includes/scripts/grunt.js' ]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default', [ 'concat:css', 'cssmin:css', 'concat:js', 'uglify:js' ]);
};
\ No newline at end of file
require "rubygems"
require "tmpdir"
require "bundler/setup"
require "jekyll"
# Change your GitHub reponame
GITHUB_REPONAME = "richardp2/travel"
BITBUCKET_REPO = "richardp2/travel-blog-website"
desc "Build and preview the site"
task :preview => [:grunt, :clean] do
puts "## Building a preview of the site"
pids = [
spawn("jekyll serve -w --drafts")
]
trap "INT" do
Process.kill "INT", *pids
puts "\n## Preview site shutdown"
exit 1
end
loop do
sleep 1
end
end
desc 'Runs grunt'
task :grunt do
puts "## Concatenating & minifying/uglifying css & js files"
system "grunt"
end
desc 'Delete generated _site files'
task :clean do
puts "## Cleaning up build folder (if it exists)"
system "rm -rf _site"
end
desc "Commit the source branch of the site"
task :commit do
puts "## Adding unstaged files"
system "git add -A > /dev/null"
puts "\n## Committing changes with commit message from file 'changes'"
system "git commit -aF changes"
end
desc "Push source file commits up to origin"
task :push do
puts "## Check there is nothing to pull from origin"
system "git pull"
puts "## Pushing commits to origin"
system "git push origin source"
end
desc "Build the site ready for deployment"
task :build => [:grunt, :clean] do
puts "## Generate the Jekyll site files"
Jekyll::Site.new(Jekyll.configuration({
"source" => ".",
"destination" => "_site"
})).process
puts "## Build complete"
end
desc "Generate and deploy blog to master"
task :deploy, [:message] => [:commit, :push, :build] do |t, args|
args.with_defaults(:message => "Site updated at #{Time.now.utc}")
puts "## Push built site to master branch"
Dir.mktmpdir do |tmp|
# Clone the master branch into a temporary directory"
system "git clone git@github.com:#{GITHUB_REPONAME}.git -b gh-pages #{tmp}"
# Delete all files in the temporary directory to ensure deleted file are removed"
rm_rf "#{tmp}/*"
# Copy the build site to the temporary directory
cp_r "_site/.", tmp
# Store the current working directory for latere
pwd = Dir.pwd
# Change to the temporary directory
Dir.chdir tmp
# Add unstaged files, commit them, add the additional repository at Bitbucket and push to origin
system "git add -A"
system "git commit -m #{args[:message].inspect}"
system "git remote set-url --add origin git@bitbucket.org:#{BITBUCKET_REPO}.git"
system "git push origin gh-pages"
# Change back to the previous working directory
Dir.chdir pwd
end
puts "\nSite Published and Deployed to GitHub"
puts "\nHave a nice day :-)"
end
# The following task was adapted from one written by Shane Burkhart
# Source: http://www.shaneburkhart.me/2013/12/07/rake-task-to-publish-drafts-in-jekyll.html
desc "Publish draft posts and update the date field"
task :publish, [:file] do |t, args|
require "time"
require 'yaml'
if args[:file]
file = "_drafts/#{args[:file]}"
text = File.read(file)
time = Time.now.iso8601.gsub!('T', ' ')
text.gsub!(/^date.*$/, "date: #{time}")
today = Time.now.strftime("%Y-%m-%d")
post_name = file.split("/").last
dest = "_posts/#{today}-#{post_name}"
File.open(dest, 'w') {|f| f.write(text) }
puts "Published file #{post_name}"
dest = "../perry-online/_posts/#{today}-#{post_name}"
data = YAML::load_file file
if data['permalink']
permalink = data['permalink']
else
permalink = '/'
data['categories'].each do |category|
permalink += "#{category.downcase!}/"
end
permalink += "#{args[:file][0..-4]}/"
end
if data['author']
author = data['author']
else
author = 'rosiejim'
end
File.open(dest, 'w') {|f|
f.write("---")
f.write("\n")
f.write("blog: travel")
f.write("\n")
f.write("date: #{time}")
f.write("\n")
f.write("title: \"#{data['title']}\"")
f.write("\n")
f.write("author: #{author}")
f.write("\n")
f.write("permalink: #{permalink}")
f.write("\n")
f.write("---")
}
File.delete(file)
puts "Deleted draft file #{post_name}"
else
puts "Incorrect usage of the :publish task"
puts "\n\tUsage:"
puts "\trake publish[draft-post.md]"
puts "\nPlease try again"
end
end
name: Rosie & Jim's Travel Blog
######################################
# #
# Site Configuration #
# #
######################################
# Site details
title: Rosie & Jim's Travel Blog
description: A blog of all our travels
owner: rosiejim
author: rosiejim
authors:
- richard
- rosie
url: https://travel.perry-online.me.uk
email: travel@perry-online.me.uk
 
# Where things are
images: /assets/images
thumbs: /assets/images/thumbs
# Handling Reading
exclude:
- 'changes'
- 'Gemfile'
- 'Gemfile.lock'
- 'Gruntfile.js'
- 'node_modules'
- 'package.json'
- 'Rakefile'
- 'LICENSE.md'
- 'README.md'
gems:
- jemoji
- jekyll-seo-tag
- jekyll-archives
- jekyll-paginate
- jekyll-gist
- jekyll-redirect-from
- jekyll-sitemap
 
sass:
######################################
# #
# Theme Configuration #
# #
######################################
# General Configuration
theme: jekyll-theme-perry
logo: /assets/images/logo.svg
meta:
copyright:
year: '2009'
powered-by: true
hosting:
name: GitLab Pages
link: //pages.gitlab.io
# Markdown Processors
# sass:
sass_dir: _sass
style: compressed
 
encoding: utf-8
# Comments
disqus:
shortname: rosiejimtravel
 
# Outputting
permalink: /:categories/:title/
relative_permalinks: false
paginate: 10
paginate_path: "page/:num"
images: /assets/images
thumbs: /assets/images/thumbs
timezone: Europe/London
defaults:
-
scope:
path: ""
type: "posts"
values:
layout: "post"
comments: true
-
scope:
path: ""
type: "pages"
values:
layout: "page"
comments: false
######################################
# #
# Plugin Configuration #
# #
######################################
# Flickr Plugin
flickr:
cache_dir: ./_cache
api_key: 4389a0eb79c41ca17e149830c22fc7c2
shared_secret: ef41108edae962b0
access_token: 72157641557984045-92a5dbebf3e01418
access_secret: 1625dbdd3cf26db6
# Jekyll Archives Gem
jekyll-archives:
enabled:
- year
layouts: archive
permalinks:
year: '/archives/:year/'
# Jekyll SEO Tag Gem
facebook:
app_id: 181763705182339
admins: 286603693
twitter:
username: richard_p2
social:
links:
- https://twitter.com/richard_p2
- https://www.facebook.com/richardpperry
- https://www.linkedin.com/in/rpperry
- https://plus.google.com/+RichardPerry1
- https://github.com/richardp2
google:
analytics: UA-26085183-4
webmaster_verifications:
google: kShm7KvCbKtxnGKHhDpje_9bPdemRwk2OLXtfjEBWEQ
 
category_dir: /
######################################
# #
# Additional Configuration #
# #
######################################
 
# Location Config
locations:
China:
name: China
link: /china/
Beijing:
name: Beijing
link: /china/beijing/
Chengdu:
name: Chengdu
link: /china/chengdu/
Chongqing:
name: Chongqing
link: /china/chongqing/
Guilin:
name: Guilin
link: /china/guilin/
Hong-Kong:
name: Hong Kong
link: /china/hong-kong/
Macau:
name: Macau
link: /china/macau/
Shanghai:
name: Shanghai
link: /china/shanghai/
Xian:
name: Xi'an
link: /china/xian/
Yangshuo:
name: Yangshuo
link: /china/yangshuo/
Yangtze:
name: Yangtze
link: /china/yangtze/
Iceland:
name: Iceland
link: /iceland/
Reykjavik:
name: Reykjavik
link: /iceland/reykjavik/
Morocco:
name: Morocco
link: /morocco/
Marrakech:
name: Marrakech
link: /morocco/marrakech/
Mongolia:
name: Mongolia
link: /mongolia/
Tov:
name: Töv
link: /mongolia/tov/
Ulaanbaatar:
name: Ulaanbaatar
link: /mongolia/ulaanbaatar/
Tibet:
name: Tibet
link: /tibet/
Lhasa:
name: Lhasa
link: /tibet/lhasa/
UK:
name: UK
link: /uk/
Cornwall:
name: Cornwall
link: /uk/cornwall/
North-East:
NE:
name: North East England
link: /uk/north-east/
Vietnam:
name: Vietnam
link: /vietnam/
Hanoi:
name: Hanoi
link: /vietnam/hanoi/
Ha-Long-Bay:
name: Ha Long Bay
link: /vietnam/ha-long-bay/
Huế:
name: Huế
link: /vietnam/huế/
Hội-An:
name: "Hội-An"
link: /vietnam/hội-an/
Iceland:
name: Iceland
link: /iceland/
Reykjavik:
name: Reykjavik
link: /iceland/reykjavik/
Hanoi:
name: Hanoi
link: /vietnam/hanoi/
Hoi-An:
name: Hoi-An
link: /vietnam/hoi-an/
Hue:
name: Hue
link: /vietnam/hue/
 
flickr:
enabled: yes
cache_dir: _cache/flickr
screen_name: Richard Perry
api_key: 4389a0eb79c41ca17e149830c22fc7c2
shared_secret: ef41108edae962b0
access_token: 72157641557984045-92a5dbebf3e01418
access_secret: 1625dbdd3cf26db6
post_categories:
china-2009:
name: China 2009
three-nations:
name: Three Nations
honeymoon-2010:
name: Honeymoon 2010
new-year-2010-11:
name: "New Year 2010/11"
vietnam-2011:
name: Vietnam 2011
cornwall-2012:
name: Cornwall 2012
\ No newline at end of file
- url: http://www.perry-online.me.uk/
- url: //www.perry-online.me.uk/
title: Home
sub:
- url: about/
- url: //www.perry-online.me.uk/about/
title: About Us
- url: author/richard-perry/
- url: //www.perry-online.me.uk/author/richard-perry/
title: Richard Perry
- url: author/rosie-perry/
- url: //www.perry-online.me.uk/author/rosie-perry/
title: Rosie Perry
- url: author/rosie-jim/
- url: //www.perry-online.me.uk/author/rosie-jim/
title: Rosie & Jim
- url: archives/
- url: //www.perry-online.me.uk/archives/
title: Global Archives
- url: http://travel.perry-online.me.uk/
- url: /
title: Travel
sub:
- url: cornwall-2012/
- url: /cornwall-2012/
title: Cornwall 2012
- url: vietnam-2011/
- url: /vietnam-2011/
title: Vietnam 2011
- url: new-year-2010-11/
- url: /new-year-2010-11/
title: New Year 2010-11
- url: honeymoon-2010/
- url: /honeymoon-2010/
title: Honeymoon 2010
- url: china-2009/
- url: /china-2009/
title: China 2009
- url: china-2009/three-nations/
- url: /three-nations/
title: Three Nations 2009
- url: archives/
- url: /archives/
title: Travel Archives
- url: http://richard.perry-online.me.uk/
- url: //richard.perry-online.me.uk/
title: Richard
sub:
- url: about/
- url: //richard.perry-online.me.uk/about/
title: About Me
- url: series/
title: Post Series
- url: archives/
- url: //richard.perry-online.me.uk/series/
title: Post Series'
- url: //richard.perry-online.me.uk/archives/
title: Blog Archives
- url: http://photos.perry-online.me.uk/
- url: //photos.perry-online.me.uk/
title: Photos
sub:
- url: george/
- url: //photos.perry-online.me.uk/george/
title: George
- url: events/
- url: //photos.perry-online.me.uk/events/
title: Events
- url: travel/
- url: //photos.perry-online.me.uk/travel/
title: Travel
- url: other/
- url: //photos.perry-online.me.uk/other/
title: Other
sub:
- url: days-out/
- url: //photos.perry-online.me.uk/other/days-out/
title: Days Out
- url: wedding/
- url: //photos.perry-online.me.uk/wedding/
title: Our Wedding
- url: archives/
- url: //photos.perry-online.me.uk/archives/
title: Photo Archives
\ No newline at end of file