Skip to content

Commit

Permalink
Add new post, update site header, and fix HTML formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Deep0Thinking committed Jan 23, 2024
1 parent 9b8bab1 commit d06851f
Show file tree
Hide file tree
Showing 22 changed files with 780 additions and 417 deletions.
56 changes: 31 additions & 25 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
# documentation.

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

name: Deploy Jekyll site to "_site" branch on GitHub Pages
name: Deploy Jekyll site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
paths:
- "_site/**" # Runs only when there are changes in the 'site' directory
paths-ignore:
- "_site/**"
pull_request:
branches: ["main"]
paths:
Expand All @@ -23,7 +22,7 @@ on:

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

Expand All @@ -46,11 +45,17 @@ jobs:
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@v4
- 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@v3

# Deployment job
deploy:
Expand All @@ -60,28 +65,29 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout main branch
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: "main"
- name: Copy _site contents
ref: _site

- name: Configure Git
run: |
cp -r _site/ Gemfile _config.yml /tmp/
git checkout -b _site
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: _site

- name: Deploy to Specific Branch
run: |
# Clear out existing contents
rm -rf *
cp -r /tmp/_site/* /tmp/Gemfile /tmp/_config.yml ./
# Copy _site contents to root
cp -r _site/* .
# Add all files
git add --all
git config user.name github-actions
git config user.email github-actions@github.com
git commit -m "update _site content"
git push --force origin _site
- name: Deploy to GitHub Pages
uses: jeffreytse/jekyll-deploy-action@v0.5.1
with:
provider: "github"
token: ${{ secrets.GITHUB_TOKEN }}
repository: ""
branch: "_site"
jekyll_src: "./"
jekyll_cfg: "_config.yml"
jekyll_baseurl: "/2nd-Minima"
# Commit and push
git commit -m "Deploy Jekyll site to '_site' branch"
git push origin HEAD:_site
57 changes: 51 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ GEM
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.16.3)
forwardable-extended (2.6.0)
google-protobuf (3.25.1-arm64-darwin)
google-protobuf (3.25.2)
google-protobuf (3.25.2-aarch64-linux)
google-protobuf (3.25.2-arm64-darwin)
google-protobuf (3.25.2-x86-linux)
google-protobuf (3.25.2-x86_64-darwin)
google-protobuf (3.25.2-x86_64-linux)
http_parser.rb (0.8.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -59,8 +64,18 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
nokogiri (1.16.0-aarch64-linux)
racc (~> 1.4)
nokogiri (1.16.0-arm-linux)
racc (~> 1.4)
nokogiri (1.16.0-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.0-x86-linux)
racc (~> 1.4)
nokogiri (1.16.0-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.4)
Expand All @@ -71,21 +86,51 @@ GEM
rexml (3.2.6)
rouge (4.2.0)
safe_yaml (1.0.5)
sass-embedded (1.69.7-arm64-darwin)
sass-embedded (1.70.0-aarch64-linux-gnu)
google-protobuf (~> 3.25)
sass-embedded (1.70.0-aarch64-linux-musl)
google-protobuf (~> 3.25)
sass-embedded (1.70.0-arm-linux-gnueabihf)
google-protobuf (~> 3.25)
sass-embedded (1.70.0-arm-linux-musleabihf)
google-protobuf (~> 3.25)
sass-embedded (1.70.0-arm64-darwin)
google-protobuf (~> 3.25)
sass-embedded (1.70.0-x86-linux-gnu)
google-protobuf (~> 3.25)
sass-embedded (1.70.0-x86-linux-musl)
google-protobuf (~> 3.25)
sass-embedded (1.70.0-x86_64-darwin)
google-protobuf (~> 3.25)
sass-embedded (1.70.0-x86_64-linux-gnu)
google-protobuf (~> 3.25)
sass-embedded (1.70.0-x86_64-linux-musl)
google-protobuf (~> 3.25)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.5.0)
webrick (1.8.1)

PLATFORMS
arm64-darwin-22
ruby
aarch64-linux
aarch64-linux-gnu
aarch64-linux-musl
arm-linux
arm-linux-gnueabihf
arm-linux-musleabihf
arm64-darwin
x86-linux
x86-linux-gnu
x86-linux-musl
x86_64-darwin
x86_64-linux
x86_64-linux-gnu
x86_64-linux-musl

DEPENDENCIES
bundler
jekyll-toc
minima!

BUNDLED WITH
2.5.4
2.5.5
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

The **2nd-Minima** Github repository is designed for individuals seeking to handily create a blog. It's a user-friendly, advanced **template** based on the popular [Jekyll-theme-Minima](https://github.com/jekyll/minima), perfect for those unfamiliar with front-end programming.

Experience a live example of a [2nd-Minima](https://github.com/Deep0Thinking/2nd-Minima) based website here: [Deep0Thinking.github.io](https://deep0thinking.github.io)
Experience a live demo of a [2nd-Minima](https://github.com/Deep0Thinking/2nd-Minima) based website here: [Deep0Thinking.github.io](https://deep0thinking.github.io)

![Deep0Thinking.github.io](https://repository-images.githubusercontent.com/481486169/e28e51cb-d7c1-49c7-b8e5-c81a3e27fb46)

Expand Down
94 changes: 61 additions & 33 deletions _posts/2022-11-28-How-to-post-posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
layout: post
title: How to post posts
tags: this-is-a-tag WoW let's go
toc: true
description: You could write a brief description here to catch your readers' interests, like this is a post about how to post posts :)
thumbnail: https://deep0thinking.com/wp-content/uploads/2024/01/my-first-post.jpg
---

First, let's talk about the basic requirements for a valid post file:
Welcome to the 2nd-Minima Jekyll theme! This guide will walk you through creating and managing your posts effectively. Whether you're a beginner or an experienced Jekyll user, these instructions will help you make the most out of this theme.

- **External requirements**:

- **Naming**: You need to name your post file with the naming format of "Year-Month-Date-Title.md", for example: "2022-11-28-My-first-post.md". ***(Attention: The file naming does not allow any "space" character, so please make sure to use "-" to replace them.)***
- **Naming**: Posts should be named following the "Year-Month-Date-Title.md" format, for example: "2022-11-28-My-first-post.md". ***(Attention: Spaces (` `) are not permitted in file names. Use hyphens (`-`) to separate words)***

- **Location**: You need to place your post file under the "**/_posts/**" folder.
- **Location**: Place your post files in the "**/_posts/**" directory

- **tag-page**: (You could temporarily skip this part until you have gotten up to the **tags** part under **Internal requirements** below) Please remember, if you add tags to a post, let's assume one of the tags name is "the-tag-you-add", then you should create a "**the-tag-you-add.md**" file under the "**/tag/**" folder in order to generate a tag-page for the "the-tag-you-add" and with just these contents in that "**the-tag-you-add.md**":
- **tag-page**: (This section can be deferred until you've read about **tags** in the **Internal Requirements**.) Please remember, if you add tags to a post, let's assume one of the tags name is "the-tag-you-add", then you should create a "**the-tag-you-add.md**" file under the "**/tag/**" folder in order to generate a tag-page for the "the-tag-you-add" tag and the "**the-tag-you-add.md**" file should contain the following:

```markdown
---
Expand All @@ -23,40 +25,58 @@ First, let's talk about the basic requirements for a valid post file:
---
```

And that tag-page would collect and display all your posts with that tag. In fact, there is a more efficient way to repeat this repetitive procedure, which is to create a python script to help you do that, for more detailed information please click on the solutions link below.
***(Attention: Ensure the title is enclosed in double quotes (`"`) if it contains a colon (`:`) for successful tag page creation.)***

The tag page will aggregate and display all posts with the specified tag. Considering a more efficient implementation, which is to create a python script to automate this process, more details can be found in the solutions link right below.

*The tags and tag-page display solutions are [here](http://longqian.me/2017/02/09/github-jekyll-tag/) provided by [Long Qian](http://longqian.me/aboutme/), great thanks to him!*

- **Internal requirements**:

- **Predeclaration**:

Every "**post.md**" file you posted need to have a **Predeclaration** in the form of this at the file's head (beginning) part (including this file: You can see the **Predeclaration** part at the beginning):
Each "**post.md**" file you posted must have a **Predeclaration** block in the form of this at the file's head (beginning) part (including this file: You can see the **Predeclaration** part at the beginning):

```markdown
---
layout: post
title: How to post posts
tags: this-is-a-tag WoW let's go
toc: true
description: You could write a brief description here to catch your readers' interests, like this is a post about how to post posts :)
thumbnail: https://deep0thinking.com/wp-content/uploads/2024/01/my-first-post.jpg
---
```

And let me explain this part line by line:

- **layout**: post
- **layout**: Apply the "???" layout from "_layouts/???.html" to the post.

Please just write 1 word "post". This means your post that you want to post would use the **post** layout of "**_layouts/page.html**" file.
Please just write 1 word "post" here for every post file. This means to apply the **post** layout from "**_layouts/post.html**" on your post.

- **title**: Please write your post title here.
- **title**: The title of your post.

In fact, the file name in the **Naming** part of the **External requirements** can be different from the title name here, but it is always a good habit to keep them the same to disambiguate and improve convenience (just like writing the annotation when coding), especially when you want to read or modify these posts files in the future. But if you find a more efficient and effective naming method, you could definitely follow your way.

- **tags**: Please write your post tag(s) here.
- **tags**: List the tags associated with your post, separated by spaces (` `). Use hyphens (`-`) to avoid breaking multi-word tags.

If you want to put 2 or more tags here, you need to use "space" (` `) to separate them, and what can you do if you don't want the tag to be separated, you could use `-` to replace the "space" to combine the words and prevent the breakage in 1 tag. For example: `this-is-a-tag` is 1 tag, `WoW` is 1 tag, but `let's go` is 2 tags, since it actually breaks into the 2 tags `let's` and `go` due to the "space" between them.

- **toc**: Set to `true` to include a Table of Contents, `false` otherwise.

The table of contents is a block contains a list of links to the different sections in your post. It is generated automatically based on the headings in your post. If you want to turn it off, just replace the `true` in `toc: true` with `false` or just simply delete that whole line.

If you want to put 2 or more tags here, you need to use "space" to separate them, and what can you do if you don't want the tag to be separated, you could use "-" to replace the "space" to combine the words and prevent the breakage in 1 tag. For example: `this-is-a-tag` is 1 tag, `WoW` is 1 tag, `let's go` is 2 tags, they actually break into 2 tags of `let's` and `go` due to the "space" between them.
When `true`, the toc appears on the left side of your post. It automatically generates clickable links to different sections based on Markdown headings (e.g., `# Heading`, `## Subheading`). Clicking on these links allows readers to quickly navigate to specific sections of your post. ***(Attention: While HTML headings like `<h1>Heading</h1>` will be included in the toc, they are not interactive and cannot be clicked to navigate to the respective sections. This feature is exclusively available for Markdown headings.)***

- **description**: You could write a brief description in the description part to catch your readers' interests ***(Attention: Please don't leave "space" between ":" and following the word or punctuation in the description part, or your post and description will not be able to display.)*** , like this is a post about how to post posts (Me: It sounds super attractive right? Me again: Hahahahaha, no.) . Or, if you don't like the description part, you could always turn it off in the "**/_config.yml**" file by replacing the `true` in `show_description: true` with `false` or just simply delete that whole line.
Conversely, setting `toc` to `false` or removing the line entirely disables the toc. This means no interactive list of sections will appear on the left of your post, and there will be no clickable links for navigation within the post.

- **thumbnail**: Put your post thumbnail link (URL or local path) here.

The thumbnail link is the link of the image you want to display on the post page, it can be an URL like this: `https://deep0thinking.com/wp-content/uploads/2024/01/my-first-post.jpg` or a local file path like this: `/assets/img/my-first-post.jpg`. ***(Attention: Please make sure to use the correct link format, or the thumbnail would not be able to display.)***

- **description**: A short description to engage readers. Avoid spaces after colons in `???` inside `description: ???` like `description: Hi, : )`; `description: Hi, :)` is permitted.

You could write a brief description in the description part to catch your readers' interests ***(Attention: Please don't leave "space" (` `) after `:` and following the word or punctuation in the description part, or your post and description will not be able to display.)*** , like this is a post about how to post posts (Me: It sounds super attractive right? Me again: Hahahahaha, no.) . If you don't want the description part in all posts (the post layout), you could disable it permanently in the "**/_config.yml**" file by replacing the `true` in `show_description: true` with `false` or just simply delete that whole line.

- **Post body part**:

Expand All @@ -70,12 +90,16 @@ First, let's talk about the basic requirements for a valid post file:

- **Javascript**

Don't worry, you don't need to master these 4 languages to write a post, in fact, using only the Markdown language is basically enough (look at this post file name, its suffix is ".md" and md represents the Markdown language), because Markdown language can support the basic post arrangements and it is super easy and convenient to learn and use. BTW I bet you could master its basic syntax within 5 minutes, then you could be able to write the following Mardown contents too:
Don't worry, mastery of these languages is not required to write a post... In fact, using only the **Markdown** language is sufficient for most posts (look at this post file name, its suffix is ".md" and md represents the Markdown language), because Markdown language can support the basic post arrangements and it is super easy and convenient to learn and use. BTW I bet you could master its basic syntax within 5 minutes, then you could be able to write the following Markdown contents too:


<hr>

<br><br>
<br>

# Markdown Syntax

<br>

```markdown
# Heading 1
Expand Down Expand Up @@ -157,17 +181,17 @@ print(a)
Here is a table:

|title 1|title 2|title 3|
|:-|:-:|-:|
|left|middle|right|
|text|text|text|
|:- | :-: | -:|
|left |middle |right |
|text |text |text |
```

Here is a table:

|title 1|title 2|title 3|
|:-|:-:|-:|
|left|middle|right|
|text|text|text|
|:- | :-: | -:|
|left |middle |right |
|text |text |text |

<br><br>

Expand Down Expand Up @@ -239,21 +263,25 @@ BTW: They are totally free and it would be better if you use both of them to lea

<br><br>

# HTML Syntax

<br><br>

```html
<h1> Heading </h1>
<h2> Heading </h2>
<h3> Heading </h3>
<h4> Heading </h4>
<h5> Heading </h5>
<h6> Heading </h6>
<h1> Heading 1 </h1>
<h2> Heading 2 </h2>
<h3> Heading 3 </h3>
<h4> Heading 4 </h4>
<h5> Heading 5 </h5>
<h6> Heading 6 </h6>
```

<h1> Heading </h1>
<h2> Heading </h2>
<h3> Heading </h3>
<h4> Heading </h4>
<h5> Heading </h5>
<h6> Heading </h6>
<h1> Heading 1 </h1>
<h2> Heading 2 </h2>
<h3> Heading 3 </h3>
<h4> Heading 4 </h4>
<h5> Heading 5 </h5>
<h6> Heading 6 </h6>

<br><br>

Expand Down Expand Up @@ -453,4 +481,4 @@ BTW: They are totally free and it would be better if you use both of them to lea

<br><br>

Maybe you have already noticed the **fake comments section** below, wanna put it somewhere else or delete it? Click it for more information ~
Maybe you have already noticed the **fake comments section** below, wanna activate it? Click it for more information ~
10 changes: 10 additions & 0 deletions _posts/2024-01-20-My-first-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: post
title: My first post
tags: WoW go
toc: true
description: Haha! This is my first post.
thumbnail: https://deep0thinking.com/wp-content/uploads/2024/01/my-first-post.jpg
---

###
Loading

0 comments on commit d06851f

Please sign in to comment.