This blog collects quick notes in developing jekyll notes. We also perform different general tests in this notes.

Some notes

Make entire Div Clickable:

<a href="http://example.com">
  <div class="example"> anything </div>
</a>

This is perfectly valid HTML.

In liquid, we can use composite filter. The exection order is from left to right. For example.

{% assign var = site.baseurl | append: "/page" | append: 2 | string %}

Note that { int | string } convert integer to strings.

Also, we need to find a way to write liquid in code block.

Publish github page with no jekyll

Github page only accepts specific jekyll plugins. Some plugins such as jekyll-paginate-v2 cannot be recgnized by github pages. Therefore, one way to publish github page is to publish the generated pages to Github instead of letting github complie pages online. The generated pages are in _site folder.

We should note two things when using jekyll to generate pages and publish to github:

  • in _config.yaml, set baseurl: /your-repo-name
  • include an empty file named .nojekyll in the _site folder
  • change _site to docs. Or move everything out of the _site folder.

set z-index to overlay

The dropdown menu has position: relative. However, the two column layout also have the same property. Therefore, the two column layout may overlay the dropdown menu. To solve the problem, we have two ways:

  • Set position: static to the two column layout. (May not feasible in some scenarios)
  • Set z-index of the dropdown menu higher than the two column layout.

The superscript can be written like this[1]

font matter settings

Jekyll can distinguish plural. But the reserved keyword is pluarl. So it is suggested to use pluarl. For example,

category:
- ca
- cb

is equivalent to

categories: ca cb

Note: there is no comma , when using the plural. If we want to add a category or tag with space, we need to use brackets:

tags: [ha ha, la la]

Note using double quotes does not help. For example,

tags: "ha ha"

will interprete two tags.

The same applies for tag and tags.

Check out the Jekyll docs for more info on how to get the most out of Jekyll. File all bugs/feature requests at Jekyll’s GitHub repo. If you have questions, you can ask them on Jekyll Talk.

For excerpt

We have two ways to display partial posts in the blog pages:

  • use excerpt in the front matter
  • use excerpt_separator in the front matter

For example,

excerpt: "These pre-written contents will be displayed in the blog page instead of any content in the post."
# or
excerpt_separator: <!--more-->

The second methods displays the post content before <!--more-->.

margin collaps

when we use container-all with 0 margin and 0 padding to cover the background, we may encounter a margin collapse. The container will automatically have margin. We can use a fack padding to solve this problem padding: 0.1px.

See Collapsing Margins of Block Elements

github pages

In order to use the github page domain name yuhan16.github.io, we need to create a repo with the name yuhan16.github.io. Then we go to the GitHub page settings. The page will be automatically published to this domain.

See About GitHub Pages

markup text in div and mathjax

This is a paragraph without &lt p &gt. This is a paragraph without &lt p &gt.

This is a paragraph without <p>.

This is a paragraph without <p>.

For testing

/2019/09/01/misc-tests.html

test empty link

deeplearning

Output all categories:

Miscellaneous Programming Web Optimization Probability Machine Learning

Output all tags:

jekyll, test, web, templating, html, mathjax, tutorial, static web, dynamic web, php, SSG, static site generator, css, github pages, math, shortest path, Dijkstra, notes, RLS, python, practice, venv, virtualenv, git, pip, string, packaging, requirements, pyproject, setuptools, exception, numpy, scipy, MDP, RL, parallelization, parallel computing, collocation, trajectory optimization, optimization, control,

Output all filtered tags:

'jekyll', 'test', 'web', 'templating', 'html', 'mathjax', 'tutorial', 'static-web', 'dynamic-web', 'php', 'ssg', 'static-site-generator', 'css', 'github-pages', 'math', 'shortest-path', 'dijkstra', 'notes', 'rls', 'python', 'practice', 'venv', 'virtualenv', 'git', 'pip', 'string', 'packaging', 'requirements', 'pyproject', 'setuptools', 'exception', 'numpy', 'scipy', 'mdp', 'rl', 'parallelization', 'parallel-computing', 'collocation', 'trajectory-optimization', 'optimization', 'control',

h1 title

h2 title

h2 title

h3 title

h3 title

h4 title

This is a paragraph.

$x_t$, $x^\ast_t$ $y^\star_t$,

Now we let $\bar{y}_i (w^\ast_m) = y_i - f(x_i, w^\ast_m) + \nabla_w f(x_i, w^\ast_m)^T w^\ast_m$ and $\bar{x}_i (w^\ast_m) = \nabla_w f(x_i,w^\ast_m)$. We can formulate a new data matrix $\bar{Y}_m(w^\ast_m)$ and $\bar{X}_m (w^\ast_m)$. At step $m+1$, we receive $(x_{m+1}, y_{m+1})$