What is Mermaid? Mermaid is a sequence diagram generator written in JavaScript.
https://github.com/mermaid-js/mermaid
Not only sequence diagrams, but Mermaid can also generate simple graphs.
Sequence diagram Here is the simple snippet for beginners (slightly changed from official sample).
Mainroad syntax:
sequenceDiagram participant Alice participant Bob Alice->>Bob: Hello John, how are you? Bob-->>Alice: Great! sequenceDiagram: I want to draw sequenceDiagram participant Alice: There is a member of our protocol whose name is Alice.
I think my solution here is not the best way to use Mermaid in Hugo.
What is Mermaid? Mermaid is a sequence diagram generator written in Javascript.
https://github.com/mermaid-js/mermaid
Not only sequence diagrams, Mermaid can also generate simple graphs.
Enabling Mermaid in Hugo - use mermaid-cli Failures I tried two patterns but I failed both cases.
Make a template in the theme Mainroad. I’ve Tried to copy MathJax template but failed. But this is the simplest and useful, so I need to study Hugo more.
Before installing via pip (in WSL) sudo apt install libffi-dev Debugging step by step Run a playbook with option --step.
Pipe (|) in variable It is called “filter”.
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#product-filters
when, and, or, not https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html
Group restriction If you have a large amount of servers in inventories, -l option can restrict the target of playbook.
-l Server_group_name -l FQDN What ever the system use systemd or initd When your environment has different OSs, systemd module doesn’t work sometimes.
Tips - Change the template which generated by hugo new You can define a template in the file archetypes/default.md.
Here is my sample.
--- title: "{{ replace .Name "-" " " | title }}" date: {{ .Date }} categories: - "Draft" tags: - "dummy_tag" isCKJLanguage: false mathjax: false comments: false draft: true ---
Most of the information on this page is in the official document.
https://themes.gohugo.io/mainroad/
This post is a personal memo to remind me of what I did.
Main page It “specifies section pages to show on home page and the “Recent articles” widget.” The following config line shows content/general and content/hugo category on our main page.
[Params] mainSections = ["general", "hugo"] Add Google Analytics Mainroad theme supports Google Analytics as default, so you don’t need to input the JavaScript in the template manually.
Highlight codes in Hugo - It’s changed Old Hugo Around a year ago (2019), we need to configure pygments in order to highlight codes in code block. Here are sample lines in config.toml file.
... pygmentsCodefences = true pygmentsCodefencesGuessSyntax = true pygmentsStyle = "monokai" ... Latest Hugo (2020) At the new version Hugo in 2020, Hugo officially supports code highlight as a default as a default.
Official syntax highlighting: https://gohugo.io/content-management/syntax-highlighting/#highlighting-in-code-fences
Hugo is a static web site generator. I use Hugo to make this page (see general->impress).
Caution I wouldn’t recommend this method if you want to upgrade hugo continuously.
Install TL;DR If you are Go-lang user, please go next section. Unless, I highly recommend you, who just want to use Hugo features (not Go), to install as follows (official says “Install Hugo from Tarball”).
curl -sSL https://github.com/gohugoio/hugo/releases/download/v0.97.3/hugo_0.97.3_Linux-64bit.tar.gz -o hugo.tar.gz tar xvfz hugo.
About me Hi. I’m atlex and working on IT field. This web page is my memo.
I’ve tried lots of memo tools, e.g. local Markdown, Sphinx Document builder, Evernote, etc…. But I realized that I’ve always used these tools for IT technical memo. I’ve written diaries, grumblings, and daily ToDos IN PAPER WITH MY FOUNTAIN PENS because writing these things down on a paper makes me relax.
My conclusion is, for personal snippets and memos, the blog is the best way to write, manage, and find them.
update-rc.d updates the System V style init script links /etc/rcrunlevel.d/NNname whose target is the script /etc/init.d/name.
To set the start and kill priority we simply add them to the above update-rc.d command with the start priority first, followed by the kill priority.
update-rc.d apache2 defaults [START] [KILL] The below command will start mysql first, then apache2. On shutdown, the kill will be the reverse of the start with apache2 being killed first and mysql second.