kronosapiens.github.io - Maintaining Octopress themes as git submodules









Search Preview

Maintaining Octopress themes as git submodules

kronosapiens.github.io
I’ve spent much of this week converting my technical blog onto Octopress, away from Wordpress. It’s been a very pleasant experience – my technical chops are ...
.io > kronosapiens.github.io

SEO audit: Content analysis

Language Error! No language localisation is found.
Title Maintaining Octopress themes as git submodules
Text / HTML ratio 62 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud theme files directory Octopress repository repo source pull submodule you’ll git themes main install updates submodules make copy made
Keywords consistency
Keyword Content Title Description Headings
theme 59
files 20
directory 18
Octopress 16
repository 15
repo 15
Headings
H1 H2 H3 H4 H5 H6
2 5 5 0 0 0
Images We found 0 images on this web page.

SEO Keywords (Single)

Keyword Occurrence Density
theme 59 2.95 %
files 20 1.00 %
directory 18 0.90 %
Octopress 16 0.80 %
repository 15 0.75 %
repo 15 0.75 %
source 14 0.70 %
pull 10 0.50 %
submodule 9 0.45 %
you’ll 9 0.45 %
git 8 0.40 %
themes 7 0.35 %
main 7 0.35 %
6 0.30 %
install 6 0.30 %
updates 6 0.30 %
submodules 5 0.25 %
make 5 0.25 %
copy 5 0.25 %
made 5 0.25 %

SEO Keywords (Two Word)

Keyword Occurrence Density
the theme 41 2.05 %
of the 18 0.90 %
to the 17 0.85 %
files in 12 0.60 %
your changes 11 0.55 %
in the 10 0.50 %
the files 9 0.45 %
into the 8 0.40 %
theme directory 7 0.35 %
in your 7 0.35 %
theme and 7 0.35 %
source directory 6 0.30 %
to your 6 0.30 %
theme repo 6 0.30 %
theme is 5 0.25 %
your source 5 0.25 %
changes to 5 0.25 %
your Octopress 5 0.25 %
is that 5 0.25 %
the submodule 4 0.20 %

SEO Keywords (Three Word)

Keyword Occurrence Density Possible Spam
to the theme 10 0.50 % No
the files in 7 0.35 % No
files in your 7 0.35 % No
the theme directory 6 0.30 % No
the theme and 6 0.30 % No
the theme repo 5 0.25 % No
a pull request 4 0.20 % No
of the theme 4 0.20 % No
in your source 4 0.20 % No
all of the 3 0.15 % No
updating the files 3 0.15 % No
files in the 3 0.15 % No
updates to the 3 0.15 % No
your source directory 3 0.15 % No
for the theme 3 0.15 % No
made to the 3 0.15 % No
of your Octopress 3 0.15 % No
your Octopress directory 3 0.15 % No
changes to your 3 0.15 % No
the source directory 3 0.15 % No

SEO Keywords (Four Word)

Keyword Occurrence Density Possible Spam
files in your source 4 0.20 % No
updates to the theme 3 0.15 % No
made to the theme 3 0.15 % No
the files in the 3 0.15 % No
the files in your 3 0.15 % No
of your Octopress directory 3 0.15 % No
in your source directory 3 0.15 % No
pull request to the 2 0.10 % No
will include your changes 2 0.10 % No
to your forked copy 2 0.10 % No
changes to your forked 2 0.10 % No
the theme files in 2 0.10 % No
theme files in your 2 0.10 % No
edit the files in 2 0.10 % No
to the theme directory 2 0.10 % No
affect the theme repo 2 0.10 % No
of the theme and 2 0.10 % No
contains all of the 2 0.10 % No
forked copy of the 2 0.10 % No
a pull request to 2 0.10 % No

Internal links in - kronosapiens.github.io

About
About
Strange Loops and Blockchains
Strange Loops and Blockchains
Trie, Merkle, Patricia: A Blockchain Story
Trie, Merkle, Patricia: A Blockchain Story
Reputation Systems: Promise and Peril
Reputation Systems: Promise and Peril
The Future of Housing, in Three Parts
The Future of Housing, in Three Parts
Proof of Work vs Proof of Stake: a Mirror of History
Proof of Work vs Proof of Stake: a Mirror of History
Introducing Talmud
Introducing Talmud
The Economics of Urban Farming
The Economics of Urban Farming
Time and Authority
Time and Authority
On Meaning in Games
On Meaning in Games
Objective Functions in Machine Learning
Objective Functions in Machine Learning
A Basic Computing Curriculum
A Basic Computing Curriculum
The Problem of Information II
The Problem of Information II
The Problem of Information
The Problem of Information
Elements of Modern Computing
Elements of Modern Computing
Blockchain as Talmud
Blockchain as Talmud
Understanding Variational Inference
Understanding Variational Inference
OpsWorks, Flask, and Chef
OpsWorks, Flask, and Chef
On Learning Some Math
On Learning Some Math
Understanding Unix Permissions
Understanding Unix Permissions
30 Feet from Michael Bloomberg
30 Feet from Michael Bloomberg
The Academy: A Machine Learning Framework
The Academy: A Machine Learning Framework
Setting up a queue service: Django, RabbitMQ, Celery on AWS
Setting up a queue service: Django, RabbitMQ, Celery on AWS
Versioning and Orthogonality in an API
Versioning and Orthogonality in an API
Designing to be Subclassed
Designing to be Subclassed
Understanding Contexts in Flask
Understanding Contexts in Flask
Setting up Unit Tests with Flask, SQLAlchemy, and Postgres
Setting up Unit Tests with Flask, SQLAlchemy, and Postgres
Understanding Package Imports in Python
Understanding Package Imports in Python
Setting up Virtual Environments in Python
Setting up Virtual Environments in Python
Creating superfunctions in Python
Creating superfunctions in Python
Some Recent Adventures
Some Recent Adventures
Sorting in pandas
Sorting in pandas
Mimicking DCI through Integration Tests
Mimicking DCI through Integration Tests
From Ruby to Python
From Ruby to Python
Self-Focus vs. Collaboration in a Programming School
Self-Focus vs. Collaboration in a Programming School
Designing Software to Influence Behavior
Designing Software to Influence Behavior
Maintaining Octopress themes as git submodules
Maintaining Octopress themes as git submodules
Setting up a test suite with FactoryGirl and Faker
Setting up a test suite with FactoryGirl and Faker
To Unit Test or not to Unit Test
To Unit Test or not to Unit Test
A Dynamic and Generally Efficient Front-End Filtering Algorithm
A Dynamic and Generally Efficient Front-End Filtering Algorithm
Trails & Ways: A Look at Rails Routing
Trails & Ways: A Look at Rails Routing
Getting Cozy with rspec_helper
Getting Cozy with rspec_helper
Exploring the ActiveRecord Metaphor
Exploring the ActiveRecord Metaphor
Civic Hacking as Inspiration
Civic Hacking as Inspiration
From Scheme to Ruby
From Scheme to Ruby
Setting up Auto-Indent in Sublime Text 2
Setting up Auto-Indent in Sublime Text 2
hello world
hello world
via RSS
Abacus

Kronosapiens.github.io Spined HTML


Maintaining Octopress themes as git submodules AbacusWell-nighMaintaining Octopress themes as git submodules May 1, 2014 I’ve spent much of this week converting my technical blog onto Octopress, yonder from Wordpress. It’s been a very pleasant wits – my technical chops are worlds vastitude what they were when I first experimented with Octopress when in February, and I’m finding that developing and maintaining an Octopress blog is a unconfined opportunity to test out my burgeoning developer chops. One of the first challenges I tackled was integrating a third-party theme, using git submodules. Octopress themes are often contained within their own repos, and often have four top-level components: sass/ source/ .editorconfig README.md The substance of the theme is stored in the first two directories, sass and source. sass contains all of the styling for the theme, including the wiring bootstrap styles, custom theme styles, and placeholders for user-added styles. source contains all of the html, page templates, and javascript files for the theme. Aside: ‘What is a submodule?’ A submodule is a git repository which has been included as a subdirectory in flipside repository. The submodule is maintained indepenently of the ‘supermodule’, or main repository – pushing to its own ‘origin’, keeping its own commit history, and so on. You add a submodule to a project by cloning that submodule into your main project, and in the context of development, those files are as wieldy to your text editor and server as any other. From git’s perspective, however, the contents of the submodule are not tracked by git, nor included in any of the commits of the ‘supermodule’. All the supermodule keeps track of is the commit id of the version of the submodule that it is currently using – substantially a pointer to the repository where the submodule is unquestionably stuff tracked and version controlled. Mostly, submodules work the way you expect a repo-within-a-repo would work, and while you’ll need to be a bit increasingly shielding virtually pushing and pulling, it’s a powerful and intersting full-length of git. You can read increasingly well-nigh submodules here. Installing a theme Cloning You install a theme by cloning the theme repository into the .themes folder at the top level of your Octopress directory as a submodule. In essence, you are cloning a self-contained repo into flipside repo (in this case, your Octopress blog). If you trammels your remotes, you’ll notice that the remotes for the theme repository point when to the creator of the theme, while the remotes in the rest of the repository point when to your own Github account. If you navigate to the theme files in your writ line, you’ll notice that the repo name changes as you navigate into the theme directory. Any git status checks, commits, and pushes will take place within the context of the repo you are currently in. Commits made to the theme repo will only stupefy the theme repo, while commits made elsewhere will stupefy the overall Octopress repo. Installing To install, navigate to the top level of your Octopress directory and run rake install['ThemeName']. The install writ will substantially reprinting all of the files in .themes/ThemeName into your source folder, overrwriting any previous themes. Note that this is the point at which files are copied from the theme repo (the submodule) into the main Octopress repo (the ‘super’ module). When you commit your site now, the files which were copied from the theme directory into the source directory will be single-minded to the main Octopress repository. Maintaining a theme Now that you’ve installed the theme, you might be wondering what the workflow is for updating and waffly the theme. There are three ways you might go well-nigh this, with differing amounts of complexity and benefit. They are, in ascending order of difficulty: Editing the theme files in your source directory Updating the files in the .themes/ThemeName directory locally Forking the theme, updating the files in the theme directory, and making a pull request to the theme creator Editing files in your source folder The easiest way to make changes to your theme is to edit the files in your source directory. When Octopress generates your site, it uses the templates and styles in source. By running rake preview and editing files in source, you can get near-instant feedback on site changes. Most sandbox editing should be washed-up in this way – it’s the safest and easiest way to play virtually with your theme. Updating files in your theme directory The downside of editing your theme in the source directory is that all of those changes will be lost if and when you decide to install a new theme. A increasingly permanent way to transpiration a theme is to make changes in the .themes/ThemeName directory. This way, your changes will be preserved in the specimen you want to transpiration themes, considering a future re-install of ThemeName will include your changes. The workflow I recommend is to treat the source directory as your sandbox, and to reprinting your changes over to the theme directory when you’re satisfied with the results. Now, if you’re never planning on downloading any updated versions of the theme, and have no desire to try and have your changes incorporated into the theme so that others can use them, then this will probably be unbearable for you. However, if you plan on maintaining the theme and installing future updates, or have a desire to share your changes with the larger community, then you’ll probably want to consider this last option: Forking the theme, updating the files, and making a pull request The limitation to updating the files in the theme directory locally is that you run into problems as the theme evolves. Recall, our third-party theme is not a part of our blog’s repository. It is an self-sustaining repo that lives within our main repository. This ways that as changes are made to the theme, you’ll be worldly-wise to pull in and integrating those new changes. The problem is that any changes you’ve made to the theme directory will be overwritten when you pull lanugo new changes (there are ways virtually this, though, such as saving all your changes to a new workshop surpassing you pull, and merging that temporary workshop into the updated master). The solution here is, instead of simply cloning the theme repo into your repository, to fork the theme and clone your copy, make and push the theme changes to your forked reprinting of the theme, and then make a pull request when to the theme’s creator. The biggest benefits of this workflow is that your changes will goody the unshortened polity using the theme, and that future updates to the theme will include your changes (so that you’ll never have to worry well-nigh future updates overwriting your local edits). The biggest rencontre of this method is that you must alimony your changes generic – any changes to the theme which pertain to only you should not be transferred onto the main theme. To emulate this workflow, you’ll need to set up a second remote pointing to the theme’s original creator, from which you’ll pull new updates to the theme. For example, here is my remote configuration for the MediumFox theme: [14:25:07] (master) MediumFox ƒ: git remote -v origin git@github.com:kronosapiens/MediumFox.git (fetch) origin git@github.com:kronosapiens/MediumFox.git (push) sevenadrian git@github.com:sevenadrian/MediumFox.git (fetch) sevenadrian git@github.com:sevenadrian/MediumFox.git (push) In this example, I push all my edits to origin, and pull theme updates from sevenadrian. The spritz The overall spritz for this last system is as follows: Find a third-party theme you like and fork the repository Clone your version of the repository into the .themes/ folder of your Octopress directory. Install the theme (follow the instructions on the theme, they’ll be some variation of rake install['ThemeName']). Play with the files in your source directory, experiment with new features and fixes, hack yonder and make it better. Remember, commits to your Octopress repo won’t stupefy the theme repo (if you go to Github.com and explore the repo’s files, you’ll see that there aren’t plane any files where the theme is – just a pointer to a specific commit in flipside repository). When you’re satisfied with your changes, edit the files in your theme’s folders. Push the changes to your forked reprinting of the theme’s repository.Unshuta pull request to the original theme and ask that your changes be merged into the main repo. Smile the satisfied smile of someone who knows that they’ve just made a positive impact in the lives of Octopress users virtually the world. Periodically, trammels for updates to the theme and pull those changes from the original theme repo. Reinstall the theme to get all the new changes. World peace. Repeat steps 3-11 forever, as necessary. And that’s basically it. Through the power of submodules, Octopress users can enjoy and contribute to a number of third-party, unshut source themes, as well as get unconfined wits managing files and collaborating with git. Comments Please enable JavaScript to view the comments powered by Disqus. Abacus Abacus kronovet@gmail.com kronosapiens kronosapiens I'm Daniel Kronovet, a data scientist living in Tel Aviv.