Skip to content

feat(direction): add direction option #2243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
846ec60
feat(piill): update js assets
davidazad1 Feb 5, 2025
2b4b061
feat: add persian support
davidazad1 Feb 5, 2025
abb36eb
style: convert direction to rtl
davidazad1 Feb 5, 2025
0843799
refactor: move default posts of theme to "_draft" folder
davidazad1 Feb 6, 2025
e23c767
fix: rtl problem for code sections
davidazad1 Feb 6, 2025
a5f3de9
feat: add part 1 posts of Python Programming MOOC 2023
davidazad1 Feb 6, 2025
f82d46f
feat: add priority for showing posts of categories
davidazad1 Feb 6, 2025
9856c9f
feat: add a post
davidazad1 Feb 7, 2025
1bbc694
fix: adjust some settings
davidazad1 Feb 7, 2025
4369965
feat: don't know whay is this
davidazad1 Feb 7, 2025
98cb09d
update _site
davidazad1 Feb 7, 2025
cdc2b1f
feat: change logo
davidazad1 Feb 7, 2025
976f7e1
feat: update site
davidazad1 Feb 7, 2025
ae89734
feat: add posts
davidazad1 Feb 7, 2025
266b4c3
feat: add posts
davidazad1 Feb 7, 2025
3a8730f
feat: add some posts
davidazad1 Feb 7, 2025
566890e
feat: update _site
davidazad1 Feb 7, 2025
cce28f9
feat: update _site
davidazad1 Feb 7, 2025
60c830b
feat(direction): add direction option
davidazad1 Feb 9, 2025
e143490
fix(direction): fix style of rtl direction
davidazad1 Feb 12, 2025
ef86c49
Merge remote-tracking branch 'my-origin/master'
davidazad1 Feb 12, 2025
fb5882d
fix(direction): remove some confict styles
davidazad1 Feb 12, 2025
ab40bd9
fix(update): update _site
davidazad1 Feb 12, 2025
a754d02
feat: update about page
davidazad1 Feb 12, 2025
8b02696
feat: update site
davidazad1 Mar 11, 2025
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
73 changes: 73 additions & 0 deletions .github/workflows/pages-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: "Build and Deploy"
on:
push:
branches:
- main
- master
paths-ignore:
- .gitignore
- README.md
- LICENSE

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

permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# submodules: true
# If using the 'assets' git submodule from Chirpy Starter, uncomment above
# (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets)

- name: Setup Pages
id: pages
uses: actions/configure-pages@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true

- name: Build site
run: bundle exec jekyll b -d "_site${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: "production"

- name: Test site
run: |
bundle exec htmlproofer _site \
\-\-disable-external \
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
- name: Upload site artifact
uses: actions/upload-pages-artifact@v3
with:
path: "_site${{ steps.pages.outputs.base_path }}"

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@v4
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Gemfile.lock
# Jekyll cache
.jekyll-cache
.jekyll-metadata
_site

# RubyGems
*.gem
Expand Down
31 changes: 20 additions & 11 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,44 @@ theme: jekyll-theme-chirpy
# The language of the webpage › http://www.lingoes.net/en/translator/langcode.htm
# If it has the same name as one of the files in folder `_data/locales`, the layout language will also be changed,
# otherwise, the layout language will use the default value of 'en'.
lang: en
lang: fa

# the direction of the webpage
#
# Available options:
#
# ltr — use left to right direction (default)
# rtl — use right to left direction
#
direction: rtl

# Change to your timezone › https://kevinnovak.github.io/Time-Zone-Picker
timezone: Asia/Shanghai

# jekyll-seo-tag settings › https://github.com/jekyll/jekyll-seo-tag/blob/master/docs/usage.md
# ↓ --------------------------

title: Chirpy # the main title
title: Bug to Debug # the main title

tagline: A text-focused Jekyll theme # it will display as the subtitle
tagline: ما تو این وبلاگ راجب اخبار تکنولوژی و اموزش های برنامه نویسی صحبت میکنیم # it will display as the subtitle

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', note that it does not end with a '/'.
url: ""
url: "https://davidazad1.github.io"

github:
username: github_username # change to your GitHub username
username: davidazad1 # change to your GitHub username

twitter:
username: twitter_username # change to your Twitter username

social:
# Change to your full name.
# It will be displayed as the default author of the posts and the copyright owner in the Footer
name: your_full_name
name: داوود اروجی
email: [email protected] # change to your email address
links:
# The first element serves as the copyright owner's link
Expand Down Expand Up @@ -92,13 +101,13 @@ theme_mode: # [light | dark]

# The CDN endpoint for media resources.
# Notice that once it is assigned, the CDN url
# will be added to all media resources (site avatar, posts' images, audio and video files) paths starting with '/'
#
# will be added to all lmedia resources (site avatar, posts' images, audio and video files) paths starting with '/'
#
# e.g. 'https://cdn.com'
cdn: "https://chirpy-img.netlify.app"
cdn: ""

# the avatar on sidebar, support local or CORS resources
avatar: "/commons/avatar.jpg"
avatar: "assets/img/favicons/image.png"

# The URL of the site-wide social preview image used in SEO `og:image` meta tag.
# It can be overridden by a customized `page.image` in front matter.
Expand Down
89 changes: 89 additions & 0 deletions _data/locales/fa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# The layout text of site

# ----- Commons label -----

layout:
post: پست
category: دسته‌بندی
tag: تگ

# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home: خانه
categories: دسته‌بندی‌ها
tags: تگ‌ها
archives: آرشیو‌ها
about: درباره

# the text displayed in the search bar & search results
search:
hint: جست‌و‌جو
cancel: لغو
no_results: ای بابا، نتیجه ای پیدا نکردیم

panel:
lastmod: به تازگی بروز شده
trending_tags: پرطرفدار
toc: محتوا

copyright:
# Shown at the bottom of the post
license:
template:
name: CC BY 4.0
link: https://creativecommons.org/licenses/by/4.0/

# Displayed in the footer
brief: حقوق محفوط است
verbose:

meta:

not_found:
statement: اوپس، چیزی که دنبالش بودی پیدا نشد

notification:
update_found: نسخه‌ی جدید در دسترس است
update: بروزرسانی

# ----- Posts related labels -----

post:
written_by: توسط
posted: پست شده
updated: بروز شده
words: کلمات
pageview_measure: بازدیدها
read_time:
unit: دقیقه
prompt: خواندن
relate_posts: ادامه مطلب
share: اشتراک‌‌ گذاری
button:
next: جدیدتر
previous: قدیمی‌تر
copy_code:
succeed: کپی شده!
share_link:
title: کپی لینک
succeed: لینک با موفقیت کپی شد!

# Date time format.
# See: <http://strftime.net/>, <https://day.js.org/docs/en/display/format>
df:
post:
strftime: "%b %e, %Y"
dayjs: "ll"
archives:
strftime: "%b"
dayjs: "MMM"

# categories page
categories:
category_measure:
singular: دسته‌بندی
plural: دسته‌بندی‌ها
post_measure:
singular: پست‌
plural: پست‌ها
1 change: 1 addition & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!-- The Footer -->

<footer
dir={{ site.direction | default: ltr }}
aria-label="Site Info"
class="
d-flex flex-column justify-content-center text-muted
Expand Down
2 changes: 1 addition & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<head>
<head dir={{ site.direction | default: ltr }}>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f7f7f7">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#1b1b1e">
Expand Down
10 changes: 10 additions & 0 deletions _includes/no-linenos.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% comment %}
Remove the line number of the code snippet.
{% endcomment %}

{% assign content = include.content %}

{% if content contains '<td class="rouge-gutter gl"><pre class="lineno">' %}
{% assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">'%}
{% assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
{% endif %}
1 change: 1 addition & 0 deletions _includes/notification.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<aside
dir={{ site.direction | default: ltr }}
id="notification"
class="toast"
role="alert"
Expand Down
2 changes: 1 addition & 1 deletion _includes/post-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class="btn btn-outline-primary"
aria-label="{{ next }}"
>
<p>{{ page.next.title }}</p>
<p dir={{ site.direction | default: ltr }}>{{ page.next.title }}</p>
</a>
{% else %}
<div class="btn btn-outline-primary disabled" aria-label="{{ next }}">
Expand Down
2 changes: 1 addition & 1 deletion _includes/post-sharing.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Post sharing snippet -->

<div class="share-wrapper d-flex align-items-center">
<div dir={{ site.direction | default: ltr }} class="share-wrapper d-flex align-items-center">
<span class="share-label text-muted">{{ site.data.locales[include.lang].post.share }}</span>
<span class="share-icons">
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- The Side Bar -->

<aside aria-label="Sidebar" id="sidebar" class="d-flex flex-column align-items-end">
<aside dir={{ site.direction | default: ltr }} aria-label="Sidebar" id="sidebar" class="d-flex flex-column align-items-end">
<header class="profile-wrapper">
<a href="{{ '/' | relative_url }}" id="avatar" class="rounded-circle">
{%- if site.avatar != empty and site.avatar -%}
Expand Down
2 changes: 1 addition & 1 deletion _includes/toc.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% include toc-status.html %}

{% if enable_toc %}
<div class="toc-border-cover z-3"></div>
<div dir={{ site.direction | default: ltr }} class="toc-border-cover z-3"></div>
<section id="toc-wrapper" class="invisible position-sticky ps-0 pe-4 pb-4">
<h2 class="panel-heading ps-3 pb-2 mb-0">{{- site.data.locales[include.lang].panel.toc -}}</h2>
<nav id="toc"></nav>
Expand Down
2 changes: 1 addition & 1 deletion _includes/topbar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- The Top Bar -->

<header id="topbar-wrapper" aria-label="Top Bar">
<header dir=rtl id="topbar-wrapper" aria-label="Top Bar">
<div
id="topbar"
class="d-flex align-items-center justify-content-between px-lg-3 h-100"
Expand Down
2 changes: 1 addition & 1 deletion _includes/trending-tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{% endfor %}

{% if trending_tags.size > 0 %}
<section>
<section dir={{ site.direction | default: ltr }}>
<h2 class="panel-heading">{{- site.data.locales[include.lang].panel.trending_tags -}}</h2>
<div class="d-flex flex-wrap mt-3 mb-1 me-3">
{% for tag_name in trending_tags %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/update-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% endfor %}

{% if update_list.size > 0 %}
<section id="access-lastmod">
<section dir={{ site.direction | default: ltr }} id="access-lastmod">
<h2 class="panel-heading">{{- site.data.locales[include.lang].panel.lastmod -}}</h2>
<ul class="content list-unstyled ps-0 pb-1 ms-1 mt-2">
{% for item in update_list %}
Expand Down
7 changes: 6 additions & 1 deletion _layouts/archives.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@

<li>
{% assign ts = post.date | date: '%s' %}
<span class="date day" data-ts="{{ ts }}" data-df="DD">{{ post.date | date: '%d' }}</span>
{% if site.direction != "rtl" %}
<span class="date day" data-ts="{{ ts }}" data-df="DD">{{ post.date | date: '%d' }}</span>
{% endif %}
<span class="date month small text-muted ms-1" data-ts="{{ ts }}" data-df="{{ df_dayjs_m }}">
{{ post.date | date: df_strftime_m }}
</span>
{% if site.direction == "rtl" %}
<span class="date day" data-ts="{{ ts }}" data-df="DD">{{ post.date | date: '%d' }}</span>
{% endif %}
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
</li>

Expand Down
4 changes: 3 additions & 1 deletion _layouts/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ <h1 class="ps-lg-2">
<span class="lead text-muted ps-2">{{ page.posts | size }}</span>
</h1>

{% assign sorted_posts = page.posts | sort: "priority" %}

<ul class="content ps-0">
{% for post in page.posts %}
{% for post in sorted_posts %}
<li class="d-flex justify-content-between px-md-3">
<a href="{{ post.url | relative_url }}">{{ post.title }}</a>
<span class="dash flex-grow-1"></span>
Expand Down
4 changes: 2 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{% include topbar.html lang=lang %}

<div class="row flex-grow-1">
<main aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4">
<main dir={{ site.direction | default: ltr }} aria-label="Main Content" class="col-12 col-lg-11 col-xl-9 px-md-4">
{% if layout.refactor or layout.layout == 'default' %}
{% include refactor-content.html content=content lang=lang %}
{% else %}
Expand All @@ -33,7 +33,7 @@
</main>

<!-- panel -->
<aside aria-label="Panel" id="panel-wrapper" class="col-xl-3 ps-2 text-muted">
<aside dir={{ site.direction | default: ltr }} aria-label="Panel" id="panel-wrapper" class="col-xl-3 ps-2 text-muted">
<div class="access">
{% include_cached update-list.html lang=lang %}
{% include_cached trending-tags.html lang=lang %}
Expand Down
Loading