Skip to content
Closed

NEW #2402

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Deploy Jekyll site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v1

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ description: >- # used by seo meta and the atom feed
A minimal, responsive and feature-rich Jekyll theme for technical writing.

# fill in the protocol & hostname for your site, e.g., 'https://username.github.io'
url: ""
url: "https://shineshin0411.github.io"

github:
username: github_username # change to your github username
Expand Down
16 changes: 10 additions & 6 deletions _includes/datetime.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
-->

{% assign wrap_elem = include.wrap | default: 'em' %}
{% assign df_strftime = site.data.locales[site.lang].df.post.strftime | default: '%d/%m/%Y' %}
{% assign df_dayjs = site.data.locales[site.lang].df.post.dayjs | default: 'DD/MM/YYYY' %}
{% assign df_strftime = site.data.locales[include.lang].df.post.strftime | default: '%d/%m/%Y' %}
{% assign df_dayjs = site.data.locales[include.lang].df.post.dayjs | default: 'DD/MM/YYYY' %}

<{{ wrap_elem }} class="{% if include.class %}{{ include.class }}{% endif %}"
data-ts="{{ include.date | date: '%s' }}"
data-df="{{ df_dayjs }}"
{% if include.tooltip %}data-toggle="tooltip" data-placement="bottom"{% endif %}>
<{{ wrap_elem }}
class="{% if include.class %}{{ include.class }}{% endif %}"
data-ts="{{ include.date | date: '%s' }}"
data-df="{{ df_dayjs }}"
{% if include.tooltip %}
data-toggle="tooltip" data-placement="bottom"
{% endif %}
>
{{ include.date | date: df_strftime }}
</{{ wrap_elem }}>
20 changes: 13 additions & 7 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@
<div class="d-flex justify-content-between align-items-center text-muted ml-md-3 mr-md-3">
<div class="footer-left">
<p class="mb-0">
© {{ 'now' | date: "%Y" }}
© {{ 'now' | date: '%Y' }}
<a href="{{ site.social.links[0] }}">{{ site.social.name }}</a>.
{% if site.data.locales[site.lang].copyright.brief %}
<span data-toggle="tooltip" data-placement="top"
title="{{ site.data.locales[site.lang].copyright.verbose }}">{{ site.data.locales[site.lang].copyright.brief }}</span>
{% if site.data.locales[include.lang].copyright.brief %}
<span
data-toggle="tooltip"
data-placement="top"
title="{{ site.data.locales[include.lang].copyright.verbose }}"
>
{{- site.data.locales[include.lang].copyright.brief -}}
</span>
{% endif %}
</p>
</div>

<div class="footer-right">
<p class="mb-0">

{%- capture _platform -%}
<a href="https://jekyllrb.com" target="_blank" rel="noopener">Jekyll</a>
{%- endcapture -%}
Expand All @@ -25,9 +29,11 @@
<a href="https://github.com/cotes2020/jekyll-theme-chirpy" target="_blank" rel="noopener">Chirpy</a>
{%- endcapture -%}

{{ site.data.locales[site.lang].meta
{{
site.data.locales[include.lang].meta
| default: 'Using the :PLATFORM theme :THEME.'
| replace: ':PLATFORM', _platform | replace: ':THEME', _theme
| replace: ':PLATFORM', _platform
| replace: ':THEME', _theme
}}
</p>
</div>
Expand Down
8 changes: 8 additions & 0 deletions _includes/lang.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% comment %}
Detect appearance language and return it through variable "lang"
{% endcomment %}
{% if site.data.locales[site.lang] %}
{% assign lang = site.lang %}
{% else %}
{% assign lang = 'en' %}
{% endif %}
47 changes: 27 additions & 20 deletions _includes/post-nav.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
<!--
Navigation buttons at the bottom of the post.
-->
<!-- Navigation buttons at the bottom of the post. -->

<div class="post-navigation d-flex justify-content-between">
{% if page.previous.url %}
<a href="{{ site.baseurl }}{{ page.previous.url }}" class="btn btn-outline-primary"
prompt="{{ site.data.locales[site.lang].post.button.previous }}">
<p>{{ page.previous.title }}</p>
</a>
<a
href="{{ site.baseurl }}{{ page.previous.url }}"
class="btn btn-outline-primary"
prompt="{{ site.data.locales[include.lang].post.button.previous }}"
>
<p>{{ page.previous.title }}</p>
</a>
{% else %}
<div class="btn btn-outline-primary disabled"
prompt="{{ site.data.locales[site.lang].post.button.previous }}">
<p>-</p>
</div>
<div
class="btn btn-outline-primary disabled"
prompt="{{ site.data.locales[include.lang].post.button.previous }}"
>
<p>-</p>
</div>
{% endif %}

{% if page.next.url %}
<a href="{{ site.baseurl }}{{page.next.url}}" class="btn btn-outline-primary"
prompt="{{ site.data.locales[site.lang].post.button.next }}">
<p>{{ page.next.title }}</p>
</a>
<a
href="{{ site.baseurl }}{{page.next.url}}"
class="btn btn-outline-primary"
prompt="{{ site.data.locales[include.lang].post.button.next }}"
>
<p>{{ page.next.title }}</p>
</a>
{% else %}
<div class="btn btn-outline-primary disabled"
prompt="{{ site.data.locales[site.lang].post.button.next }}">
<p>-</p>
</div>
<div
class="btn btn-outline-primary disabled"
prompt="{{ site.data.locales[include.lang].post.button.next }}"
>
<p>-</p>
</div>
{% endif %}

</div>
34 changes: 21 additions & 13 deletions _includes/post-sharing.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
<!--
Post sharing snippet
-->
<!-- Post sharing snippet -->

<div class="share-wrapper">
<span class="share-label text-muted mr-1">{{ site.data.locales[site.lang].post.share }}</span>
<span class="share-label text-muted mr-1">{{ site.data.locales[include.lang].post.share }}</span>
<span class="share-icons">
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
{% assign title = title | uri_escape %}
{% assign url = page.url | absolute_url | url_encode %}

{% for share in site.data.share.platforms %}
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
<a href="{{ link }}" data-toggle="tooltip" data-placement="top"
title="{{ share.type }}" target="_blank" rel="noopener" aria-label="{{ share.type }}">
<i class="fa-fw {{ share.icon }}"></i>
</a>
<a
href="{{ link }}"
data-toggle="tooltip"
data-placement="top"
title="{{ share.type }}"
target="_blank"
rel="noopener"
aria-label="{{ share.type }}"
>
<i class="fa-fw {{ share.icon }}"></i>
</a>
{% endfor %}

<i id="copy-link" class="fa-fw fas fa-link small"
data-toggle="tooltip" data-placement="top"
title="{{ site.data.locales[site.lang].post.button.share_link.title }}"
data-title-succeed="{{ site.data.locales[site.lang].post.button.share_link.succeed }}">
<i
id="copy-link"
class="fa-fw fas fa-link small"
data-toggle="tooltip"
data-placement="top"
title="{{ site.data.locales[include.lang].post.button.share_link.title }}"
data-title-succeed="{{ site.data.locales[include.lang].post.button.share_link.succeed }}"
>
</i>

</span>
</div>
27 changes: 17 additions & 10 deletions _includes/read-time.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<!--
Calculate the post's reading time, and display the word count in tooltip
-->
<!-- Calculate the post's reading time, and display the word count in tooltip -->

{% assign words = include.content | strip_html | number_of_words: "auto" %}
{% assign words = include.content | strip_html | number_of_words: 'auto' %}

<!-- words per minute -->
<!-- words per minute -->

{% assign wpm = 180 %}
{% assign min_time = 1 %}
Expand All @@ -16,15 +14,24 @@
{% endunless %}

{% capture read_prompt %}
{{- site.data.locales[site.lang].post.read_time.prompt -}}
{{- site.data.locales[include.lang].post.read_time.prompt -}}
{% endcapture %}

<!-- return element -->
<span class="readtime" data-toggle="tooltip" data-placement="bottom"
title="{{ words }} {{ site.data.locales[site.lang].post.words }}">
<em>{{- read_time -}}{{" "}}{{- site.data.locales[site.lang].post.read_time.unit -}}</em>
<span
class="readtime"
data-toggle="tooltip"
data-placement="bottom"
title="{{ words }} {{ site.data.locales[include.lang].post.words }}"
>
<em>
{{- read_time -}}
{{ ' ' }}
{{- site.data.locales[include.lang].post.read_time.unit -}}
</em>
{%- if include.prompt -%}
{%- assign _prompt_words = read_prompt | number_of_words: 'auto' -%}
{%- unless _prompt_words > 1 -%}{{ " " }}{%- endunless -%}{{ read_prompt }}
{%- unless _prompt_words > 1 -%}{{ ' ' }}{%- endunless -%}
{{ read_prompt }}
{%- endif -%}
</span>
2 changes: 1 addition & 1 deletion _includes/refactor-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
| append: '<div class="code-header">'
| append: _label
| append: '<button aria-label="copy" data-title-succeed="'
| append: site.data.locales[site.lang].post.button.copy_code.succeed
| append: site.data.locales[include.lang].post.button.copy_code.succeed
| append: '"><i class="far fa-clipboard"></i></button></div>'
| append: '<div class="highlight"><code>'
%}
Expand Down
Loading
Loading