Skip to content

Commit

Permalink
Merge pull request #30 from byanko55/rbss
Browse files Browse the repository at this point in the history
v1.2.0~1.2.1
  • Loading branch information
cvlian authored Feb 4, 2024
2 parents b0e4c06 + a68fba5 commit c6d8251
Show file tree
Hide file tree
Showing 21 changed files with 480 additions and 69 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ An emotional and adorable blog theme powered by ***Jekyll***. Live demo is avail

## Installation

There are two way to setup this theme:
There are two ways to setup this theme:

### Method 1: Build from source (Recommended)
Fork this repository or download the [source](https://github.com/byanko55/jekyll-theme-satellite/releases) as a zip.

If you use as destination a repository named USERNAME.github.io then your url will be https://USERNAME.github.io/.
If you use as destination a repository named USERNAME.github.io, then your url will be https://USERNAME.github.io/.


### Method 2: Utilize Gem package
Create a clean site directory (Follow the **Instruction 1~4** described in [here](https://jekyllrb.com/docs/)).
Create a clean site directory (Follow the **Instruction 1~4** described [here](https://jekyllrb.com/docs/)).

The following materials are redundant, so remove them.
* index.markdown
Expand All @@ -59,7 +59,7 @@ Then, add this line to your Jekyll site's `Gemfile`:
gem "jekyll-theme-satellite"
```

You need to replace the initial `_config.yml` file with the [prepared one](https://github.com/byanko55/jekyll-theme-satellite/docs/_config.yml).
You need to replace the initial `_config.yml` file with the [prepared one](https://github.com/byanko55/jekyll-theme-satellite/blob/master/docs/_config.yml).

### Modify your site setting

Expand Down Expand Up @@ -102,12 +102,12 @@ You can find useful manuals for customizing your site from the below table:

|||
|---|---|
|Posting guidelines|[link](https://github.com/byanko55/jekyll-theme-satellite/docs/Posting%20guide.md)|
|Enabling ***comment system***|[link](https://github.com/byanko55/jekyll-theme-satellite/docs/Comment%20system.md)|
|Enabling ***Visitor counter***|[link](https://github.com/byanko55/jekyll-theme-satellite/docs/Visitor%20counter.md)|
|Posting guidelines|[link](https://github.com/byanko55/jekyll-theme-satellite/blob/master/docs/Posting%20Guide.md)|
|Enabling ***comment system***|[link](https://github.com/byanko55/jekyll-theme-satellite/blob/master/docs/Comment%20System.md)|
|Enabling ***Visitor counter***|[link](https://github.com/byanko55/jekyll-theme-satellite/blob/master/docs/Visitor%20Counter.md)|

## Contribution
If you would like to report a bug, or request a new feature, please open [an issue](https://github.com/byanko55/jekyll-theme-satellite/docs/Contribution%20Guidelines.md) We are open to any kind of feedback or collaboration.
If you would like to report a bug or request a new feature, please open [an issue](https://github.com/byanko55/jekyll-theme-satellite/issues) We are open to any kind of feedback or collaboration.

## License
© 2024 *Yankos*. This theme is available as open source under the terms of the [MIT License](https://opensource.org/license/mit/).
10 changes: 5 additions & 5 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ linkedin_username: linkedin
facebook_username: facebook

# External API
giscus_repo: "byanko55/byanko55.github.io"
giscus_repoId: "R_kgDOLM6LCA"
giscus_category: "Q&A"
giscus_categoryId: "DIC_kwDOLM6LCM4Cc4-i"
giscus_repo:
giscus_repoId:
giscus_category:
giscus_categoryId:
goatcounter_code:
google_analytics:

Expand All @@ -26,7 +26,7 @@ plugins:
- jekyll-seo-tag

exclude:
- guide/
- docs/

collections:
pages:
Expand Down
63 changes: 38 additions & 25 deletions _includes/navigation.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<nav id="navigation">
{%- assign nav_pages = site.pages
| where_exp: "item", "item.title != nil"
| where_exp: "item", "item.bookmark == true"
| sort: 'title' -%}
| where_exp: "item", "item.bookmark == true or item.name == 'index.md'"
| sort: 'url'
-%}

{% assign first_level_pages = "" | split, "" %}
{% assign second_level_pages = "" | split, "" %}
Expand All @@ -12,30 +12,41 @@
{%- assign p_tree = p.url | remove_first: "/" | split: "/" -%}
{%- assign p_level = p_tree | size -%}

{% if p_level <= 2 and p.bookmark %}
{% assign first_level_pages = first_level_pages | push:p %}
{% elsif (p_level == 3 and p.bookmark) or (p_level == 2 and p.bookmark == nil) %}
{% assign second_level_pages = second_level_pages | push:p %}
{% elsif (p_level == 4 and p.bookmark) or (p_level == 3 and p.bookmark == nil) %}
{% assign third_level_pages = third_level_pages | push:p %}
{% if p.bookmark %}
{% if p_level == 1 %}
{% assign first_level_pages = first_level_pages | push:p %}
{% elsif p_level == 2 %}
{% assign second_level_pages = second_level_pages | push:p %}
{% elsif p_level == 3 %}
{% assign third_level_pages = third_level_pages | push:p %}
{% endif %}
{% else %}
{% if p_level <= 2 %}
{% assign first_level_pages = first_level_pages | push:p %}
{% elsif p_level == 3 %}
{% assign second_level_pages = second_level_pages | push:p %}
{% elsif p_level == 4 %}
{% assign third_level_pages = third_level_pages | push:p %}
{% endif %}
{% endif %}
{% endfor %}

<ul class="nav-list">
{%- for node in first_level_pages -%}
{%- assign node_url = node.url | remove: 'index.html' -%}
{%- assign node_title = node.path | remove: 'index.md' | split: "/" | last | remove: '.md' | replace: "_pages", "Home" -%}
{%- assign children_list = second_level_pages
| where_exp: "item", "item.url contains node_url"
| sort: 'title' -%}
| sort: 'url' -%}
{%- assign num_children = children_list | size -%}
<li id="nav-first" aria-label="{{ node.title }}">
<li id="nav-first" aria-label="{{ node_title }}">
<div class="nav-item">
<a href="{{ node_url }}" class="nav-list-link nav-lh">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M181.3 32.4c17.4 2.9 29.2 19.4 26.3 36.8L197.8 128h95.1l11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3s29.2 19.4 26.3 36.8L357.8 128H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H347.1L325.8 320H384c17.7 0 32 14.3 32 32s-14.3 32-32 32H315.1l-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8l9.8-58.7H155.1l-11.5 69.3c-2.9 17.4-19.4 29.2-36.8 26.3s-29.2-19.4-26.3-36.8L90.2 384H32c-17.7 0-32-14.3-32-32s14.3-32 32-32h68.9l21.3-128H64c-17.7 0-32-14.3-32-32s14.3-32 32-32h68.9l11.5-69.3c2.9-17.4 19.4-29.2 36.8-26.3zM187.1 192L165.8 320h95.1l21.3-128H187.1z"/></svg>
<span>{{ node.title }}</span>
<span>{{ node_title }}</span>
</a>
{%- if num_children > 0 and node_url != "/" -%}
<button class="nav-list-expander" aria-label="toggle items in {{ node.title }} category" aria-pressed="false">
<button class="nav-list-expander" aria-label="toggle items in {{ node_title }} category" aria-pressed="false">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M201.4 342.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 274.7 86.6 137.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"/></svg>
</button>
{%- endif -%}
Expand All @@ -44,33 +55,35 @@
<ul class="nav-list">
{%- for child in children_list -%}
{%- assign child_url = child.url | remove: 'index.html' -%}
{%- assign child_title = child.path | remove: 'index.md' | split: "/" | last | remove: '.md' -%}
{%- assign grand_children_list = third_level_pages
| where_exp: "item", "item.url contains child_url"
| sort: 'title' -%}
| sort: 'url' -%}
{%- assign num_grand_children = grand_children_list | size -%}
<li id="nav-second" aria-label="{{ child.title }}">
<li id="nav-second" aria-label="{{ child_title }}">
<div class="nav-item">
<a href="{{ child_url }}" class="nav-list-link nav-sh">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"/></svg>
<span>{{ child.title }}</span>
<span>{{ child_title }}</span>
</a>
{%- if num_grand_children > 0 -%}
<button class="nav-list-expander" aria-label="toggle items in {{ child.title }} category" aria-pressed="false">
<button class="nav-list-expander" aria-label="toggle items in {{ child_title }} category" aria-pressed="false">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M201.4 342.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 274.7 86.6 137.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"/></svg>
</button>
{%- endif -%}
</div>
{%- if num_grand_children > 0 -%}
<ul class="nav-list">
{%- for grand_child in grand_children_list -%}
<li id="nav-third" aria-label="{{ grand_child.title }}">
<div class="nav-item">
<a href="{{ grand_child.url | relative_url }}" class="nav-list-link nav-sh">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"/></svg>
<span>{{ grand_child.title }}</span>
</a>
</div>
</li>
{%- assign grand_child_title = grand_child.path | remove: 'index.md' | split: "/" | last | remove: '.md' -%}
<li id="nav-third" aria-label="{{ grand_child_title }}">
<div class="nav-item">
<a href="{{ grand_child.url | relative_url }}" class="nav-list-link nav-sh">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M432 256c0 17.7-14.3 32-32 32L48 288c-17.7 0-32-14.3-32-32s14.3-32 32-32l352 0c17.7 0 32 14.3 32 32z"/></svg>
<span>{{ grand_child_title }}</span>
</a>
</div>
</li>
{%- endfor -%}
</ul>
{%- endif -%}
Expand Down
2 changes: 0 additions & 2 deletions _pages/Category A/Subcategory a/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
---
title: Subcategory a
bookmark: true
---
2 changes: 0 additions & 2 deletions _pages/Category A/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
---
title: Category A
bookmark: true
---
2 changes: 0 additions & 2 deletions _pages/Category B/Subcategory b/Subsubcategory 1/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
---
title: Subsubcategory 1
bookmark: true
---
2 changes: 0 additions & 2 deletions _pages/Category B/Subcategory b/Subsubcategory 2/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
---
title: Subsubcategory 2
bookmark: true
---
2 changes: 0 additions & 2 deletions _pages/Category B/Subcategory b/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
---
title: Subcategory b
bookmark: true
---
1 change: 1 addition & 0 deletions _pages/Category B/Subcategory b/post-03.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ tags:
- education
date: "2023-12-03"
thumbnail: "/assets/img/thumbnail/book.jpg"
bookmark: true
---

# What is Lorem Ipsum?
Expand Down
2 changes: 0 additions & 2 deletions _pages/Category B/Subcategory c/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
---
title: Subcategory c
bookmark: true
---
2 changes: 0 additions & 2 deletions _pages/Category B/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
---
title: Category B
bookmark: true
---
58 changes: 58 additions & 0 deletions _pages/comment system.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: "Manage blog comments with Giscus"
tags:
- user manual
- utility
- giscus
date: "2024-02-03"
thumbnail: "https://i.ibb.co/V9j2Qsg/giscus-Wl0-X3byd-az-U68-1.webp"
bookmark: true
---

[![goatcounter](https://opengraph.githubassets.com/4f866d5b634e7cd5422af77f8dbfb6d48dd288b7c5c18326544c1973210320ed/giscus/giscus){:class="img-lg"}](https://www.goatcounter.com/)

**Giscus** is a free **comments system** powered without your own database. Giscus uses the Github Discussions to store and load associated comments based on a chosen mapping (URL, pathname, title, etc.).

To comment, visitors must authorize the giscus app to post on their behalf using the GitHub OAuth flow. Alternatively, visitors can comment on the GitHub Discussion directly. You can moderate the comments on GitHub.

# Prerequisites
---

## Create a github repo

You need a GitHub repository first. If you gonna use *GitHub Pages* for hosting your website, you can choose the corresponding repository (i.e., `[userID].github.io`)

The repository should be **public**, otherwise visitors will not be able to view the discussion.

## Turn on Discussion feature

In your GitHub repository Settings, make sure that `General` > `Features` > `Discussions` feature is enabled.

![Discussion](https://i.ibb.co/P1FV02D/giscus-00.png)

# Activate Giscus API
---

Follow the steps in [Configuration guide](https://giscus.app/). Make sure the verification of your repository is successful.

![Verification](https://i.ibb.co/y87w8rB/giscus-02.png)

Then, scroll down from the manual page and choose the `Discussion Category` options. You don't need to touch other configs.

![Verification](https://i.ibb.co/0hqLWX0/giscus-03.png)

## Copy `_config.yml`

Now, you get the giscus script. Copy the four properties marked with a red box as shown below:

![](https://i.ibb.co/Z154x8P/giscus-04.png)

Paste those values to `_config.yml` placed in the root directory.

```
# External API
giscus_repo: "[ENTER REPO HERE]"
giscus_repoId: "[ENTER REPO ID HERE]"
giscus_category: "[ENTER CATEGORY NAME HERE]"
giscus_categoryId: "[ENTER CATEGORY ID HERE]"
```
2 changes: 0 additions & 2 deletions _pages/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
---
title: "Home"
bookmark: true
---
Loading

0 comments on commit c6d8251

Please sign in to comment.