From b5cd8c1c5f544a769c7cfb6a6428d8d7a58d3522 Mon Sep 17 00:00:00 2001 From: Alexander Gusman Date: Thu, 22 Jun 2023 11:23:47 +0300 Subject: [PATCH] chore: move 0.1.0 as latest to see changes when 1.0.0 is generated --- versions/latest/.gitignore | 5 + versions/latest/Makefile | 5 + versions/latest/config.yaml | 30 +++++ versions/latest/shared_dependencies.md | 7 ++ .../devsparks/layouts/_default/baseof.html | 47 ++++++++ .../devsparks/layouts/_default/list.html | 25 +++++ .../devsparks/layouts/_default/single.html | 19 ++++ .../layouts/shortcodes/hackermans-tip.html | 5 + .../shortcodes/padawans-playground.html | 5 + .../themes/devsparks/static/css/main.css | 103 ++++++++++++++++++ .../static/css/syntax-highlighting.css | 20 ++++ .../devsparks/static/css/theme-dark.css | 56 ++++++++++ .../devsparks/static/css/theme-light.css | 56 ++++++++++ .../devsparks/static/js/footer-image.js | 14 +++ .../themes/devsparks/static/js/remark42.js | 13 +++ .../themes/devsparks/static/js/theme.js | 47 ++++++++ 16 files changed, 457 insertions(+) create mode 100644 versions/latest/.gitignore create mode 100644 versions/latest/Makefile create mode 100644 versions/latest/config.yaml create mode 100644 versions/latest/shared_dependencies.md create mode 100644 versions/latest/themes/devsparks/layouts/_default/baseof.html create mode 100644 versions/latest/themes/devsparks/layouts/_default/list.html create mode 100644 versions/latest/themes/devsparks/layouts/_default/single.html create mode 100644 versions/latest/themes/devsparks/layouts/shortcodes/hackermans-tip.html create mode 100644 versions/latest/themes/devsparks/layouts/shortcodes/padawans-playground.html create mode 100644 versions/latest/themes/devsparks/static/css/main.css create mode 100644 versions/latest/themes/devsparks/static/css/syntax-highlighting.css create mode 100644 versions/latest/themes/devsparks/static/css/theme-dark.css create mode 100644 versions/latest/themes/devsparks/static/css/theme-light.css create mode 100644 versions/latest/themes/devsparks/static/js/footer-image.js create mode 100644 versions/latest/themes/devsparks/static/js/remark42.js create mode 100644 versions/latest/themes/devsparks/static/js/theme.js diff --git a/versions/latest/.gitignore b/versions/latest/.gitignore new file mode 100644 index 0000000..967824e --- /dev/null +++ b/versions/latest/.gitignore @@ -0,0 +1,5 @@ +.hugo_build.lock +/public/ +/resources/_gen/ +/assets/jsconfig.json +hugo_stats.json \ No newline at end of file diff --git a/versions/latest/Makefile b/versions/latest/Makefile new file mode 100644 index 0000000..83651e7 --- /dev/null +++ b/versions/latest/Makefile @@ -0,0 +1,5 @@ +serve: + docker run --rm -it -v $(PWD):/src -v $(PWD)/../../content:/src/content -v $(PWD)/../../static:/src/static -p 1313:1313 klakegg/hugo:0.111.3 server + +build: + docker run --rm -it -v $(PWD):/src -v $(PWD)/../../content:/src/content -v $(PWD)/../../static:/src/static klakegg/hugo:0.111.3 \ No newline at end of file diff --git a/versions/latest/config.yaml b/versions/latest/config.yaml new file mode 100644 index 0000000..b0fb3ba --- /dev/null +++ b/versions/latest/config.yaml @@ -0,0 +1,30 @@ +baseURL: "https://devsparks.goooseman.dev" +languageCode: "en-us" +title: "DevSparks Blog" +theme: "devsparks" +relativeUrls: true + +module: + mounts: + - source: "../../content" + target: "content" + - source: "../../static" + target: "static" + +params: + dateFormat: "January 2, 2006" + +menu: + main: + - name: "Hacks" + weight: 10 + identifier: "hacks" + url: '/' + - name: "About" + weight: 20 + identifier: "about" + url: '/about/' + - name: "GitHub" + weight: 30 + identifier: "github" + url: 'https://github.com/goooseman/devsparks-blog' \ No newline at end of file diff --git a/versions/latest/shared_dependencies.md b/versions/latest/shared_dependencies.md new file mode 100644 index 0000000..fb91378 --- /dev/null +++ b/versions/latest/shared_dependencies.md @@ -0,0 +1,7 @@ +the app is: DevSparks Blog Specification + +the files we have decided to generate are: Makefile, .gitignore, config.yaml, themes/devsparks/layouts/_default/baseof.html, themes/devsparks/layouts/_default/list.html, themes/devsparks/layouts/_default/single.html, themes/devsparks/layouts/shortcodes/hackermans-tip.html, themes/devsparks/layouts/shortcodes/padawans-playground.html, themes/devsparks/static/css/main.css, themes/devsparks/static/css/syntax-highlighting.css, themes/devsparks/static/css/theme-light.css, themes/devsparks/static/css/theme-dark.css, themes/devsparks/static/js/theme.js, themes/devsparks/static/js/footer-image.js, themes/devsparks/static/js/remark42.js + +Now that we have a list of files, we need to understand what dependencies they share. +Please name and briefly describe what is shared between the files we are generating, including exported variables, data schemas, id names of every DOM elements that javascript functions will use, message names, and function names. +Exclusively focus on the names of the shared dependencies, and do not add any other explanation. \ No newline at end of file diff --git a/versions/latest/themes/devsparks/layouts/_default/baseof.html b/versions/latest/themes/devsparks/layouts/_default/baseof.html new file mode 100644 index 0000000..fdbd328 --- /dev/null +++ b/versions/latest/themes/devsparks/layouts/_default/baseof.html @@ -0,0 +1,47 @@ + + + + + + {{ .Title }} + + + + + + +
+ + +
+
+ {{ block "main" . }}{{ end }} +
+ + + + + \ No newline at end of file diff --git a/versions/latest/themes/devsparks/layouts/_default/list.html b/versions/latest/themes/devsparks/layouts/_default/list.html new file mode 100644 index 0000000..4029b96 --- /dev/null +++ b/versions/latest/themes/devsparks/layouts/_default/list.html @@ -0,0 +1,25 @@ +{{ define "main" }} +{{ if eq .Title "Hacks" }} +

{{ .Title }}

+{{ else }} +

{{ .Title }}

+{{ end }} +{{ range (where .Site.RegularPages "Type" "in" (slice "hacks")).GroupByDate "2006" }} +

{{ .Key }}

+ +{{ end }} +{{ end }} \ No newline at end of file diff --git a/versions/latest/themes/devsparks/layouts/_default/single.html b/versions/latest/themes/devsparks/layouts/_default/single.html new file mode 100644 index 0000000..49de279 --- /dev/null +++ b/versions/latest/themes/devsparks/layouts/_default/single.html @@ -0,0 +1,19 @@ +{{ define "main" }} +
+

{{ .Title }}

+ {{ with .Date }} + + {{ end }} + {{ with .Params.tags }} + + {{ end }} +
+ {{ .Content }} +
+
+
+{{ end }} \ No newline at end of file diff --git a/versions/latest/themes/devsparks/layouts/shortcodes/hackermans-tip.html b/versions/latest/themes/devsparks/layouts/shortcodes/hackermans-tip.html new file mode 100644 index 0000000..8cf47fc --- /dev/null +++ b/versions/latest/themes/devsparks/layouts/shortcodes/hackermans-tip.html @@ -0,0 +1,5 @@ +
+

Hackerman's tip

+ Hackerman Image + {{ .Inner | markdownify }} +
\ No newline at end of file diff --git a/versions/latest/themes/devsparks/layouts/shortcodes/padawans-playground.html b/versions/latest/themes/devsparks/layouts/shortcodes/padawans-playground.html new file mode 100644 index 0000000..7374a23 --- /dev/null +++ b/versions/latest/themes/devsparks/layouts/shortcodes/padawans-playground.html @@ -0,0 +1,5 @@ +
+

Padawan's Playground

+ Padawan Image + {{ .Inner | markdownify }} +
\ No newline at end of file diff --git a/versions/latest/themes/devsparks/static/css/main.css b/versions/latest/themes/devsparks/static/css/main.css new file mode 100644 index 0000000..e464995 --- /dev/null +++ b/versions/latest/themes/devsparks/static/css/main.css @@ -0,0 +1,103 @@ +@import url('https://fonts.googleapis.com/css2?family=Fira+Code&display=swap'); + +:root { + --border-width: 2px; +} + +a { + color: var(--text-color); + text-decoration: none; + border-bottom: var(--border-width) solid var(--text-color); + transition: color 0.3s, background-color 0.3s; +} + +a:hover { + color: var(--background-color); + background-color: var(--text-color); + background-image: linear-gradient(to top, var(--text-color), var(--background-color)); + background-position: 0 100%; + background-repeat: no-repeat; + background-size: 100% 200%; +} + +.layout__link__active { + border: var(--border-width) solid; +} + +.layout__header { + display: flex; + justify-content: space-between; + padding-top: 10px; +} + +.header__theme_switch { + background: transparent; + border: var(--border-width) solid; + padding: 0; + width: 22px; + height: 22px; + text-align: center; +} + +.section__tip__hackerman .tip__title, +.section__tip__padawan .tip__title { + font-style: italic; + font-weight: bold; +} + +.tip__container { + position: relative; + margin-top: 300px; + margin-bottom: 5px; + border: var(--border-color) solid; + padding: 20px; + margin-left: -20px; + margin-right: -20px; +} + +.tip__image { + position: absolute; + bottom: 100%; + left: 20%; + height: 280px; +} + +body { + width: 600px; + margin: 0 auto; + background-color: var(--background-color); +} + +@media (max-width: 680px) { + body { + width: 100%; + padding: 20px; + } +} + +.layout__header nav { + display: flex; +} + +.footer__container { + display: flex; +} + +.footer__author-photo { + height: 160px; +} + +.footer__about_text { + border: var(--border-color) solid; +} + +.article__content h3 { + padding-top: 5px; + border-top: var(--border-width) solid currentColor; +} + +.article__remark42 { + margin-left: -20px; + margin-right: -20px; + margin-top: 10px; +} \ No newline at end of file diff --git a/versions/latest/themes/devsparks/static/css/syntax-highlighting.css b/versions/latest/themes/devsparks/static/css/syntax-highlighting.css new file mode 100644 index 0000000..ba855fb --- /dev/null +++ b/versions/latest/themes/devsparks/static/css/syntax-highlighting.css @@ -0,0 +1,20 @@ +/* Code syntax highlighting */ + +/* Single line code */ +code { + color: var(--background-color); + background-color: var(--color); +} + +/* Code block */ +pre div.highlight { + background-color: var(--background-color); + color: white; + padding: 10px; +} + +/* Code inside code block */ +pre div.highlight code { + background-color: transparent; + color: white; +} \ No newline at end of file diff --git a/versions/latest/themes/devsparks/static/css/theme-dark.css b/versions/latest/themes/devsparks/static/css/theme-dark.css new file mode 100644 index 0000000..50dd3a8 --- /dev/null +++ b/versions/latest/themes/devsparks/static/css/theme-dark.css @@ -0,0 +1,56 @@ +:root { + --background-color: #40414e; + --text-color: #ffc000; + --border-color: #ffc000; +} + +body { + background-color: var(--background-color); + color: var(--text-color); +} + +.layout__header nav a { + color: var(--text-color); + border-bottom: 2px solid var(--text-color); +} + +.layout__header nav a:hover { + color: var(--background-color); + background-color: var(--text-color); + background-image: linear-gradient(to top, var(--text-color), var(--background-color)); + background-position: 0 100%; + background-repeat: no-repeat; + background-size: 100% 200%; +} + +.layout__link__active { + border: 2px solid; +} + +.footer__about_text { + border: var(--border-color) solid; +} + +.tip__container { + border: var(--border-color) solid; +} + +.header__theme_switch { + background: transparent; + border: 2px solid; +} + +@media (max-width: 680px) { + body { + width: 100%; + padding: 20px; + } +} + +.footer__container { + display: flex; +} + +.footer__author-photo { + height: 160px; +} \ No newline at end of file diff --git a/versions/latest/themes/devsparks/static/css/theme-light.css b/versions/latest/themes/devsparks/static/css/theme-light.css new file mode 100644 index 0000000..c246ae5 --- /dev/null +++ b/versions/latest/themes/devsparks/static/css/theme-light.css @@ -0,0 +1,56 @@ +:root { + --background-color: #ffc000; + --text-color: #40414e; + --border-color: #40414e; +} + +body { + background-color: var(--background-color); + color: var(--text-color); +} + +.layout__header nav a { + color: var(--text-color); + border-bottom: 2px solid var(--text-color); +} + +.layout__header nav a:hover { + color: var(--background-color); + background-color: var(--text-color); + background-image: linear-gradient(to top, var(--text-color), var(--background-color)); + background-position: 0 100%; + background-repeat: no-repeat; + background-size: 100% 200%; +} + +.layout__link__active { + border: 2px solid; +} + +.footer__about_text { + border: var(--border-color) solid; +} + +.tip__container { + border: var(--border-color) solid; +} + +.header__theme_switch { + background: transparent; + border: 2px solid; +} + +@media (max-width: 680px) { + body { + width: 100%; + padding: 20px; + } +} + +.footer__container { + display: flex; +} + +.footer__author-photo { + height: 160px; +} \ No newline at end of file diff --git a/versions/latest/themes/devsparks/static/js/footer-image.js b/versions/latest/themes/devsparks/static/js/footer-image.js new file mode 100644 index 0000000..e8ad1ba --- /dev/null +++ b/versions/latest/themes/devsparks/static/js/footer-image.js @@ -0,0 +1,14 @@ +document.addEventListener("DOMContentLoaded", function() { + const footerImageHuman = document.getElementById("footer-image-human"); + const footerImageRobot = document.getElementById("footer-image-robot"); + + footerImageHuman.addEventListener("mouseover", function() { + footerImageHuman.style.display = "none"; + footerImageRobot.style.display = "block"; + }); + + footerImageRobot.addEventListener("mouseout", function() { + footerImageRobot.style.display = "none"; + footerImageHuman.style.display = "block"; + }); +}); \ No newline at end of file diff --git a/versions/latest/themes/devsparks/static/js/remark42.js b/versions/latest/themes/devsparks/static/js/remark42.js new file mode 100644 index 0000000..329293e --- /dev/null +++ b/versions/latest/themes/devsparks/static/js/remark42.js @@ -0,0 +1,13 @@ +// https://r42.com/docs/configuration/frontend/ +var remark_config = { + host: 'https://r42.goooseman.dev', + site_id: 'dev_sparks', + components: ['embed', 'last-comments'], + max_shown_comments: 100, + theme: 'dark', + show_email_subscription: false, + simple_view: false, + no_footer: false +} + +!function(e,n){for(var o=0;o