Skip to content
Closed

Nohome #2548

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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@

This is a fork of the chirpy jekyll theme.

to run:
'''
bundle exec jekyll s
'''

<div align="center">

# Chirpy Jekyll Theme
Expand Down
34 changes: 20 additions & 14 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,35 @@ 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: Shoham Jacoby # the main title

tagline: A text-focused Jekyll theme # it will display as the sub-title
tagline: Quantum computing researcher # it will display as the sub-title

description: >- # used by seo meta and the atom feed
A minimal, responsive and feature-rich Jekyll theme for technical writing.
Quantum computing researcher focused on quantum error correction and fault-tolerant quantum computing.

# 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://shohamjac.github.io" # the base hostname & protocol for your site

github:
username: github_username # change to your github username
username: shohamjac # change to your github username

twitter:
username: twitter_username # change to your twitter username
username: shohamjacoby # 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
email: example@domain.com # change to your email address
name: Shoham Jacoby
email: shohamjac@gmail.com # change to your email address
links:
# The first element serves as the copyright owner's link
- https://twitter.com/username # change to your twitter homepage
- https://github.com/username # change to your github homepage
- https://twitter.com/shohamjacoby # change to your twitter homepage
- https://github.com/shohamjac # change to your github homepage
# Uncomment below to add more social links
# - https://www.facebook.com/username
# - https://www.linkedin.com/in/username
- https://www.linkedin.com/in/shoham-jacoby-711a82154/

google_site_verification: # fill in to your verification string

Expand Down Expand Up @@ -70,10 +70,10 @@ theme_mode: # [light|dark]
# will be added to all image (site avatar & posts' images) paths starting with '/'
#
# e.g. 'https://cdn.com'
img_cdn: "https://chirpy-img.netlify.app"
img_cdn:

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

# boolean type, the global switch for TOC in posts.
toc: true
Expand Down Expand Up @@ -109,7 +109,12 @@ assets:
pwa:
enabled: true # the option for PWA feature

paginate: 10
plugins: [jekyll-paginate]


paginate: 3

paginate_path: "/blog/page:num/"

# The base URL of your site
baseurl: ""
Expand Down Expand Up @@ -183,6 +188,7 @@ exclude:
- LICENSE
- rollup.config.js
- package*.json
- _tabs/about.md

jekyll-archives:
enabled: [categories, tags]
Expand Down
5 changes: 5 additions & 0 deletions _data/authors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ cotes:
twitter: cotes2020
url: https://github.com/cotes2020/

jacoby:
name: Shoham Jacoby
twitter: shohamjacoby
url: https://shohamjac.github.io/

sille_bille:
name: Dinesh Prasanth Moluguwan Krishnamoorthy
twitter: dinesh_MKD
Expand Down
8 changes: 5 additions & 3 deletions _data/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ layout:
# The tabs of sidebar
tabs:
# format: <filename_without_extension>: <value>
home: Home
home: About
blog: Blog
categories: Categories
tags: Tags
posts: Blog
# tags: Tags
archives: Archives
about: About
# about: About

# the text displayed in the search bar & search results
search:
Expand Down
7 changes: 5 additions & 2 deletions _includes/js-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

<!-- layout specified -->

{% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' %}
{% if page.layout == 'post' or page.layout == 'page' or page.layout == 'home' or page.layout == 'blog' %}
{% assign urls = urls | append: ',' | append: site.data.origin[type]['lazy-polyfill'].js %}

{% unless page.layout == 'home' %}
{% unless page.layout == 'home' or page.layout == 'blog' %}
<!-- image lazy-loading & popup & clipboard -->
{% assign urls = urls
| append: ','
Expand All @@ -30,6 +30,7 @@
or page.layout == 'archives'
or page.layout == 'category'
or page.layout == 'tag'
or page.layout == 'blog'
%}
{% assign locale = site.lang | split: '-' | first %}

Expand Down Expand Up @@ -59,6 +60,8 @@
{% case page.layout %}
{% when 'home', 'categories', 'post', 'page' %}
{% assign js = page.layout %}
{% when 'blog' %}
{% assign js = 'home' %}
{% when 'archives', 'category', 'tag' %}
{% assign js = 'misc' %}
{% else %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/refactor-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
{% assign _left = _left | append: ' loading="lazy"' %}
{% endif %}

{% if page.layout == 'home' %}
{% if page.layout == 'home' or page.layout == 'blog' %}
<!-- create the image wrapper -->
{% assign _wrapper_start = '<div class="preview-img ' | append: _class | append: '">' %}

Expand Down
13 changes: 12 additions & 1 deletion _includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,23 @@ <h1 class="site-title">
<nav class="flex-column flex-grow-1 w-100 ps-0">
<ul class="nav">
<!-- home -->
<li class="nav-item{% if page.layout == 'home' %}{{ " active" }}{% endif %}">

<li class="nav-item{% if page.url == '/' %}{{ " active" }}{% endif %}">
<a href="{{ '/' | relative_url }}" class="nav-link">
<i class="fa-fw fas fa-home"></i>
<span>{{ site.data.locales[include.lang].tabs.home | upcase }}</span>
</a>
</li>

<!-- blog -->

<li class="nav-item{% if page.url == '/blog/' %}{{ " active" }}{% endif %}">
<a href="{{ '/blog/' | relative_url }}" class="nav-link">
<i class="fa-fw fa fa-pencil-square"></i>
<span>{{ site.data.locales[include.lang].tabs.blog | upcase }}</span>
</a>
</li>

<!-- the real tabs -->
{% for tab in site.tabs %}
<li class="nav-item{% if tab.url == page.url %}{{ " active" }}{% endif %}">
Expand Down
10 changes: 8 additions & 2 deletions _includes/topbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
{% else %}
{% for item in paths %}
{% if forloop.first %}
<span>
<!-- <span>
<a href="{{ '/' | relative_url }}">
{{ site.data.locales[include.lang].tabs.home | capitalize }}
</a>
</span>
</span> -->

{% elsif forloop.last %}
{% if page.collection == 'tabs' %}
Expand All @@ -34,6 +34,12 @@
{{ site.data.locales[include.lang].tabs[item] | default: page.title }}
</a>
</span>
{% elsif page.layout == 'post' %}
<span>
<a href="{{ '/blog/' | relative_url }}">
{{ site.data.locales[include.lang].tabs[item] | default: page.title }}
</a>
</span>
{% endif %}
{% endfor %}
{% endif %}
Expand Down
119 changes: 119 additions & 0 deletions _layouts/blog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
layout: default
refactor: true
---

{% include lang.html %}

{% assign pinned = site.posts | where: 'pin', 'true' %}
{% assign default = site.posts | where_exp: 'item', 'item.pin != true and item.hidden != true' %}

{% assign posts = '' | split: '' %}

<!-- Get pinned posts -->

{% assign offset = paginator.page | minus: 1 | times: paginator.per_page %}
{% assign pinned_num = pinned.size | minus: offset %}

{% if pinned_num > 0 %}
{% for i in (offset..pinned.size) limit: pinned_num %}
{% assign posts = posts | push: pinned[i] %}
{% endfor %}
{% else %}
{% assign pinned_num = 0 %}
{% endif %}

<!-- Get default posts -->

{% assign default_beg = offset | minus: pinned.size %}

{% if default_beg < 0 %}
{% assign default_beg = 0 %}
{% endif %}

{% assign default_num = paginator.posts | size | minus: pinned_num %}
{% assign default_end = default_beg | plus: default_num | minus: 1 %}

{% if default_num > 0 %}
{% for i in (default_beg..default_end) %}
{% assign posts = posts | push: default[i] %}
{% endfor %}
{% endif %}


<div id="post-list" class="flex-grow-1 px-xl-1">
{% for post in posts %}
<article class="card-wrapper card">
<a href="{{ post.url | relative_url }}" class="post-preview row g-0 flex-md-row-reverse">
{% assign card_body_col = '12' %}

{% if post.image %}
{% assign src = post.image.path | default: post.image %}
{% unless src contains '//' %}
{% assign src = post.img_path | append: '/' | append: src | replace: '//', '/' %}
{% endunless %}

{% assign alt = post.image.alt | xml_escape | default: 'Preview Image' %}

{% assign lqip = null %}

{% if post.image.lqip %}
{% capture lqip %}lqip="{{ post.image.lqip }}"{% endcapture %}
{% endif %}

<div class="col-md-5">
<img src="{{ src }}" alt="{{ alt }}" {{ lqip }}>
</div>

{% assign card_body_col = '7' %}
{% endif %}

<div class="col-md-{{ card_body_col }}">
<div class="card-body d-flex flex-column">
<h1 class="card-title my-2 mt-md-0">{{ post.title }}</h1>

<div class="card-text content mt-0 mb-3">
<p>
{% include no-linenos.html content=post.content %}
{{ content | markdownify | strip_html | truncate: 200 | escape }}
</p>
</div>

<div class="post-meta flex-grow-1 d-flex align-items-end">
<div class="me-auto">
<!-- posted date -->
<i class="far fa-calendar fa-fw me-1"></i>
{% include datetime.html date=post.date lang=lang %}

<!-- categories -->
{% if post.categories.size > 0 %}
<i class="far fa-folder-open fa-fw me-1"></i>
<span class="categories">
{% for category in post.categories %}
{{ category }}
{%- unless forloop.last -%},{%- endunless -%}
{% endfor %}
</span>
{% endif %}
</div>

{% if post.pin %}
<div class="pin ms-1">
<i class="fas fa-thumbtack fa-fw"></i>
<span>{{ site.data.locales[lang].post.pin_prompt }}</span>
</div>
{% endif %}
</div>
<!-- .post-meta -->
</div>
<!-- .card-body -->
</div>
</a>
</article>
{% endfor %}
</div>
<!-- #post-list -->

{% if paginator.total_pages > 1 %}
{% include post-paginator.html %}
{% endif %}
4 changes: 4 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@

<!-- panel -->
<aside aria-label="Panel" id="panel-wrapper" class="col-xl-3 ps-2 mb-5 text-muted">
{% comment %}

<div class="access">
{% include_cached update-list.html lang=lang %}
{% include_cached trending-tags.html lang=lang %}
</div>
{% endcomment %}


{% for _include in layout.panel_includes %}
{% assign _include_path = _include | append: '.html' %}
Expand Down
1 change: 1 addition & 0 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
{% endfor %}
{% endif %}


<div id="post-list" class="flex-grow-1 px-xl-1">
{% for post in posts %}
<article class="card-wrapper card">
Expand Down
Loading
Loading