Skip to content

Commit

Permalink
General code reformat through pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzafernan committed Jan 14, 2024
1 parent 27f1e34 commit d38895f
Show file tree
Hide file tree
Showing 78 changed files with 2,102 additions and 2,384 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ liberapay: jeffreytse
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

52 changes: 26 additions & 26 deletions .github/workflows/build-jekyll.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
name: Github Pages

on:
push:
branches:
- master # Here source code branch is `master`, it could be other branch
push:
branches:
- master # Here source code branch is `master`, it could be other branch

jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
build_and_deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Use GitHub Actions' cache to cache dependencies on servers
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
# Use GitHub Actions' cache to cache dependencies on servers
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
# Use GitHub Deploy Action to build and deploy to Github
- uses: jeffreytse/jekyll-deploy-action@master
with:
provider: 'github'
token: ${{ secrets.GITHUB_TOKEN }} # It's your Personal Access Token(PAT)
repository: '' # Default is current repository
branch: 'gh-pages' # Default is gh-pages for github provider
jekyll_src: './' # Default is root directory
jekyll_cfg: '_config.yml' # Default is _config.yml
jekyll_baseurl: '/jekyll-theme-yat' # Default is empty
cname: '' # Default is to not use a cname
actor: '' # Default is the GITHUB_ACTOR
# Use GitHub Deploy Action to build and deploy to Github
- uses: jeffreytse/jekyll-deploy-action@master
with:
provider: "github"
token: ${{ secrets.GITHUB_TOKEN }} # It's your Personal Access Token(PAT)
repository: "" # Default is current repository
branch: "gh-pages" # Default is gh-pages for github provider
jekyll_src: "./" # Default is root directory
jekyll_cfg: "_config.yml" # Default is _config.yml
jekyll_baseurl: "/jekyll-theme-yat" # Default is empty
cname: "" # Default is to not use a cname
actor: "" # Default is the GITHUB_ACTOR
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@

source "https://rubygems.org"
gemspec

40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,33 @@ I will respect your crucial support and say THANK YOU!

## Features

- Support beautiful **Night Mode**.
- Modern responsive web design.
- Full layouts `home`, `post`, `tags`, `archive` and `about`.
- Uses font awesome 5 for icons.
- Beautiful page banner with image and video.
- Beautiful Syntax Highlight using [highlight.js][highlight-js].
- Beautiful image gallery previewer using [PhotoSwipe 5][photoswipe-5].
- RSS support using [Jekyll Feed][jekyll-feed] gem.
- Optimized for search engines using [Jekyll Seo Tag][jekyll-seo-tag] gem.
- Sitemap support using [Jekyll Sitemap][jekyll-sitemap] gem.
- Complex and flexible table support using [Jekyll Spaceship][jekyll-spaceship] gem.
- MathJAX and LaTeX optional support using [Jekyll Spaceship][jekyll-spaceship] gem.
- Media (Youtube, Spotify, etc.) support using [Jekyll Spaceship][jekyll-spaceship] gem.
- Diagram (PlantUML, Mermaid) support using [Jekyll Spaceship][jekyll-spaceship] gem.
- Google Translation support.
- New post tag support.
- Pin post tag support.
- Support beautiful **Night Mode**.
- Modern responsive web design.
- Full layouts `home`, `post`, `tags`, `archive` and `about`.
- Uses font awesome 5 for icons.
- Beautiful page banner with image and video.
- Beautiful Syntax Highlight using [highlight.js][highlight-js].
- Beautiful image gallery previewer using [PhotoSwipe 5][photoswipe-5].
- RSS support using [Jekyll Feed][jekyll-feed] gem.
- Optimized for search engines using [Jekyll Seo Tag][jekyll-seo-tag] gem.
- Sitemap support using [Jekyll Sitemap][jekyll-sitemap] gem.
- Complex and flexible table support using [Jekyll Spaceship][jekyll-spaceship] gem.
- MathJAX and LaTeX optional support using [Jekyll Spaceship][jekyll-spaceship] gem.
- Media (Youtube, Spotify, etc.) support using [Jekyll Spaceship][jekyll-spaceship] gem.
- Diagram (PlantUML, Mermaid) support using [Jekyll Spaceship][jekyll-spaceship] gem.
- Google Translation support.
- New post tag support.
- Pin post tag support.

Also, visit the [Live Demo][yat-live-demo] site for the theme.

## Installation

There are three ways to install:

- As a [gem-based theme](https://jekyllrb.com/docs/themes/#understanding-gem-based-themes).
- As a [remote theme](https://blog.github.com/2017-11-29-use-any-theme-with-github-pages/) (GitHub Pages compatible).
- Forking/directly copying all of the theme files into your project.
- As a [gem-based theme](https://jekyllrb.com/docs/themes/#understanding-gem-based-themes).
- As a [remote theme](https://blog.github.com/2017-11-29-use-any-theme-with-github-pages/) (GitHub Pages compatible).
- Forking/directly copying all of the theme files into your project.

### Gem-based Theme Method

Expand Down
20 changes: 10 additions & 10 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ author: Gonzalo G. Fernandez
copyright: "Unpublished Work (cleft) 2023-{currentYear} {author}"

description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. https://example.com
Expand All @@ -54,7 +54,7 @@ favicon: "/assets/images/yat-favicon-color.png" # the favicon for your site
# Yat date format
# refer to https://shopify.github.io/liquid/filters/date/ if you want to customize this
yat:
date_format: "%b %d, %Y"
date_format: "%b %d, %Y"

# If you want more debug log, you can set true
# debug: false
Expand Down Expand Up @@ -241,11 +241,11 @@ yat:
# highlighter: none
markdown: kramdown
kramdown:
input: GFM
input: GFM

plugins:
- jekyll-feed
- jekyll-seo-tag
- jekyll-sitemap
- jekyll-paginate
- jekyll-spaceship
- jekyll-feed
- jekyll-seo-tag
- jekyll-sitemap
- jekyll-paginate
- jekyll-spaceship
6 changes: 3 additions & 3 deletions _data/defaults.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
home:
heading: "Yet Another TurtleBot"
subheading: "Two-wheeled mobile robot based on SoC Zynq 7000"
banner: "Your image url"
heading: "Yet Another TurtleBot"
subheading: "Two-wheeled mobile robot based on SoC Zynq 7000"
banner: "Your image url"
11 changes: 5 additions & 6 deletions _includes/custom-head.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{% comment %}
Placeholder to allow defining custom head, in principle, you can add anything here, e.g. favicons:

1. Head over to https://realfavicongenerator.net/ to add your own favicons.
2. Customize default _includes/custom-head.html in your source directory and insert the given code snippet.
{% endcomment %}
{% comment %} Placeholder to allow defining custom head, in principle, you can
add anything here, e.g. favicons: 1. Head over to
https://realfavicongenerator.net/ to add your own favicons. 2. Customize default
_includes/custom-head.html in your source directory and insert the given code
snippet. {% endcomment %}
28 changes: 14 additions & 14 deletions _includes/extensions/click-to-top.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<div id="click-to-top" class="click-to-top">
<i class="fa fa-arrow-up"></i>
<i class="fa fa-arrow-up"></i>
</div>
<script>
(function () {
const clickToTop = document.getElementById('click-to-top');
window.addEventListener('scroll', () => {
if (window.scrollY > 100) {
clickToTop.classList.add('show')
}else {
clickToTop.classList.remove('show')
}
});
clickToTop.addEventListener('click', () => {
window.smoothScrollTo(0);
});
})();
;(function () {
const clickToTop = document.getElementById("click-to-top")
window.addEventListener("scroll", () => {
if (window.scrollY > 100) {
clickToTop.classList.add("show")
} else {
clickToTop.classList.remove("show")
}
})
clickToTop.addEventListener("click", () => {
window.smoothScrollTo(0)
})
})()
</script>
153 changes: 76 additions & 77 deletions _includes/extensions/code-highlight.html
Original file line number Diff line number Diff line change
@@ -1,91 +1,90 @@
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/default.min.css">
<link
rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/default.min.css"
/>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script charset="UTF-8"
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/languages/go.min.js"
async></script>
<script
charset="UTF-8"
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/languages/go.min.js"
async
></script>

{%- assign name = 'code_badge.enabled' -%}
{%- include functions.html func='get_value' default='true' -%}
{%- assign badge_enabled = return -%}

{%- assign name = 'code_badge.color' -%}
{%- include functions.html func='get_value' default='#fff' -%}
{%- assign badge_color = return -%}

{%- assign name = 'code_badge.background_color' -%}
{%- include functions.html func='get_value' default='#ff4e00' -%}
{%- assign badge_background_color = return -%}

{%- assign name = 'code_badge.text_transform' -%}
{%- include functions.html func='get_value' default='uppercase' -%}
{%- assign badge_text_transform = return -%}
{%- assign name = 'code_badge.enabled' -%} {%- include functions.html
func='get_value' default='true' -%} {%- assign badge_enabled = return -%} {%-
assign name = 'code_badge.color' -%} {%- include functions.html func='get_value'
default='#fff' -%} {%- assign badge_color = return -%} {%- assign name =
'code_badge.background_color' -%} {%- include functions.html func='get_value'
default='#ff4e00' -%} {%- assign badge_background_color = return -%} {%- assign
name = 'code_badge.text_transform' -%} {%- include functions.html
func='get_value' default='uppercase' -%} {%- assign badge_text_transform =
return -%}

<script>
// Init highlight js
document.addEventListener('DOMContentLoaded', function(event) {
var els = document.querySelectorAll('pre code')
// Init highlight js
document.addEventListener("DOMContentLoaded", function (event) {
var els = document.querySelectorAll("pre code")

function addLangData(block) {
var outer = block.parentElement.parentElement.parentElement;
var lang = block.getAttribute('data-lang');
for (var i = 0; i < outer.classList.length; i++) {
var cls = outer.classList[i];
if (cls.startsWith('language-')) {
lang = cls;
break;
}
}
if (!lang) {
cls = block.getAttribute('class');
lang = cls ? cls.replace('hljs ', '') : '';
}
if (lang.startsWith('language-')) {
lang = lang.substr(9);
}
block.setAttribute('class', 'hljs ' + lang);
block.parentNode.setAttribute('data-lang', lang);
}
function addLangData(block) {
var outer = block.parentElement.parentElement.parentElement
var lang = block.getAttribute("data-lang")
for (var i = 0; i < outer.classList.length; i++) {
var cls = outer.classList[i]
if (cls.startsWith("language-")) {
lang = cls
break
}
}
if (!lang) {
cls = block.getAttribute("class")
lang = cls ? cls.replace("hljs ", "") : ""
}
if (lang.startsWith("language-")) {
lang = lang.substr(9)
}
block.setAttribute("class", "hljs " + lang)
block.parentNode.setAttribute("data-lang", lang)
}

function addBadge(block) {
var enabled = ('{{ badge_enabled }}' || 'true').toLowerCase();
if (enabled == 'true') {
var pre = block.parentElement;
pre.classList.add('badge');
}
}
function addBadge(block) {
var enabled = ("{{ badge_enabled }}" || "true").toLowerCase()
if (enabled == "true") {
var pre = block.parentElement
pre.classList.add("badge")
}
}

function handle(block) {
addLangData(block);
addBadge(block)
hljs.highlightBlock(block);
}
function handle(block) {
addLangData(block)
addBadge(block)
hljs.highlightBlock(block)
}

for (var i = 0; i < els.length; i++) {
var el = els[i];
handle(el);
}
});
for (var i = 0; i < els.length; i++) {
var el = els[i]
handle(el)
}
})
</script>

<style>
/* code language badge */
pre.badge::before {
content: attr(data-lang);
color: {{badge_color}};
background-color: {{badge_background_color}};
padding: 0 .5em;
border-radius: 0 2px;
text-transform: {{badge_text_transform}};
text-align: center;
min-width: 32px;
display: inline-block;
position: absolute;
right: 0;
}
/* code language badge */
pre.badge::before {
content: attr(data-lang);
color: {{badge_color}};
background-color: {{badge_background_color}};
padding: 0 .5em;
border-radius: 0 2px;
text-transform: {{badge_text_transform}};
text-align: center;
min-width: 32px;
display: inline-block;
position: absolute;
right: 0;
}

/* fix wrong badge display for firefox browser */
code > table pre::before {
display: none;
}
/* fix wrong badge display for firefox browser */
code > table pre::before {
display: none;
}
</style>
Loading

0 comments on commit d38895f

Please sign in to comment.