-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1bb7a3c
commit 541f1fe
Showing
1 changed file
with
22 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,116 +1,43 @@ | ||
# The Cayman theme | ||
# Pyekyll / Python与Jekyll的简易博客系统 | ||
|
||
[![.github/workflows/ci.yaml](https://github.com/pages-themes/cayman/actions/workflows/ci.yaml/badge.svg)](https://github.com/pages-themes/cayman/actions/workflows/ci.yaml) [![Gem Version](https://badge.fury.io/rb/jekyll-theme-cayman.svg)](https://badge.fury.io/rb/jekyll-theme-cayman) | ||
好吧同志们,本项目其实一点也不玄学,不需要NodeJs和NPM,我用了Python的方式最简单的实现了一个比较美观且好做的方案,如果你觉得Jekyll在GithubPage上的主题不错,那么你选对地方了。这里不需要服务器部署,不需要终端知识,只需要一个手即可。 | ||
|
||
*Cayman is a Jekyll theme for GitHub Pages. You can [preview the theme to see what it looks like](http://pages-themes.github.io/cayman), or even [use it today](#usage).* | ||
好的,现在我来简单讲解以下运行方式。 | ||
|
||
![Thumbnail of Cayman](thumbnail.png) | ||
## Jekyll方面 | ||
|
||
## Usage | ||
首先本实例中使用[cayman](https://github.com/pages-themes/cayman)主题,实际上,不用Jekyll主题也一样可以实现,只不过你需要用HTML与Markdown适配,这需要另外的js库,所以不建议。 | ||
|
||
To use the Cayman theme: | ||
## 博客位置 | ||
|
||
1. Add the following to your site's `_config.yml`: | ||
对于博客来说,我们的文章需要储存到某一个特定位置,这时候创建文件夹是一个很好的方式,就像文件里面的example1和example2文件夹 | ||
|
||
```yml | ||
remote_theme: pages-themes/[email protected] | ||
plugins: | ||
- jekyll-remote-theme # add this line to the plugins list if you already have one | ||
``` | ||
![博客位置](https://i.gyazo.com/d1a338a1c3bec55acfd6208dd370b16d.png "博客位置") | ||
|
||
2. Optionally, if you'd like to preview your site on your computer, add the following to your site's `Gemfile`: | ||
接下来我们只需要将文章使用markdown形式写入这两个文件夹即可,例如在example1内有一个ex.md,那么当你访问这篇文章时,链接就会是https://your-domain.com/example1/ex,就是这个原理。 | ||
|
||
```ruby | ||
gem "github-pages", group: :jekyll_plugins | ||
``` | ||
## Python方面 | ||
|
||
## Customizing | ||
这个python实现也很简单,首先你需要在本项目目录下运行[这个文件](https://github.com/alltobebetter/Pyekyll/blob/master/deploy.py),遍历文件夹内容并给出相应markdown内容,我这么说你一定不是很明白,没关系,下面是实际演示。 | ||
|
||
### Configuration variables | ||
> 第一步:克隆到本地或您选择的云端,直接下载或者使用Git都可以,我这里用了Git | ||
Cayman will respect the following variables, if set in your site's `_config.yml`: | ||
![克隆](https://i.gyazo.com/7c423ca95afbb7042606dcda9f34c7bc.png "克隆") | ||
|
||
```yml | ||
title: [The title of your site] | ||
description: [A short description of your site's purpose] | ||
``` | ||
|
||
Additionally, you may choose to set the following optional variables: | ||
> 第二步:运行deploy.py文件 | ||
```yml | ||
show_downloads: ["true" or "false" (unquoted) to indicate whether to provide a download URL] | ||
google_analytics: [Your Google Analytics tracking ID] | ||
```python | ||
python /work/Pyekyll/deploy.py #请把这里换成您自己的路径,deploy.py里也有路径设置 | ||
``` | ||
|
||
### Stylesheet | ||
|
||
If you'd like to add your own custom styles: | ||
|
||
1. Create a file called `/assets/css/style.scss` in your site | ||
2. Add the following content to the top of the file, exactly as shown: | ||
```scss | ||
--- | ||
--- | ||
@import "{{ site.theme }}"; | ||
``` | ||
3. Add any custom CSS (or Sass, including imports) you'd like immediately after the `@import` line | ||
|
||
*Note: If you'd like to change the theme's Sass variables, you must set new values before the `@import` line in your stylesheet.* | ||
|
||
### Layouts | ||
|
||
If you'd like to change the theme's HTML layout: | ||
|
||
1. For some changes such as a custom `favicon`, you can add custom files in your local `_includes` folder. The files [provided with the theme](https://github.com/pages-themes/cayman/tree/master/_includes) provide a starting point and are included by the [original layout template](https://github.com/pages-themes/cayman/blob/master/_layouts/default.html). | ||
2. For more extensive changes, [copy the original template](https://github.com/pages-themes/cayman/blob/master/_layouts/default.html) from the theme's repository<br />(*Pro-tip: click "raw" to make copying easier*) | ||
3. Create a file called `/_layouts/default.html` in your site | ||
4. Paste the default layout content copied in the first step | ||
5. Customize the layout as you'd like | ||
|
||
### Customizing Google Analytics code | ||
|
||
Google has released several iterations to their Google Analytics code over the years since this theme was first created. If you would like to take advantage of the latest code, paste it into `_includes/head-custom-google-analytics.html` in your Jekyll site. | ||
|
||
### Overriding GitHub-generated URLs | ||
|
||
Templates often rely on URLs supplied by GitHub such as links to your repository or links to download your project. If you'd like to override one or more default URLs: | ||
|
||
1. Look at [the template source](https://github.com/pages-themes/cayman/blob/master/_layouts/default.html) to determine the name of the variable. It will be in the form of `{{ site.github.zip_url }}`. | ||
2. Specify the URL that you'd like the template to use in your site's `_config.yml`. For example, if the variable was `site.github.url`, you'd add the following: | ||
```yml | ||
github: | ||
zip_url: http://example.com/download.zip | ||
another_url: another value | ||
``` | ||
3. When your site is built, Jekyll will use the URL you specified, rather than the default one provided by GitHub. | ||
|
||
*Note: You must remove the `site.` prefix, and each variable name (after the `github.`) should be indent with two space below `github:`.* | ||
|
||
For more information, see [the Jekyll variables documentation](https://jekyllrb.com/docs/variables/). | ||
|
||
## Roadmap | ||
|
||
See the [open issues](https://github.com/pages-themes/cayman/issues) for a list of proposed features (and known issues). | ||
|
||
## Project philosophy | ||
|
||
The Cayman theme is intended to make it quick and easy for GitHub Pages users to create their first (or 100th) website. The theme should meet the vast majority of users' needs out of the box, erring on the side of simplicity rather than flexibility, and provide users the opportunity to opt-in to additional complexity if they have specific needs or wish to further customize their experience (such as adding custom CSS or modifying the default layout). It should also look great, but that goes without saying. | ||
|
||
## Contributing | ||
|
||
Interested in contributing to Cayman? We'd love your help. Cayman is an open source project, built one contribution at a time by users like you. See [the CONTRIBUTING file](docs/CONTRIBUTING.md) for instructions on how to contribute. | ||
> 第三步:查看同路径下是否出现new.md文件 | ||
### Previewing the theme locally | ||
![new](https://i.gyazo.com/460ae6954180fb3048f9fabd26417fba.png "new") | ||
|
||
If you'd like to preview the theme locally (for example, in the process of proposing a change): | ||
详细内容如下: | ||
|
||
1. Clone down the theme's repository (`git clone https://github.com/pages-themes/cayman`) | ||
2. `cd` into the theme's directory | ||
3. Run `script/bootstrap` to install the necessary dependencies | ||
4. Run `bundle exec jekyll serve` to start the preview server | ||
5. Visit [`localhost:4000`](http://localhost:4000) in your browser to preview the theme | ||
![内容](https://i.gyazo.com/91f90441a13119765700ee9479db32c5.png "内容") | ||
|
||
### Running tests | ||
> 最后 | ||
The theme contains a minimal test suite, to ensure a site with the theme would build successfully. To run the tests, simply run `script/cibuild`. You'll need to run `script/bootstrap` once before the test script will work. | ||
我们复制到index.md相应位置中,于是就实现了博客的基本链接归档,其余的您可以根据自己的情况更改,本项目可更新方面十分显著,恳求您可以pull request来使这个项目更加完好! |