Skip to content
Extraits de code Groupes Projets
Valider bf0b2384 rédigé par Théo - Le Filament's avatar Théo - Le Filament
Parcourir les fichiers

hugo repo creation

parent be7b48fa
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
<nav>
<a href="/" class="logo-link" rel="home" itemprop="url">
<img src="https://le-filament.com/img/logo-lefilament-H.svg" class="logo" alt="Le Filament" >
</a>
<div class="menu">
{{ range .Site.Menus.main }}
<div class="menu-item">
<div class="menu-shadow">
<a href="{{ .URL }}">{{ .Name }}</a>
</div>
</div>
{{ end }}
</div>
</nav>
{{ define "main" }}
<main id="main">
<h1>{{ .Title }}</h1>
{{ .Content }}
<section class="posts-list">
{{ range .Pages }}
<div class="post">
<a href="{{.Permalink}}" class="post-title">{{.Title}}</a>
<span class="post-info">le {{.Date.Format "02/01/2006"}} par {{ .Params.author }}</span>
<p class="post-summary">{{ .Summary }}</p>
</div>
{{ end }}
</section>
</main>
{{ end }}
{{ define "main" }}
<main id="main">
<article>
<h1>{{ .Title }}</h1>
{{ .Content }}
</article>
<section class="post-taxonomy">
<h3>Étiquettes</h3>
<div>
{{ range (.GetTerms "tags") }}
<a href="{{ .Permalink }}" class="taxonomy">{{ .LinkTitle }}</a>
{{ end }}
</div>
<h3>Catégories</h3>
<div>
{{ range (.GetTerms "categories") }}
<a href="{{ .Permalink }}" class="taxonomy">{{ .LinkTitle }}</a>
{{ end }}
</div>
</section>
{{ if (isset .Params "mastodon_id") }}
<section id="comments">
<h2>Commentaires</h2>
<a type=button id="load_comments" class="mastodon_button" onclick="loadComments({{ .Params.mastodon_id }})">Afficher les commentaires</a>
<div id="comments_holder"></div>
<a type=button class="mastodon_button" href="https://mastodon.social/interact/{{ .Params.mastodon_id }}?type=reply">Écrire un commentaire</a>
</section>
{{ end }}
</main>
{{ end }}
{{ define "main" }}
<main id="main">
<article>
<h1>Étiquette : {{ .Title }}</h1>
{{ .Content }}
</article>
<section class="posts-list">
{{ range .Pages }}
<div class="post">
<a href="{{.Permalink}}" class="post-title">{{.Title}}</a>
<span class="post-info">le {{.Date.Format "02/01/2006"}} par {{ .Params.author }}</span>
<p class="post-summary">{{ .Summary }}</p>
</div>
{{ end }}
</section>
</main>
{{ end }}
{{ define "main" }}
<main id="main">
<h1>{{ .Title }}</h1>
{{ .Content }}
<ul>
{{ range .Site.Taxonomies.tags }}
<li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a> ({{ .Count }})</li>
{{ end }}
</ul>
</main>
{{ end }}
@font-face {
font-family:'DejaVu Sans';
src:url(https://le-filament.com/src/fonts/DejaVuSans-ExtraLight.woff2) format('woff2'),
url(https://le-filament.com/src/fonts/DejaVuSans-ExtraLight.woff) format('woff');
font-weight:200;
font-style:normal
}
*, ::before, ::after {
box-sizing: inherit;
}
body, button, input, select, optgroup, textarea {
font-family: 'DejaVu Sans', sans-serif;
font-weight: 100;
font-size: 16px;
font-size: 1rem;
line-height: 1.5;
color: #1c2f82;
}
body {
height:100vh;
margin:0;
display: flex;
flex-direction: column;
}
a {
color: #1C2F82;
background-color: transparent;
text-decoration: none;
color: #1C2F82;
}
a:visited {
color: #1C2F82;
}
p {
margin-bottom: 1.5em;
}
img {
height: auto;
max-width: 100%;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
width: 800px;
margin: 25px auto;
}
nav .logo {
width: 155px;
margin-top: 10px;
}
section {
margin: 100px 0;
}
.menu {
display: flex;
justify-content: space-between;
align-items: center;
width: 50%;
}
.menu-item a {
text-decoration: none;
font-size: 13px;
color: #1C2F82;
border: 1px solid #1C2F82;
padding-bottom: 7px;
padding-right: 17px;
padding-left: 15px;
padding-top: 8px;
background-color: transparent;
font-family: monospace;
}
.menu-shadow {
display: block;
width: 85%;
cursor: pointer;
background-color: #FFD14C;
padding-left: 3px;
padding-top: 8px;
}
main {
width: 750px;
margin: 50px auto;
}
.post {
margin: 50px 0;
}
.post-title {
background-color: #ffd14c;
border-radius: 1.2em;
padding: 0 10px;
font-size: 1.2em;
font-weight: bold;
}
.post-info {
font-size: 0.8em;
font-weight: lighter;
}
.post-summary {
padding-left: 25px;
}
.taxonomy {
background-color: #ffd14c;
border-radius: 1em;
padding: 2px 12px;
}
.mastodon_button {
display: block;
width: 400px;
margin: 20px auto;
padding: 5px 10px;
border-radius: 4px;
background-color: #2b90d9;
color: #fff;
font-family: sans-serif;
font-weight: bold;
text-transform: uppercase;
text-decoration: none;
text-align: center;
}
.mastodon_button:visited {
color: #fff;
}
.comment {
display: block;
padding: 10px;
margin: 20px;
border: solid #1c2f82 2px;
border-radius: 4px;
}
.comment > .author {
font-weight: bold;
}
footer {
margin-top: auto;
padding-bottom: 10px;
text-align: center;
font-size: 12px;
}
footer img {
height: 20px;
margin: 10px;
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
id="svg3771"
version="1.1"
viewBox="0 0 216.4144 232.00976">
<metadata
id="metadata3777">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs3775" />
<path
style="fill:#1c2f82;fill-opacity:1"
id="path3769"
fill="#fff"
d="M107.86523 0C78.203984.2425 49.672422 3.4535937 33.044922 11.089844c0 0-32.97656262 14.752031-32.97656262 65.082031 0 11.525-.224375 25.306175.140625 39.919925 1.19750002 49.22 9.02375002 97.72843 54.53124962 109.77343 20.9825 5.55375 38.99711 6.71547 53.505856 5.91797 26.31125-1.45875 41.08203-9.38867 41.08203-9.38867l-.86914-19.08984s-18.80171 5.92758-39.91796 5.20508c-20.921254-.7175-43.006879-2.25516-46.390629-27.94141-.3125-2.25625-.46875-4.66938-.46875-7.20313 0 0 20.536953 5.0204 46.564449 6.21289 15.915.73001 30.8393-.93343 45.99805-2.74218 29.07-3.47125 54.38125-21.3818 57.5625-37.74805 5.0125-25.78125 4.59961-62.916015 4.59961-62.916015 0-50.33-32.97461-65.082031-32.97461-65.082031C166.80539 3.4535938 138.255.2425 108.59375 0h-.72852zM74.296875 39.326172c12.355 0 21.710234 4.749297 27.896485 14.248047l6.01367 10.080078 6.01563-10.080078c6.185-9.49875 15.54023-14.248047 27.89648-14.248047 10.6775 0 19.28156 3.753672 25.85156 11.076172 6.36875 7.3225 9.53907 17.218828 9.53907 29.673828v60.941408h-24.14454V81.869141c0-12.46875-5.24453-18.798829-15.73828-18.798829-11.6025 0-17.41797 7.508516-17.41797 22.353516v32.375002H96.207031V85.423828c0-14.845-5.815468-22.353515-17.417969-22.353516-10.49375 0-15.740234 6.330079-15.740234 18.798829v59.148439H38.904297V80.076172c0-12.455 3.171016-22.351328 9.541015-29.673828 6.568751-7.3225 15.172813-11.076172 25.851563-11.076172z" />
</svg>
const getJSON = async url => {
const response = await fetch(url);
if(!response.ok)
throw new Error(response.statusText);
const data = response.json();
return data;
}
function loadComments(id) {
getJSON('https://mastodon.social/api/v1/statuses/' + id + '/context').then(data => {
document.getElementById('load_comments').disable = true;
for (toot in data.descendants) {
const comment = document.createElement('div');
comment.classList.add('comment');
const author = document.createElement('div');
author.classList.add('author');
author.innerHTML = data.descendants[toot].account.username;
const content = document.createElement('div');
content.classList.add('content');
content.innerHTML = data.descendants[toot].content;
comment.appendChild(author);
comment.appendChild(content);
document.getElementById('comments_holder').appendChild(comment);
}
document.getElementById('load_comments').remove();
});
}
# theme.toml template for a Hugo theme
# See https://github.com/gohugoio/hugoThemes#themetoml for an example
name = "le_filament"
license = "MIT"
licenselink = "https://github.com/yourname/yourtheme/blob/master/LICENSE"
description = ""
homepage = "http://example.com/"
tags = []
features = []
min_version = "0.41.0"
[author]
name = ""
homepage = ""
# If porting an existing theme
[original]
name = ""
homepage = ""
repo = ""
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter