diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..066ebdf --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/node_modules/ +/static/styles/ diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..72dfa5a --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,6 @@ +--- +date: "2016-11-08T16:00:00+02:00" +title: "Title" +weight: 10 +draft: false +--- diff --git a/archetypes/docs.md b/archetypes/docs.md new file mode 100644 index 0000000..9774f40 --- /dev/null +++ b/archetypes/docs.md @@ -0,0 +1,8 @@ +--- +date: "2016-11-08T16:00:00+02:00" +title: "Title" +weight: 10 +toc: true +draft: false +type: "docs" +--- diff --git a/archetypes/page.md b/archetypes/page.md new file mode 100644 index 0000000..825c1d6 --- /dev/null +++ b/archetypes/page.md @@ -0,0 +1,8 @@ +--- +date: "2016-11-08T16:00:00+02:00" +title: "Title" +weight: 10 +toc: true +draft: false +type: "page" +--- diff --git a/archetypes/post.md b/archetypes/post.md new file mode 100644 index 0000000..b6bb895 --- /dev/null +++ b/archetypes/post.md @@ -0,0 +1,8 @@ +--- +date: "2016-11-08T16:00:00+02:00" +author: "go-gitea" +title: "Title" +tags: ["tag"] +draft: false +type: "post" +--- diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..fa4d535 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,17 @@ +var gulp = require('gulp'); +var sass = require('gulp-sass'); +var sourcemaps = require('gulp-sourcemaps'); + +gulp.task('default', ['sass']); + +gulp.task('sass', function () { + return gulp.src('./src/main.scss') + .pipe(sourcemaps.init()) + .pipe(sass().on('error', sass.logError)) + .pipe(sourcemaps.write('.')) + .pipe(gulp.dest('./static/styles')); +}); + +gulp.task('watch', function () { + gulp.watch('./src/*.scss', ['sass']); +}); diff --git a/i18n/de.yaml b/i18n/de.yaml new file mode 100644 index 0000000..6472e51 --- /dev/null +++ b/i18n/de.yaml @@ -0,0 +1,29 @@ +- id: navbar_menu + translation: "Menü" + +- id: toplink_website + translation: "Website" + +- id: toplink_blog + translation: "Blog" + +- id: toplink_docs + translation: "Doku" + +- id: toplink_code + translation: "Quelltext" + +- id: toplink_downloads + translation: "Downloads" + +- id: toplink_github + translation: "GitHub" + +- id: read_more + translation: "Mehr..." + +- id: page_prev + translation: "Vorherige" + +- id: page_next + translation: "Nächste" diff --git a/i18n/en.yaml b/i18n/en.yaml new file mode 100644 index 0000000..b732115 --- /dev/null +++ b/i18n/en.yaml @@ -0,0 +1,32 @@ +- id: navbar_menu + translation: "Menu" + +- id: toplink_website + translation: "Website" + +- id: toplink_blog + translation: "Blog" + +- id: toplink_docs + translation: "Docs" + +- id: toplink_code + translation: "Import" + +- id: toplink_downloads + translation: "Downloads" + +- id: toplink_github + translation: "GitHub" + +- id: read_more + translation: "More..." + +- id: authored_by + translation: "by" + +- id: page_prev + translation: "Previous" + +- id: page_next + translation: "Next" diff --git a/layouts/404.html b/layouts/404.html index 78875eb..fdf9bc1 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,7 +1,12 @@ {{ partial "header" . }} +{{ partial "navbar" . }} -

- Page not found -

+
+
+
+

Oops. We're sorry, but this page does not exist.

+
+
+
{{ partial "footer" . }} diff --git a/static/styles/main.css b/layouts/_default/list.html similarity index 100% rename from static/styles/main.css rename to layouts/_default/list.html diff --git a/layouts/_default/single.html b/layouts/_default/single.html index de4b8f6..67e7581 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,3 +1,12 @@ -{{ partial "header" . }} -{{ .Content }} -{{ partial "footer" . }} +{{ partial "header.html" . }} +{{ partial "navbar.html" . }} + +
+
+
+ {{ .Content }} +
+
+
+ +{{ partial "footer.html" . }} diff --git a/layouts/docs/list.html b/layouts/docs/list.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/docs/single.html b/layouts/docs/single.html new file mode 100644 index 0000000..cb1fee5 --- /dev/null +++ b/layouts/docs/single.html @@ -0,0 +1,15 @@ +{{ partial "header.html" . }} +{{ partial "navbar.html" . }} + +
+
+
+ {{ partial "menu" . }} +
+
+ {{ .Content }} +
+
+
+ +{{ partial "footer.html" . }} diff --git a/layouts/index.html b/layouts/index.html index 5557fb8..015a11d 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,7 +1,17 @@ {{ partial "header" . }} +{{ partial "navbar" . }} -{{ range where .Site.Pages "Type" "index" }} - {{ .Content }} -{{ end }} +
+
+
+ {{ partial "menu" . }} +
+
+ {{ range where .Site.Pages "Type" "index" }} + {{ .Content }} + {{ end }} +
+
+
{{ partial "footer" . }} diff --git a/layouts/page/list.html b/layouts/page/list.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/page/single.html b/layouts/page/single.html new file mode 100644 index 0000000..c7096e7 --- /dev/null +++ b/layouts/page/single.html @@ -0,0 +1,15 @@ +{{ partial "header.html" . }} +{{ partial "navbar.html" . }} + +
+
+
+ {{ partial "menu" . }} +
+
+ {{ .Content }} +
+
+
+ +{{ partial "footer.html" . }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index b605728..17ec260 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,2 +1,31 @@ - + + + + + + + diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 272d3d4..d6d7146 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,23 +1,24 @@ - - {{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }} - {{ .Hugo.Generator }} + + + + + {{ .Hugo.Generator }} + {{ with .Params.goimport }}{{ end }} + {{ with .Params.gosource }}{{ end }} + {{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }} - {{ with .Params.goimport }} - - {{ end }} + + + + + - {{ with .Params.gosource }} - - {{ end }} - - - - - - - - - {{ partial "navbar" . }} + {{ with .RSSLink }} + + + {{ end }} + + diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index e69de29..8598f4c 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -0,0 +1,2 @@ +{{ partial "pages.html" . }} +{{ partial "toc.html" . }} diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index 60ba9fe..53f32a3 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -1 +1,12 @@ -{{ partial "menu" . }} + diff --git a/layouts/partials/pages.html b/layouts/partials/pages.html new file mode 100644 index 0000000..6a3dd12 --- /dev/null +++ b/layouts/partials/pages.html @@ -0,0 +1,12 @@ +
+ +
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html new file mode 100644 index 0000000..9ac136f --- /dev/null +++ b/layouts/partials/toc.html @@ -0,0 +1,5 @@ +{{ if .Params.toc }} +
+ {{ .TableOfContents }} +
+{{ end }} diff --git a/layouts/partials/toplinks.html b/layouts/partials/toplinks.html new file mode 100644 index 0000000..fd4aceb --- /dev/null +++ b/layouts/partials/toplinks.html @@ -0,0 +1,36 @@ + + + + + + diff --git a/layouts/post/list.html b/layouts/post/list.html new file mode 100644 index 0000000..396f623 --- /dev/null +++ b/layouts/post/list.html @@ -0,0 +1,51 @@ +{{ partial "header.html" . }} +{{ partial "navbar.html" . }} + +
+
+
+ {{ $paginator := .Paginate (where .Data.Pages "Type" "post") }}{{ range $paginator.Pages }} + + {{ end }} + + {{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }} +
+ {{ if and (.Paginator.HasPrev) (.Paginator.HasNext) }} + {{ i18n "page_prev" }} + {{ i18n "page_next" }} + {{ end }} + {{ if and (.Paginator.HasPrev) (not .Paginator.HasNext) }} + {{ i18n "page_prev" }} + {{ i18n "page_next" }} + {{ end }} + {{ if and (not .Paginator.HasPrev) (.Paginator.HasNext) }} + {{ i18n "page_prev" }} + {{ i18n "page_next" }} + {{ end }} +
+ {{ end }} +
+
+
+ +{{ partial "footer.html" . }} + diff --git a/layouts/post/single.html b/layouts/post/single.html new file mode 100644 index 0000000..9456ffb --- /dev/null +++ b/layouts/post/single.html @@ -0,0 +1,27 @@ +{{ partial "header.html" . }} +{{ partial "navbar.html" . }} + +
+
+
+
+
+

+ + {{ .Title }} + +

+

+ {{ .Date.Format "Mon Jan 2, 2006" }} + {{ i18n "authored_by" }} + {{ .Params.author | default .Site.Params.author }} +

+
+ + {{ .Content }} +
+
+
+
+ +{{ partial "footer.html" . }} diff --git a/package.json b/package.json new file mode 100644 index 0000000..cff2a65 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "gitea-theme", + "description": "This is a Hugo theme that gets used within all of our websites like our blog, documentation and also the redirects.", + "repository": { + "type": "git", + "url": "git+https://github.com/go-gitea/theme.git" + }, + "author": "The Gitea Authors", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/go-gitea/theme/issues" + }, + "homepage": "https://github.com/go-gitea/theme#readme", + "dependencies": { + "bootstrap": "^4.0.0-alpha.5" + }, + "devDependencies": { + "gulp": "^3.9.1", + "gulp-sass": "^2.3.2", + "gulp-sourcemaps": "^1.9.1" + } +} diff --git a/src/colors.scss b/src/colors.scss new file mode 100644 index 0000000..7688011 --- /dev/null +++ b/src/colors.scss @@ -0,0 +1,14 @@ +//Palette generated by Material Palette +//materialpalette.com/light-green/orange +$primary-color-dark: #689F38; +$primary-color: #8BC34A; +$primary-color-light: #DCEDC8; +$primary-color-text: #212121; +$accent-color: #FF9800; +$primary-text-color: #212121; +$secondary-text-color: #757575; +$divider-color: #BDBDBD; + +//Set bootstrap colors +$brand-primary: $primary-color; +$body-color: $primary-text-color; diff --git a/src/main.scss b/src/main.scss new file mode 100644 index 0000000..9510217 --- /dev/null +++ b/src/main.scss @@ -0,0 +1,36 @@ +@import "colors"; +@import "../node_modules/bootstrap/scss/bootstrap"; + +.navbar { + padding: 21px 32px; + border-bottom: 1px solid $accent-color; +} + +.navbar-brand { + padding: 0; + + img { + height: 38px; + } +} + +.footer { + width: 100%; + padding: 32px 0; + background-color: #f7f7f9; + + + + p { + margin: 0; + padding: 16px 0; + } +} + +.content { + margin: 64px auto; + + blockquote{ + @extend .blockquote; + } +} diff --git a/static/images/gitea.png b/static/images/gitea.png new file mode 100644 index 0000000..935b7c7 Binary files /dev/null and b/static/images/gitea.png differ diff --git a/theme.toml b/theme.toml index 43c0f32..a862d7a 100644 --- a/theme.toml +++ b/theme.toml @@ -3,7 +3,6 @@ license = "Apache-2.0" licenselink = "https://github.com/go-gitea/theme/blob/master/LICENSE" description = "General theme for Gitea pages" homepage = "https://github.com/go-gitea/theme" -tags = [] [author] name = "The Gitea Authors"