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

Some resembalance of an MVP #2

Merged
merged 5 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Build

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.135.0"
extended: true

- name: Cache
uses: actions/cache@v4
with:
path: /tmp/hugo_cache
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-hugomod-

- name: Build
run: hugo --minify
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Generated files by hugo
/public/
/resources/_gen/
/assets/jsconfig.json
hugo_stats.json

# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux

# Temporary lock file while building
/.hugo_build.lock
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [year] [fullname]

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.
9 changes: 5 additions & 4 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
---
+++
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
date = {{ .Date }}
draft = true
+++
84 changes: 84 additions & 0 deletions assets/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
:root {
--primary-color: #196680;
--secondary-color: #80dfff;
--alternative-color: #ff9b33;
--text-color: #222222;
}

a {
color: var(--primary-color);
}

.dark a {
color: var(--secondary-color);
}

a:hover {
color: var(--alternative-color);
}

h1,
h2,
h3 {
color: var(--primary-color);
}

.dark h1,
.dark h2,
.dark h3 {
color: var(--secondary-color);
}

.dark .pagination a {
color: var(--primary-color);
}

body {
color: #222;
font-family:
Monaspace Argon,
sans-serif;
line-height: 1.5;
margin: 1rem;
max-width: 768px;
}

header {
border-bottom: 1px solid #222;
margin-bottom: 1rem;
}

footer {
border-top: 1px solid #222;
margin-top: 1rem;
}

a {
color: #00e;
text-decoration: none;
}

h1 {
font-family:
Optician Sans,
sans-serif;
}

@font-face {
font-family: "Optician Sans";
font-style: normal;
font-weight: 400;
src: url("/fonts/Optiker-K.woff") format("woff");
}

@font-face {
font-family: "Monaspace Radon";
font-style: normal;
src: url("/fonts/MonaspaceRadon-Regular.woff") format("woff");
}

@font-face {
font-family: "Monaspace Argon";
font-style: normal;
src: url("/fonts/MonaspaceArgon-Medium.woff") format("woff");
}
1 change: 1 addition & 0 deletions assets/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('This site was generated by Hugo.');
Empty file added data/.gitkeep
Empty file.
9 changes: 0 additions & 9 deletions exampleSite/content/_index.md

This file was deleted.

5 changes: 0 additions & 5 deletions exampleSite/content/about/index.md

This file was deleted.

6 changes: 0 additions & 6 deletions exampleSite/content/posts/my-first-post.md

This file was deleted.

16 changes: 0 additions & 16 deletions exampleSite/hugo.toml

This file was deleted.

35 changes: 21 additions & 14 deletions hugo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
baseURL = "https://mynewhugosite.com"
title = "My New Hugo Site"
theme = "hugo-starter"
baseURL = 'https://example.org/'
languageCode = 'en-US'
title = 'My New Hugo Site'

[menu]
[[menu.main]]
identifier = "posts"
name = "Posts"
url = "/posts"
weight = 10
[[menus.main]]
name = 'Home'
pageRef = '/'
weight = 10

[[menu.main]]
identifier = "about"
name = "About"
url = "/about"
weight = 20
[[menus.main]]
name = 'Posts'
pageRef = '/posts'
weight = 20

[[menus.main]]
name = 'Tags'
pageRef = '/tags'
weight = 30

[module]
[module.hugoVersion]
extended = false
min = "0.116.0"
Empty file added i18n/.gitkeep
Empty file.
9 changes: 0 additions & 9 deletions layouts/404.html

This file was deleted.

17 changes: 17 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="{{ site.Language.LanguageCode }}" dir="{{ or site.Language.LanguageDirection `ltr` }}">
<head>
{{ partial "head.html" . }}
</head>
<body>
<header>
{{ partial "header.html" . }}
</header>
<main>
{{ block "main" . }}{{ end }}
</main>
<footer>
{{ partial "footer.html" . }}
</footer>
</body>
</html>
7 changes: 7 additions & 0 deletions layouts/_default/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{ define "main" }}
{{ .Content }}
{{ range site.RegularPages }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ .Summary }}
{{ end }}
{{ end }}
24 changes: 7 additions & 17 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
{{ partial "header.html" . }}

<h1>{{ .Title }}</h1>

{{ .Content }}

{{ range.Data.Pages }}
<article class="post-snippet">
<h3>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h3>
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{ .Date.Format "January 2, 2006" }}
</time>
</article>
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ range .Pages }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ .Summary }}
{{ end }}
{{ end }}

{{ partial "footer.html" . }}
13 changes: 8 additions & 5 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{{ partial "header.html" . }}
{{ define "main" }}
<h1>{{ .Title }}</h1>

<h1>{{ .Title }}</h1>
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $dateHuman := .Date | time.Format ":date_long" }}
<time datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>

{{ .Content }}

{{ partial "footer.html" . }}
{{ .Content }}
{{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
{{ end }}
5 changes: 0 additions & 5 deletions layouts/index.html

This file was deleted.

9 changes: 1 addition & 8 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
</main>

<footer>
<p>&copy;{{ dateFormat "2006" now }} {{ .Site.Title }}</p>
</footer>

</body>
</html>
<p>Copyright {{ now.Year }}. All rights reserved.</p>
5 changes: 5 additions & 0 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
{{ partialCached "head/css.html" . }}
{{ partialCached "head/js.html" . }}
9 changes: 9 additions & 0 deletions layouts/partials/head/css.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- with resources.Get "css/main.css" }}
{{- if eq hugo.Environment "development" }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{- else }}
{{- with . | minify | fingerprint }}
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{- end }}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions layouts/partials/head/js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- with resources.Get "js/main.js" }}
{{- if eq hugo.Environment "development" }}
{{- with . | js.Build }}
<script src="{{ .RelPermalink }}"></script>
{{- end }}
{{- else }}
{{- $opts := dict "minify" true }}
{{- with . | js.Build $opts | fingerprint }}
<script src="{{ .RelPermalink }}" integrity="{{- .Data.Integrity }}" crossorigin="anonymous"></script>
{{- end }}
{{- end }}
{{- end }}
24 changes: 2 additions & 22 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
<!DOCTYPE html>
<html lang="en">
<head>

<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>

<link rel="stylesheet" href="/css/style.css" type="text/css" media="all" />

{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}

</head>

<body>

{{ partial "nav.html" . }}

<main class="content">
<h1>{{ site.Title }}</h1>
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}
Loading