# [Color tomato](README.md)
Two Jekyll themes to decorate static websites. The color variant was written earlier
using AngularJS and Material, this was the design of the previous version of my blog.
Then a lightweight single-color variant was written using only HTML and CSS, the
appearance resembles the default design theme on GitHub Pages. Both themes supplement
each other and are similar to each other, commonalities and differences between them
are marked in the list of features.
- Color tomato — color selection during the build.
- [Older tomato](https://git.org.ru/golovin/older-tomato-theme/src/branch/master/README.en.md) — lightweight decoration theme.
### Features
- [x] Responsive layout.
- [x] User JS and CSS files in the head block of HTML pages.
- [x] SEO-markup using JSON-LD and Open Graph.
- [x] Switch between two languages and two tomato themes.
- [x] Map of site pages with their translations in XML format.
- [x] Simple 404 page for non-existing URLs.
- [x] Redirection to site root from folders, without `index.html`.
- [x] Fonts: Roboto for text and JBMono for code blocks.
- [x] Tomatoes: PNG, JPG 120x120, SVG 64x64, ICO 32x32.
- [ ] Color selection during the build, green is the default color.
- [ ] Scroll-to-top button in Material style.
### Colors
The theme color can be selected from the list of colors of the Material library. Each
color goes with a palette of its shades, that are used to design the entire site, green
is the default color. Only syntax highlighting in code blocks and custom JS and CSS
files are independent of color. In the old version of the blog, the palette could be
selected from a drop-down menu by a button on the client. Now the palette is selected
once at the build time — this noticeably simplifies the DOM tree and eases the client.
List of colors
- [ ] red
- [ ] pink
- [ ] purple
- [ ] deep-purple
- [ ] indigo
- [ ] blue
- [ ] light-blue
- [ ] cyan
- [ ] teal
- [x] green
- [ ] light-green
- [ ] lime
- [ ] yellow
- [ ] amber
- [ ] orange
- [ ] deep-orange
- [ ] brown
- [ ] grey
- [ ] blue-grey
### Installation
Run the script from the theme folder, build the *gem* package and install it.
```shell
rm color-tomato-theme-1.0.1.gem
gem build color-tomato-theme.gemspec
sudo gem install --local color-tomato-theme-1.0.1.gem
```
### After build
The site can be built using the `jekyll build` command. After that, we get the `_site` folder with the
generated pages and the `assets` subfolder from the theme. We move the contents of this subfolder back
to the `_site` folder — we get shorter links, that are used in the theme. After that we bypass HTML pages
and optimize a number of tags also for shortness and for correctness. Additionally, we copy from theme the
redirection file to the root of the site for all subdirectories, if they don't contain the `index.html`
file. The script is intended for this purpose.
```shell
# optimizing gathered content
cd _site || exit
cp -r assets/* .
rm -r assets
# optimizing a number of tags
function optimize_html {
echo "Optimize: $1"
sed -i 's|layout-padding=""|layout-padding|g' "$1"
sed -i 's| class="language-plaintext highlighter-rouge"||g' "$1"
sed -i 's| class="language-java highlighter-rouge"||g' "$1"
sed -i 's| class="language-html highlighter-rouge"||g' "$1"
sed -i 's| class="language-js highlighter-rouge"||g' "$1"
sed -i 's| class="language-bash highlighter-rouge"||g' "$1"
sed -i 's|