Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2 #56

Merged
merged 42 commits into from
Aug 20, 2017
Merged

V2 #56

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b2ac829
feat: support of Hugo 0.22+ #51 #48 #11 #50
matcornic Jul 27, 2017
2b03e25
feat: mermaid #53 + archetypes + move doc + expand
matcornic Jul 30, 2017
204f9be
fixed edit URL
matcornic Jul 30, 2017
1227b1d
feat: renamed docs example to exampleSite
matcornic Jul 30, 2017
85c046f
remove link in docs because of error
matcornic Jul 30, 2017
b2437aa
add travis
matcornic Jul 30, 2017
157e3ac
feat: add full i18n. Select desired language in the site automatically
matcornic Jul 31, 2017
47c72cb
feat: better UX in the menu
matcornic Jul 31, 2017
b39d952
Update font-awesome
matcornic Jul 31, 2017
2294a54
fixed scrollbar in left menu
matcornic Jul 31, 2017
9eb81ef
fix busting javascript #47
matcornic Jul 31, 2017
e37af28
add parameter to disable copy-to-clipboard function for inline code
matcornic Jul 31, 2017
da20844
feat: add sticky bar with smooth scroll
matcornic Aug 1, 2017
951e8fb
feat: add shortcode for attachments
matcornic Aug 1, 2017
3e61961
feat: add children shortcode
matcornic Aug 1, 2017
389b985
feat(attachments): rename styles with colors + delete red style + add…
matcornic Aug 1, 2017
eb60deb
feat: add 'more' section in left menu
matcornic Aug 2, 2017
7ca4b0c
feat: add theme variant system + add blue variant
matcornic Aug 3, 2017
1df25a3
feat: slight changes to blue theme
matcornic Aug 8, 2017
44821c9
fix search for multiple languages
matcornic Aug 8, 2017
554480d
add wercker to compare with travis
matcornic Aug 8, 2017
33cada7
remove travis file
matcornic Aug 8, 2017
88f55b8
feat: add red and green variant themes
matcornic Aug 8, 2017
c1d1d7a
Add variant theme rule for anchors
matcornic Aug 9, 2017
a4157f1
fixed home page messages
matcornic Aug 9, 2017
7ce4b9a
click on logo of doc redirect to home
matcornic Aug 9, 2017
f3e1970
Removed draft from archetype
matcornic Aug 9, 2017
52e897d
changed defaults + scroll with offset
matcornic Aug 16, 2017
6b265c5
add first content for new documentation
matcornic Aug 16, 2017
a64a454
Handling multilingual mode on extra menu shortcuts
matcornic Aug 20, 2017
a04d94f
document HTML way of creting homepage
matcornic Aug 20, 2017
cd75621
chore: delete useless folders
matcornic Aug 20, 2017
1e46e6b
fix archetype content
matcornic Aug 20, 2017
aff3307
add english documentation content
matcornic Aug 20, 2017
2bbbf60
fix jumping navbar
matcornic Aug 20, 2017
7cfaed4
doc: fix editURL
matcornic Aug 20, 2017
9007ec8
Update README for v2
matcornic Aug 20, 2017
3465ef7
i18n of expand shortcode
matcornic Aug 20, 2017
5608a87
Translate in french
matcornic Aug 20, 2017
761af86
doc translation
matcornic Aug 20, 2017
8e15e78
doc translation
matcornic Aug 20, 2017
b3d783e
translation of children shortcode
matcornic Aug 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
public/
exampleSite/public
54 changes: 25 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,48 @@

This repository contains a theme for [Hugo](https://gohugo.io/), based on great [Grav Learn Theme](http://learn.getgrav.org/).

Visit the [theme documentation](https://matcornic.github.io/hugo-learn-doc/basics/what-is-this-hugo-theme/) to see what is going on. It is actually built with this theme.
Visit the [theme documentation](https://learn.netlify.com/en/) to see what is going on. It is actually built with this theme.

## Main features

- Automatic Search
- Multilingual mode
- Unlimited menu levels
- Automatic next/prev buttons to navigate through menu entries
- Image resizing, shadow…
- Attachments files
- List child pages
- Mermaid diagram (flowchart, sequence, gantt)
- Customizable look and feel and themes variants
- Buttons, Tip/Note/Info/Warning boxes, Expand

## Installation

Navigate to your themes folder in your Hugo site and use the following commands:

```
$ cd themes
$ git clone https://github.com/matcornic/hugo-theme-learn.git
```

Check that your Hugo version is between `0.19` and `0.21` with `hugo version`.

> From `0.22`, Hugo team introduced a long awaited feature: [nested sections](https://github.com/gohugoio/hugo/issues/465). As Hugo team deleted some functions on which this theme was based on, **this theme fails with current Hugo version**. A complete rewrite is needed and is [currently under construction](https://github.com/matcornic/hugo-theme-learn/issues/51). Be aware that this new version will possibly make breaking changes.

> Until the v2 is not out yet, feel free to check [Docdock](https://github.com/vjeantet/hugo-theme-docdock), a great fork of hugo-learn-theme by [@vjeantet](https://github.com/vjeantet) that works and embraces latest features of Hugo!
Check that your Hugo version is minimum `0.25` with `hugo version`.

![Overview](https://github.com/matcornic/hugo-theme-learn/raw/master/images/tn.png)

## Usage

- [Visit the documentation](https://matcornic.github.io/hugo-learn-doc/basics/what-is-this-hugo-theme/)
- [Visit the documentation](https://learn.netlify.com/en/)

# Main functionalities
## Download old versions (prior to 2.0.0)

- Handle two levels of documentation
- Tip/Note/Info and Warning boxes
- Resize images
- Preview of original image size
- Add shadow or border on images
- Automatic table of contents
- Create buttons (typically used to provide a link to a demo)
- Search using `lunr` index
- Automatic next/prev buttons to navigate through pages
If you need old version for compatibility purpose, either download [theme source code from releases](https://github.com/matcornic/hugo-theme-learn/releases) or use the right git tag. For example, with `1.1.0`

# TODO

- [Handling more than 2 levels in documentation](https://github.com/matcornic/hugo-theme-learn/issues/11)
- [Handling videos](https://github.com/matcornic/hugo-theme-learn/issues/13)
- [Add optional button to create doc issue (like github)](https://github.com/matcornic/hugo-theme-learn/issues/14)

# Troubleshooting

Changes have been made for automatically creating previous and next arrows. These changes restructured the theme and you might have compatibility problems when updating to the latest version of the theme. Please read [PR#36](https://github.com/matcornic/hugo-theme-learn/pull/36) to update your documentation with latest guidelines.

If you don't want to update your documentation, use the git tag `1.0.0`
- Direct download way: https://github.com/matcornic/hugo-theme-learn/archive/1.1.0.zip
- Git way:

```shell
cd themes/hugo-theme-learn
git checkout tags/1.0.0
git checkout tags/1.1.0
```

For both solutions, the documentation is available at https://github.com/matcornic/hugo-theme-learn/releases/download/1.1.0/hugo-learn-doc-1.1.0.zip
14 changes: 8 additions & 6 deletions archetypes/chapter.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: "Some Chapter title"
weight: 0
icon: "<b>X. </b>" # HTML code as prefix in the menu
---
+++
title = "{{ replace .TranslationBaseName "-" " " | title }}"
date = {{ .Date }}
weight = 5
chapter = true
pre = "<b>X. </b>"
+++

### Chapter X

# Some Chapter title

Lorem ipsum
Lorem Ipsum.
12 changes: 6 additions & 6 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Some Title"
weight: 5
toc: true
---
+++
title = "{{ replace .TranslationBaseName "-" " " | title }}"
date = {{ .Date }}
weight = 5
+++

Lorem Ipsum
Lorem Ipsum.
20 changes: 20 additions & 0 deletions exampleSite/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2016 MATHIEU CORNIC

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.
39 changes: 39 additions & 0 deletions exampleSite/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
- récriture doc -> TODO
- créer une section Showcase
- Menus déroulants icone -> TODO

- créer des jolis thèmes de base (avec des noms ou au moins de meilleures couleurs) -> DOING
- Thème blue : OK
- Thème red: OK
- Theme green: OK
- Passer a Wercker -> OK
- corriger le multilangue pour la recherche et les autres ressources statiques : OK
- Section "MORE" -> OK
- ajouter les childs -> OK
- ajouter les attachments -> OK
- refaire la possibilité d'overrider le style/script/etc -> OK
- sticky bar -> OK
- ajouter Travis pour tester le thème quotidiennement avec les nouvelles versions de Hugo -> OK
- #54 -> OK
- corriger slider menu qui ne fonctionne plus -> OK
- Update font awesome -> OK
- internationalisation -> OK
- Messages: OK
- Ajouter un bouton pour changer de langue : OK
- netlify -> OK
- home page -> OK
- réintégrer la doc dans le même repo -> OK
- récupérer les shortcodes utiles -> OK
- expand : OK
- mermaid : OK
- chapter -> OK
- recherche (avec pointage à la première occurence sur la page) -> OK
- visited links -> OK
- disable Search -> OK
- vérifier que ça fonctionne avec une base url -> OK
- tester les affichages de page enfant -> OK
- comprendre l'histoire de pagination -> OK
- améliorer les couleurs de surlignement de highlightjs -> OK
- créer les archetypes -> OK
-> créé ceux de base -> OK
-> vérifier la possibilité de générer automatiquement le bon weight -> OK
73 changes: 73 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
baseURL = "/"
languageCode = "en-US"
defaultContentLanguage = "en"

title = "Hugo Learn Documentation"
theme = "hugo-theme-learn"
themesdir = "../.."
metaDataFormat = "yaml"
defaultContentLanguageInSubdir= true

[params]
editURL = "https://github.com/matcornic/hugo-theme-learn/edit/master/exampleSite/content/"
description = "Documentation for Hugo Learn Theme"
author = "Mathieu Cornic"
showVisitedLinks = true

[outputs]
home = [ "HTML", "RSS", "JSON"]

[Languages]
[Languages.en]
title = "Documentation for Hugo Learn Theme"
weight = 1
languageName = "English"

[[Languages.en.menu.shortcuts]]
name = "<i class='fa fa-github'></i> Github repo"
identifier = "ds"
url = "https://github.com/matcornic/hugo-theme-learn"
weight = 10

[[Languages.en.menu.shortcuts]]
name = "<i class='fa fa-camera'></i> Showcases"
url = "showcase"
weight = 11

[[Languages.en.menu.shortcuts]]
name = "<i class='fa fa-bookmark'></i> Hugo Documentation"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20

[[Languages.en.menu.shortcuts]]
name = "<i class='fa fa-bullhorn'></i> Credits"
url = "/credits"
weight = 30

[Languages.fr]
title = "Documentation du thème Hugo Learn"
weight = 2
languageName = "Français"

[[Languages.fr.menu.shortcuts]]
name = "<i class='fa fa-github'></i> Repo Github"
identifier = "ds"
url = "https://github.com/matcornic/hugo-theme-learn"
weight = 10

[[Languages.fr.menu.shortcuts]]
name = "<i class='fa fa-camera'></i> Vitrine"
url = "/showcase"
weight = 11

[[Languages.fr.menu.shortcuts]]
name = "<i class='fa fa-bookmark'></i> Documentation Hugo"
identifier = "hugodoc"
url = "https://gohugo.io/"
weight = 20

[[Languages.fr.menu.shortcuts]]
name = "<i class='fa fa-bullhorn'></i> Crédits"
url = "/credits"
weight = 30
41 changes: 41 additions & 0 deletions exampleSite/content/_index.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: "Learn Theme for Hugo"
---

# Hugo learn theme

[Hugo-theme-learn](http://github.com/matcornic/hugo-theme-learn) is a theme for [Hugo](https://gohugo.io/), a fast and modern static website engine written in Go. Where Hugo is often used for blogs, this multilingual-ready theme is **fully designed for documentation**.

This theme is a partial porting of the [Learn theme](http://learn.getgrav.org/) of [Grav](https://getgrav.org/), a modern flat-file CMS written in PHP.

{{% notice tip %}}Learn theme works with a _page tree structure_ to organize content : All contents are pages, which belong to other pages. [read more about this]({{%relref "cont/pages/_index.md"%}})
{{% /notice %}}

## Main features

* [Automatic Search]({{%relref "basics/configuration/_index.md" %}})
* [Multilingual mode]({{%relref "cont/i18n/_index.md" %}})
* **Unlimited menu levels**
* **Automatic next/prev buttons to navigate through menu entries**
* [Image resizing, shadow...]({{%relref "cont/markdown.en.md#images" %}})
* [Attachments files]({{%relref "shortcodes/attachments.en.md" %}})
* [List child pages]({{%relref "shortcodes/children/_index.md" %}})
* [Mermaid diagram]({{%relref "shortcodes/mermaid.en.md" %}}) (flowchart, sequence, gantt)
* [Customizable look and feel and themes variants]({{%relref "basics/configuration/_index.md"%}})
* [Buttons]({{%relref "shortcodes/button.en.md" %}}), [Tip/Note/Info/Warning boxes]({{%relref "shortcodes/notice.en.md" %}}), [Expand]({{%relref "shortcodes/expand.en.md" %}})

![Screenshot](https://github.com/matcornic/hugo-theme-learn/raw/master/images/screenshot.png?width=40pc&classes=shadow)

## Contribute to this documentation
Feel free to update this content, just click the **Edit this page** link displayed on top right of each page, and pullrequest it

{{% notice info %}}
Your modification will be deployed automatically when merged.
{{% /notice %}}

## Documentation website
This current documentation has been statically generated with Hugo with a simple command : `hugo -t hugo-theme-learn` -- source code is [available here at GitHub](https://github.com/matcornic/hugo-theme-learn)

{{% notice note %}}
Automatically published and hosted thanks to [Netlify](https://www.netlify.com/). Read more about [Automated HUGO deployments with Netlify](https://www.netlify.com/blog/2015/07/30/hosting-hugo-on-netlifyinsanely-fast-deploys/)
{{% /notice %}}
43 changes: 43 additions & 0 deletions exampleSite/content/_index.fr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: "Learn Theme for Hugo"
---

# Thème Hugo learn

[Hugo-theme-learn](http://github.com/matcornic/hugo-theme-learn) est un thème pour [Hugo](https://gohugo.io/), un générateur de site statique, rapide et modern, écrit en Go. Tandis que Hugo est souvent utilisé pour des blogs, ce thème multi-langue est **entièrement conçu pour la documentation**.

Ce thème est un portage partiel du [thème Learn](http://learn.getgrav.org/) de [Grav](https://getgrav.org/), un CMS modern écrit en PHP.

{{% notice tip %}}Le thème Learn fonctionne grâce à la structure de page aborescentes pour organiser le contenu: tous les contenus sont des pages qui appartiennent à d'autres pages. [Plus d'infos]({{%relref "cont/pages/_index.md"%}})
{{% /notice %}}

## Fonctionnalité principales

* [Recherche automatique]({{%relref "basics/configuration/_index.md" %}})
* [Mode multi-langue]({{%relref "cont/i18n/_index.md" %}})
* **Nombre de niveau infini dans le menu**
* **Boutons suivant/précédent automatiquement générés pour naviguer entre les items du menu**
* [Taille d'image, ombres...]({{%relref "cont/markdown.fr.md#images" %}})
* [Fichiers joints]({{%relref "shortcodes/attachments.fr.md" %}})
* [Lister les pages filles]({{%relref "shortcodes/children/_index.md" %}})
* [Diagrammes Mermaid]({{%relref "shortcodes/mermaid.fr.md" %}}) (flowchart, sequence, gantt)
* [Style configurable and variantes de couleurs]({{%relref "basics/configuration/_index.md"%}})
* [Boutons]({{%relref "shortcodes/button.fr.md" %}}), [Messages Astuce/Note/Info/Attention]({{%relref "shortcodes/notice.fr.md" %}}), [Expand]({{%relref "shortcodes/expand.fr.md" %}})

![Screenshot](https://github.com/matcornic/hugo-theme-learn/raw/master/images/screenshot.png?width=40pc&classes=shadow)

## Contribuer à cette documentation

N'hésitez pas à mettre à jour ce contenu en cliquant sur le lien **Modifier cette page** en haut de chaque page, et créer la Pull Request associée.

{{% notice info %}}
Votre modification sera déployée automatiquement quand elle sera mergée.
{{% /notice %}}

## Site de documentation

Cette documentation statique a été générée avec Hugo avec une simple commande : `hugo -t hugo-theme-learn` -- le code source est [disponible sur Github](https://github.com/matcornic/hugo-theme-learn)

{{% notice note %}}
Le site est auomatiquement publié et hébergé par [Netlify](https://www.netlify.com/). Plus d'infos sur le [déploiement de site Hugo avec Netlify](https://www.netlify.com/blog/2015/07/30/hosting-hugo-on-netlifyinsanely-fast-deploys/)(En anglais)
{{% /notice %}}
12 changes: 12 additions & 0 deletions exampleSite/content/basics/_index.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Basics
weight: 5
pre: "<b>1. </b>"
chapter: true
---

### Chapter 1

# Basics

Discover what this Hugo theme is all about and the core-concepts behind it.
12 changes: 12 additions & 0 deletions exampleSite/content/basics/_index.fr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Démarrage
weight: 5
pre: "<b>1. </b>"
chapter: true
---

### Chapitre 1

# Démarrage

Découvrez comment utiliser ce thème Hugo et apprenez en les concepts
Loading