Skip to content

Commit 696b1f5

Browse files
committed
Update blog post: 2020-04-13-post-template. Update text code blocks format. Use code font Roboto Mono as default. Update README.md
1 parent 0bf27c8 commit 696b1f5

File tree

6 files changed

+63
-10
lines changed

6 files changed

+63
-10
lines changed

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ If you wish to use the Jekyll theme of this website, please follow the guideline
3030

3131
1. Please give credit by starring [this project](https://github.com/liuyxpp/liuyxpp.github.io) and/or display this line on your website: <q>This website is powered by [LYX Jekyll theme](https://github.com/liuyxpp/liuyxpp.github.io)</q>.
3232
2. Remove all personal materials and personal information about me (Yi-Xin Liu).
33-
3. Remove all the contents in the following directories: `_posts`, `_drafts`, `_data`, `_site`, `CV`, `downloads`, `images`, `publications`, `research`, and `software`.
33+
3. Remove all the contents in the following directories: `_posts`, `_drafts`, `_data`, `_site`, `downloads`, `images`, and `pages`.
3434
4. Modify the configuration file `_config.yml` to add your own personal information.
3535
5. Add your contents.
36-
6. Publish your website.
36+
6. You can add your own per category page at `blog/category` by editing the sample pages. Just remove all `.md` files if you don't want any per category page.
37+
7. Publish your website.
38+
39+
A Sample blog post/template can be found at `_posts/2020-04-13-post-template.md`. It also includes some guidelines to write blog posts with this Jekyll theme. You can read it [here]({% post_url 2020-04-13-post-template.md %}).
3740

3841
## Important Notice
3942

_includes/head.html

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,15 @@
5353
<script src="{{ site.url }}/assets/js/vendor/modernizr-2.6.2.custom.min.js"></script>
5454

5555
<!-- Custom Fonts -->
56-
<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic" rel="stylesheet" type="text/css">
56+
<!-- For headings -->
57+
<link href="//fonts.googleapis.com/css?family=Lato:700&display=swap" rel="stylesheet" type="text/css">
5758
<!-- <link href='//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'> -->
5859
<!-- <link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'> -->
5960
<!-- <link href="https://fonts.googleapis.com/css?family=Noto+Serif:400,400i,700&display=swap" rel="stylesheet"> -->
61+
<!-- For site logo -->
6062
<link href='http://fonts.googleapis.com/css?family=Viga|Ubuntu:700' rel='stylesheet' type='text/css'>
63+
<!-- For codes -->
64+
<!-- <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,400i&display=swap" rel="stylesheet"> -->
6165
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
6266

6367
<!-- Icons -->

_posts/2020-04-13-post-template.md

+19-4
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,21 @@ struct GeneralizedPeak <: ScatteringPeak
135135
end
136136
{% endhighlight %}
137137

138-
`Output` as `Markdown` syntax highlighting using fencing blocks:
138+
The output by running previous code block is formatted as language `text` whose syntax highlighting using fencing blocks:
139139

140-
{% highlight markdown linenos %}
140+
```
141+
Translation{Float64}([1.0, 2.0, 3.0])
142+
```
143+
144+
The output syntax highlighting using Liquid fencing blocks:
145+
146+
{% highlight text linenos %}
141147
Translation{Float64}([1.0, 2.0, 3.0])
142148
{% endhighlight %}
143149

144-
`Console` syntax highlighting using fencing code blocks
150+
Note that the appearance is different from fencing blocks because `<pre>` is the parent of `<code data-lang=text>`. We can not select the `<pre>` to markup using `CSS` rules.
151+
152+
`Console` syntax highlighting using fencing code blocks:
145153

146154
```console?lang=julia
147155
julia> f(x, y) = x + y
@@ -151,7 +159,7 @@ julia> f(3, 4)
151159
7
152160
```
153161

154-
`Console` syntax highlighting using Liquid code blocks
162+
`Console` syntax highlighting using Liquid code blocks:
155163

156164
{% highlight console linenos %}
157165
julia> f(x, y) = x + y
@@ -171,6 +179,13 @@ Note that since we can not set the `lang=julia` as in fencing code blocks, the L
171179
* Fencing code blocks' ticks can be output like this: ````<code>```</code>```` &rarr; <code>```</code>.
172180
* Don't be lazy with `alternative`/`code`/`formatting`.
173181

182+
## Links
183+
184+
* External links: the [github](https://github.com).
185+
* Internal pages: the [Research page](/research/).
186+
* Internal blog posts: [Julia in Practice: Building Scattering.jl from Scratch (1)]({% post_url 2020-03-19-scattering-1 %}).
187+
* In-page links: [Heading](#heading)
188+
174189
## Images
175190

176191
* Centered: use `.center`

_sass/_page.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ header .entry-meta {
291291
}
292292
}
293293
div.highlighter-rouge {
294-
margin: 0;
294+
//margin: 0;
295295
padding-top: 10px;
296296
padding-bottom: 10px;
297297
}

_sass/_syntax.scss

+29-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
div.highlighter-rouge,
1212
figure.highlight {
1313
position: relative;
14-
margin-bottom: 1em;
14+
margin-bottom: 16px;
1515
line-height: 1.8;
1616
border-radius: 3;
1717

@@ -29,6 +29,21 @@ figure.highlight {
2929
color: $lang-color;
3030
font-size: 12px;
3131
}
32+
&[data-lang=text] {
33+
background-color: $text-lang-bg-color;
34+
tr {
35+
background-color: $text-lang-bg-color;
36+
&:hover {
37+
background-color: $gray-lighter;
38+
td, pre {
39+
background-color: $gray-lighter;
40+
}
41+
}
42+
}
43+
pre {
44+
background-color: $text-lang-bg-color;
45+
}
46+
}
3247
}
3348
}
3449

@@ -213,6 +228,7 @@ div.language-yaml {
213228
div.language-text {
214229
position: relative;
215230
pre.highlight {
231+
background-color: $text-lang-bg-color;
216232
padding: 14px;
217233
&::before {
218234
content: "text";
@@ -223,6 +239,18 @@ div.language-text {
223239
font-size: 12px;
224240
}
225241
}
242+
tr {
243+
background-color: $text-lang-bg-color;
244+
&:hover {
245+
background-color: $gray-lighter;
246+
td, pre {
247+
background-color: $gray-lighter;
248+
}
249+
}
250+
}
251+
pre {
252+
background-color: $text-lang-bg-color;
253+
}
226254
}
227255

228256
/* Hack: mobile browser no border */

_sass/_variables.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
$base-font: -apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
66
$heading-font: 'Lato','Open Sans','Helvetica Neue',Helvetica,Calibri,Arial,sans-serif;
77
$caption-font: 'Lato','Open Sans','Helvetica Neue',Helvetica,Calibri,Arial,sans-serif;
8-
$code-font: "Monaco","Inconsolata","DejaVu Sans Mono","Andale Mono WT","Andale Mono","Courier New",Courier,monospace;
8+
$code-font: "Roboto Mono","Monaco","Inconsolata","DejaVu Sans Mono","Andale Mono WT","Andale Mono","Courier New",Courier,monospace;
99
$alt-font: serif;
1010
$site-title-font: 'Viga', $heading-font;
1111

@@ -58,7 +58,10 @@ $danger : $alizarin;
5858
$info: $peter-river;
5959

6060
/* syntax highlighting */
61+
// for display language name on the upper right corner of the code block panel
6162
$lang-color: $gray;
63+
// only for language text/plaintext, background color of the code block panel
64+
$text-lang-bg-color: lighten($wet-asphalt, 66%);
6265

6366
$base-color: $black-almost;
6467
$body-color: $white-almost;

0 commit comments

Comments
 (0)