Commit b6b1fb5a authored by shirenn's avatar shirenn 🌊
Browse files

Initial hugo project

parents
# Build files
public/
resources/
baseURL = "https://ludothon.abys.se"
languageCode = "fr-fr"
title = "Ludothon"
theme = "cactus"
disableKinds = ["taxonomyTerm"]
[markup]
[markup.tableOfContents]
endLevel = 4
ordered = false
startLevel = 2
[params]
colortheme = "dark" # dark, light, white, or classic
# Home page settings
description = "Site internet du ludothon"
# https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference
dateFormat = "02/01/2006"
[params.comments]
enabled = false
# the value of name should be an valid font awesome icon name (brands type)
# https://fontawesome.com/icons?d=gallery&s=brands
[[params.social]]
name = "discord"
link = "https://discord.gg/vwXMRb7nCh"
[[params.social]]
name = "wikipedia-w"
link = "https://wiki.crans.org/VieBdl/Ludothon"
public/
\ No newline at end of file
MIT License
Copyright (c) 2020 ZERAN WU
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.
## Cactus
A hugo theme for personal blog. Fork from hexo theme [cactus](https://github.com/probberechts/hexo-theme-cactus) created by @probberechts.
[Live demo on github pages](https://www.takuzen.me/hugo-theme-cactus/).
Some works are still in progress. See [TODOS](#todos) below.
## Install
1. clone cactus to your hugo site's `themes` folder.
```
git clone https://github.com/monkeyWzr/hugo-theme-cactus.git themes/cactus
```
2. change your theme to cactus in your site config
```toml
# config.toml
theme = "cactus"
```
3. config your site. See [Config] or a [complete config sample](exampleSite/config.toml)
4. test your site
```
hugo server
```
5. publish your site in your prefered way. See hugo's doc: [Hosting & Deployment](https://gohugo.io/hosting-and-deployment/)
## Config
### Color themes
```toml
[params]
colortheme = "white" # dark, light, white, or classic
```
### Navigation
```toml
# Main menu which appears below site header.
[[menu.main]]
name = "Home"
url = "/"
weight = 1
[[menu.main]]
name = "All posts"
url = "/posts"
weight = 2
[[menu.main]]
name = "Tags"
url = "/tags"
weight = 3
[[menu.main]]
name = "About"
url = "/about"
weight = 4
```
### Homepage settings
* description: description will be displayed in the homepage.
```toml
[params]
description = "Hugo is a general-purpose website framework. Technically speaking, Hugo is a static site generator. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website’s end users and an ideal writing experience for website authors."
```
* set your main section (used as the link for the "writings" title on the homepage)
```toml
[params]
mainSection = "posts"
```
* Show only the 5 most recent posts (default)
```toml
[params]
showAllPostsOnHomePage = false
postsOnHomePage = 5
```
* show all posts
```toml
[params]
showAllPostsOnHomePage = true
postsOnHomePage = 5 # this option will be ignored
```
* show tagsoverview (defalut) or not
*
```toml
[params]
tagsOverview = true
```
* show projects list (default) or not.
```toml
[params]
showProjectsList = true
projectsUrl = "https://github.com/monkeyWzr"
```
Projects section will not be shown if no data file detecSee [Projects list](#projects-list) below.
### Projects list
Create your projects data file `data/projects.yaml|toml|json`. Hugo support yaml, toml and json formats.
for former hexo cactus users: please assign your json array to a `list` key.
for example, `data/projects.json`:
```json
{
"list": [
{
"name":"Hexo",
"url":"https://hexo.io/",
"desc":"A fast, simple & powerful blog framework"
},
{
"name":"Font Awesome",
"url":"http://fontawesome.io/",
"desc":"The iconic font and CSS toolkit"
}
]
}
```
## Social media links
```toml
[[params.social]]
name = "github"
link = "https://github.com/monkeyWzr"
[[params.social]]
name = "email"
link = "monkeywzr@gmail.com" # no need for "mailto:" at the start
[[params.social]]
name = "linkedin"
link = "https://www.linkedin.com/in/monkeywzr/"
```
The `name` key expects the name of a [Font Awesome icon](https://fontawesome.com/icons?d=gallery&s=brands).
### Copyright
Assign your copy right to `.Site.Copyright`. Cactus will append current year to the head.
TODO: Customizable copyright year
```toml
copyright = "Zeran Wu" # cactus theme will use site title if copyright is not set
```
### Comments
Comments is disabled by default. Enable comments in your `.Site.Params`.
```toml
[params]
[params.comments]
enabled = true
# engine = "disqus" # in progress
```
You can also enable/disable comments per post. in your posts' front matter, add:
```yaml
comments: true
```
The site config is ignored when `comments` option exists in front matter.
The default engine is disqus. **By now only disqus is supported in cactus.** I will add more options sooner or later. See [Comments Alternatives](https://gohugo.io/content-management/comments/#comments-alternatives)
Before using disqus, you need to register and get your [disqus shortname](https://help.disqus.com/en/articles/1717111-what-s-a-shortname). Assign your shortname in `.Site.disqusShortname`, or cactus will use `.Site.Title` by default.
```
disqusShortname = "wzr" # cactus will use site title if not set
```
### highlight
Use hugo's built-in [syntax highlighting](https://gohugo.io/getting-started/configuration-markup#highlight).
default config:
```toml
[markup]
[markup.highlight]
codeFences = true
guessSyntax = false
hl_Lines = ""
lineNoStart = 1
lineNos = false
lineNumbersInTable = true
noClasses = true
style = "monokai"
tabWidth = 4
```
### Analytics
Cactus uses hugo's bulit in [analytics templates](https://gohugo.io/templates/internal#google-analytics)
Add you tracking id in your site config. By default cactus uses synchronous tracking code. You can switch to asynchronous tracking by set `googleAnalyticsAsync` to `true`.
```toml
googleAnalytics = "UA-123-45"
googleAnalyticsAsync = true # not required
```
### RSS
The rss feed is not generated by default. you can enable it in your site config:
```toml
[params]
rss = true
```
The rss link will be `https://example.com/index.xml` assuming your `baseURL` is set to `https://example.com/`
Please also check [Configure RSS](https://gohugo.io/templates/rss/#configure-rss)
### Mathjax
Cactus supports mathjax. Just add `mathjax` option in your site config:
```toml
[params]
mathjax = true # not required
```
You can also enable/disable mathjax per post. In your posts' front matter, add:
```yaml
mathjax: true # or false
```
The site config will be ignored when `mathjax` option exists in front matter.
## TODOS
- [ ] More comments engines
- [x] RSS
- [ ] I18n
- [x] Analytics
- [ ] Local Search
- [ ] toc template
- [ ] Customizable copyright year
- [ ] gallery
- [ ] expose [mathjax configuration](https://docs.mathjax.org/en/latest/web/configuration.html#web-configuration)
## License
MIT
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
{{ partial "head.html" . }}
<body class="max-width mx-auto px3 ltr">
<div class="content index py4">
{{ partial "header.html" . }}
{{ block "main" . }}
{{ end }}
{{ partial "footer.html" . }}
</div>
</body>
<link rel="stylesheet" href={{ "lib/font-awesome/css/all.min.css" | relURL }}>
<script src={{ "lib/jquery/jquery.min.js" | relURL }}></script>
<script src={{ "js/main.js" | relURL }}></script>
</html>
{{ define "main" }}
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<div class="content" itemprop="articleBody">
{{ .Content }}
</div>
</article>
{{ end }}
{{ define "main" }}
<section id="about">
{{ if isset .Site.Params "social" }}
<p>Liens utiles :
{{ $length := (len .Site.Params.social) }}
{{ range $index, $elem := .Site.Params.social}}
<a class="icon" target="_blank" rel="noopener" href="{{ $elem.link }}">
<i class="fab fa-{{ lower $elem.name }}"></i>
</a>
{{ if (lt (add $index 2) $length) }}
{{- print " , " -}}
{{ else if (lt (add $index 1) $length) }}
{{- print " and " -}}
{{ else }}
{{- print "." -}}
{{ end }}
{{ end }}
</p>
{{ end }}
</section>
<article class="post" itemscope itemtype="http://schema.org/BlogPosting">
<div class="content" itemprop="articleBody">
{{ .Content }}
</div>
</article>
{{ end }}
<!-- TODO -->
<link rel="icon" type="image/png" href="{{ "images/favicon.ico" | absURL }}" />
<footer id="footer">
<div class="footer-left">
Copyright &copy; {{ now.Format "2006" }} {{ if .Site.Copyright }} {{ print .Site.Copyright }} {{ else }} {{ print .Site.Title }} {{ end }}
</div>
<div class="footer-right">
<nav>
<ul>
{{ range .Site.Menus.main }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
</ul>
</nav>
</div>
</footer>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{ if .IsPage }} {{ .Title }} | {{ end }}{{ .Site.Title }}</title>
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex">
{{ template "_internal/opengraph.html" . }}
{{ template "_internal/twitter_cards.html" . }}
{{ .Scratch.Set "colortheme" "white"}}
{{ if .Site.Params.Colortheme }}
{{ .Scratch.Set "colortheme" .Site.Params.Colortheme }}
{{ end }}
{{ $colortheme := .Scratch.Get "colortheme" }}
<link rel="stylesheet" href="{{ $colortheme | printf "css/style-%s.css" | absURL }}">
{{ `
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
` | safeHTML }}
{{ partial "favicon.html" . }}
</head>
<header id="header">
<a href="{{ .Site.BaseURL }}">
<div id="logo" style="background-image: url({{ "images/logo.png" | absURL }})"></div>
<div id="title">
<h1>{{ .Site.Title }}</h1>
</div>
</a>
<div id="nav">
<ul>
<li class="icon">
<a href="#"><i class="fas fa-bars fa-2x"></i></a>
</li>
{{ range .Site.Menus.main }}
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
{{ end }}
</ul>
</div>
</header>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment