Skip to content

Commit

Permalink
New content structure outline
Browse files Browse the repository at this point in the history
Updates #1
  • Loading branch information
bep committed Mar 4, 2022
1 parent f0fb3ad commit 4f264ee
Show file tree
Hide file tree
Showing 39 changed files with 739 additions and 586 deletions.
Binary file added .DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions assets/css/components/all.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "variables.css";
@import "fonts.css";
@import "chroma.css";
@import "chroma_dark.css";
@import "code.css";
Expand Down
45 changes: 45 additions & 0 deletions assets/css/components/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* mulish-200 - latin */
@font-face {
font-family: 'Mulish';
font-style: normal;
font-weight: 200;
src: local(''),
url('../fonts/mulish-v10-latin-200.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/mulish-v10-latin-200.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* mulish-regular - latin */
@font-face {
font-family: 'Mulish';
font-style: normal;
font-weight: 400;
src: local(''),
url('../fonts/mulish-v10-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/mulish-v10-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* mulish-800 - latin */
@font-face {
font-family: 'Mulish';
font-style: normal;
font-weight: 800;
src: local(''),
url('../fonts/mulish-v10-latin-800.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/mulish-v10-latin-800.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* mulish-italic - latin */
@font-face {
font-family: 'Mulish';
font-style: italic;
font-weight: 400;
src: local(''),
url('../fonts/mulish-v10-latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/mulish-v10-latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* mulish-800italic - latin */
@font-face {
font-family: 'Mulish';
font-style: italic;
font-weight: 800;
src: local(''),
url('../fonts/mulish-v10-latin-800italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('../fonts/mulish-v10-latin-800italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
2 changes: 1 addition & 1 deletion assets/css/components/prose.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

.prose table th {
@apply font-semibold;
@apply font-extrabold;
}

.prose table td,
Expand Down
70 changes: 35 additions & 35 deletions assets/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,43 @@
@import "components/all.css";

html {
font-size: 14px;
font-size: 14px;
}

@screen md {
html {
font-size: 16px;
}
html {
font-size: 16px;
}
}

body {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
fill: currentColor; /* Applies to SVG only */
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
fill: currentColor; /* Applies to SVG only */
}

.nested-blockquote blockquote {
border-left: 4px solid var(--primary-color);
padding-left: 1em;
/*margin: 0;*/
border-left: 4px solid var(--primary-color);
padding-left: 1em;
/*margin: 0;*/
}

.mw-90 {
max-width: 90%;
max-width: 90%;
}

/* Hide pre-initialized DOM elements. */
[x-cloak] {
visibility: hidden;
visibility: hidden;
}

/* Combine with classes in skins and skins-pseudo for
* many different transition possibilities. */
.bg-animate,
.bg-animate:hover,
.bg-animate:focus {
-webkit-transition: background-color 0.15s ease-in-out;
transition: background-color 0.15s ease-in-out;
-webkit-transition: background-color 0.15s ease-in-out;
transition: background-color 0.15s ease-in-out;
}

/*
Expand All @@ -50,36 +50,36 @@ body {
*/
.dim {
opacity: 1;
-webkit-transition: opacity 0.15s ease-in;
transition: opacity 0.15s ease-in;
opacity: 1;
-webkit-transition: opacity 0.15s ease-in;
transition: opacity 0.15s ease-in;
}
.dim:hover,
.dim:focus {
opacity: 0.5;
-webkit-transition: opacity 0.15s ease-in;
transition: opacity 0.15s ease-in;
opacity: 0.5;
-webkit-transition: opacity 0.15s ease-in;
transition: opacity 0.15s ease-in;
}
.dim:active {
opacity: 0.8;
-webkit-transition: opacity 0.15s ease-out;
transition: opacity 0.15s ease-out;
opacity: 0.8;
-webkit-transition: opacity 0.15s ease-out;
transition: opacity 0.15s ease-out;
}

@layer components {
.btn-primary {
@apply py-2 px-4 font-semibold rounded-md shadow-md bg-steel-600 hover:bg-steel-700 text-white hover:text-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-steel-500;
}
.btn-primary {
@apply py-2 px-4 font-extrabold rounded-md shadow-md bg-steel-600 hover:bg-steel-700 text-white hover:text-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-steel-500;
}

.btn-secondary {
@apply py-2 px-4 font-semibold rounded-md shadow-md bg-green-600 hover:bg-green-700 text-white hover:text-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-steel-500;
}
.btn-secondary {
@apply py-2 px-4 font-extrabold rounded-md shadow-md bg-green-600 hover:bg-green-700 text-white hover:text-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-steel-500;
}

a {
@apply text-blue-700 hover:text-steel-500 no-underline;
}
a {
@apply text-blue-700 hover:text-steel-500 no-underline;
}

.dark a {
@apply text-steel-600 hover:text-steel-400 no-underline;
}
.dark a {
@apply text-steel-600 hover:text-steel-400 no-underline;
}
}
44 changes: 22 additions & 22 deletions assets/js/main/nav/alpine-turbo-bridge.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
export function bridgeTurboAndAlpine(Alpine) {
document.addEventListener('turbo:render', () => {
if (document.documentElement.hasAttribute('data-turbo-preview')) {
return;
}
document.addEventListener("turbo:render", () => {
if (document.documentElement.hasAttribute("data-turbo-preview")) {
return;
}

// Restart Alpine.
Alpine.start();
});
// Restart Alpine.
Alpine.start();
});

// Cleanup Alpine state on navigation.
document.addEventListener('turbo:before-cache', () => {
Alpine.stopObservingMutations();
// Cleanup Alpine state on navigation.
document.addEventListener("turbo:before-cache", () => {
Alpine.stopObservingMutations();

document.body.querySelectorAll('[x-data]').forEach((el) => {
if (el.hasAttribute('data-turbo-permanent')) {
el._x_ignore = true;
} else {
Alpine.destroyTree(el);
document.body.querySelectorAll("[x-data]").forEach((el) => {
if (el.hasAttribute("data-turbo-permanent")) {
el._x_ignore = true;
} else {
Alpine.destroyTree(el);

// Turbo leaks DOM elements via their data-turbo-permanent handling.
// That needs to be fixed upstream, but until then.
let clone = el.cloneNode(true);
el.replaceWith(clone);
}
});
});
// Turbo leaks DOM elements via their data-turbo-permanent handling.
// That needs to be fixed upstream, but until then.
let clone = el.cloneNode(true);
el.replaceWith(clone);
}
});
});
}
11 changes: 5 additions & 6 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ keepWhitespace = true


[module]
[[module.mounts]]
lang = "en"
source = "content/en"
target = "content"
[[module.imports]]
path = "github.com/gohugoio/gohugoioTheme2"
[[module.imports]]
Expand All @@ -60,18 +64,13 @@ ignoreImports = true
[[module.imports.mounts]]
lang = "en"
source = "content/en"
target = "content/documentation"
target = "content/old"

[[module.imports.mounts]]
lang = "en"
source = "content/site/en"
target = "content"

[[module.imports.mounts]]
lang = "zh"
source = "content/zh"
target = "content/documentation"

[[module.imports.mounts]]
source = "static"
target = "static"
Expand Down
5 changes: 5 additions & 0 deletions exampleSite/content/en/documentation/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Hugo Documentation
linkTitle: Docs
---

5 changes: 5 additions & 0 deletions exampleSite/content/en/documentation/explanation/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "Explanation"
linkTitle: "Explanation"
weight: 20
---
5 changes: 5 additions & 0 deletions exampleSite/content/en/documentation/guides/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "How-to Guides"
linkTitle: "Guides"
weight: 40
---
5 changes: 5 additions & 0 deletions exampleSite/content/en/documentation/reference/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "Technical Reference"
linkTitle: "Reference"
weight: 10
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "Template Functions"
linkTitle: "Functions"
weight: 10
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: "Collections Namespace"
linkTitle: "collections"
namespace: "collections"
---


Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: "Interfaces"
linkTitle: "Interfaces"
weight: 20
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "Page Interface"
linkTitle: "Page"
---


4 changes: 4 additions & 0 deletions exampleSite/content/en/documentation/tutorials/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "Tutorials"
weight: 30
---
10 changes: 2 additions & 8 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{{ define "main" }}
{{ $pages := "" }}
{{ if .Parent.IsHome }}
{{/* /documentation root: Show all pages in the fundementals category. */}}
{{ $pages = (.Site.Taxonomies.categories.fundamentals).Pages | lang.Merge (.Sites.First.Taxonomies.categories.fundamentals).Pages }}
{{ else }}
{{ $pages = .Pages | union .Sections }}
{{ end }}
<h1 class="text-3xl text-black font-semibold">
{{ $pages := .Pages | union .Sections }}
<h1 class="text-3xl text-black font-extrabold">
{{ .Title | title }}
</h1>
<div class="mt-8 text-lg text-black">
Expand Down
29 changes: 17 additions & 12 deletions layouts/_default/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{{ end }}


<h1 class="text-4xl font-semibold leading-tight mb-3 my-0 pt-3 text-black">
<h1 class="text-4xl font-extrabold leading-tight mb-3 my-0 pt-3 text-black">
{{ .Title }}
</h1>
</header>
Expand All @@ -27,7 +27,11 @@ <h1 class="text-4xl font-semibold leading-tight mb-3 my-0 pt-3 text-black">
</div>
{{ end }}

{{- partial "docs/functions-signature.html" . -}}
{{- partial "documentation/functions-signature.html" . -}}
{{ if .Params.namespace }}
{{ warnf "HER?" }}
{{- partial "documentation/reference/list-namespace.html" . -}}
{{ end }}
{{ .Content }}


Expand All @@ -43,14 +47,15 @@ <h1 class="text-4xl font-semibold leading-tight mb-3 my-0 pt-3 text-black">
</div>
{{ end }}


<div class="mt-4 text-gray-300 text-sm">
Last updated:
{{ .Lastmod.Format "January 2, 2006" }}{{ with .GitInfo }}
:
<a href="{{ site.Params.ghrepo }}commit/{{ .Hash }}"
>{{ .Subject }} ({{ .AbbreviatedHash }})</a
>
{{ end }}
</div>
{{ if .Lastmod }}
<div class="mt-4 text-gray-300 text-sm">
Last updated:
{{ .Lastmod.Format "January 2, 2006" }}{{ with .GitInfo }}
:
<a href="{{ site.Params.ghrepo }}commit/{{ .Hash }}"
>{{ .Subject }} ({{ .AbbreviatedHash }})</a
>
{{ end }}
</div>
{{ end }}
</div>
2 changes: 1 addition & 1 deletion layouts/news/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h1 class="text-steel-900">

{{ $interior_classes := $.Site.Params.flex_box_interior_classes }}
<section class="sm:flex flex-wrap justify-between w-full w-80-nsTK v-top">
{{ $paginator := .Paginate (.Pages | lang.Merge (where .Sites.First.RegularPages "Section" .Section)) -}}
{{ $paginator := .Paginator -}}
{{ range $paginator.Pages }}
{{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" false) }}
{{ end }}
Expand Down
Loading

0 comments on commit 4f264ee

Please sign in to comment.