feat: partials for style and scripts are now empty

This commit is contained in:
Mathieu Cornic 2016-04-11 00:09:03 +02:00
parent 9ac9c082b1
commit f50a77d0c5
14 changed files with 98 additions and 44 deletions

View file

@ -1,5 +1,22 @@
# Learn Hugo Theme # Learn Hugo Theme
This repository contains a theme for Hugo, based on great Grav Learn Theme (http://learn.getgrav.org/). This repository contains a theme for [Hugo](https://gohugo.io/), based on great [Grav Learn Theme](http://learn.getgrav.org/).
**/!\ Is currently a draft project** Visit the [theme documentation](https://matcornic.github.io/hugo-learn-doc) to see what is going on. It is actually built with this theme.
# Main functionalities
- 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)
# TODO
- Handling more than 2 levels in documentation.
- Search in site
- Handling videos
- Add optional button to create doc issue (like github)

14
archetypes/chapter.md Normal file
View file

@ -0,0 +1,14 @@
---
title: "Some Chapter title"
weight: 0
prev: /prev/path
next: /next/path
chapter: true
icon: "<b>X. </b>" # HTML code as prefix in the menu
---
### Chapter X
# Some Chapter title
Lorem ipsum

View file

@ -1,11 +1,9 @@
--- ---
title: "Some Title" title: "Some Title"
aliases: weight: 5
- /some/path
weight: 0 # To change for order
prev: /prev/path prev: /prev/path
next: /next/path next: /next/path
toc: true # For leaf pages toc: true
#chapter: true # For nodes pages
#icon: "<b>1. </b>" # Prefix icon for node pages
--- ---
Lorem Ipsum

View file

@ -6,9 +6,27 @@
{{ partial "favicon.html" . }} {{ partial "favicon.html" . }}
{{ .Scratch.Add "title" "" }}{{ if isset .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}} {{ .Scratch.Add "title" "" }}{{ if isset .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}}
<title>{{ .Scratch.Get "title" }}</title> <title>{{ .Scratch.Get "title" }}</title>
{{ partial "head_includes.html" . }} {{ partial "style.html" . }}
<link href="/css/nucleus.css" rel="stylesheet">
<link href="/css/font-awesome.min.css" rel="stylesheet">
<link href="/css/hybrid.css" rel="stylesheet">
<link href="/css/featherlight.min.css" rel="stylesheet">
<link href="/css/perfect-scrollbar.min.css" rel="stylesheet">
<link href="/css/theme.css" rel="stylesheet">
<link href="/css/hugo-theme.css" rel="stylesheet">
<style type="text/css"> <style type="text/css">
:root #header + #content > #left > #rlblock_left {display:none !important;} :root #header + #content > #left > #rlblock_left {
display:none !important;
}
p,li,ul {
text-align: center
}
ul
{
list-style-type: none;
}
</style> </style>
</head> </head>
<body> <body>
@ -19,10 +37,15 @@
<div class="padding highlightable"> <div class="padding highlightable">
<h1>Customize your own home page</h1> <h1>Customize your own home page</h1>
<p style="text-align: center"> <p>
The site is working but you should overwrite this index.html with your own. The site is working, change the URL in your browser to get to any custom page. But, don't forget to <a href="https://gohugo.io/themes/customizing/">overwrite this index.html</a> with your own. You typically have 3 choices :
If you want to redirect You may want to redirect to the first document page.
</p> </p>
<ul>
<li><b>1. </b> Create an overview page for your project</li>
<li><b>2. </b> Create an empty html page with this code in the head tag to redirect to one of your documentation page : <code>&lt;meta http-equiv="refresh" content="0; url=http://example.com/"/&gt;</code> </li>
<li><b>3. </b> Configure your server to automatically redirect home page to one your documentation page</li>
</ul>
<p><i class="fa fa-heart fa-4x"></i></p>
</div> </div>
</section> </section>
</body> </body>

View file

@ -14,6 +14,18 @@
<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"> <div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
<div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div> <div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
</div> </div>
{{ partial "script_includes.html" . }} <script src="/js/jquery-2.x.min.js"></script>
<script src="/js/clipboard.min.js"></script>
<script src="/js/perfect-scrollbar.min.js"></script>
<script src="/js/perfect-scrollbar.jquery.min.js"></script>
<script src="/js/jquery.sticky-kit.min.js"></script>
<script src="/js/featherlight.min.js"></script>
<script src="/js/html5shiv-printshiv.min.js"></script>
<script src="/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/modernizr.custom.71422.js"></script>
<script src="/js/learn.js"></script>
<script src="/js/hugo-learn.js"></script>
{{ partial "script.html" . }}
</body> </body>
</html> </html>

View file

@ -1,9 +0,0 @@
<link href="/css/nucleus.css" rel="stylesheet">
<link href="/css/font-awesome.min.css" rel="stylesheet">
<link href="/css/hybrid.css" rel="stylesheet">
<link href="/css/featherlight.min.css" rel="stylesheet">
<link href="/css/perfect-scrollbar.min.css" rel="stylesheet">
<link href="/css/theme.css" rel="stylesheet">
<link href="/css/hugo-theme.css" rel="stylesheet">
<style type="text/css">:root #header + #content > #left > #rlblock_left
{display:none !important;}</style>

View file

@ -1,11 +1,23 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en" class="js csstransforms3d"> <html lang="en" class="js csstransforms3d">
<head> <head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
{{ .Hugo.Generator }}
{{ partial "meta.html" . }} {{ partial "meta.html" . }}
{{ partial "favicon.html" . }} {{ partial "favicon.html" . }}
{{ .Scratch.Add "title" "" }}{{ if isset .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}} {{ .Scratch.Add "title" "" }}{{ if isset .Site.Data.titles .Title }}{{ .Scratch.Set "title" (index .Site.Data.titles .Title).title }}{{ else }}{{ .Scratch.Set "title" .Title}}{{end}}
<title>{{ .Scratch.Get "title" }}</title> <title>{{ .Scratch.Get "title" }}</title>
{{ partial "head_includes.html" . }} <link href="/css/nucleus.css" rel="stylesheet">
<link href="/css/font-awesome.min.css" rel="stylesheet">
<link href="/css/hybrid.css" rel="stylesheet">
<link href="/css/featherlight.min.css" rel="stylesheet">
<link href="/css/perfect-scrollbar.min.css" rel="stylesheet">
<link href="/css/theme.css" rel="stylesheet">
<link href="/css/hugo-theme.css" rel="stylesheet">
<style type="text/css">:root #header + #content > #left > #rlblock_left
{display:none !important;}</style>
{{ partial "style.html" . }}
</head> </head>
<body class="" data-url="/"> <body class="" data-url="/">
{{ partial "menu.html" . }} {{ partial "menu.html" . }}
@ -34,7 +46,7 @@
</a> </a>
</span> </span>
{{ if and (not .Params.chapter) (.Params.toc) }} {{ if and (not .Params.chapter) (.Params.toc) }}
<span id="toc-menu"><a href=""><i class="fa fa-ellipsis-v"></i></a></span> <span id="toc-menu"><a href=""><i class="fa fa-list-alt"></i></a></span>
{{ end }} {{ end }}
{{ $type := .Type }} {{ $type := .Type }}
{{ $relLink := .RelPermalink }} {{ $relLink := .RelPermalink }}

View file

@ -1,5 +1,2 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}"> <meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }} {{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ .Hugo.Generator }}

View file

@ -0,0 +1 @@
<!-- Partial intended to be overwritten to add javacript -->

View file

@ -1,12 +0,0 @@
<script src="/js/jquery-2.x.min.js"></script>
<script src="/js/clipboard.min.js"></script>
<script src="/js/perfect-scrollbar.min.js"></script>
<script src="/js/perfect-scrollbar.jquery.min.js"></script>
<script src="/js/jquery.sticky-kit.min.js"></script>
<script src="/js/featherlight.min.js"></script>
<script src="/js/html5shiv-printshiv.min.js"></script>
<script src="/js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="/js/modernizr.custom.71422.js"></script>
<script src="/js/learn.js"></script>
<script src="/js/hugo-learn.js"></script>

View file

@ -0,0 +1 @@
<!-- Partial intended to be overwritten to add CSS -->

View file

@ -231,7 +231,7 @@ jQuery(document).ready(function() {
$('#top-bar a:not(:has(img)):not(.btn)').addClass('highlight'); $('#top-bar a:not(:has(img)):not(.btn)').addClass('highlight');
$('#body-inner a:not(:has(img)):not(.btn)').addClass('highlight'); $('#body-inner a:not(:has(img)):not(.btn)').addClass('highlight');
$('#toc-menu a').hover(function() { $('#toc-menu').hover(function() {
$('.progress').stop(true, false, true).fadeToggle(100); $('.progress').stop(true, false, true).fadeToggle(100);
}); });

View file

@ -1,11 +1,11 @@
# theme.toml template for a Hugo theme # theme.toml template for a Hugo theme
# See https://github.com/spf13/hugoThemes#themetoml for an example # See https://github.com/spf13/hugoThemes#themetoml for an example
name = "learn" name = "Learn"
license = "MIT" license = "MIT"
licenselink = "https://github.com/matcornic/hugo-theme-learn/blob/master/LICENSE.md" licenselink = "https://github.com/matcornic/hugo-theme-learn/blob/master/LICENSE.md"
description = "Documentation theme for Hugo, based on Grav Learn theme" description = "Documentation theme for Hugo, based on Grav Learn theme"
#homepage = "http://siteforthistheme.com/" homepage = "http://matcornic.github.io/hugo-learn-doc"
tags = ["documentation", "grav", "learn"] tags = ["documentation", "grav", "learn"]
features = ["documentation"] features = ["documentation"]
min_version = 0.15 min_version = 0.15
@ -15,6 +15,6 @@ min_version = 0.15
homepage = "http://matcornic.com" homepage = "http://matcornic.com"
[original] [original]
name = "Grav" name = "Grav Learn"
homepage = "http://learn.getgrav.org/" homepage = "http://learn.getgrav.org/"
repo = "https://github.com/getgrav/grav-learn" repo = "https://github.com/getgrav/grav-learn"