Browse Source

Initial Commit

master
Sarah Jamie Lewis 1 month ago
commit
c4b3b9005a
100 changed files with 3421 additions and 0 deletions
  1. 3
    0
      .idea/.gitignore
  2. 9
    0
      .idea/cwtch-docs.iml
  3. 7
    0
      .idea/inspectionProfiles/Project_Default.xml
  4. 6
    0
      .idea/misc.xml
  5. 8
    0
      .idea/modules.xml
  6. 7
    0
      .idea/vcs.xml
  7. 6
    0
      archetypes/default.md
  8. 8
    0
      config.toml
  9. 6
    0
      content/_index.md
  10. 4
    0
      content/architecture/_index.md
  11. 10
    0
      content/architecture/anonymizing-communication-networks.md
  12. 5
    0
      content/architecture/groups.md
  13. 66
    0
      content/architecture/overview.md
  14. 39
    0
      content/architecture/peer-to-peer.md
  15. 19
    0
      content/architecture/untrusted-infrastructure.md
  16. 5
    0
      content/contributing/_index.md
  17. 8
    0
      content/contributing/checklist.md
  18. 8
    0
      content/research/_index.md
  19. 7
    0
      content/research/token-based-services.md
  20. 1
    0
      resources/_gen/assets/js/search-data.js_e302c8c7accf6faf255a3bba2272a0aa.content
  21. 1
    0
      resources/_gen/assets/js/search-data.js_e302c8c7accf6faf255a3bba2272a0aa.json
  22. 5
    0
      resources/_gen/assets/js/search.js_9c51d69b801919ae36e3d128f11c048d.content
  23. 1
    0
      resources/_gen/assets/js/search.js_9c51d69b801919ae36e3d128f11c048d.json
  24. 1
    0
      resources/_gen/assets/scss/book.scss_50fc8c04e12a2f59027287995557ceff.content
  25. 1
    0
      resources/_gen/assets/scss/book.scss_50fc8c04e12a2f59027287995557ceff.json
  26. 26
    0
      themes/hugo-theme-techdoc/.editorconfig
  27. 2
    0
      themes/hugo-theme-techdoc/.gitignore
  28. 20
    0
      themes/hugo-theme-techdoc/LICENSE.md
  29. 255
    0
      themes/hugo-theme-techdoc/README.md
  30. 10
    0
      themes/hugo-theme-techdoc/archetypes/default.md
  31. 72
    0
      themes/hugo-theme-techdoc/exampleSite/config.toml
  32. 25
    0
      themes/hugo-theme-techdoc/exampleSite/content/_index.md
  33. 17
    0
      themes/hugo-theme-techdoc/exampleSite/content/about.md
  34. 11
    0
      themes/hugo-theme-techdoc/exampleSite/content/archives/hello_world.md
  35. 11
    0
      themes/hugo-theme-techdoc/exampleSite/content/archives/hello_world1.md
  36. 11
    0
      themes/hugo-theme-techdoc/exampleSite/content/archives/hello_world2.md
  37. 11
    0
      themes/hugo-theme-techdoc/exampleSite/content/blog/hello_world.md
  38. 11
    0
      themes/hugo-theme-techdoc/exampleSite/content/blog/hello_world1.md
  39. 11
    0
      themes/hugo-theme-techdoc/exampleSite/content/blog/hello_world2.md
  40. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter1/1.md
  41. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter1/2.md
  42. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter1/3.md
  43. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter1/4.md
  44. 8
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter1/_index.md
  45. 8
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter2/1.md
  46. 8
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter2/2.md
  47. 8
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter2/3.md
  48. 8
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter2/4.md
  49. 8
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter2/_index.md
  50. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter3/1.md
  51. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter3/3.md
  52. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter3/4.md
  53. 8
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter3/_index.md
  54. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter3/chapter3-2/1.md
  55. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter3/chapter3-2/2.md
  56. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter3/chapter3-2/3.md
  57. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter3/chapter3-2/4.md
  58. 7
    0
      themes/hugo-theme-techdoc/exampleSite/content/chapter3/chapter3-2/_index.md
  59. 11
    0
      themes/hugo-theme-techdoc/exampleSite/content/entry/hello_world.md
  60. 11
    0
      themes/hugo-theme-techdoc/exampleSite/content/entry/hello_world1.md
  61. 11
    0
      themes/hugo-theme-techdoc/exampleSite/content/entry/hello_world2.md
  62. 22
    0
      themes/hugo-theme-techdoc/exampleSite/content/getting-started/_index.md
  63. 134
    0
      themes/hugo-theme-techdoc/exampleSite/content/getting-started/configuration.md
  64. 35
    0
      themes/hugo-theme-techdoc/exampleSite/content/getting-started/installation.md
  65. 24
    0
      themes/hugo-theme-techdoc/exampleSite/content/getting-started/screenshot.md
  66. 8
    0
      themes/hugo-theme-techdoc/exampleSite/content/hello_world.md
  67. 1150
    0
      themes/hugo-theme-techdoc/exampleSite/content/post/creating-a-new-theme.md
  68. 344
    0
      themes/hugo-theme-techdoc/exampleSite/content/post/goisforlovers.md
  69. 89
    0
      themes/hugo-theme-techdoc/exampleSite/content/post/hugoisforlovers.md
  70. 156
    0
      themes/hugo-theme-techdoc/exampleSite/content/post/migrate-from-jekyll.md
  71. 12
    0
      themes/hugo-theme-techdoc/exampleSite/content/posts/hello_world.md
  72. 96
    0
      themes/hugo-theme-techdoc/exampleSite/content/sample/_index.md
  73. 44
    0
      themes/hugo-theme-techdoc/exampleSite/content/sample/build-in-shortcodes.md
  74. 58
    0
      themes/hugo-theme-techdoc/exampleSite/content/sample/custom-shortcodes.md
  75. 101
    0
      themes/hugo-theme-techdoc/exampleSite/content/sample/table-of-contents.md
  76. BIN
      themes/hugo-theme-techdoc/exampleSite/static/images/pexels-photo-196666.jpeg
  77. 115
    0
      themes/hugo-theme-techdoc/gulpfile.js
  78. BIN
      themes/hugo-theme-techdoc/images/screenshot-edit-link.png
  79. BIN
      themes/hugo-theme-techdoc/images/screenshot-open-menu.png
  80. BIN
      themes/hugo-theme-techdoc/images/screenshot-slide-menu.gif
  81. BIN
      themes/hugo-theme-techdoc/images/screenshot-theme-color.png
  82. BIN
      themes/hugo-theme-techdoc/images/screenshot.png
  83. BIN
      themes/hugo-theme-techdoc/images/tn.png
  84. 3
    0
      themes/hugo-theme-techdoc/layouts/404.html
  85. 27
    0
      themes/hugo-theme-techdoc/layouts/_default/baseof.html
  86. 6
    0
      themes/hugo-theme-techdoc/layouts/_default/list.html
  87. 7
    0
      themes/hugo-theme-techdoc/layouts/_default/single.html
  88. 4
    0
      themes/hugo-theme-techdoc/layouts/blog/li.html
  89. 8
    0
      themes/hugo-theme-techdoc/layouts/blog/list.html
  90. 4
    0
      themes/hugo-theme-techdoc/layouts/blog/single.html
  91. 5
    0
      themes/hugo-theme-techdoc/layouts/blog/summary.html
  92. 15
    0
      themes/hugo-theme-techdoc/layouts/index.html
  93. 0
    0
      themes/hugo-theme-techdoc/layouts/partials/content-footer.html
  94. 6
    0
      themes/hugo-theme-techdoc/layouts/partials/custom-css.html
  95. 0
    0
      themes/hugo-theme-techdoc/layouts/partials/custom-head.html
  96. 5
    0
      themes/hugo-theme-techdoc/layouts/partials/edit-meta.html
  97. 3
    0
      themes/hugo-theme-techdoc/layouts/partials/edit-page.html
  98. 11
    0
      themes/hugo-theme-techdoc/layouts/partials/footer.html
  99. 22
    0
      themes/hugo-theme-techdoc/layouts/partials/global-menu.html
  100. 0
    0
      themes/hugo-theme-techdoc/layouts/partials/head.html

+ 3
- 0
.idea/.gitignore View File

@@ -0,0 +1,3 @@

# Default ignored files
/workspace.xml

+ 9
- 0
.idea/cwtch-docs.iml View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

+ 7
- 0
.idea/inspectionProfiles/Project_Default.xml View File

@@ -0,0 +1,7 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="Stylelint" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>

+ 6
- 0
.idea/misc.xml View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

+ 8
- 0
.idea/modules.xml View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/cwtch-docs.iml" filepath="$PROJECT_DIR$/.idea/cwtch-docs.iml" />
</modules>
</component>
</project>

+ 7
- 0
.idea/vcs.xml View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/themes/hugo-theme-techdoc" vcs="Git" />
</component>
</project>

+ 6
- 0
archetypes/default.md View File

@@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---


+ 8
- 0
config.toml View File

@@ -0,0 +1,8 @@
baseURL = "http://example.org/"
languageCode = "en-us"
title = "Cwtch"
theme = "hugo-theme-techdoc"

[Params]

menu_style = "open-menu"

+ 6
- 0
content/_index.md View File

@@ -0,0 +1,6 @@
---
title: "Cwtch"
weight: 100
---

Cwtch!

+ 4
- 0
content/architecture/_index.md View File

@@ -0,0 +1,4 @@
---
title: "Architecture"
weight: 2
---

+ 10
- 0
content/architecture/anonymizing-communication-networks.md View File

@@ -0,0 +1,10 @@
---
title: "Anonymizing Communication Networks"
date: 2020-01-06T12:09:14-08:00
weight: 500
---

In order to realize many of the desirable properties outlined in our [goals](/architecture/overview) Cwtch depends on
running on top of an anonymous communication network.

For now only [Tor](https://torproject.org) version 3 onion address have been implemented.

+ 5
- 0
content/architecture/groups.md View File

@@ -0,0 +1,5 @@
---
title: "Groups"
date: 2020-01-06T12:09:14-08:00
weight: 175
---

+ 66
- 0
content/architecture/overview.md View File

@@ -0,0 +1,66 @@
---
title: "Overview"
date: 2020-01-06T12:09:14-08:00
weight: 100
---


This section describes the metadata resistance model addressed by Cwtch. It first describes the problem and enumerates the properties of an ideal solution.

## Metadata Resistance

It is important to identify and understand that metadata is ubiquitous in communication protocols. However, information that is used to facilitate communication between peers and servers is also highly relevant to adversaries wishing to exploit such information

For our purposes, we will assume that the content of a communication is encrypted in such a way that an adversary is practically unable to break, and as such will limit our scope to the context of a communication (i.e. the metadata).

We seek to protect the following communication contexts, from all adversaries (including supporting infrastructure):

* **Who** is involved in a communication? It may be possible to identify people or simply device or network identifiers. E.g., ``this communication involves Alice, a journalist, and Bob a government employee.''.
* **Where** are the participants of the conversation? E.g., ``during this communication Alice was in France and Bob was in Canada.'' - Using communications metadata to track the location of users is well studied.
* **When** did a conversation take place? The timing and length of communication can reveal a large amount about the nature of a call, e.g., ``Bob a government employee, talked to Alice on the phone for an hour yesterday evening. This is the first time they have communicated.''
* **How** was the conversation mediated? Whether a conversation took place over an encrypted or unencrypted email can provide useful intelligence. E.g., ``Alice sent an encrypted email to Bob yesterday, whereas they usually only send plaintext emails to each other.''
* **What** is the conversation about? Even if the content of the communication is encrypted it is sometimes possible to derive a probable context of a conversation without knowing exactly what is said, e.g. ``a person called a pizza store at dinner time'' or ``someone called a known suicide hotline number at 3am.''

Beyond individual conversations, we also seek to defend against context correlation attacks, whereby multiple conversations are analyzed to derive higher level information:

* **Relationships**: Discovering social relationships between a pair of entities by analyzing the frequency and length of their communications over a period of time. E.g. Carol and Eve call each other every single day for multiple hours at a time.
* **Cliques**: Discovering social relationships between a group of entities that all interact with each other. E.g. Alice, Bob and Eve all communicate with each other.
* **Loosely Connected Cliques and Bridge Individuals**: Discovering groups that communicate to each other through intermediaries by analyzing communication chains (e.g. everytime Alice talks to Bob she talks to Carol almost immediately after; Bob and Carol never communicate.)
* **Pattern of Life**: Discovering which communications are cyclical and predictable. E.g. Alice calls Eve every Monday evening for around an hour.


# Centralized Servers

The vast majority of communication protocols rely on centralized servers to handle routing, and otherwise facilitate communications. Even if participants were to trust such a server unilaterally, that does not solve the metadata analysis problem.

An adversary who is able to observe traffic between each participant and the centralized server will likely be able to perform statistical correlation and reconstruct the routing table of the server -- even if communication between the server and the participants is encrypted.

Such an adversary would likely be able to derive much of the metadata we have described above.

The Tor Network provides some degree of protection from this kind of metadata analysis: a (non-global) adversary cannot simply observe communication between participants because traffic is obfuscated by onion routing. Other anonymization networks such as i2p provide similar properties.

However, even if we were to ensure all communication took place over an anonymizing network, the centralized server still holds a wealth of information regarding relationships between participants. In order to provide metadata-resistance we must eliminate the need for the centralized server to be aware of this information.

# Goals

To motivate our work we define the properties that any solution to the metadata resistance problem should have. For this we will rely on definitions provided by a previous systemization of secure messaging properties by Unger et al..

Any modern, secure messaging solution must provide **Confidentiality**, **Integrity** and **Authentication**.

As mentioned in our introduction and problem statement we require any solution be **Asynchronous** and provide **Multi-Device Support**.

For this paper we will separate the concepts of **Asynchronous Key-Exchange** and **Asynchronous Conversation**, focusing on achieving **Asynchronous Conversation**. We will discuss **Asynchronous Key-Exchange** further in Section 6.

We define that any metadata resistant system must be **Anonymity Preserving**, providing **Sender Anonymity**, **Recipient Anonymity**, **Participation Anonymity** and **Unlinkability** between protocol messages belonging to the same conversation.

In an adversarial environment requiring metadata protection we must provide mechanisms for both **Forward Secrecy** and **Backward Secrecy**, such that compromise of key material does not enable decryption of previous or succeeding data.

For group application the properties of **Participant Consistency**, **Speaker Consistency** and **Destination Validation** are necessary to ensure a cryptographically secure and **Global Transcript**, and as such be **Causality Preserving**.

Some properties of secure group communications are ostensibly desired, but also difficult to implement in a way that does not compromise usability in a decentralized, metadata resistant environment. **Computational Equality** and **Trust Equality** require a substantial amount of pairwise communication in a group context, the overhead for which is costly in an environment where there may be high latency and low (or no) availability between some participants.

Additionally, while the properties of **Contractible Membership** and **Expandable Membership** potentially reduce the overhead of group management in such an environment, we will not consider them in our solution, because they are generally only achievable with the same communication symmetry necessary to achieve computational and trust equality, and the aforementioned overhead of such algorithms is not desirable

Finally we will state usability criteria for any solution. Taking into account the networking environment and the likelihood of dropped or delayed packets, we require any solution to be **Out-of-Order Resilient** and **Dropped Message Resilient**.



+ 39
- 0
content/architecture/peer-to-peer.md View File

@@ -0,0 +1,39 @@
---
title: "Peer to Peer Infrastructure"
date: 2020-01-06T12:09:14-08:00
weight: 150
---

In an ideal setting all communication could be done point to point, or peer to peer. Cwtch relies on peer to peer
connections (facilitated by an [ACN](/architecture/anonymizing-communication-networks/)) for many privacy properties.

## Peer Identity

Each peer is identified by a specific public key. At the time of writing only ed25519 public keys that are encoded as,and are valid, Tor
hostnames are valid Cwtch identifiers. They look like this:

`g4rdu7cajgb444minvsk2bii7lkne6cmlhiibtx3pnozbiszjp55qvid`

Optionally, users can provide a name that is prepended to the start of the address e.g.

`sarah~g4rdu7cajgb444minvsk2bii7lkne6cmlhiibtx3pnozbiszjp55qvid`

## Peer Authentication

A Cwtch peer can both accept new inbound connections from other peers and make outgoing connections to other peers. Cwtch
peers listen and connect to port `9878`.

After a connection is initialized, both peers engage in an authentication protocol. At the time of writing only
one type of authentication is support in Cwtch - [a triple diffie hellman handshake involving the public keys of both peers](https://git.openprivacy.ca/cwtch.im/tapir/src/branch/master/applications/auth.go).

The authentication protocol is outlined as follows:

1. Each peer generates an additional ephemeral key pair.
2. Each peer sends their identity & ephemeral public keys to the other.
3. Each peer perform the triple-diffie-hellman exchange and derives an session key
4. Each peer encrypts a [transcript](/architecture/transcripts)-derived challenge with the session key.
5. Each peer verifies the challenge, if both succeed then the session key is used to encrypt all further communication for the session.





+ 19
- 0
content/architecture/untrusted-infrastructure.md View File

@@ -0,0 +1,19 @@
---
title: "Untrusted Infrastructure"
date: 2020-01-06T12:09:14-08:00
weight: 200
---

In order to provide offline messaging Cwtch relies on *untrusted infrastructure*. This section will outline the model
that we use to define and implement such infrastructure.

Let us start by laying out our ideal infrastructure.

* Untrusted Infrastructure may be used by multiple groups or just one.
* Untrusted Infrastructure, without collaboration of a group member, should never learn the identity of participants within a group.
* Untrusted Infrastructure, should never learn the content of any communication.
* Untrusted Infrastructure should never be able to distinguish messages as belonging to a particular group.





+ 5
- 0
content/contributing/_index.md View File

@@ -0,0 +1,5 @@
---
title: "Contributing"
weight: 3
---


+ 8
- 0
content/contributing/checklist.md View File

@@ -0,0 +1,8 @@
---
title: "Contributor Checklist"
weight: 2
---

<input type="checkbox"/> Sign up for an account on our [gitea instance](https://git.openprivacy.ca/)



+ 8
- 0
content/research/_index.md View File

@@ -0,0 +1,8 @@
---
title: "Research"
weight: 2
---

In this section we will document a number of ongoing and previous research into various aspect of Cwtch & Metadata Resistant Services.

Where such research has been incorporated into Cwtch, it will also be documented in [Archiecture](/architecture)

+ 7
- 0
content/research/token-based-services.md View File

@@ -0,0 +1,7 @@
---
title: "Token Based Services"
date: 2020-01-06T12:09:14-08:00
weight: 100
---

Paper: [Towards Anonymous Prepaid Services](https://openprivacy.ca/assets/towards-anonymous-prepaid-services.pdf)

+ 1
- 0
resources/_gen/assets/js/search-data.js_e302c8c7accf6faf255a3bba2272a0aa.content
File diff suppressed because it is too large
View File


+ 1
- 0
resources/_gen/assets/js/search-data.js_e302c8c7accf6faf255a3bba2272a0aa.json View File

@@ -0,0 +1 @@
{"Target":"en.search-data.min.1076bd0a0383cecd7bb8c3ff699ef0f25f870944c254b156d58e08d45c9bcbe7.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-EHa9CgODzs17uMP/aZ7w8l+HCUTCVLFW1Y4I1Fyby+c="}}

+ 5
- 0
resources/_gen/assets/js/search.js_9c51d69b801919ae36e3d128f11c048d.content View File

@@ -0,0 +1,5 @@
'use strict';(function(){const input=document.querySelector('#book-search-input');const results=document.querySelector('#book-search-results');input.addEventListener('focus',init);input.addEventListener('keyup',search);function init(){input.removeEventListener('focus',init);input.required=true;loadScript('/flexsearch.min.js');loadScript('/en.search-data.min.1076bd0a0383cecd7bb8c3ff699ef0f25f870944c254b156d58e08d45c9bcbe7.js',function(){input.required=false;search();});}
function search(){while(results.firstChild){results.removeChild(results.firstChild);}
if(!input.value){return;}
const searchHits=window.bookSearchIndex.search(input.value,10);searchHits.forEach(function(page){const li=document.createElement('li'),a=li.appendChild(document.createElement('a'));a.href=page.href;a.textContent=page.title;results.appendChild(li);});}
function loadScript(src,callback){const script=document.createElement('script');script.defer=true;script.async=false;script.src=src;script.onload=callback;document.head.appendChild(script);}})();

+ 1
- 0
resources/_gen/assets/js/search.js_9c51d69b801919ae36e3d128f11c048d.json View File

@@ -0,0 +1 @@
{"Target":"en.search.min.0e1d15c01178583597559efac7e98af11996aa69adafb5e47d2083b5d0dc1de8.js","MediaType":"application/javascript","Data":{"Integrity":"sha256-Dh0VwBF4WDWXVZ76x+mK8RmWqmmtr7XkfSCDtdDcHeg="}}

+ 1
- 0
resources/_gen/assets/scss/book.scss_50fc8c04e12a2f59027287995557ceff.content
File diff suppressed because it is too large
View File


+ 1
- 0
resources/_gen/assets/scss/book.scss_50fc8c04e12a2f59027287995557ceff.json View File

@@ -0,0 +1 @@
{"Target":"book.min.3845c1ae899a405406825dbb3c2fa5af1c34611bc5c58551ef3037392844503d.css","MediaType":"text/css","Data":{"Integrity":"sha256-OEXBromaQFQGgl27PC+lrxw0YRvFxYVR7zA3OShEUD0="}}

+ 26
- 0
themes/hugo-theme-techdoc/.editorconfig View File

@@ -0,0 +1,26 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 2

[{*.html,*.js}]
indent_style = space

[{package.json,*.yml}]
indent_style = space
indent_size = 2

[{composer.json,*.toml}]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false

+ 2
- 0
themes/hugo-theme-techdoc/.gitignore View File

@@ -0,0 +1,2 @@
.DS_Store
node_modules

+ 20
- 0
themes/hugo-theme-techdoc/LICENSE.md View File

@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2017- Thingsym

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 255
- 0
themes/hugo-theme-techdoc/README.md View File

@@ -0,0 +1,255 @@
# Hugo Theme Techdoc

The Techdoc is a Hugo Theme for technical documentation.

![The Techdoc screenshot](https://raw.githubusercontent.com/thingsym/hugo-theme-techdoc/master/images/screenshot.png)

## Features

* Modern, Simple layout
* Responsive web design
* Documentation menu (Select Menu style)
* Table Of Contents for the page (selective)
* Theme color
* Edit link to documentation repository
* Custom Shortcodes
* Open Graph
* Analytics with Google Analytics, Google Tag Manager

## Screenshot

### Theme color

![Theme color](https://raw.githubusercontent.com/thingsym/hugo-theme-techdoc/master/images/screenshot-theme-color.png)

### Menu style

#### Open Menu

![Open Menu](https://raw.githubusercontent.com/thingsym/hugo-theme-techdoc/master/images/screenshot-open-menu.png)

#### Slide Menu

![Slide Menu](https://raw.githubusercontent.com/thingsym/hugo-theme-techdoc/master/images/screenshot-slide-menu.gif)

### Edit link

![Edit link](https://raw.githubusercontent.com/thingsym/hugo-theme-techdoc/master/images/screenshot-edit-link.png)

## Getting Started

### Download Hugo theme

If you have git installed, you can do the following at the command-line-interface within the Hugo directory:

```
cd themes
git clone https://github.com/thingsym/hugo-theme-techdoc.git
```

For more information read [the Hugo documentation](https://gohugo.io/themes/installing-and-using-themes/).

### Configure

You may specify options in config.toml (or config.yaml/config.json) of your site to make use of this theme's features.

For an example of `config.toml`, [config.toml](https://github.com/thingsym/hugo-theme-techdoc/blob/master/exampleSite/config.toml) in exampleSite.

### Directory layout

```
archetypes
|- default.md
exampleSite
|- config.toml
|- ...
images
|- screenshot.png
|- tn.png
|- ...
layouts
|- index.html
|- 404.html
|- _default
| |- baseof.html
| |- list.html
| |- single.html
|- blog
| |- li.html
| |- list.html
| |- single.html
| |- summary.html
|- partials
| |- content-footer.html
| |- custom-head.html
| |- edit-meta.html
| |- edit-page.html
| |- footer.html
| |- global-menu.html
| |- head.html
| |- last-updated.html
| |- menu
| | |- open-menu.html
| | |- slide-menu.html
| |- meta
| | |- chroma.html
| | |- google-analytics-async.html
| | |- google-site-verification.html
| | |- metatag-manager.html
| |- notification.html
| |- pagination.html
| |- powered.html
| |- prepend-body.html
| |- sidebar-footer.html
| |- sidebar.html
| |- site-header.html
| |- table-of-contents.html
|- posts
| |- list.html
| |- single.html
|- shortcodes
|- button.html
|- panel.html
node_modules
resources
src
|- js
| |- jquery.backtothetop
| |- functions.js
| |- main.js
|- scss
|- foundation
| |- _element.scss
| |- _normalize.scss
| |- _reset.scss
| |- _stack.scss
|- function
| |- _calc-font-size.scss
| |- _calc-stack.scss
| |- _contrast-color.scss
| |- _strip-unit.scss
|- _component.scss
|- _foundation.scss
|- _function.scss
|- _project.scss
|- _structure.scss
|- _variable.scss
|- chroma.scss
|- theme.scss
static
|- css
| |- chroma.css
| |- chroma.min.css
| |- theme.css
| |- theme.min.css
|- images
|- js
|- bundle.js
.editorconfig
.gitignore
gulpfile.js
LICENSE.md
package-lock.json
package.json
README.md
theme.toml
webpack.config.js
```

### Preview site

To preview your site, run Hugo's built-in local server.

```
hugo server -t hugo-theme-techdoc
```

Browse site on http://localhost:1313

## Deploy Site to public_html directory

```
hugo -t hugo-theme-techdoc -d public_html
```

## Development environment

```
cd /path/to/hugo-theme-techdoc
npm install
npm run gulp:watch
```

### Preview exampleSite

```
cd /path/to/dir/themes/hugo-theme-techdoc/exampleSite

hugo server --themesDir ../..
```

Browse site on http://localhost:1313

## Contribution

### Patches and Bug Fixes

Small patches and bug reports can be submitted a issue tracker in Github. Forking on Github is another good way. You can send a pull request.

1. Fork [Hugo Theme Techdoc](https://github.com/thingsym/hugo-theme-techdoc) from GitHub repository
2. Create a feature branch: git checkout -b my-new-feature
3. Commit your changes: git commit -am 'Add some feature'
4. Push to the branch: git push origin my-new-feature
5. Create new Pull Request

## Changelog

* Version 0.5.0 - 2019.12.08
* update Sample Document
* add table of contents
* add open graph
* add function and stack scss
* Version 0.4.0 - 2019.11.02
* update Sample Document
* add Theme color
* add Menu style
* improve scss
* Version 0.3.0 - 2019.10.06
* fix archetypes
* add prepend-body.html for Tag Manager noscript version
* change class name from menu to global-menu
* rename partials files
* fix javascript path for webpack
* improve development environment
* move javascript files to src directory
* Version 0.2.2 - 2019.04.27
* fix Lastmod's and PublishDate's initial value of 0001-01-01
* Version 0.2.1 - 2018.12.07
* fix scss lint errors
* change lint from scss-lint to stylelint
* add published date
* change the font color of powered by
* fix link on powered by
* Version 0.2.0 - 2018.11.21
* add screenshot images
* add exampleSite
* fix sub-menu for responsive
* improve menu and pagination
* Version 0.1.0 - 2018.03.04
* initial release

## License

Techdoc is licensed under the MIT License.

Techdoc bundles the following third-party resources:

* CSS reset by [normalize.css](https://necolas.github.io/normalize.css/), [MIT](https://opensource.org/licenses/MIT)
* jQuery Plugin [Back to the Top](https://github.com/thingsym/jquery.backtothetop), [MIT](https://opensource.org/licenses/MIT)
* Sass Mixin [Flexbox Grid Mixins](https://thingsym.github.io/flexbox-grid-mixins/), [MIT](https://opensource.org/licenses/MIT)

## Author

[thingsym](https://github.com/thingsym)

Copyright (c) 2017-2019 by thingsym

+ 10
- 0
themes/hugo-theme-techdoc/archetypes/default.md View File

@@ -0,0 +1,10 @@
---
title: "{{ replace .TranslationBaseName "-" " " | title }}"
date: {{ .Date }}
lastmod: {{ .Date }}
publishdate: {{ .Date }}
description: ""
weight: 10
---

Lorem Ipsum.

+ 72
- 0
themes/hugo-theme-techdoc/exampleSite/config.toml View File

@@ -0,0 +1,72 @@
baseURL = "https://example.com"

languageCode = "en-us"
DefaultContentLanguage = "en"
title = "Hugo Techdoc Theme"
theme = "hugo-theme-techdoc"

hasCJKLanguage = true
metaDataFormat = "yaml"

pygmentsCodeFences = true
pygmentsUseClasses = true

defaultContentLanguage = "en"
defaultContentLanguageInSubdir= false
enableMissingTranslationPlaceholders = false

[Params]

# Souce Code repository section
description = "put your description"
github_repository = "https://github.com/thingsym/hugo-theme-techdoc"
version = "0.5.0"

# Documentation repository section
# documentation repository (set edit link to documentation repository)
github_doc_repository = "https://github.com/thingsym/hugo-theme-techdoc"

# Analytic section
google_analytics_id = "" # Your Google Analytics tracking id
tag_manager_container_id = "" # Your Google Tag Manager container id
google_site_verification = "" # Your Google Site Verification for Search Console

# Open Graph and Twitter Cards settings section
title = "Hugo Techdoc Theme"
images = ["og-image.png"]
# See https://gohugo.io/templates/internal/#open-graph
# See https://gohugo.io/templates/internal/#twitter-cards

# Theme settings section
# Theme color
custom_font_color = ""
custom_background_color = ""

# Documentation Menu section
# Menu style settings
menu_style = "open-menu" # "open-menu" or "slide-menu"

# Date format
dateformat = "" # default "2 Jan 2006"
# See the format reference https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference

# path name excluded from documentation menu
menu_exclusion = [
"archives",
"archive",
"blog",
"entry",
"post",
"posts"
]

# Global menu section
[[menu.main]]
name = "Home"
url = "/"
weight = 1

[[menu.main]]
name = "Twitter"
url = "https://twitter.com/thingsym"
weight = 2

+ 25
- 0
themes/hugo-theme-techdoc/exampleSite/content/_index.md View File

@@ -0,0 +1,25 @@
---
date: 2017-10-19T15:26:15Z
lastmod: 2019-10-26T15:26:15Z
publishdate: 2018-11-23T15:26:15Z

title: Home title
description: Text about this post
images:
- home-cover.png
---

# Hugo Techdoc Theme

## The Techdoc is a Hugo Theme for technical documentation.

## Features

* Modern, Simple layout
* Responsive web design
* Documentation menu (Select [Menu style](getting-started/screenshot/#menu-style))
* [Table Of Contents](sample/table-of-contents/) for the page (selective)
* [Theme color](getting-started/screenshot/#theme-color)
* [Edit link](getting-started/screenshot/#edit-link) to documentation repository
* [Custom Shortcodes](sample/custom-shortcodes/)
* Analytics with Google Analytics, Google Tag Manager

+ 17
- 0
themes/hugo-theme-techdoc/exampleSite/content/about.md View File

@@ -0,0 +1,17 @@
+++
title = "About Hugo"
date = "2014-04-09"
menu = "main"
+++

Hugo is a static site engine written in Go.


It makes use of a variety of open source projects including:

* [Cobra](https://github.com/spf13/cobra)
* [Viper](https://github.com/spf13/viper)
* [J Walter Weatherman](https://github.com/spf13/jWalterWeatherman)
* [Cast](https://github.com/spf13/cast)

Learn more and contribute on [GitHub](https://github.com/gohugoio).

+ 11
- 0
themes/hugo-theme-techdoc/exampleSite/content/archives/hello_world.md View File

@@ -0,0 +1,11 @@
---
title: "Hello_world"
date: 2017-10-17T14:00:45Z
draft: false
---

aaaaaa

vvvv

aaa

+ 11
- 0
themes/hugo-theme-techdoc/exampleSite/content/archives/hello_world1.md View File

@@ -0,0 +1,11 @@
---
title: "Hello_world1"
date: 2017-11-17T14:00:45Z
draft: false
---

aaaaaa

vvvv

aaa

+ 11
- 0
themes/hugo-theme-techdoc/exampleSite/content/archives/hello_world2.md View File

@@ -0,0 +1,11 @@
---
title: "Hello_world2"
date: 2017-12-17T14:00:45Z
draft: false
---

aaaaaa

vvvv

aaa

+ 11
- 0
themes/hugo-theme-techdoc/exampleSite/content/blog/hello_world.md View File

@@ -0,0 +1,11 @@
---
title: "Hello_world"
date: 2017-10-17T14:00:45Z
draft: false
---

aaaaaa

vvvv

aaa

+ 11
- 0
themes/hugo-theme-techdoc/exampleSite/content/blog/hello_world1.md View File

@@ -0,0 +1,11 @@
---
title: "Hello_world1"
date: 2017-11-17T14:00:45Z
draft: false
---

aaaaaa

vvvv

aaa

+ 11
- 0
themes/hugo-theme-techdoc/exampleSite/content/blog/hello_world2.md View File

@@ -0,0 +1,11 @@
---
title: "Hello_world2"
date: 2017-12-17T14:00:45Z
draft: false
---

aaaaaa

vvvv

aaa

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter1/1.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 1-1"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter1/2.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 1-2"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter1/3.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 1-3"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter1/4.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 1-4"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 8
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter1/_index.md View File

@@ -0,0 +1,8 @@
---
title: "Chapter 1"
date: 2017-10-17T15:26:15Z
draft: false
weight: 20
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 8
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter2/1.md View File

@@ -0,0 +1,8 @@
---
title: "Chapter 2-1 (weight: 40)"
date: 2017-10-17T15:26:15Z
draft: false
weight: 40
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 8
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter2/2.md View File

@@ -0,0 +1,8 @@
---
title: "Chapter 2-2 (weight: 30)"
date: 2017-10-17T15:26:15Z
draft: false
weight: 30
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 8
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter2/3.md View File

@@ -0,0 +1,8 @@
---
title: "Chapter 2-3 (weight: 10)"
date: 2017-10-17T15:26:15Z
draft: false
weight: 10
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 8
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter2/4.md View File

@@ -0,0 +1,8 @@
---
title: "Chapter 2-4 (weight: 20)"
date: 2017-10-17T15:26:15Z
draft: false
weight: 20
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 8
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter2/_index.md View File

@@ -0,0 +1,8 @@
---
title: "Chapter 2 (weighted)"
date: 2017-10-17T15:26:15Z
draft: false
weight: 30
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter3/1.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 3-1"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter3/3.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 3-3"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter3/4.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 3-4"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 8
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter3/_index.md View File

@@ -0,0 +1,8 @@
---
title: "Chapter 3 (hierarchized)"
date: 2017-10-17T15:26:15Z
draft: false
weight: 40
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter3/chapter3-2/1.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 3-2-1"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter3/chapter3-2/2.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 3-2-2"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter3/chapter3-2/3.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 3-2-3"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter3/chapter3-2/4.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 3-2-4"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 7
- 0
themes/hugo-theme-techdoc/exampleSite/content/chapter3/chapter3-2/_index.md View File

@@ -0,0 +1,7 @@
---
title: "Chapter 3-2"
date: 2017-10-17T15:26:15Z
draft: false
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+ 11
- 0
themes/hugo-theme-techdoc/exampleSite/content/entry/hello_world.md View File

@@ -0,0 +1,11 @@
---
title: "Hello_world"
date: 2017-10-17T14:00:45Z
draft: false
---

aaaaaa

vvvv

aaa

+ 11
- 0
themes/hugo-theme-techdoc/exampleSite/content/entry/hello_world1.md View File

@@ -0,0 +1,11 @@
---
title: "Hello_world1"
date: 2017-11-17T14:00:45Z
draft: false
---

aaaaaa

vvvv

aaa

+ 11
- 0
themes/hugo-theme-techdoc/exampleSite/content/entry/hello_world2.md View File

@@ -0,0 +1,11 @@
---
title: "Hello_world2"
date: 2017-12-17T14:00:45Z
draft: false
---

aaaaaa

vvvv

aaa

+ 22
- 0
themes/hugo-theme-techdoc/exampleSite/content/getting-started/_index.md View File

@@ -0,0 +1,22 @@
---
title: "Getting Started"
date: 2017-10-17T15:26:15Z
lastmod: 2018-12-08T15:26:15Z
publishdate: 2018-11-23T15:26:15Z
draft: false
weight: 9

description: Text about this post
images:
- post-cover.png
---

## [Installation](./installation)

Download Hugo theme, configure, preview site ...

## [Configuration](./configuration)

You may specify options in config.toml (or config.yaml/config.json) of your site to make use of this theme's features.

## [Screenshot](./screenshot)

+ 134
- 0
themes/hugo-theme-techdoc/exampleSite/content/getting-started/configuration.md View File

@@ -0,0 +1,134 @@
---
title: "Configuration"
date: 2017-10-17T15:26:15Z
lastmod: 2019-10-26T15:26:15Z
draft: false
weight: 20
---

You may specify options in config.toml (or config.yaml/config.json) of your site to make use of this theme’s features.

For an example of `config.toml`, see [config.toml](https://github.com/thingsym/hugo-theme-techdoc/blob/master/exampleSite/config.toml) in exampleSite.

## Params

# Souce Code repository section
description = "put your description"
github_repository = "https://github.com/thingsym/hugo-theme-techdoc"
version = "0.5.0"

# Documentation repository section
# documentation repository (set edit link to documentation repository)
github_doc_repository = "https://github.com/thingsym/hugo-theme-techdoc"

# Analytic section
google_analytics_id = "" # Your Google Analytics tracking id
tag_manager_container_id = "" # Your Google Tag Manager container id
google_site_verification = "" # Your Google Site Verification for Search Console

# Theme settings section
# Theme color
custom_font_color = ""
custom_background_color = ""

# Documentation Menu section
# Menu style settings
menu_style = "open-menu" # "open-menu" or "slide-menu"

# Date format
dateformat = "" # default "2 Jan 2006"
# See the format reference https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference

# path name excluded from documentation menu
menu_exclusion = [
"archives",
"archive",
"blog",
"entry",
"post",
"posts"
]

#### `description`

The document summary

default: `put your description`

#### `github_repository`

URL of souce code repository

default: `https://github.com/thingsym/hugo-theme-techdoc`

#### `version`

The version of souce code

default: `0.5.0`

#### `github_doc_repository`

URL of documentation repository for editting

default: `https://github.com/thingsym/hugo-theme-techdoc`

#### `google_analytics_id`

ID of Google Analytics

default: `""`

Container ID of Google Tag Manager

#### `tag_manager_container_id`

default: `""`

#### `google_site_verification`

Content value in meta tag `google-site-verification` for Google Search Console

```
<meta name="google-site-verification" content="e7-viorjjfiihHIoowh8KLiowhbs" />
```

default: `""`

#### `custom_font_color`

Header font color

default: `""`

#### `custom_background_color`

Header background color

default: `""`

#### `menu_style`

Documentation Menu style, Open Menu or Slide Menu

default: `open-menu`
value: `open-menu` | `slide-menu`

#### `dateformat`

default: `""` as `2 Jan 2006`

#### `menu_exclusion`

Path name excluded from documentation menu

By default, we exclude commonly used folder names in blogs.

default: `[
"archives",
"archive",
"blog",
"entry",
"post",
"posts"
]`

+ 35
- 0
themes/hugo-theme-techdoc/exampleSite/content/getting-started/installation.md View File

@@ -0,0 +1,35 @@
---
title: "Installation"
date: 2017-10-17T15:26:15Z
draft: false
weight: 10
---

## Download Hugo theme

If you have git installed, you can do the following at the command-line-interface within the Hugo directory:

```
cd themes
git clone https://github.com/thingsym/hugo-theme-techdoc.git
```

For more information read [the Hugo documentation](https://gohugo.io/themes/installing-and-using-themes/).

## Configure

You may specify options in config.toml (or config.yaml/config.json) of your site to make use of this theme's features.

For an example of `config.toml`, see [config.toml](https://github.com/thingsym/hugo-theme-techdoc/blob/master/exampleSite/config.toml) in exampleSite.

See [the Configuration documentation](../configuration/).

## Preview site

To preview your site, run Hugo's built-in local server.

```
hugo server -t hugo-theme-techdoc
```

Browse site on http://localhost:1313

+ 24
- 0
themes/hugo-theme-techdoc/exampleSite/content/getting-started/screenshot.md View File

@@ -0,0 +1,24 @@
---
title: "Screenshot"
date: 2019-10-26T15:26:15Z
draft: false
weight: 30
---

### Theme color

![Theme color](https://raw.githubusercontent.com/thingsym/hugo-theme-techdoc/master/images/screenshot-theme-color.png)

### Menu style

#### Open Menu

![Open Menu](https://raw.githubusercontent.com/thingsym/hugo-theme-techdoc/master/images/screenshot-open-menu.png)

#### Slide Menu

![Slide Menu](https://raw.githubusercontent.com/thingsym/hugo-theme-techdoc/master/images/screenshot-slide-menu.gif)

### Edit link

![Edit link](https://raw.githubusercontent.com/thingsym/hugo-theme-techdoc/master/images/screenshot-edit-link.png)

+ 8
- 0
themes/hugo-theme-techdoc/exampleSite/content/hello_world.md View File

@@ -0,0 +1,8 @@
---
title: "Hello world!"
date: 2017-10-17T14:00:45Z
draft: false
weight: 11
---

Hello world!

+ 1150
- 0
themes/hugo-theme-techdoc/exampleSite/content/post/creating-a-new-theme.md
File diff suppressed because it is too large
View File


+ 344
- 0
themes/hugo-theme-techdoc/exampleSite/content/post/goisforlovers.md View File

@@ -0,0 +1,344 @@
+++
title = "(Hu)go Template Primer"
description = ""
tags = [
"go",
"golang",
"templates",
"themes",
"development",
]
date = "2014-04-02"
categories = [
"Development",
"golang",
]
menu = "main"
+++

Hugo uses the excellent [Go][] [html/template][gohtmltemplate] library for
its template engine. It is an extremely lightweight engine that provides a very
small amount of logic. In our experience that it is just the right amount of
logic to be able to create a good static website. If you have used other
template systems from different languages or frameworks you will find a lot of
similarities in Go templates.

This document is a brief primer on using Go templates. The [Go docs][gohtmltemplate]
provide more details.

## Introduction to Go Templates

Go templates provide an extremely simple template language. It adheres to the
belief that only the most basic of logic belongs in the template or view layer.
One consequence of this simplicity is that Go templates parse very quickly.

A unique characteristic of Go templates is they are content aware. Variables and
content will be sanitized depending on the context of where they are used. More
details can be found in the [Go docs][gohtmltemplate].

## Basic Syntax

Golang templates are HTML files with the addition of variables and
functions.

**Go variables and functions are accessible within {{ }}**

Accessing a predefined variable "foo":

{{ foo }}

**Parameters are separated using spaces**

Calling the add function with input of 1, 2:

{{ add 1 2 }}

**Methods and fields are accessed via dot notation**

Accessing the Page Parameter "bar"

{{ .Params.bar }}

**Parentheses can be used to group items together**

{{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }}


## Variables

Each Go template has a struct (object) made available to it. In hugo each
template is passed either a page or a node struct depending on which type of
page you are rendering. More details are available on the
[variables](/layout/variables) page.

A variable is accessed by referencing the variable name.

<title>{{ .Title }}</title>

Variables can also be defined and referenced.

{{ $address := "123 Main St."}}
{{ $address }}


## Functions

Go template ship with a few functions which provide basic functionality. The Go
template system also provides a mechanism for applications to extend the
available functions with their own. [Hugo template
functions](/layout/functions) provide some additional functionality we believe
are useful for building websites. Functions are called by using their name
followed by the required parameters separated by spaces. Template
functions cannot be added without recompiling hugo.

**Example:**

{{ add 1 2 }}

## Includes

When including another template you will pass to it the data it will be
able to access. To pass along the current context please remember to
include a trailing dot. The templates location will always be starting at
the /layout/ directory within Hugo.

**Example:**

{{ template "chrome/header.html" . }}


## Logic

Go templates provide the most basic iteration and conditional logic.

### Iteration

Just like in Go, the Go templates make heavy use of range to iterate over
a map, array or slice. The following are different examples of how to use
range.

**Example 1: Using Context**

{{ range array }}
{{ . }}
{{ end }}

**Example 2: Declaring value variable name**

{{range $element := array}}
{{ $element }}
{{ end }}

**Example 2: Declaring key and value variable name**

{{range $index, $element := array}}
{{ $index }}
{{ $element }}
{{ end }}

### Conditionals

If, else, with, or, & and provide the framework for handling conditional
logic in Go Templates. Like range, each statement is closed with `end`.


Go Templates treat the following values as false:

* false
* 0
* any array, slice, map, or string of length zero

**Example 1: If**

{{ if isset .Params "title" }}<h4>{{ index .Params "title" }}</h4>{{ end }}

**Example 2: If -> Else**

{{ if isset .Params "alt" }}
{{ index .Params "alt" }}
{{else}}
{{ index .Params "caption" }}
{{ end }}

**Example 3: And & Or**

{{ if and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}

**Example 4: With**

An alternative way of writing "if" and then referencing the same value
is to use "with" instead. With rebinds the context `.` within its scope,
and skips the block if the variable is absent.

The first example above could be simplified as:

{{ with .Params.title }}<h4>{{ . }}</h4>{{ end }}

**Example 5: If -> Else If**

{{ if isset .Params "alt" }}
{{ index .Params "alt" }}
{{ else if isset .Params "caption" }}
{{ index .Params "caption" }}
{{ end }}

## Pipes

One of the most powerful components of Go templates is the ability to
stack actions one after another. This is done by using pipes. Borrowed
from unix pipes, the concept is simple, each pipeline's output becomes the
input of the following pipe.

Because of the very simple syntax of Go templates, the pipe is essential
to being able to chain together function calls. One limitation of the
pipes is that they only can work with a single value and that value
becomes the last parameter of the next pipeline.

A few simple examples should help convey how to use the pipe.

**Example 1 :**

{{ if eq 1 1 }} Same {{ end }}

is the same as

{{ eq 1 1 | if }} Same {{ end }}

It does look odd to place the if at the end, but it does provide a good
illustration of how to use the pipes.

**Example 2 :**

{{ index .Params "disqus_url" | html }}

Access the page parameter called "disqus_url" and escape the HTML.

**Example 3 :**

{{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
Stuff Here
{{ end }}

Could be rewritten as

{{ isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" | if }}
Stuff Here
{{ end }}


## Context (aka. the dot)

The most easily overlooked concept to understand about Go templates is that {{ . }}
always refers to the current context. In the top level of your template this
will be the data set made available to it. Inside of a iteration it will have
the value of the current item. When inside of a loop the context has changed. .
will no longer refer to the data available to the entire page. If you need to
access this from within the loop you will likely want to set it to a variable
instead of depending on the context.

**Example:**

{{ $title := .Site.Title }}
{{ range .Params.tags }}
<li> <a href="{{ $baseurl }}/tags/{{ . | urlize }}">{{ . }}</a> - {{ $title }} </li>
{{ end }}

Notice how once we have entered the loop the value of {{ . }} has changed. We
have defined a variable outside of the loop so we have access to it from within
the loop.

# Hugo Parameters

Hugo provides the option of passing values to the template language
through the site configuration (for sitewide values), or through the meta
data of each specific piece of content. You can define any values of any
type (supported by your front matter/config format) and use them however
you want to inside of your templates.


## Using Content (page) Parameters

In each piece of content you can provide variables to be used by the
templates. This happens in the [front matter](/content/front-matter).

An example of this is used in this documentation site. Most of the pages
benefit from having the table of contents provided. Sometimes the TOC just
doesn't make a lot of sense. We've defined a variable in our front matter
of some pages to turn off the TOC from being displayed.

Here is the example front matter:

```
---
title: "Permalinks"
date: "2013-11-18"
aliases:
- "/doc/permalinks/"
groups: ["extras"]
groups_weight: 30
notoc: true
---
```

Here is the corresponding code inside of the template:

{{ if not .Params.notoc }}
<div id="toc" class="well col-md-4 col-sm-6">
{{ .TableOfContents }}
</div>
{{ end }}



## Using Site (config) Parameters
In your top-level configuration file (eg, `config.yaml`) you can define site
parameters, which are values which will be available to you in chrome.

For instance, you might declare:

```yaml
params:
CopyrightHTML: "Copyright &#xA9; 2013 John Doe. All Rights Reserved."
TwitterUser: "spf13"
SidebarRecentLimit: 5
```

Within a footer layout, you might then declare a `<footer>` which is only
provided if the `CopyrightHTML` parameter is provided, and if it is given,
you would declare it to be HTML-safe, so that the HTML entity is not escaped
again. This would let you easily update just your top-level config file each
January 1st, instead of hunting through your templates.

```
{{if .Site.Params.CopyrightHTML}}<footer>
<div class="text-center">{{.Site.Params.CopyrightHTML | safeHtml}}</div>
</footer>{{end}}
```

An alternative way of writing the "if" and then referencing the same value
is to use "with" instead. With rebinds the context `.` within its scope,
and skips the block if the variable is absent:

```
{{with .Site.Params.TwitterUser}}<span class="twitter">
<a href="https://twitter.com/{{.}}" rel="author">
<img src="/images/twitter.png" width="48" height="48" title="Twitter: {{.}}"
alt="Twitter"></a>
</span>{{end}}
```

Finally, if you want to pull "magic constants" out of your layouts, you can do
so, such as in this example:

```
<nav class="recent">
<h1>Recent Posts</h1>
<ul>{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
{{end}}</ul>
</nav>
```


[go]: https://golang.org/
[gohtmltemplate]: https://golang.org/pkg/html/template/

+ 89
- 0
themes/hugo-theme-techdoc/exampleSite/content/post/hugoisforlovers.md View File

@@ -0,0 +1,89 @@
+++
title = "Getting Started with Hugo"
description = ""
tags = [
"go",
"golang",
"hugo",
"development",
]
date = "2014-04-02"
categories = [
"Development",
"golang",
]
menu = "main"
+++

## Step 1. Install Hugo

Go to [Hugo releases](https://github.com/spf13/hugo/releases) and download the
appropriate version for your OS and architecture.

Save it somewhere specific as we will be using it in the next step.

More complete instructions are available at [Install Hugo](https://gohugo.io/getting-started/installing/)

## Step 2. Build the Docs

Hugo has its own example site which happens to also be the documentation site
you are reading right now.

Follow the following steps:

1. Clone the [Hugo repository](http://github.com/spf13/hugo)
2. Go into the repo
3. Run hugo in server mode and build the docs
4. Open your browser to http://localhost:1313

Corresponding pseudo commands:

git clone https://github.com/spf13/hugo
cd hugo
/path/to/where/you/installed/hugo server --source=./docs
> 29 pages created
> 0 tags index created
> in 27 ms
> Web Server is available at http://localhost:1313
> Press ctrl+c to stop

Once you've gotten here, follow along the rest of this page on your local build.

## Step 3. Change the docs site

Stop the Hugo process by hitting Ctrl+C.

Now we are going to run hugo again, but this time with hugo in watch mode.

/path/to/hugo/from/step/1/hugo server --source=./docs --watch
> 29 pages created
> 0 tags index created
> in 27 ms
> Web Server is available at http://localhost:1313
> Watching for changes in /Users/spf13/Code/hugo/docs/content
> Press ctrl+c to stop


Open your [favorite editor](http://vim.spf13.com) and change one of the source
content pages. How about changing this very file to *fix the typo*. How about changing this very file to *fix the typo*.

Content files are found in `docs/content/`. Unless otherwise specified, files
are located at the same relative location as the url, in our case
`docs/content/overview/quickstart.md`.

Change and save this file.. Notice what happened in your terminal.

> Change detected, rebuilding site

> 29 pages created
> 0 tags index created
> in 26 ms

Refresh the browser and observe that the typo is now fixed.

Notice how quick that was. Try to refresh the site before it's finished building. I double dare you.
Having nearly instant feedback enables you to have your creativity flow without waiting for long builds.

## Step 4. Have fun

The best way to learn something is to play with it.

+ 156
- 0
themes/hugo-theme-techdoc/exampleSite/content/post/migrate-from-jekyll.md View File

@@ -0,0 +1,156 @@
---
date: 2014-03-10
linktitle: Migrating from Jekyll
menu:
main:
parent: Tutorials
prev: /tutorials/mathjax
title: Migrate to Hugo from Jekyll
weight: 10
---

## Move static content to `static`
Jekyll has a rule that any directory not starting with `_` will be copied as-is to the `_site` output. Hugo keeps all static content under `static`. You should therefore move it all there.
With Jekyll, something that looked like

▾ <root>/
▾ images/
logo.png

should become

▾ <root>/
▾ static/
▾ images/
logo.png

Additionally, you'll want any files that should reside at the root (such as `CNAME`) to be moved to `static`.

## Create your Hugo configuration file
Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the [Hugo configuration documentation](/overview/configuration/) for details.

## Set your configuration publish folder to `_site`
The default is for Jekyll to publish to `_site` and for Hugo to publish to `public`. If, like me, you have [`_site` mapped to a git submodule on the `gh-pages` branch](http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html), you'll want to do one of two alternatives:

1. Change your submodule to point to map `gh-pages` to public instead of `_site` (recommended).

git submodule deinit _site
git rm _site
git submodule add -b gh-pages git@github.com:your-username/your-repo.git public

2. Or, change the Hugo configuration to use `_site` instead of `public`.

{
..
"publishdir": "_site",
..
}

## Convert Jekyll templates to Hugo templates
That's the bulk of the work right here. The documentation is your friend. You should refer to [Jekyll's template documentation](http://jekyllrb.com/docs/templates/) if you need to refresh your memory on how you built your blog and [Hugo's template](/layout/templates/) to learn Hugo's way.

As a single reference data point, converting my templates for [heyitsalex.net](http://heyitsalex.net/) took me no more than a few hours.

## Convert Jekyll plugins to Hugo shortcodes
Jekyll has [plugins](http://jekyllrb.com/docs/plugins/); Hugo has [shortcodes](/doc/shortcodes/). It's fairly trivial to do a port.

### Implementation
As an example, I was using a custom [`image_tag`](https://github.com/alexandre-normand/alexandre-normand/blob/74bb12036a71334fdb7dba84e073382fc06908ec/_plugins/image_tag.rb) plugin to generate figures with caption when running Jekyll. As I read about shortcodes, I found Hugo had a nice built-in shortcode that does exactly the same thing.

Jekyll's plugin:

module Jekyll
class ImageTag < Liquid::Tag
@url = nil
@caption = nil
@class = nil
@link = nil
// Patterns
IMAGE_URL_WITH_CLASS_AND_CAPTION =
IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i
IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i
IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i
IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
def initialize(tag_name, markup, tokens)
super
if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK
@class = $1
@url = $3
@caption = $7
@link = $9
elsif markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION
@class = $1
@url = $3
@caption = $7
elsif markup =~ IMAGE_URL_WITH_CAPTION
@url = $1
@caption = $5
elsif markup =~ IMAGE_URL_WITH_CLASS
@class = $1
@url = $3
elsif markup =~ IMAGE_URL
@url = $1
end
end
def render(context)
if @class
source = "<figure class='#{@class}'>"
else
source = "<figure>"
end
if @link
source += "<a href=\"#{@link}\">"
end
source += "<img src=\"#{@url}\">"
if @link
source += "</a>"
end
source += "<figcaption>#{@caption}</figcaption>" if @caption
source += "</figure>"
source
end
end
end
Liquid::Template.register_tag('image', Jekyll::ImageTag)

is written as this Hugo shortcode:

<!-- image -->
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} />
{{ if .Get "link"}}</a>{{ end }}
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
<figcaption>{{ if isset .Params "title" }}
{{ .Get "title" }}{{ end }}
{{ if or (.Get "caption") (.Get "attr")}}<p>
{{ .Get "caption" }}
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
{{ .Get "attr" }}
{{ if .Get "attrlink"}}</a> {{ end }}
</p> {{ end }}
</figcaption>
{{ end }}
</figure>
<!-- image -->

### Usage
I simply changed:

{% image full http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg "One of my favorite touristy-type photos. I secretly waited for the good light while we were "having fun" and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." ->http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/ %}

to this (this example uses a slightly extended version named `fig`, different than the built-in `figure`):

{{%/* fig class="full" src="http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg" title="One of my favorite touristy-type photos. I secretly waited for the good light while we were having fun and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." link="http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/" */%}}

As a bonus, the shortcode named parameters are, arguably, more readable.

## Finishing touches
### Fix content
Depending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that `hugo server --watch` is your friend. Test your changes and fix errors as needed.

### Clean up
You'll want to remove the Jekyll configuration at this point. If you have anything else that isn't used, delete it.

## A practical example in a diff
[Hey, it's Alex](http://heyitsalex.net/) was migrated in less than a _father-with-kids day_ from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this [diff](https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610).

+ 12
- 0
themes/hugo-theme-techdoc/exampleSite/content/posts/hello_world.md View File

@@ -0,0 +1,12 @@
---
title: "Hello_world"
date: 2017-10-17T14:00:45Z
draft: false
weight: 11
---

aaaaaa

vvvv

aaa

+ 96
- 0
themes/hugo-theme-techdoc/exampleSite/content/sample/_index.md View File

@@ -0,0 +1,96 @@
---
title: "Sample Document"
date: 2017-10-17T15:26:15Z
draft: false
weight: 10
description: "this is a sample document."
---

## Header

# H1 Header
## H2 Header
### H3 Header
#### H4 Header
##### H5 Header
###### H6 Header

## Paragraph

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

## Emphasis

**Lorem ipsum dolor sit amet, consectetur adipisicing** elit, sed do ~~eiusmod tempor incididunt ut labore~~ et dolore magna aliqua. Ut enim *ad minim veniam, quis nostrud exercitation* ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

## Horizontal Rule

---

## List

* Lorem ipsum dolor sit amet, consectetur adipisicing elit
* Lorem ipsum dolor sit amet, consectetur adipisicing elit
* Lorem ipsum dolor sit amet, consectetur adipisicing elit
* Lorem ipsum dolor sit amet, consectetur adipisicing elit
* Lorem ipsum dolor sit amet, consectetur adipisicing elit
* Lorem ipsum dolor sit amet, consectetur adipisicing elit
* Lorem ipsum dolor sit amet, consectetur adipisicing elit

1. Lorem ipsum dolor sit amet, consectetur adipisicing elit
2. Lorem ipsum dolor sit amet, consectetur adipisicing elit
3. Lorem ipsum dolor sit amet, consectetur adipisicing elit

## Code

```ruby
puts 'The best way to log and share programmers knowledge.' puts 'The best way to log and share programmers knowledge.'

puts 'The best way to log and share programmers knowledge.' puts 'The best way to log and share programmers knowledge.'

puts 'The best way to log and share programmers knowledge.'

puts 'The best way to log and share programmers knowledge.'
puts 'The best way to log and share programmers knowledge.' puts 'The best way to log and share programmers knowledge.'
```

inline code `#ffce44`

## Blockquote

> this is a blockquote. this is a blockquote. this is a blockquote. this is a blockquote. this is a blockquote. this is a blockquote.
>
> this is a blockquote.
>
> this is a blockquote.
>
> this is a blockquote.

## Table

| header | header | header |
|------------|-------------|--------------|
| Lorem | Lorem | Lorem |
| ipsum | ipsum | ipsum |
| dolor | dolor | dolor |
| sit | sit | sit |
| amet | amet | amet |

### with alignment

| Left align | Right align | Center align |
|:-----------|------------:|:------------:|
| This | This | This |
| column | column | column |
| will | will | will |
| be | be | be |
| left | right | center |
| aligned | aligned | aligned |

## Image

![2 People Sitting With View of Yellow Flowers during Daytime](/images/pexels-photo-196666.jpeg "sample")

## Image with link

[![2 People Sitting With View of Yellow Flowers during Daytime](/images/pexels-photo-196666.jpeg)](https://www.pexels.com/photo/2-people-sitting-with-view-of-yellow-flowers-during-daytime-196666/)

+ 44
- 0
themes/hugo-theme-techdoc/exampleSite/content/sample/build-in-shortcodes.md View File

@@ -0,0 +1,44 @@
---
title: "Build-in Shortcodes"
date: 2017-10-17T15:26:15Z
draft: false
weight: 10
description: "calling built-in Shortcodes into your content files."
---

See https://gohugo.io/content-management/shortcodes/#use-hugo-s-built-in-shortcodes

## figure

{{< figure src="/images/pexels-photo-196666.jpeg" title="2 People Sitting With View of Yellow Flowers during Daytime" >}}

## gist

{{< gist spf13 7896402 "img.html" >}}

## highlight

{{< highlight html >}}
<section id="main">
<div>
<h1 id="title">{{ .Title }}</h1>
{{ range .Data.Pages }}
{{ .Render "summary"}}
{{ end }}
</div>
</section>
{{< /highlight >}}

## instagram

{{< instagram BWNjjyYFxVx >}}

## tweet

{{< tweet 877500564405444608 >}}

## vimeo
{{< vimeo 146022717 >}}

## youtube
{{< youtube w7Ft2ymGmfc >}}

+ 58
- 0
themes/hugo-theme-techdoc/exampleSite/content/sample/custom-shortcodes.md View File

@@ -0,0 +1,58 @@
---
title: "Custom Shortcodes"
date: 2017-10-17T15:26:15Z
draft: false