misc tests
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, setbaseurl: /your-repo-name - include an empty file named
.nojekyllin the_sitefolder - change
_sitetodocs. Or move everything out of the_sitefolder.
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: staticto the two column layout. (May not feasible in some scenarios) - Set
z-indexof 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.
link in markdown
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
excerptin the front matter - use
excerpt_separatorin 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.
markup text in div and mathjax
This is a paragraph without <p>.
This is a paragraph without <p>.
For testing
/2019/09/01/misc-tests.html
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.
- abc
- fjdjfdk
$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})$