diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-04-27 09:32:38 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-04-27 09:32:38 +0200 |
| commit | eea340ada9c1eaac99d0779130fea18a078377b0 (patch) | |
| tree | 94ba8a138cbc358fae5f63cf0ac3d373b18d11a0 /exampleSite/content/documentation | |
| parent | 7f391e070f69ecf01ade7916c0f83df099b11d79 (diff) | |
| download | gohugo-theme-ed-eea340ada9c1eaac99d0779130fea18a078377b0.tar.gz | |
Update installation instruction
Diffstat (limited to 'exampleSite/content/documentation')
| -rw-r--r-- | exampleSite/content/documentation/index.md | 116 |
1 files changed, 14 insertions, 102 deletions
diff --git a/exampleSite/content/documentation/index.md b/exampleSite/content/documentation/index.md index e21f054..b99f898 100644 --- a/exampleSite/content/documentation/index.md +++ b/exampleSite/content/documentation/index.md @@ -17,37 +17,11 @@ This documentation was built with beginners in mind, but has the necessary infor To install and use Ed you will be using your terminal. If you need a refresher, I highly recommend "[The Command Line Crash Course](https://www.computervillage.org/articles/CommandLine.pdf)." Working knowledge of HTML and CSS is also taken for granted. If you're new to HTML and CSS, you may want to check out the relevant courses on [codecademy.com](https://www.codecademy.com/learn/web). -Jekyll does not run very well on Windows machines for now. If you are using Windows, this theme won't work for you, but we hope that you simply deploy our principles, and parts of our stylesheet, on a system like [Hugo](https://gohugo.io/), which does work on Windows. - --- -## Installing Ed: Easy - -The easy way to do this is not necessarily the more robust, and may simply not work on your system. The easy way could also be called the 'lucky' way. It will work if your system is ready for Ed. Two major caveats to keep in mind if you go the easy route: a) You may run into problems later when some Ed components need updating; and, b) You may run into conflicts if you run several Ruby environments for different projects. That said, if you just want to quickly try Ed, and you don't run into problems installing, this is perhaps the best approach. - - -If you're using a Mac, make sure you have the appropriate version of [XCode command line tools](https://developer.apple.com/xcode/download/) for your OSX. Using the terminal's `cd` command, switch to the directory where you want to install your project. Once inside the folder, you are ready to download and start using Ed. Enter each of these lines into your terminal (remember to ignore the `$`): - -~~~ bash -$ git clone https://github.com/sergeyklay/gohugo-theme-ed.git -$ cd ed -$ gem install bundler -$ bundle install -~~~ - -That's it. To see if Ed is working properly we will take advantage of Jekyll's built in server. You can build the first version of your site and run the jekyll server at the same time by entering: - -~~~ bash -$ jekyll serve -~~~ - -If at any point during this process you had an error you could not resolve, move on to the next section. If the site was rendered fine, copy the url from your terminal log and paste it into your browser of choice (I recommend Firefox). This url usually looks something like this `http://127.0.0.1:4000/ed`. At this point you should be looking at your very own working version of Ed: - - - ---- +## Installing Ed -## Installing Ed: Robust +Before starting, please be sure that you have [installed Hugo](https://gohugo.io/getting-started/quick-start/#step-1-install-hugo) and [created a new site](https://gohugo.io/getting-started/quick-start/#step-2-create-a-new-site). After that, you are ready to install Ed. The first step to install Ed is to download the source files from GitHub. To do so you must have git installed on your computer. You probably have git already, but if you don't, the easiest way is probably to install [Github Desktop](https://desktop.github.com/) (even though we will be using git and github from the terminal in this tutorial). Mac users may want to ensure they have [Xcode](https://developer.apple.com/xcode/) and its command line tools installed as well. To check if git is running on your system enter the following line on your terminal (remember to ignore the $): @@ -55,100 +29,38 @@ The first step to install Ed is to download the source files from GitHub. To do $ git --version ~~~ -If you don't get an error, you're good to go. Using the `cd` command on your terminal, navigate to the folder where you keep your web projects. Once you're in the folder where you want Ed to live, download it from github using the following line (remember you can copy and paste): - -~~~ bash -$ git clone https://github.com/sergeyklay/gohugo-theme-ed.git -~~~ - -At this point you should navigate inside your Ed project folder and stay there until further notice: - -~~~ bash -$ cd ed -~~~ - -Jekyll is a Ruby gem (Ruby's name for software packages). The best way to ensure you have the right environment is to use Ruby Version Manager, or [rvm](https://rvm.io/), and the latest stable version of Ruby. To install rvm *and* a recent version of Ruby at the same time, follow the instructions on rvm's site. Remember to add `--ruby=2.3.0` at the end of the `curl` command to install ruby at the same time. - -After the process runs succesfully, read the last few lines generated by the terminal. You will see final instructions for making rvm run. Once you finish the process, check to see if rvm is running by entering: - -~~~ bash -$ rvm --version -~~~ - -If you don't get an error, you're ready for the next step. If you do get an error, and don't feel comfortable troubleshooting on the terminal, this is a good opportunity to reach out to a friend who can help. You can leave me a note on [the issues page](hhttps://github.com/sergeyklay/gohugo-theme-ed/issues), for example. I'll try to get to it as soon as my other commitments permit. If you're comfortable troubleshooting on your own, I recommend Jekyll's own [troubleshooting documentation](http://jekyllrb.com/docs/troubleshooting/). Another great strategy for troubleshooting on the terminal is to copy and paste the errors you receive (sans personal information) into your favorite search engine. - -The next step is to create a gemset for your jekyll projects. A gemset is a set of gems. If you don't create and use a gemset, every gem you install will be applied system-wide. This is not necessarily a bad thing, but if you will have several projects with several setups, this strategy will serve you well in the long run. To create a gemset: +If you don't get an error, you're good to go. Using the `cd` command on your terminal, navigate to the folder where you keep your web projects. Once you're in the folder where project live, download it from github using the following line (remember you can copy and paste): ~~~ bash -$ rvm gemset create ed +$ git clone https://github.com/sergeyklay/gohugo-theme-ed.git themes/ed ~~~ -To use the gemset you just created: +Or, if you don't plan to make any significant changes but want to track and update the theme, you can add it as a git submodule via the following command: ~~~ bash -$ rvm gemset use ed -~~~ - -N.B. Everytime you open a new tab or window on your terminal you need to declare your gemset using `rvm gemset use ed`, or else it will revert to `(default)`. - -Now that rvm and Ruby are set up, we're ready to install our first gem: Bundler. Bundler is a gem that allows you to install many gems at the same time using Gemfiles, which is a simple list of specific gems that lives in your project folder. Once you install it, you will be ready to run the Gemfile I provided in the source files. To install Bundler: - -~~~ bash -$ gem install bundler -~~~ - -You're very close. Now that Bundler is installed, the final step is to install the right version of Jekyll. To do so run the Gemfile this way (remember you must be inside the `ed` folder for this to work): - -~~~ bash -$ bundle install +$ git submodule add https://github.com/sergeyklay/gohugo-theme-ed.git themes/ed ~~~ +At this point you should navigate inside your Ed project folder and stay there until further notice: -If you don't get any errors, Ed should work at this point. To see if Ed is working properly we will take advantage of Jekyll's built in server. You can build the first version of your site and run the jekyll server at the same time by entering: +Next, open `config.toml` in the base of the Hugo site and ensure the theme option is set to `ed`: -~~~ bash -$ jekyll serve +~~~ toml +theme = "ed" ~~~ -If you are running multiple Ruby environments using bundler, you will need to add `bundle exec` to the command: +If you don't get any errors, Ed should work at this point. To see if Ed is working properly we will take advantage of Hugo's built in server. You can build the first version of your site and run the Hugo server at the same time by entering: ~~~ bash -$ bundle exec jekyll serve +$ hugo server ~~~ -Copy the url from your terminal log and paste it into your browser of choice (I recommend Firefox). This url usually looks something like this `http://127.0.0.1:4000/ed`. At this point you should be looking at your very own working version of Ed: +Copy the url from your terminal log and paste it into your browser of choice. This url usually looks something like this `http://localhost:1313`. At this point you should be looking at your very own working version of Ed: - + --- -## Installing Ed: Replacing an existing Jekyll theme - -Ed, like Jekyll, is also a gem. Jekyll gives you the option to switch themes, as long as those themes are gems as well. If you have existing content and would like to use Ed, you need to add the following line to your _config.yml file, usually at the bottom: - -~~~ -theme: "ed." -~~~ - -You also need to add the gem to your Gemfile file: - -~~~ -gem "ed." -~~~ - -Make sure to replace the version number with the one you need. I will do my best to document what changes come with each new gem. If your current theme does not have a Gemfile, you would need to create one and add the line above. The Gemfile is a plain text file like all other files in Jekyll, and should not have a file extension. - -After these files have been modified, you need to update your Bundle in the terminal: - -~~~ bash -$ bundle update -~~~ - -When using the gem on top of a previous theme, you will not have all the files of a full Ed install immediately available to you. More importantly, you may not have a _texts folder. You need to create one or copy them from a full installation of Ed. You might also want to add the search and index file. The gem comes bundled with all these files once you install it on your system, but they won't be in the same folder as your project. To locate them you can refer to the [Jekyll documentation for gem-based themes](https://jekyllrb.com/docs/themes/). With some previous themes you might need to erase lingering files that interfere with the functioning of Ed. This can be an advanced operation I can't do justice to here. At that point you might need to familiarize yourself with the architecture of Jekyll, or pay close attention to errors when you try to serve the site, and reverse-engineer from there. - -Going forward, updating to a new version of Ed is as simple as changing the release version and running the bundle update. I will try to keep changes in the actual markup to a minimum, but will let users know if any changes require a global find and replace in your editions. - ---- ## Jekyll |
