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

Multiple changes required to move to GitLab Pages for ease of maintenance

- Added the following Gems that can be used with GitLab Pages natively (actually,
  anything can be used with GitLab Pages and their shared runners setup. No more
  safe mode Jekyll for me 😃)
  - jemoji
  - jekyll-paginate
  - jekyll-gist
  - jekyll-redirect-from
  - jekyll-sitemap
- Removed the pages.rb plugin and moved the pages into the Pages folder so that
  Jekyll would process them.
- Removed the redirect pages and added the necessary YAML frontmatter for the
  jekyll-redirect-from gem
- Removed the RSS Feed xsl and css files
- Removed the need for the Rakefile, Gruntfile etc
- Put the css into a sass file so Jekyll could combine them itself and added the
  sas declarations to _config.yml
- Removed the sitemap.xml file in lieu of the jekyll-sitemap gem
- Removed the defunct javascript files
- Removed the CNAME file as it isn't needed in GitLab
- Changed back to the old Flickr plugin as it seems to work better

Now I just have to work out how to merge this back into the source branch and
then rename that to pages so we don't have any unnecessary branches lying
around 😃
parent 93f12879
travel.perry-online.me.uk
source 'https://rubygems.org'
gem 'jekyll', '~> 2.4'
gem 'github-pages', '~> 43'
gem 'jekyll'
# gem 'stringex'
gem 'titleize'
gem 'jekyll-oembed', :require => 'jekyll_oembed'
gem 'flickraw'
gem 'emoji_for_jekyll'
gem 'jemoji'
gem 'execjs'
gem 'therubyracer', :platforms => :ruby
#gem 'jekyll-paginate'
#gem 'jekyll-sitemap'
#gem 'jekyll-gist'
\ No newline at end of file
gem 'jekyll-gist'
gem 'jekyll-redirect-from'
gem 'jekyll-paginate'
gem 'jekyll-sitemap'
\ No newline at end of file
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
The MIT License (MIT)
 
Copyright (c) 2014 Richard Perry
Copyright (c) 2016 Richard Perry
 
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -2,12 +2,12 @@
 
Here resides the source code for our travel blog. At the beginning of 2014, after a number of years using
[WordPress][wp] as my main blogging platform, I decided it was time for a change. So, I have adopted the
[Jekyll][jk] blogging platform hosted at [GitHub Pages][gp].
[Jekyll][jk] blogging platform hosted at [GitLab Pages][gp].
 
For more information about the migration process I followed see my [blog series][bs] at my personal [blog][bl].
 
[wp]: //wordpress.org/ "WordPress › Blog Tool, Publishing Platform, and CMS"
[jk]: //jekyllrb.com/ "Jekyll • Simple, blog-aware, static sites"
[gp]: //pages.github.com/ "GitHub Pages"
[gp]: //pages.gitlab.io/ "GitLab Pages"
[bs]: //richard.perry-online.me.uk/series/jekyll/ "Series: Migrating to Jekyll | Richard Perry"
[bl]: //richard.perry-online.me.uk/ "Richard Perry | Just another blog about nothing"
\ 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
......@@ -2,25 +2,30 @@ name: Rosie & Jim's Travel Blog
description: A blog of all our travels
owner: rosiejim
authors:
- richard
- rosie
- richard
- rosie
url: http://travel.perry-online.me.uk
email: travel@perry-online.me.uk
 
markdown: kramdown
kramdown:
enable_coderay: true
highlighter: pygments
exclude:
- 'changes'
- 'Gemfile'
- 'Gemfile.lock'
- 'Gruntfile.js'
- 'node_modules'
- 'package.json'
- 'Rakefile'
- 'README.md'
gems: ["emoji_for_jekyll"]
- 'changes'
- 'Gemfile'
- 'Gemfile.lock'
- 'Gruntfile.js'
- 'node_modules'
- 'package.json'
- 'Rakefile'
- 'README.md'
gems:
- jemoji
- jekyll-paginate
- jekyll-gist
- jekyll-redirect-from
- jekyll-sitemap
sass:
sass_dir: _sass
style: compressed
 
encoding: utf-8
 
......@@ -42,7 +47,5 @@ flickr:
shared_secret: ef41108edae962b0
access_token: 72157641557984045-92a5dbebf3e01418
access_secret: 1625dbdd3cf26db6
use_cache: true
cache_dir: _cache/flickr
 
/* Flexnav Base Styles */
.flexnav {
-webkit-transition: none;
-moz-transition: none;
-ms-transition: none;
transition: none;
-webkit-transform-style: preserve-3d;
overflow: hidden;
margin: 0 auto;
max-height: 0;
width: 100%; }
.flexnav.opacity {
opacity: 0; }
.flexnav.flexnav-show {
max-height: 2000px;
opacity: 1;
-webkit-transition: all .5s ease-in-out;
-moz-transition: all .5s ease-in-out;
-ms-transition: all .5s ease-in-out;
transition: all .5s ease-in-out; }
.flexnav.one-page {
position: fixed;
top: 50px;
right: 5%;
max-width: 200px; }
.flexnav li {
font-size: 100%;
position: relative;
overflow: hidden; }
.flexnav li a {
position: relative;
display: block;
padding: .96em;
z-index: 2;
overflow: hidden;
color: #222222;
background: #a6a6a2;
border-bottom: 1px solid rgba(0, 0, 0, 0.15); }
.flexnav li ul {
width: 100%; }
.flexnav li ul li {
font-size: 100%;
position: relative;
overflow: hidden; }
.flexnav li ul.flexnav-show li {
overflow: visible; }
.flexnav li ul li a {
display: block;
background: #b2b2af; }
.flexnav ul li ul li a {
background: #bfbfbc; }
.flexnav ul li ul li ul li a {
background: #cbcbc9; }
.flexnav .touch-button {
position: absolute;
z-index: 999;
top: 0;
right: 0;
width: 50px;
height: 50px;
display: inline-block;
background: #acaca1;
background: rgba(0, 0, 0, 0.075);
text-align: center; }
.flexnav .touch-button:hover {
cursor: pointer; }
.flexnav .touch-button .navicon {
position: relative;
top: 1.4em;
font-size: 12px;
color: #666; }
.btn-menu {
position: relative;
display: block;
padding: 1em;
background: #a6a6a2;
color: #222222;
cursor: pointer;
border-bottom: 1px solid rgba(0, 0, 0, 0.2); }
.btn-menu.one-page {
position: fixed;
top: 0;
right: 5%;
padding-right: 45px; }
.btn-menu .touch-button {
background: transparent;
position: absolute;
z-index: 999;
top: 0;
right: 0;
width: 50px;
height: 50px;
display: inline-block;
text-align: center; }
.btn-menu .touch-button .navicon {
font-size: 16px;
position: relative;
top: 1em;
color: #666; }
@media all and (min-width: 768px) {
body.one-page {
padding-top: 70px; }
.flexnav {
max-height: 0px;
overflow: visible; }
.flexnav.opacity {
opacity: 1; }
.flexnav.one-page {
top: 0;
right: auto;
max-width: 1080px; }
.flexnav li {
position: relative;
list-style: none;
float: left;
display: block;
background-color: #a6a6a2;
overflow: visible;
width: 20%; }
.flexnav li a {
border-left: 1px solid #acaca1;
border-bottom: none; }
.flexnav li > ul {
position: absolute;
top: auto;
left: 0; }
.flexnav li > ul li {
width: 100%; }
.flexnav li ul li > ul {
margin-left: 100%;
top: 0; }
.flexnav li ul li a {
border-bottom: none; }
.flexnav li ul.open {
display: block;
opacity: 1;
visibility: visible;
z-index: 1; }
.flexnav li ul.open li {
overflow: visible;
max-height: 100px; }
.flexnav li ul.open ul.open {
margin-left: 100%;
top: 0; }
.btn-menu {
display: none; } }
.oldie body.one-page {
padding-top: 70px; }
.oldie .flexnav {
overflow: visible; }
.oldie .flexnav.one-page {
top: 0;
right: auto;
max-width: 1080px; }
.oldie .flexnav li {
position: relative;
list-style: none;
float: left;
display: block;
background-color: #a6a6a2;
width: 20%;
min-height: 50px;
overflow: visible; }
.oldie .flexnav li:hover > ul {
display: block;
width: 100%;
overflow: visible; }
.oldie .flexnav li:hover > ul li {
width: 100%;
float: none; }
.oldie .flexnav li a {
border-left: 1px solid #acaca1;
border-bottom: none;
overflow: visible; }
.oldie .flexnav li > ul {
background: #acaca1;
position: absolute;
top: auto;
left: 0;
display: none;
z-index: 1;
overflow: visible; }
.oldie .flexnav li ul li ul {
top: 0; }
.oldie .flexnav li ul li a {
border-bottom: none; }
.oldie .flexnav li ul.open {
display: block;
width: 100%;
overflow: visible; }
.oldie .flexnav li ul.open li {
width: 100%; }
.oldie .flexnav li ul.open ul.open {
margin-left: 100%;
top: 0;
display: block;
width: 100%;
overflow: visible; }
.oldie .flexnav ul li:hover ul {
margin-left: 100%;
top: 0; }
.oldie .btn-menu {
display: none; }
.oldie.ie7 .flexnav li {
width: 19.9%; }
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kn { font-weight: bold } /* Keyword.Namespace */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
.type-csharp .highlight .k { color: #0000FF }
.type-csharp .highlight .kt { color: #0000FF }
.type-csharp .highlight .nf { color: #000000; font-weight: normal }
.type-csharp .highlight .nc { color: #2B91AF }
.type-csharp .highlight .nn { color: #000000 }
.type-csharp .highlight .s { color: #A31515 }
.type-csharp .highlight .sc { color: #A31515 }
......@@ -5,7 +5,7 @@
{% when 'image' %}
{% if post.image %}<img src='{{ post.image }}' title='{{ post.title }}' alt='{{ post.title }}' class='aligncentre' />{% endif %}
{% if post.flickimg %}{% flickr_image post.flickimg aligncentre d %}{% endif %}
{{ post.content }}
{{ post.content | xml_escape }}
{% when 'video' %}
{% oembed https://www.youtube.com/watch?v={{post.video}}&rel=0 width=560 height=315 %}
{{ post.content }}
......
---
permalink: /china/beijing/china-2009/
layout: none
---