+ {{ $currentPage.Title }} + {{ if .Draft }} + DRAFT + {{ end }} +
+{{ $currentPage.Description | markdownify }}
+ {{ end }} +diff --git a/content/blog/.gitkeep b/content/blog/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/content/docs/.gitkeep b/content/docs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/content/docs/sample-subject/_index.md b/content/docs/sample-subject/_index.md new file mode 100644 index 0000000..f4bdcbd --- /dev/null +++ b/content/docs/sample-subject/_index.md @@ -0,0 +1,11 @@ +--- +weight: 999 +title: "Example" +description: "Sujet d'exemple pour faire un sujet" +icon: "function" +date: "2023-08-26T20:43:23+01:00" +lastmod: "2023-08-26T20:43:23+01:00" +draft: false +toc: true +katex: false +--- diff --git a/content/docs/sample-subject/markdown.md b/content/docs/sample-subject/markdown.md new file mode 100644 index 0000000..74e51a0 --- /dev/null +++ b/content/docs/sample-subject/markdown.md @@ -0,0 +1,73 @@ +--- +weight: 500 +title: "Ecrire un sujet" +description: "Comment les sujets sont écrits ?" +icon: "fluid_med" +date: "2023-08-26T20:43:23+01:00" +lastmod: "2023-08-26T20:43:23+01:00" +draft: false +toc: true +katex: true +--- + +### Markdown ? + +Le LaTeX c'est bien beau mais si on doit faire tous nos cours comme ça, ça nous prendrait une éternité pour couvrir tous les chapitres :c. + +C'est pour ça que les sujets sont écrits en `Markdown`. +Enfin, on écrit un fichier en Markdown et `Hugo` nous permet de le transformer en page `Html` automatiquement. + +Le `Markdown` est un langage de balisage (un peu comme le `Html`) créer avec comme objectif d'offrire une syntaxe facile à lire et à écrire. + +#### Pourquoi faire du Markdown ? + +Si vous utilisez **Discord** alors vous avez peut-être déjà entendu parlé de `Markdown`, sinon vous allez voir que c'est vraiment très simple à prendre en main :) + +Voici un exemple montrant la simplicité du `Markdown` par rapport au `Html` et `LaTex` + +{{< tabs tabTotal="3">}} +{{% tab title="Html" %}} + +**Html demo** + +```html +
CeMot en gras et celui-là aussi.
+``` + +CeMot en gras et celui-là aussi.
+ +{{% /tab %}} +{{% tab title="LaTex" %}} + +**LaTeX demo** + +```latex +Ce \textbf{Mot} en gras et celui-là \textbf{aussi}. +``` + +{{< katex >}} +$$ +Ce\ \textbf{Mot}\ en\ gras\ et\ celui-là\ \textbf{aussi}. +$$ +{{< /katex >}} + +{{% /tab %}} +{{% tab title="Markdown" %}} + +**MarkDown demo** + +```markdown +Ce **Mot** en gras et celui-là **aussi**. +``` + +Ce **Mot** en gras et celui-là **aussi**. + +{{% /tab %}} +{{< /tabs >}} + +#### Comment faire du Markdown ? + +|format|Markdown|Résultat| +|--------|--------|--------| +| Italique | `*lorem*` | *lorem ipsum* | +| C | D || diff --git a/content/docs/sample-subject/overview.md b/content/docs/sample-subject/overview.md new file mode 100644 index 0000000..95f2f4a --- /dev/null +++ b/content/docs/sample-subject/overview.md @@ -0,0 +1,29 @@ +--- +weight: 500 +title: "Aperçu" +description: "Comment faire un sujet" +icon: "local_library" +date: "2023-08-26T20:43:23+01:00" +lastmod: "2023-08-26T20:43:23+01:00" +draft: false +toc: true +katex: false +--- + +### Hugo ? Kesako ?? + +`Hugo` est un framework pour fabriquer des sites web. +C'est l'un des framework les plus populaires pour créer des sites statiques ; +c'est à dire des sites qui n'ont pas de traitement côté serveur et donc pas de base de données. + +Le site est donc uniquement composé de `HTML`, `CSS` et `Javascript`, +les pages sont "fixes"et toute fonctionnalité *dynamique* est executé sur le navigateur de l'utilisateur grâce au *javascript*. + +De plus, `Hugo` est très simple d'utilisation et a une documentation complète et propose une large sélection de thèmes et +vous permet également de créer votre propre thème (nous avons assemblé plusieurs thèmes pour obtenir le thème qui fait fonctionner le site). + +Vous pourrez retrouver le documentation et les comment installer `Hugo` sur leur [site web](https://gohugo.io/). + +#### Le thème Hugo + +Vous pourrez retrouver le thème Hugo B2B sur [github](https://github.com/BackToBasicsEpita/b2b-theme) ainsi que la documentation pour pour l'utiliser pour faire votre propre site :) diff --git "a/content/docs/sp\303\251/_index.md" "b/content/docs/sp\303\251/_index.md" deleted file mode 100644 index c981dd1..0000000 --- "a/content/docs/sp\303\251/_index.md" +++ /dev/null @@ -1,10 +0,0 @@ ---- -weight: 999 -title: "Spé" -description: "" -icon: "article" -date: "2024-08-20T12:33:45+02:00" -lastmod: "2024-08-20T12:33:45+02:00" -draft: true -toc: true ---- \ No newline at end of file diff --git "a/content/docs/sp\303\251/tps/_index.md" "b/content/docs/sp\303\251/tps/_index.md" deleted file mode 100644 index ae289a5..0000000 --- "a/content/docs/sp\303\251/tps/_index.md" +++ /dev/null @@ -1,10 +0,0 @@ ---- -weight: 999 -title: "Tps" -description: "" -icon: "article" -date: "2024-08-20T12:34:28+02:00" -lastmod: "2024-08-20T12:34:28+02:00" -draft: true -toc: true ---- \ No newline at end of file diff --git a/content/docs/sup/_index.md b/content/docs/sup/_index.md deleted file mode 100644 index b4cee8a..0000000 --- a/content/docs/sup/_index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -weight: 999 -title: "Sup" -description: "" -icon: "article" -date: "2024-08-20T12:30:18+02:00" -lastmod: "2024-08-20T12:30:18+02:00" -draft: true -toc: true ---- \ No newline at end of file diff --git a/content/docs/sup/example-page.md b/content/docs/sup/example-page.md deleted file mode 100644 index a2e5870..0000000 --- a/content/docs/sup/example-page.md +++ /dev/null @@ -1,5 +0,0 @@ -+++ -title = 'Example Page' -date = 2024-08-20T12:02:23+02:00 -draft = true -+++ diff --git a/content/spe/.gitkeep b/content/spe/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/content/sup/.gitkeep b/content/sup/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/content/sup/caca/_index.md b/content/sup/caca/_index.md deleted file mode 100644 index 6b98663..0000000 --- a/content/sup/caca/_index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -weight: 999 -title: "Caca" -description: "" -icon: "article" -date: "2024-08-20T12:30:18+02:00" -lastmod: "2024-08-20T12:30:18+02:00" -draft: true -toc: true ---- \ No newline at end of file diff --git a/content/sup/caca/example-page.md b/content/sup/caca/example-page.md deleted file mode 100644 index 8b663dc..0000000 --- a/content/sup/caca/example-page.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: "Code" -description: "" -icon: "code" -date: "2023-05-22T00:44:31+01:00" -lastmod: "2023-05-22T00:44:31+01:00" -draft: false -toc: true -weight: 210 ---- - -{{% alert context="warning" text="The front matter `description` value for this page has been intentionally left empty in order to demonstrate FlexSearch's suggested results fallback behaviour." /%}} - -## Code Block Examples - -Code block language examples - -### Go - -```go -package main - -import "fmt" - -func main() { - fmt.Println("hello world") -} -``` - -### HTML - -```html - - - - -My first paragraph.
- - - -``` - -### Markdown - -```md -# H1 heading - -**Some bold text** - -*Italic text example* -``` \ No newline at end of file diff --git a/hugo.toml b/hugo.toml index 96afc7c..2737836 100644 --- a/hugo.toml +++ b/hugo.toml @@ -13,6 +13,9 @@ title = 'BackToBasics' path = "github.com/gohugoio/hugo-mod-bootstrap-scss/v5" disable = false +[markup.goldmark.renderer] + unsafe = true # allow html in md files + [params] [params.docs] darkMode = true diff --git a/themes/lotusdocs/layouts/spe/_markup/render-codeblock-mermaid.html b/themes/lotusdocs/layouts/spe/_markup/render-codeblock-mermaid.html new file mode 100644 index 0000000..3844cd7 --- /dev/null +++ b/themes/lotusdocs/layouts/spe/_markup/render-codeblock-mermaid.html @@ -0,0 +1,4 @@ ++ {{- .Inner }} ++{{ .Page.Store.Set "hasMermaid" true }} \ No newline at end of file diff --git a/themes/lotusdocs/layouts/spe/_markup/render-codeblock.html b/themes/lotusdocs/layouts/spe/_markup/render-codeblock.html new file mode 100644 index 0000000..4328638 --- /dev/null +++ b/themes/lotusdocs/layouts/spe/_markup/render-codeblock.html @@ -0,0 +1,85 @@ + +{{ if eq .Page.Site.Params.docs.prism true }} + {{- $attributes := .Attributes }} + {{- $ordinal := .Ordinal }} + + + {{ $innerRemoveLB := replaceRE "\r\n?|\n" "" .Inner | string }} + {{ $innerHash := substr (sha1 (printf "%s%s" $innerRemoveLB $ordinal)) 0 7 }} + + {{- $classes := slice (printf "language-%s" .Type) .Attributes.class }} + + + {{- $options := .Options }} + {{ $optionslist := newScratch }} + {{ range $k, $v := $options }} + {{ $optionslist.Add "options" (printf " %s" $k) }} + {{ end }} + {{ $optionsclasslist := $optionslist.Get "options" }} + + + {{- if isset .Options "hl_lines" }} + {{ $lines := .Options.hl_lines }} + + {{ $offset := 0 }} + {{- if isset .Options "linenostart" }} + {{ $offset = .Options.linenostart }} + {{ else }} + {{ $offset = 1 }} + {{ end }} + + {{ $data := newScratch }} + {{ range $value := $lines }} + {{ $value = uniq $value }} + {{ if lt (len $value) 2 }} + {{ $value = slice (add $offset (index $value 0)) }} + {{ else }} + {{ $value = slice (delimit (slice (add $offset (index $value 0)) (add $offset (index $value 1))) "-") }} + {{ end }} + {{ $data.Add "lines" $value }} + {{ end }} + {{ $lines = delimit ($data.Get "lines") "," }} + + {{- $attributes = merge $attributes (dict "data-line" $lines) }} + + + {{- if and (isset .Options "linenos") (ne .Options.linenos false) }} + {{- $attributes = merge $attributes (dict "data-line-offset" (string $offset)) }} + {{ else }} + {{- $attributes = merge $attributes (dict "data-line-offset" (string (sub $offset 1))) }} + {{ end }} + + {{ end -}} + + + {{- if and (isset .Options "linenos") (ne .Options.linenos false) }} + {{- $classes = $classes | append "line-numbers" }} + {{ end -}} + + + {{- if isset .Options "linenostart" }} + {{- $attributes = merge $attributes (dict "data-start" (string .Options.linenostart)) }} + {{ end -}} + + + {{- if and (isset .Options "anchorlinenos") (ne .Options.anchorlinenos false) }} + {{- $classes = $classes | append "linkable-line-numbers" }} + {{ end -}} + + {{- $attributes = merge $attributes (dict "class" (delimit $classes " ")) }} + + +{{ else }} + {{ $result := transform.HighlightCodeBlock . }} + {{ $result.Wrapped }} +{{ end }} \ No newline at end of file diff --git a/themes/lotusdocs/layouts/spe/_markup/render-heading.html b/themes/lotusdocs/layouts/spe/_markup/render-heading.html new file mode 100644 index 0000000..e4f1a21 --- /dev/null +++ b/themes/lotusdocs/layouts/spe/_markup/render-heading.html @@ -0,0 +1 @@ +
%s
%s{{ $currentPage.Description | markdownify }}
+ {{ end }} +